Belle II Software prerelease-11-00-00a
MeasurementAdder Class Reference

Algorithm class to translate the added detector hits (e.g. More...

#include <MeasurementAdder.h>

Collaboration diagram for MeasurementAdder:

Public Member Functions

 MeasurementAdder (const std::string &storeArrayNameOfPXDHits, const std::string &storeArrayNameOfSVDHits, const std::string &storeArrayNameOfCDCHits, const std::string &storeArrayNameOfBKLMHits, const std::string &storeArrayNameOfEKLMHits, const bool initializeCDCTranslators=true, bool fromTrackCreator=false)
 Create a new instance of the measurement adder.
 
void resetMeasurementCreatorsToDefaultSettings ()
 Reset the internal measurement creator storage to the default settings.
 
void resetMeasurementCreators (const std::vector< std::shared_ptr< PXDBaseMeasurementCreator > > &pxdMeasurementCreators, const std::vector< std::shared_ptr< SVDBaseMeasurementCreator > > &svdMeasurementCreators, const std::vector< std::shared_ptr< CDCBaseMeasurementCreator > > &cdcMeasurementCreators, const std::vector< std::shared_ptr< BKLMBaseMeasurementCreator > > &bklmMeasurementCreators, const std::vector< std::shared_ptr< EKLMBaseMeasurementCreator > > &eklmMeasurementCreators, const std::vector< std::shared_ptr< BaseMeasurementCreator > > &additionalMeasurementCreators)
 If you want to use non-default settings for the store arrays, you can create your own instances of the measurement creators for the different detectors and use them here.
 
void resetMeasurementCreatorsUsingFactories (const std::map< std::string, std::map< std::string, std::string > > &pxdMeasurementCreators, const std::map< std::string, std::map< std::string, std::string > > &svdMeasurementCreators, const std::map< std::string, std::map< std::string, std::string > > &cdcMeasurementCreators, const std::map< std::string, std::map< std::string, std::string > > &bklmMeasurementCreators, const std::map< std::string, std::map< std::string, std::string > > &eklmMeasurementCreators, const std::map< std::string, std::map< std::string, std::string > > &additionalMeasurementCreators)
 If you want to use non-default settings for the store arrays, you can create your own instances of the measurement creators for the different detectors and use them here.
 
bool addMeasurements (RecoTrack &recoTrack) const
 After you have filled the internal storage with measurement creators (either by providing your own or by using the default settings), you can use then to add measurements to the reco tracks with this function.
 

Private Member Functions

void createGenfitMeasurementFactory ()
 Helper function to create a genfit::MeasurementFactory, needed in the MeasurementCreators.
 
template<class HitType, Const::EDetector detector>
void addMeasurementsFromHitToRecoTrack (RecoTrack &recoTrack, RecoHitInformation &recoHitInformation, HitType *hit, const std::vector< std::shared_ptr< BaseMeasurementCreatorFromHit< HitType, detector > > > &measurementCreators, std::map< genfit::TrackPoint *, RecoHitInformation * > &trackPointHitMapping) const
 Helper: Go through all measurement creators in the given list and create the measurement with a given hit.
 
void addMeasurementsToRecoTrack (RecoTrack &recoTrack, const std::vector< std::shared_ptr< BaseMeasurementCreator > > &measurementCreators) const
 Helper: Go through all measurement creators in the given list and create the measurement without a given hit.
 

Private Attributes

std::string m_param_storeArrayNameOfPXDHits = ""
 The name of the store array for the PXD hits.
 
std::string m_param_storeArrayNameOfSVDHits = ""
 The name of the store array for the SVD hits.
 
std::string m_param_storeArrayNameOfCDCHits = ""
 The name of the store array for the CDC hits.
 
std::string m_param_storeArrayNameOfBKLMHits = ""
 The name of the store array for the BKLM hits.
 
std::string m_param_storeArrayNameOfEKLMHits = ""
 The name of the store array for the EKLM hits.
 
bool m_skipDirtyCheck = false
 Flag to skip the dirty check. Useful when using non default measurement creators.
 
std::vector< std::shared_ptr< PXDBaseMeasurementCreator > > m_pxdMeasurementCreators
 Internal storage of the PXD measurement creators.
 
std::vector< std::shared_ptr< SVDBaseMeasurementCreator > > m_svdMeasurementCreators
 Internal storage of the SVD measurement creators.
 
std::vector< std::shared_ptr< CDCBaseMeasurementCreator > > m_cdcMeasurementCreators
 Internal storage of the CDC measurement creators.
 
std::vector< std::shared_ptr< BKLMBaseMeasurementCreator > > m_bklmMeasurementCreators
 Internal storage of the BKLM measurement creators.
 
std::vector< std::shared_ptr< EKLMBaseMeasurementCreator > > m_eklmMeasurementCreators
 Internal storage of the EKLM measurement creators.
 
std::vector< std::shared_ptr< BaseMeasurementCreator > > m_additionalMeasurementCreators
 Internal storage of the additional measurement creators.
 
genfit::MeasurementFactory< genfit::AbsMeasurement > m_genfitMeasurementFactory
 Internal storage of the genfit measurement factory;.
 

Detailed Description

Algorithm class to translate the added detector hits (e.g.

CDCHits) to internal TrackPoints before fitting. This can be - depending on your setting - a non trivial process and should be taken care only by this class.

You probably do not have to use this class on your own but use the TrackFitter for that.

Before fitting a reco track with the track fitter class, you have to translate all detector signals into measurements (contained in TrackPoints) for genfit. This is done using predefined measurement creator classes.

If you do not want non-default settings, you can call the measurement adder class with the following lines of code:

MeasurementAdder measurementAdder; measurementAdder.setMeasurementCreatorsToDefaultSettings()

measurementAdder.addMeasurements(recoTrack);

After that, you can fit the track (see the TrackFitter class).

If you want to provide special settings, you can either create a list of MeasurementCreators for the three detectors and for the case without detector by yourself or you use the MeasurementCreatorFactories. Both cases are shown below:

MeasurementAdder measurementAdder; // Possibility 1 measurementAdder.setMeasurementCreators({ cdcMeasurementCreatorSharedPointer1, cdcMeasurementCreatorSharedPointer2, ...}, { svdMeasurementCreatorSharedPointer1, ...}, { pxdMeasurementCreatorSharedPointer1, ...}, { additionalMeasurementCreatorSharedPointer1, ...})

// Possibility 2 measurementAdder.setMeasurementCreatorsUsingFactories( mapOfCreatorNamesAndSettingsForCDC, mapOfCreatorNamesAndSettingsForSVD, mapOfCreatorNamesAndSettingsForPXD, mapOfCreatorNamesAndSettingsForAdditionalMeasurements )

measurementAdder.addMeasurements(recoTrack);

Definition at line 76 of file MeasurementAdder.h.

Constructor & Destructor Documentation

◆ MeasurementAdder()

MeasurementAdder ( const std::string & storeArrayNameOfPXDHits,
const std::string & storeArrayNameOfSVDHits,
const std::string & storeArrayNameOfCDCHits,
const std::string & storeArrayNameOfBKLMHits,
const std::string & storeArrayNameOfEKLMHits,
const bool initializeCDCTranslators = true,
bool fromTrackCreator = false )

Create a new instance of the measurement adder.

You probably only have to do this once in your module, except the case you want to test out different settings.

Configures whether the CDC Translators should be initialized by the FitterModule especially useful for VXD-only beamtest. In the future this could be changed to check implicitly if the cdc is available in the geometry.

Definition at line 38 of file MeasurementAdder.cc.

45 :
46 m_param_storeArrayNameOfPXDHits(storeArrayNameOfPXDHits),
47 m_param_storeArrayNameOfSVDHits(storeArrayNameOfSVDHits),
48 m_param_storeArrayNameOfCDCHits(storeArrayNameOfCDCHits),
49 m_param_storeArrayNameOfBKLMHits(storeArrayNameOfBKLMHits),
50 m_param_storeArrayNameOfEKLMHits(storeArrayNameOfEKLMHits)
51{
55 if (initializeCDCTranslators) {
56 // Create new Translators and give them to the CDCRecoHits.
57 CDCRecoHit::setTranslators(new CDC::LinearGlobalADCCountTranslator(),
58 new CDC::RealisticCDCGeometryTranslator(true),
59 new CDC::RealisticTDCCountTranslator(true, fromTrackCreator),
60 true);
61 }
64}
static void setTranslators(CDC::ADCCountTranslatorBase *const adcCountTranslator, CDC::CDCGeometryTranslatorBase *const cdcGeometryTranslator, CDC::TDCCountTranslatorBase *const tdcCountTranslator, bool useTrackTime=false, bool cosmics=false)
Setter for the Translators.
Definition CDCRecoHit.cc:33
void createGenfitMeasurementFactory()
Helper function to create a genfit::MeasurementFactory, needed in the MeasurementCreators.
std::string m_param_storeArrayNameOfPXDHits
The name of the store array for the PXD hits.
std::string m_param_storeArrayNameOfBKLMHits
The name of the store array for the BKLM hits.
void resetMeasurementCreatorsToDefaultSettings()
Reset the internal measurement creator storage to the default settings.
std::string m_param_storeArrayNameOfSVDHits
The name of the store array for the SVD hits.
std::string m_param_storeArrayNameOfEKLMHits
The name of the store array for the EKLM hits.
std::string m_param_storeArrayNameOfCDCHits
The name of the store array for the CDC hits.

Member Function Documentation

◆ addMeasurements()

bool addMeasurements ( RecoTrack & recoTrack) const

After you have filled the internal storage with measurement creators (either by providing your own or by using the default settings), you can use then to add measurements to the reco tracks with this function.

Attention
If you are using default measurement creators and the dirty flag of the reco track is not set, this method will return and not nothing, as we do not want to recreate all measurements twice. If you want to create all measurements again (because you used different settings before), you have to set the dirty flag of the reco track manually.

Returns true, if the track should be refitted afterwards and false else.

Definition at line 161 of file MeasurementAdder.cc.

162{
163 B2ASSERT("Reco Track was built with another CDC store array: Reco Track "
164 << recoTrack.getStoreArrayNameOfCDCHits()
165 << ", this class " << m_param_storeArrayNameOfCDCHits,
166 checkTwoStoreArrayNames<RecoHitInformation::UsedCDCHit>(recoTrack.getStoreArrayNameOfCDCHits(), m_param_storeArrayNameOfCDCHits));
167 B2ASSERT("Reco Track was built with another SVD store array: Reco Track "
168 << recoTrack.getStoreArrayNameOfSVDHits()
169 << ", this class " << m_param_storeArrayNameOfSVDHits,
170 checkTwoStoreArrayNames<RecoHitInformation::UsedSVDHit>(recoTrack.getStoreArrayNameOfSVDHits(), m_param_storeArrayNameOfSVDHits));
171 B2ASSERT("Reco Track was built with another PXD store array: Reco Track "
172 << recoTrack.getStoreArrayNameOfPXDHits()
173 << ", this class " << m_param_storeArrayNameOfPXDHits,
174 checkTwoStoreArrayNames<RecoHitInformation::UsedPXDHit>(recoTrack.getStoreArrayNameOfPXDHits(), m_param_storeArrayNameOfPXDHits));
175 B2ASSERT("Reco Track was built with another BKLM store array: Reco Track "
176 << recoTrack.getStoreArrayNameOfBKLMHits()
177 << ", this class " << m_param_storeArrayNameOfBKLMHits,
178 checkTwoStoreArrayNames<RecoHitInformation::UsedBKLMHit>(recoTrack.getStoreArrayNameOfBKLMHits(),
180 B2ASSERT("Reco Track was built with another EKLM store array: Reco Track "
181 << recoTrack.getStoreArrayNameOfEKLMHits()
182 << ", this class " << m_param_storeArrayNameOfEKLMHits,
183 checkTwoStoreArrayNames<RecoHitInformation::UsedEKLMHit>(recoTrack.getStoreArrayNameOfEKLMHits(),
185
186 if (m_cdcMeasurementCreators.size() == 0 and m_svdMeasurementCreators.size() == 0 and m_pxdMeasurementCreators.size() == 0 and
187 m_bklmMeasurementCreators.size() == 0 and m_eklmMeasurementCreators.size() == 0 and m_additionalMeasurementCreators.size() == 0) {
188 B2WARNING("No measurement creators where added to this instance, so no measurements where created. Did you forget to call setMeasurementCreators?");
189 return false;
190 }
191
192 if (not recoTrack.getDirtyFlag() and not m_skipDirtyCheck) {
193 B2DEBUG(100, "Hit content did not change since last measurement adding and you are using default parameters." <<
194 "I will not add the measurements again. " <<
195 "If you still want to do so, set the dirty flag to true.");
196 return false;
197 }
198
199 // Delete all other measurements.
200 RecoTrackGenfitAccess::getGenfitTrack(recoTrack).deleteTrackPointsAndFitStatus();
201 recoTrack.setDirtyFlag();
202
203 std::map<genfit::TrackPoint*, RecoHitInformation*> trackPointHitMapping;
204
205 // Add the measurements created by the CDC, SVD and PXD measurement creators.
206 recoTrack.mapOnHits<RecoHitInformation::UsedPXDHit>(m_param_storeArrayNameOfPXDHits, [&](RecoHitInformation & recoHitInformation,
209 m_pxdMeasurementCreators, trackPointHitMapping);
210 });
211 recoTrack.mapOnHits<RecoHitInformation::UsedSVDHit>(m_param_storeArrayNameOfSVDHits, [&](RecoHitInformation & recoHitInformation,
214 m_svdMeasurementCreators, trackPointHitMapping);
215 });
216 recoTrack.mapOnHits<RecoHitInformation::UsedCDCHit>(m_param_storeArrayNameOfCDCHits, [&](RecoHitInformation & recoHitInformation,
219 m_cdcMeasurementCreators, trackPointHitMapping);
220 });
221 recoTrack.mapOnHits<RecoHitInformation::UsedBKLMHit>(m_param_storeArrayNameOfBKLMHits, [&](RecoHitInformation & recoHitInformation,
224 m_bklmMeasurementCreators, trackPointHitMapping);
225 });
226 recoTrack.mapOnHits<RecoHitInformation::UsedEKLMHit>(m_param_storeArrayNameOfEKLMHits, [&](RecoHitInformation & recoHitInformation,
229 m_eklmMeasurementCreators, trackPointHitMapping);
230 });
231
232 // Special case is with the additional measurement creator factories. They do not need any hits:
234
235 auto& genfitTrack = RecoTrackGenfitAccess::getGenfitTrack(recoTrack);
236
237 genfitTrack.sort();
238
239 // FIXME: hotfix:
240 // after we have a mapping between created track points and reco track information, we can use this mapping to
241 // write it back to the reco hit information. Please note, that we only store a single index for each
242 // reco hit information (although there could be multiple track points).
243 // We also assume that the track point vector is never changed again!
244 int counter = 0;
245 for (genfit::TrackPoint* trackPoint : genfitTrack.getPoints()) {
246 trackPointHitMapping[trackPoint]->setCreatedTrackPointID(counter);
247 counter += 1;
248 }
249
250 return true;
251}
std::vector< std::shared_ptr< BKLMBaseMeasurementCreator > > m_bklmMeasurementCreators
Internal storage of the BKLM measurement creators.
std::vector< std::shared_ptr< CDCBaseMeasurementCreator > > m_cdcMeasurementCreators
Internal storage of the CDC measurement creators.
std::vector< std::shared_ptr< PXDBaseMeasurementCreator > > m_pxdMeasurementCreators
Internal storage of the PXD measurement creators.
std::vector< std::shared_ptr< EKLMBaseMeasurementCreator > > m_eklmMeasurementCreators
Internal storage of the EKLM measurement creators.
std::vector< std::shared_ptr< BaseMeasurementCreator > > m_additionalMeasurementCreators
Internal storage of the additional measurement creators.
bool m_skipDirtyCheck
Flag to skip the dirty check. Useful when using non default measurement creators.
void addMeasurementsFromHitToRecoTrack(RecoTrack &recoTrack, RecoHitInformation &recoHitInformation, HitType *hit, const std::vector< std::shared_ptr< BaseMeasurementCreatorFromHit< HitType, detector > > > &measurementCreators, std::map< genfit::TrackPoint *, RecoHitInformation * > &trackPointHitMapping) const
Helper: Go through all measurement creators in the given list and create the measurement with a given...
std::vector< std::shared_ptr< SVDBaseMeasurementCreator > > m_svdMeasurementCreators
Internal storage of the SVD measurement creators.
void addMeasurementsToRecoTrack(RecoTrack &recoTrack, const std::vector< std::shared_ptr< BaseMeasurementCreator > > &measurementCreators) const
Helper: Go through all measurement creators in the given list and create the measurement without a gi...
CDCHit UsedCDCHit
Define, use of CDC hits as CDC hits (for symmetry).
EKLMAlignmentHit UsedEKLMHit
Define, use of EKLMHit2d as EKLM hits.
KLMHit2d UsedBKLMHit
Define, use of KLMHit2d as BKLM hits.
PXDCluster UsedPXDHit
Define, use of clusters or true hits for PXD.
SVDCluster UsedSVDHit
Define, use of clusters or true hits for SVD.
static genfit::Track & getGenfitTrack(RecoTrack &recoTrack)
Give access to the RecoTrack's genfit::Track.
Definition RecoTrack.cc:404
void mapOnHits(const std::string &storeArrayNameOfHits, std::function< void(RecoHitInformation &, HitType *)> const &mapFunction, std::function< bool(const RecoHitInformation &, const HitType *)> const &pickFunction)
Call a function on all hits of the given type in the store array, that are related to this track.
Definition RecoTrack.h:766
const std::string & getStoreArrayNameOfEKLMHits() const
Name of the store array of the eklm hits.
Definition RecoTrack.h:744
const std::string & getStoreArrayNameOfSVDHits() const
Name of the store array of the svd hits.
Definition RecoTrack.h:735
const std::string & getStoreArrayNameOfPXDHits() const
Name of the store array of the pxd hits.
Definition RecoTrack.h:732
void setDirtyFlag(const bool &dirtyFlag=true)
Set to true, if you want to rebuild the measurements and do the fit independent on changes of the hit...
Definition RecoTrack.h:722
const std::string & getStoreArrayNameOfBKLMHits() const
Name of the store array of the bklm hits.
Definition RecoTrack.h:741
const std::string & getStoreArrayNameOfCDCHits() const
Name of the store array of the cdc hits.
Definition RecoTrack.h:738
bool getDirtyFlag() const
This returns true, if a hit was added after the last fit and measurement creation and a refit should ...
Definition RecoTrack.h:715

