 |
Belle II Software
release-05-02-19
|
11 #include <tracking/modules/vxdtfRedesign/SPTC2RTConverterModule.h>
12 #include <framework/logging/Logger.h>
18 SPTC2RTConverterModule::SPTC2RTConverterModule() :
Module()
20 setDescription(
"Converts the given SpacePointTrackCandidates to RecoTracks and stores them in the given RecoTracksStoreArray");
23 addParam(
"spacePointsTCsStoreArrayName", m_param_spacePointTCsStoreArrayName,
24 "StoreArray name of the input SpacePointTrackCandidates.", std::string(
""));
25 addParam(
"recoTracksStoreArrayName", m_param_recoTracksStoreArrayName,
26 "StoreArray name of the output RecoTracks.", std::string(
""));
28 addParam(
"recoHitInformationStoreArrayName", m_param_recoHitInformationStoreArrayName,
29 "StoreArray name of the output RecoHitInformation.", std::string(
""));
30 addParam(
"pxdHitsStoreArrayName", m_param_pxdHitsStoreArrayName,
"StoreArray name of the related pxd hits.",
32 addParam(
"svdHitsStoreArrayName", m_param_svdHitsStoreArrayName,
"StoreArray name of the related svd hits.",
35 addParam(
"pxdClustersName", m_param_pxdClustersName,
"StoreArray name of PXDClusters related to SpacePoints.",
37 addParam(
"svdClustersName", m_param_svdClustersName,
"StoreArray name of SVDClusters related to SpacePoints.",
74 B2DEBUG(100,
"SPTC2RTConverter::event: SpacePointTrackCandidate not active or reserved. RefereeStatus: " <<
75 spacePointTC.getRefereeStatus());
77 }
else if (spacePointTC.getNHits() < 3) {
78 B2WARNING(
"SPTC2RTConverter::event: Number of SpacePoints of track candidate is smaller than 3. Not creating RecoTrack out of it.");
90 const TVector3& position = spacePointTC.
getPosSeed();
91 const TVector3& momentum = spacePointTC.
getMomSeed();
93 const TMatrixDSym& covSeed = spacePointTC.
getCovSeed();
108 unsigned int sortingParameter = 0;
110 B2DEBUG(110,
"SPTC2RTConverter::event: Converting spacepoint: " << spacePoint->getArrayIndex());
112 int detID = spacePoint->getType();
116 B2DEBUG(110,
"SPTC2RTConverter::event: Number of related PXD Clusters: " << relatedClusters.
size());
118 for (
const PXDCluster& cluster : relatedClusters) {
119 newRecoTrack->
addPXDHit(&cluster, sortingParameter, Belle2::RecoHitInformation::c_VXDTrackFinder);
124 B2DEBUG(110,
"SPTC2RTConverter::event: Number of related SVD Clusters: " << relatedClusters.
size());
126 for (
const SVDCluster& cluster : relatedClusters) {
127 newRecoTrack->
addSVDHit(&cluster, sortingParameter, Belle2::RecoHitInformation::c_VXDTrackFinder);
131 B2WARNING(
"SPTC2RTConverter::event: SpacePointTrackCandidate containing SpacePoint of unrecognised detector ID: " << detID <<
132 ". Created RecoTrack doesn't contain these SpacePoints!");
135 spacePoint->setAssignmentState(
true);
141 B2DEBUG(110,
"SPTC2RTConverter::event: nHits: " << spacePointTC.
getNHits() <<
142 " ChargeSeed: " << charge <<
143 " PositionSeed: " << position.X() <<
", " << position.Y() <<
", " << position.Z() <<
144 " MomentumSeed: " << momentum.X() <<
", " << momentum.Y() <<
", " << momentum.Z());
149 B2DEBUG(100,
"SPTC2RTConverter::terminate: Got " <<
m_SPTCCtr <<
" SpacePointTrackCands and created " <<
m_RTCtr <<
" RecoTracks";);
size_t size() const
Get number of relations.
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.
std::string m_param_pxdHitsStoreArrayName
StoreArray name of PXDhits.
const std::vector< const Belle2::SpacePoint * > getSortedHits() const
get hits (space points) sorted by their respective sorting parameter
void event() override
This method is the core of the module.
void setDescription(const std::string &description)
Sets the description of the module.
double getQualityIndicator() const
returns the current status of the estimated quality of this track candidate.
void setSeedCovariance(const TMatrixDSym &seedCovariance)
Set the covariance of the seed. ATTENTION: This is not the fitted covariance.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
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.
const TVector3 getMomSeed() const
get momentum seed as TVector3
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).
@ c_isActive
bit 11: SPTC is active (i.e.
void setQualityIndicator(const float qualityIndicator)
Set the quality index attached to this RecoTrack. 0 means likely fake.
unsigned int m_SPTCCtr
Counter for SpacePointTrackCands presented to the module.
std::string m_param_recoHitInformationStoreArrayName
StoreArray name of RecoHitInformation.
unsigned int getNHits() const
get the number of hits (space points) in the track candidate
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
This is the Reconstruction Event-Data Model Track.
std::string m_param_recoTracksStoreArrayName
Output RecoTracks StoreArray name.
void createRecoTrack(const SpacePointTrackCand &spacePointTC)
Creates a RecoTrack corresponding to the given SpacePointTrackCand and appends it to the RecoTracks S...
Class for type safe access to objects that are referred to in relations.
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.
Abstract base class for different kinds of events.
std::string m_param_spacePointTCsStoreArrayName
Input SpacePointTrackCands StoreArray name.
std::string m_param_pxdClustersName
StoreArray name of PXDClusters.
std::string m_param_svdClustersName
StoreArray name of SVDClusters.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
double getChargeSeed() const
get charge
void initializeCounters()
reset counters to 0 to avoid indeterministic behaviour
const TVector3 getPosSeed() const
get position seed as TVector3
std::string m_param_svdHitsStoreArrayName
StoreArray name of SVDhits.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
const TMatrixDSym & getCovSeed() const
get the covariance matrix seed (6D).
void terminate() override
This method is called at the end of the event processing.
void initialize() override
Initialize the Module.
StoreArray< SpacePointTrackCand > m_spacePointTCs
StoreArray as class member to prevent relinking for every event.
Storage for (VXD) SpacePoint-based track candidates.
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.