9 #include <tracking/modules/vxdtfRedesign/SPTC2RTConverterModule.h>
10 #include <framework/logging/Logger.h>
16 SPTC2RTConverterModule::SPTC2RTConverterModule() :
Module()
18 setDescription(
"Converts the given SpacePointTrackCandidates to RecoTracks and stores them in the given RecoTracksStoreArray");
19 setPropertyFlags(c_ParallelProcessingCertified);
21 addParam(
"spacePointsTCsStoreArrayName", m_param_spacePointTCsStoreArrayName,
22 "StoreArray name of the input SpacePointTrackCandidates.", std::string(
""));
23 addParam(
"recoTracksStoreArrayName", m_param_recoTracksStoreArrayName,
24 "StoreArray name of the output RecoTracks.", std::string(
""));
26 addParam(
"recoHitInformationStoreArrayName", m_param_recoHitInformationStoreArrayName,
27 "StoreArray name of the output RecoHitInformation.", std::string(
""));
28 addParam(
"pxdHitsStoreArrayName", m_param_pxdHitsStoreArrayName,
"StoreArray name of the related pxd hits.",
30 addParam(
"svdHitsStoreArrayName", m_param_svdHitsStoreArrayName,
"StoreArray name of the related svd hits.",
33 addParam(
"pxdClustersName", m_param_pxdClustersName,
"StoreArray name of PXDClusters related to SpacePoints.",
35 addParam(
"svdClustersName", m_param_svdClustersName,
"StoreArray name of SVDClusters related to SpacePoints.",
41 void SPTC2RTConverterModule::initialize()
72 B2DEBUG(100,
"SPTC2RTConverter::event: SpacePointTrackCandidate not active or reserved. RefereeStatus: " <<
73 spacePointTC.getRefereeStatus());
75 }
else if (spacePointTC.getNHits() < 3) {
76 B2WARNING(
"SPTC2RTConverter::event: Number of SpacePoints of track candidate is smaller than 3. Not creating RecoTrack out of it.");
88 const TVector3& position = spacePointTC.
getPosSeed();
89 const TVector3& momentum = spacePointTC.
getMomSeed();
91 const TMatrixDSym& covSeed = spacePointTC.
getCovSeed();
106 unsigned int sortingParameter = 0;
108 B2DEBUG(110,
"SPTC2RTConverter::event: Converting spacepoint: " << spacePoint->getArrayIndex());
110 int detID = spacePoint->getType();
114 B2DEBUG(110,
"SPTC2RTConverter::event: Number of related PXD Clusters: " << relatedClusters.
size());
116 for (
const PXDCluster& cluster : relatedClusters) {
117 newRecoTrack->
addPXDHit(&cluster, sortingParameter, Belle2::RecoHitInformation::c_VXDTrackFinder);
122 B2DEBUG(110,
"SPTC2RTConverter::event: Number of related SVD Clusters: " << relatedClusters.
size());
124 for (
const SVDCluster& cluster : relatedClusters) {
125 newRecoTrack->
addSVDHit(&cluster, sortingParameter, Belle2::RecoHitInformation::c_VXDTrackFinder);
129 B2WARNING(
"SPTC2RTConverter::event: SpacePointTrackCandidate containing SpacePoint of unrecognised detector ID: " << detID <<
130 ". Created RecoTrack doesn't contain these SpacePoints!");
133 spacePoint->setAssignmentState(
true);
139 B2DEBUG(110,
"SPTC2RTConverter::event: nHits: " << spacePointTC.
getNHits() <<
140 " ChargeSeed: " << charge <<
141 " PositionSeed: " << position.X() <<
", " << position.Y() <<
", " << position.Z() <<
142 " MomentumSeed: " << momentum.X() <<
", " << momentum.Y() <<
", " << momentum.Z());
147 B2DEBUG(100,
"SPTC2RTConverter::terminate: Got " <<
m_SPTCCtr <<
" SpacePointTrackCands and created " <<
m_RTCtr <<
" RecoTracks";);
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
This is the Reconstruction Event-Data Model Track.
bool addPXDHit(const UsedPXDHit *pxdHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a pxd hit with the given information to the reco track.
void setSeedCovariance(const TMatrixDSym &seedCovariance)
Set the covariance of the seed. ATTENTION: This is not the fitted covariance.
void setQualityIndicator(const float qualityIndicator)
Set the quality index attached to this RecoTrack. 0 means likely fake.
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.
bool addSVDHit(const UsedSVDHit *svdHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a svd hit with the given information to the reco track.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
StoreArray< SpacePointTrackCand > m_spacePointTCs
StoreArray as class member to prevent relinking for every event.
std::string m_param_pxdHitsStoreArrayName
StoreArray name of PXDhits.
void event() override
This method is the core of the module.
std::string m_param_spacePointTCsStoreArrayName
Input SpacePointTrackCands StoreArray name.
std::string m_param_pxdClustersName
StoreArray name of PXDClusters.
void terminate() override
This method is called at the end of the event processing.
void createRecoTrack(const SpacePointTrackCand &spacePointTC)
Creates a RecoTrack corresponding to the given SpacePointTrackCand and appends it to the RecoTracks S...
std::string m_param_recoTracksStoreArrayName
Output RecoTracks StoreArray name.
std::string m_param_svdHitsStoreArrayName
StoreArray name of SVDhits.
unsigned int m_SPTCCtr
Counter for SpacePointTrackCands presented to the module.
std::string m_param_svdClustersName
StoreArray name of SVDClusters.
StoreArray< RecoTrack > m_recoTracks
StoreArray as class member to prevent relinking for every SPTC.
unsigned int m_RTCtr
Counter for RecoTracks that were actually created by the module.
std::string m_param_recoHitInformationStoreArrayName
StoreArray name of RecoHitInformation.
void initializeCounters()
reset counters to 0 to avoid indeterministic behaviour
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Storage for (VXD) SpacePoint-based track candidates.
unsigned int getNHits() const
get the number of hits (space points) in the track candidate
double getQualityIndicator() const
returns the current status of the estimated quality of this track candidate.
const TVector3 getMomSeed() const
get momentum seed as TVector3
@ c_isActive
bit 11: SPTC is active (i.e.
const TMatrixDSym & getCovSeed() const
get the covariance matrix seed (6D).
double getChargeSeed() const
get charge
const TVector3 getPosSeed() const
get position seed as TVector3
const std::vector< const Belle2::SpacePoint * > getSortedHits() const
get hits (space points) sorted by their respective sorting parameter
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.