◆ addMeasurementsFromHitToRecoTrack()

template<class HitType, Const::EDetector detector>
void addMeasurementsFromHitToRecoTrack ( RecoTrack & recoTrack,
RecoHitInformation & recoHitInformation,
HitType * hit,
const std::vector< std::shared_ptr< BaseMeasurementCreatorFromHit< HitType, detector > > > & measurementCreators,
std::map< genfit::TrackPoint *, RecoHitInformation * > & trackPointHitMapping ) const
inlineprivate

Helper: Go through all measurement creators in the given list and create the measurement with a given hit.

Definition at line 188 of file MeasurementAdder.h.

191 {
192 if (not recoHitInformation.useInFit()) {
193 return;
194 }
195
196 genfit::Track& genfitTrack = RecoTrackGenfitAccess::getGenfitTrack(recoTrack);
197
198 for (const auto& measurementCreator : measurementCreators) {
199 const std::vector<genfit::TrackPoint*>& trackPoints = measurementCreator->createMeasurementPoints(hit, recoTrack,
200 recoHitInformation);
201 for (genfit::TrackPoint* trackPoint : trackPoints) {
202 genfitTrack.insertPoint(trackPoint);
203 // FIXME: hotfix: to get a correct mapping between reco hit information and the track point.
204 // We are not able to store the TrackPoint in the RecoHitInformation directly because of problems in streaming
205 // the genfit::TrackPoint. So what we do is store the index of the track points in the vector of the genfit::Track.
206 // As this vector is sorted after this function, we can not set it here directly.
207 trackPointHitMapping[trackPoint] = &recoHitInformation;
208 }
209 }
210 }

