9 #include <tracking/modules/spacePointCreator/SpacePointCreatorTestModule.h>
11 #include <framework/dataobjects/EventMetaData.h>
13 #include <framework/logging/Logger.h>
15 #include <genfit/Track.h>
16 #include <genfit/AbsTrackRep.h>
17 #include <genfit/RKTrackRep.h>
27 setDescription(
"Tester module for the validity of the SpacePointCreatorModule. TODO: at the moment, the genfit-output can only verified visually (by checking, whether the detector types match the number of dimensions stored in the trackPoint)! when full reco chain is working, this testerModule should be extended! -> verification that input cluster(s) is/are converted to genfit-stuff shall be resilient!");
29 std::vector<std::string> containerSpacePointsName = {
"SVDSpacePoints",
"PXDSpacePoints" };
33 "PXDCluster collection name", std::string(
""));
35 "SVDCluster collection name", std::string(
""));
37 "SpacePoints collection name", containerSpacePointsName);
41 "allows the user to set an identifier for this module. Usefull if one wants to use several instances of that module",
71 B2INFO(
"SpacePointCreatorTestModule(" <<
m_nameOfInstance <<
")::initialize: names found for containers:\n" <<
75 B2WARNING(
"TODO: at the moment, the genfit-output can only verified visually (by checking, whether the detector types match the number of dimensions stored in the trackPoint)! when full reco chain is working, this testerModule should be extended! -> verification that input cluster(s) is/are converted to genfit-stuff shall be resilient!");
84 " pxd/SVDClusters in this event");
88 B2DEBUG(20,
" Entering storeArray<SpacePoint> " << aStoreArrayInterface.getName() <<
" with " << aStoreArrayInterface.getEntries()
92 for (
unsigned int i = 0; i < uint(aStoreArrayInterface.getEntries()); ++i) {
93 B2DEBUG(20,
" Executing SpacePoint " << i);
94 const SpacePoint* sp = aStoreArrayInterface[i];
96 std::vector<int> indices;
97 std::string clusterContainer =
"";
99 if (sp->
getType() == VXD::SensorInfoBase::SensorType::SVD) {
100 B2DEBUG(20,
" SpacePoint " << i <<
" is attached to SVDCluster(s) of StoreArray " << sp->
getArrayName());
103 indices.push_back(aCluster.getArrayIndex());
104 clusterContainer = aCluster.getArrayName();
106 B2DEBUG(20,
" SpacePoint " << i <<
107 " got pointer to SVDCluster with index " << aCluster.getArrayIndex() <<
108 " stored in Array " << aCluster.getArrayName());
110 }
else if (sp->
getType() == VXD::SensorInfoBase::SensorType::PXD) {
111 B2DEBUG(20,
" SpacePoint " << i <<
" is attached to PXDCluster of StoreArray " << sp->
getArrayName());
115 indices.push_back(aCluster.getArrayIndex());
117 clusterContainer = aCluster.getArrayName();
119 B2DEBUG(20,
" SpacePoint " << i <<
120 " got pointer to PXDCluster with index " << aCluster.getArrayIndex() <<
121 " stored in Array " << aCluster.getArrayName());
124 }
else { B2ERROR(
" SpacePoint is of unknown type " << sp->
getType()); }
127 B2DEBUG(20,
"SpacePoint " << i <<
128 " got sensorType: " << sp->
getType() <<
130 ", storeName for Cluster(says SpacePoint): " << sp->
getArrayName() <<
131 ", storeName for Cluster(says Cluster): " << clusterContainer);
134 B2DEBUG(20,
"testGenfitCompatibility: feed the track with spacePoints ported to genfit compatible stuff");
140 std::vector< std::pair<VXD::SensorInfoBase::SensorType, genfit::AbsMeasurement*> > hitOutput;
142 for (
auto& aSP : aStoreArrayInterface) {
143 std::vector<genfit::PlanarMeasurement> tempMeasurements = aSP.getGenfitCompatible();
146 hitOutput.push_back({aSP.getType(), measurement.clone()});
150 for (
unsigned i = 0; i < hitOutput.size(); i++) {
151 track.insertMeasurement(hitOutput[i].second);
154 B2DEBUG(20,
" executing AbsMeasurement " << i <<
" with detectorID(PXD = 0,SVD=1,TEL=2,VXD=-1) : " << hitOutput[i].first <<
":\n");
156 B2DEBUG(20,
" converted absMeasurement is of detID: " << rawPoint->getDetId() <<
", hitID: " << rawPoint->getHitId());
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
void setDescription(const std::string &description)
Sets the description of the module.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
std::string getArrayName() const
Get name of array this object is stored in, or "" if not found.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
std::string m_svdClustersName
SVDCluster collection name.
std::string m_nameOfInstance
allows the user to set an identifier for this module.
void initialize() override
Init the module.
std::vector< StoreArray< SpacePoint > > m_allSpacePointStoreArrays
a vector full of StoreArray carrying spacePoints.
StoreArray< SVDCluster > m_svdClusters
the storeArray for svdClusters as member, is faster than recreating link for each event
void event() override
eventWise jobs (e.g.
SpacePointCreatorTestModule()
Constructor.
std::string m_pxdClustersName
PXDCluster collection name.
std::vector< std::string > m_containerSpacePointsName
intermediate storage for the names of the loaded storeArrays.
StoreArray< PXDCluster > m_pxdClusters
the storeArray for pxdClusters as member, is faster than recreating link for each event
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
Belle2::VXD::SensorInfoBase::SensorType getType() const
Return SensorType (PXD, SVD, ...) on which the SpacePoint lives.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
const std::string & getName() const
Return name under which the object is saved in the DataStore.
int getEntries() const
Get the number of objects in the array.
Type-safe access to single objects in the data store.
Class to uniquely identify a any structure of the PXD and SVD.
Contains the measurement and covariance in raw detector coordinates.
Abstract base class for a track representation.
Measurement class implementing a planar hit geometry (1 or 2D).
AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v)
Object containing AbsMeasurement and AbsFitterInfo objects.
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
ExpRunEvt getPosition(const std::vector< Evt > &events, double tEdge)
Get the exp-run-evt number from the event time [hours].
Abstract base class for different kinds of events.