9#include <tracking/modules/vxdtfRedesign/SPTC2RTConverterModule.h>
10#include <framework/logging/Logger.h>
18 setDescription(
"Converts the given SpacePointTrackCandidates to RecoTracks and stores them in the given RecoTracksStoreArray");
22 "StoreArray name of the input SpacePointTrackCandidates.", std::string(
""));
24 "StoreArray name of the output RecoTracks.", std::string(
""));
27 "StoreArray name of the output RecoHitInformation.", std::string(
""));
72 B2DEBUG(29,
"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 ROOT::Math::XYZVector& position = spacePointTC.
getPosSeed();
89 const ROOT::Math::XYZVector& momentum = spacePointTC.
getMomSeed();
91 const TMatrixDSym& covSeed = spacePointTC.
getCovSeed();
106 unsigned int sortingParameter = 0;
108 B2DEBUG(29,
"SPTC2RTConverter::event: Converting spacepoint: " << spacePoint->getArrayIndex());
110 int detID = spacePoint->getType();
114 B2DEBUG(29,
"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(29,
"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(29,
"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(29,
"SPTC2RTConverter::terminate: Got " <<
m_SPTCCtr <<
" SpacePointTrackCands and created " <<
m_RTCtr <<
" RecoTracks");
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
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.
SPTC2RTConverterModule()
Constructor.
std::string m_param_pxdHitsStoreArrayName
StoreArray name of PXDhits.
void initialize() override
Initializer.
void event() override
This method is called for each event.
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.
const ROOT::Math::XYZVector getPosSeed() const
get position seed as ROOT::Math::XYZVector
const ROOT::Math::XYZVector getMomSeed() const
get momentum seed as ROOT::Math::XYZVector
unsigned int getNHits() const
get the number of hits (space points) in the track candidate
const TMatrixDSym & getCovSeed() const
get the covariance matrix seed (6D).
double getQualityIndicator() const
returns the current status of the estimated quality of this track candidate.
@ c_isActive
bit 11: SPTC is active (i.e.
double getChargeSeed() const
get charge
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 registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.