◆ addMeasurementsToRecoTrack()

void addMeasurementsToRecoTrack ( RecoTrack & recoTrack,
const std::vector< std::shared_ptr< BaseMeasurementCreator > > & measurementCreators ) const
private

Helper: Go through all measurement creators in the given list and create the measurement without a given hit.

Definition at line 253 of file MeasurementAdder.cc.

255{
256 for (const auto& measurementCreator : measurementCreators) {
257 const std::vector<genfit::TrackPoint*>& trackPoints = measurementCreator->createMeasurementPoints(recoTrack);
258 for (genfit::TrackPoint* trackPoint : trackPoints) {
259 RecoTrackGenfitAccess::getGenfitTrack(recoTrack).insertPoint(trackPoint);
260 }
261 }
262}

◆ createGenfitMeasurementFactory()

void createGenfitMeasurementFactory ( )
private

Helper function to create a genfit::MeasurementFactory, needed in the MeasurementCreators.

Definition at line 66 of file MeasurementAdder.cc.

67{
68 StoreArray<RecoHitInformation::UsedCDCHit> cdcHits(m_param_storeArrayNameOfCDCHits);
69 StoreArray<RecoHitInformation::UsedSVDHit> svdHits(m_param_storeArrayNameOfSVDHits);
70 StoreArray<RecoHitInformation::UsedPXDHit> pxdHits(m_param_storeArrayNameOfPXDHits);
71 StoreArray<RecoHitInformation::UsedBKLMHit> bklmHits(m_param_storeArrayNameOfBKLMHits);
72 StoreArray<RecoHitInformation::UsedEKLMHit> eklmHits(m_param_storeArrayNameOfEKLMHits);
73
74 // Create the related measurement factory
75 if (pxdHits.isOptional())
76 m_genfitMeasurementFactory.addProducer(Const::PXD,
77 new genfit::MeasurementProducer<RecoHitInformation::UsedPXDHit, PXDRecoHit>(pxdHits.getPtr()));
78 if (svdHits.isOptional())
79 m_genfitMeasurementFactory.addProducer(Const::SVD,
80 new genfit::MeasurementProducer<RecoHitInformation::UsedSVDHit, SVDRecoHit>(svdHits.getPtr()));
81 if (cdcHits.isOptional())
82 m_genfitMeasurementFactory.addProducer(Const::CDC,
83 new genfit::MeasurementProducer<RecoHitInformation::UsedCDCHit, CDCRecoHit>(cdcHits.getPtr()));
84 if (bklmHits.isOptional())
85 m_genfitMeasurementFactory.addProducer(Const::BKLM,
86 new genfit::MeasurementProducer<RecoHitInformation::UsedBKLMHit, AlignableBKLMRecoHit>(bklmHits.getPtr()));
87 if (eklmHits.isOptional())
88 m_genfitMeasurementFactory.addProducer(Const::EKLM,
89 new genfit::MeasurementProducer<RecoHitInformation::UsedEKLMHit, AlignableEKLMRecoHit>(eklmHits.getPtr()));
90}
genfit::MeasurementFactory< genfit::AbsMeasurement > m_genfitMeasurementFactory
Internal storage of the genfit measurement factory;.

