Belle II Software development
|
Algorithm class to translate the added detector hits (e.g. More...
#include <MeasurementAdder.h>
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) | |
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;. | |
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.
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 |
||
) |
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.
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.
Returns true, if the track should be refitted afterwards and false else.
Definition at line 160 of file MeasurementAdder.cc.
|
inlineprivate |
Helper: Go through all measurement creators in the given list and create the measurement with a given hit.
Definition at line 187 of file MeasurementAdder.h.
|
private |
Helper: Go through all measurement creators in the given list and create the measurement without a given hit.
Definition at line 252 of file MeasurementAdder.cc.
|
private |
Helper function to create a genfit::MeasurementFactory, needed in the MeasurementCreators.
Definition at line 65 of file MeasurementAdder.cc.
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 103 of file MeasurementAdder.cc.
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 91 of file MeasurementAdder.cc.
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 121 of file MeasurementAdder.cc.
|
private |
Internal storage of the additional measurement creators.
Definition at line 177 of file MeasurementAdder.h.
|
private |
Internal storage of the BKLM measurement creators.
Definition at line 173 of file MeasurementAdder.h.
|
private |
Internal storage of the CDC measurement creators.
Definition at line 171 of file MeasurementAdder.h.
|
private |
Internal storage of the EKLM measurement creators.
Definition at line 175 of file MeasurementAdder.h.
|
private |
Internal storage of the genfit measurement factory;.
Definition at line 180 of file MeasurementAdder.h.
|
private |
The name of the store array for the BKLM hits.
Definition at line 160 of file MeasurementAdder.h.
|
private |
The name of the store array for the CDC hits.
Definition at line 158 of file MeasurementAdder.h.
|
private |
The name of the store array for the EKLM hits.
Definition at line 162 of file MeasurementAdder.h.
|
private |
The name of the store array for the PXD hits.
Definition at line 154 of file MeasurementAdder.h.
|
private |
The name of the store array for the SVD hits.
Definition at line 156 of file MeasurementAdder.h.
|
private |
Internal storage of the PXD measurement creators.
Definition at line 167 of file MeasurementAdder.h.
|
private |
Flag to skip the dirty check. Useful when using non default measurement creators.
Definition at line 164 of file MeasurementAdder.h.
|
private |
Internal storage of the SVD measurement creators.
Definition at line 169 of file MeasurementAdder.h.