◆ resetMeasurementCreators()

void resetMeasurementCreators ( const std::vector< std::shared_ptr< PXDBaseMeasurementCreator > > & pxdMeasurementCreators,
const std::vector< std::shared_ptr< SVDBaseMeasurementCreator > > & svdMeasurementCreators,
const std::vector< std::shared_ptr< CDCBaseMeasurementCreator > > & cdcMeasurementCreators,
const std::vector< std::shared_ptr< BKLMBaseMeasurementCreator > > & bklmMeasurementCreators,
const std::vector< std::shared_ptr< EKLMBaseMeasurementCreator > > & eklmMeasurementCreators,
const std::vector< std::shared_ptr< BaseMeasurementCreator > > & additionalMeasurementCreators )

If you want to use non-default settings for the store arrays, you can create your own instances of the measurement creators for the different detectors and use them here.

For this method, you have to create the measurement creators by yourself.

It is assumed, that you only do this for non-default settings. This is why all measurement points will be recreated (independent on the dirty flag) and the track must be refitted afterwards.

Definition at line 104 of file MeasurementAdder.cc.

111{
112 m_pxdMeasurementCreators = pxdMeasurementCreators;
113 m_svdMeasurementCreators = svdMeasurementCreators;
114 m_cdcMeasurementCreators = cdcMeasurementCreators;
115 m_bklmMeasurementCreators = bklmMeasurementCreators;
116 m_eklmMeasurementCreators = eklmMeasurementCreators;
117 m_additionalMeasurementCreators = additionalMeasurementCreators;
118
119 m_skipDirtyCheck = true;
120}

◆ resetMeasurementCreatorsToDefaultSettings()

void resetMeasurementCreatorsToDefaultSettings ( )

Reset the internal measurement creator storage to the default settings.

The measurements will not be recreated if the dirty flag is not set (the hit content did not change).

Definition at line 92 of file MeasurementAdder.cc.

93{
94 m_pxdMeasurementCreators = { std::shared_ptr<PXDBaseMeasurementCreator>(new PXDCoordinateMeasurementCreator(m_genfitMeasurementFactory)) };
95 m_svdMeasurementCreators = { std::shared_ptr<SVDBaseMeasurementCreator>(new SVDCoordinateMeasurementCreator(m_genfitMeasurementFactory)) };
96 m_cdcMeasurementCreators = { std::shared_ptr<CDCBaseMeasurementCreator>(new CDCCoordinateMeasurementCreator(m_genfitMeasurementFactory)) };
97 m_bklmMeasurementCreators = { std::shared_ptr<BKLMBaseMeasurementCreator>(new BKLMCoordinateMeasurementCreator(m_genfitMeasurementFactory)) };
98 m_eklmMeasurementCreators = { std::shared_ptr<EKLMBaseMeasurementCreator>(new EKLMCoordinateMeasurementCreator(m_genfitMeasurementFactory)) };
100
101 m_skipDirtyCheck = false;
102}
CoordinateMeasurementCreator< RecoHitInformation::UsedSVDHit, Const::SVD > SVDCoordinateMeasurementCreator
Hit to reco hit measurement creator for the SVD.
CoordinateMeasurementCreator< RecoHitInformation::UsedPXDHit, Const::PXD > PXDCoordinateMeasurementCreator
Hit to reco hit measurement creator for the PXD.
CoordinateMeasurementCreator< RecoHitInformation::UsedBKLMHit, Const::BKLM > BKLMCoordinateMeasurementCreator
Hit to reco hit measurement creator for the BKLM.
CoordinateMeasurementCreator< RecoHitInformation::UsedCDCHit, Const::CDC > CDCCoordinateMeasurementCreator
Needed for templating.
CoordinateMeasurementCreator< RecoHitInformation::UsedEKLMHit, Const::EKLM > EKLMCoordinateMeasurementCreator
Hit to reco hit measurement creator for the EKLM.

◆ resetMeasurementCreatorsUsingFactories()

void resetMeasurementCreatorsUsingFactories ( const std::map< std::string, std::map< std::string, std::string > > & pxdMeasurementCreators,
const std::map< std::string, std::map< std::string, std::string > > & svdMeasurementCreators,
const std::map< std::string, std::map< std::string, std::string > > & cdcMeasurementCreators,
const std::map< std::string, std::map< std::string, std::string > > & bklmMeasurementCreators,
const std::map< std::string, std::map< std::string, std::string > > & eklmMeasurementCreators,
const std::map< std::string, std::map< std::string, std::string > > & additionalMeasurementCreators )

If you want to use non-default settings for the store arrays, you can create your own instances of the measurement creators for the different detectors and use them here.

In this method, the measurement creators are created by MeasurementCreatorFactories. For this, you have to give a map in the form { "creatorName" : { "parameterName1": parameterValue1, "parameterName2": parameterValue2, ... }, "otherCreatorName" : { "otherParameterName1": otherParameterValue1, ... }, ... } for each detector and for additional measurements. See the MeasurementCreatorFactories for more details.

It is assumed, that you only do this for non-default settings. This is why all measurement points will be recreated (independent on the dirty flag) and the track must be refitted afterwards.

Definition at line 122 of file MeasurementAdder.cc.

129{
130 PXDMeasurementCreatorFactory pxdMeasurementCreatorFactory(m_genfitMeasurementFactory);
131 SVDMeasurementCreatorFactory svdMeasurementCreatorFactory(m_genfitMeasurementFactory);
132 CDCMeasurementCreatorFactory cdcMeasurementCreatorFactory(m_genfitMeasurementFactory);
133 BKLMMeasurementCreatorFactory bklmMeasurementCreatorFactory(m_genfitMeasurementFactory);
134 EKLMMeasurementCreatorFactory eklmMeasurementCreatorFactory(m_genfitMeasurementFactory);
135 AdditionalMeasurementCreatorFactory additionalMeasurementCreatorFactory;
136
137 pxdMeasurementCreatorFactory.setParameters(pxdMeasurementCreators);
138 svdMeasurementCreatorFactory.setParameters(svdMeasurementCreators);
139 cdcMeasurementCreatorFactory.setParameters(cdcMeasurementCreators);
140 bklmMeasurementCreatorFactory.setParameters(bklmMeasurementCreators);
141 eklmMeasurementCreatorFactory.setParameters(eklmMeasurementCreators);
142 additionalMeasurementCreatorFactory.setParameters(additionalMeasurementCreators);
143
144 pxdMeasurementCreatorFactory.initialize();
145 svdMeasurementCreatorFactory.initialize();
146 cdcMeasurementCreatorFactory.initialize();
147 bklmMeasurementCreatorFactory.initialize();
148 eklmMeasurementCreatorFactory.initialize();
149 additionalMeasurementCreatorFactory.initialize();
150
151 m_pxdMeasurementCreators = pxdMeasurementCreatorFactory.getCreators();
152 m_svdMeasurementCreators = svdMeasurementCreatorFactory.getCreators();
153 m_cdcMeasurementCreators = cdcMeasurementCreatorFactory.getCreators();
154 m_bklmMeasurementCreators = bklmMeasurementCreatorFactory.getCreators();
155 m_eklmMeasurementCreators = eklmMeasurementCreatorFactory.getCreators();
156 m_additionalMeasurementCreators = additionalMeasurementCreatorFactory.getCreators();
157
158 m_skipDirtyCheck = true;
159}
void initialize()
Use the parameters given to the module and create the measurement creators from them.
const std::vector< std::shared_ptr< BaseMeasurementCreatorType > > & getCreators() const
Return the creators to the module.
void setParameters(const std::map< std::string, std::map< std::string, std::string > > &creatorsWithParametersDictionary)
Set the parameters.

Member Data Documentation

◆ m_additionalMeasurementCreators

std::vector<std::shared_ptr<BaseMeasurementCreator> > m_additionalMeasurementCreators
private

Internal storage of the additional measurement creators.

Definition at line 178 of file MeasurementAdder.h.

◆ m_bklmMeasurementCreators

std::vector<std::shared_ptr<BKLMBaseMeasurementCreator> > m_bklmMeasurementCreators
private

Internal storage of the BKLM measurement creators.

Definition at line 174 of file MeasurementAdder.h.

◆ m_cdcMeasurementCreators

std::vector<std::shared_ptr<CDCBaseMeasurementCreator> > m_cdcMeasurementCreators
private

Internal storage of the CDC measurement creators.

Definition at line 172 of file MeasurementAdder.h.

◆ m_eklmMeasurementCreators

std::vector<std::shared_ptr<EKLMBaseMeasurementCreator> > m_eklmMeasurementCreators
private

Internal storage of the EKLM measurement creators.

Definition at line 176 of file MeasurementAdder.h.

◆ m_genfitMeasurementFactory

genfit::MeasurementFactory<genfit::AbsMeasurement> m_genfitMeasurementFactory
private

Internal storage of the genfit measurement factory;.

Definition at line 181 of file MeasurementAdder.h.

◆ m_param_storeArrayNameOfBKLMHits

std::string m_param_storeArrayNameOfBKLMHits = ""
private

The name of the store array for the BKLM hits.

Definition at line 161 of file MeasurementAdder.h.

◆ m_param_storeArrayNameOfCDCHits

std::string m_param_storeArrayNameOfCDCHits = ""
private

The name of the store array for the CDC hits.

Definition at line 159 of file MeasurementAdder.h.

◆ m_param_storeArrayNameOfEKLMHits

std::string m_param_storeArrayNameOfEKLMHits = ""
private

The name of the store array for the EKLM hits.

Definition at line 163 of file MeasurementAdder.h.

◆ m_param_storeArrayNameOfPXDHits

std::string m_param_storeArrayNameOfPXDHits = ""
private

The name of the store array for the PXD hits.

Definition at line 155 of file MeasurementAdder.h.

◆ m_param_storeArrayNameOfSVDHits

std::string m_param_storeArrayNameOfSVDHits = ""
private

The name of the store array for the SVD hits.

Definition at line 157 of file MeasurementAdder.h.

◆ m_pxdMeasurementCreators

std::vector<std::shared_ptr<PXDBaseMeasurementCreator> > m_pxdMeasurementCreators
private

Internal storage of the PXD measurement creators.

Definition at line 168 of file MeasurementAdder.h.

◆ m_skipDirtyCheck

bool m_skipDirtyCheck = false
private

Flag to skip the dirty check. Useful when using non default measurement creators.

Definition at line 165 of file MeasurementAdder.h.

◆ m_svdMeasurementCreators

std::vector<std::shared_ptr<SVDBaseMeasurementCreator> > m_svdMeasurementCreators
private

Internal storage of the SVD measurement creators.

Definition at line 170 of file MeasurementAdder.h.


The documentation for this class was generated from the following files: