Belle II Software development
TrackFinderMCTruthRecoTracksModule Class Reference

This module uses the simulated truth information (MCParticles and their relations) to determine which hits belong to which particles and writes track candidates filled with necessary information into the DataStore. More...

#include <TrackFinderMCTruthRecoTracksModule.h>

Inheritance diagram for TrackFinderMCTruthRecoTracksModule:
Module PathElement

Public Types

enum  EModulePropFlags {
  c_Input = 1 ,
  c_Output = 2 ,
  c_ParallelProcessingCertified = 4 ,
  c_HistogramManager = 8 ,
  c_InternalSerializer = 16 ,
  c_TerminateInAllProcesses = 32 ,
  c_DontCollectStatistics = 64
}
 Each module can be tagged with property flags, which indicate certain features of the module. More...
 
typedef ModuleCondition::EAfterConditionPath EAfterConditionPath
 Forward the EAfterConditionPath definition from the ModuleCondition.
 

Public Member Functions

 TrackFinderMCTruthRecoTracksModule ()
 Constructor of the module.
 
void initialize () override
 Initialize the Module.
 
void beginRun () override
 Called when entering a new run.
 
void event () override
 This method is the core of the module.
 
void endRun () override
 This method is called if the current run ends.
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules.
 
virtual void terminate ()
 This method is called at the end of the event processing.
 
const std::string & getName () const
 Returns the name of the module.
 
const std::string & getType () const
 Returns the type of the module (i.e.
 
const std::string & getPackage () const
 Returns the package this module is in.
 
const std::string & getDescription () const
 Returns the description of the module.
 
void setName (const std::string &name)
 Set the name of the module.
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties.
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level.
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module.
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module.
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module.
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true.
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished.
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module.
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T >
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter.
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module.
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module.
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters.
 

Static Public Member Functions

static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Protected Member Functions

virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python.
 
virtual void def_beginRun ()
 Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.
 
virtual void def_event ()
 Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.
 
virtual void def_endRun ()
 This method can receive that the current run ends as a call from the Python side.
 
virtual void def_terminate ()
 Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.
 
void setDescription (const std::string &description)
 Sets the description of the module.
 
void setType (const std::string &type)
 Set the module type.
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module.
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module.
 
void setReturnValue (int value)
 Sets the return value for this module as integer.
 
void setReturnValue (bool value)
 Sets the return value for this module as bool.
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 

Private Member Functions

template<class THit , class TSimHit >
bool isWithinNLoops (double Bz, const THit *aHit, double nLoops)
 helper function which returns true if the current hit is within n loops the template give the hit type and the according sim hit type (e.g.
 
template<class THit , class TSimHit >
bool didParticleExitCDC (const THit *aHit)
 helper function which returns true if the current hit has a creation time after the MCParticle left the CDC and entered TOP.
 
std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects.
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary.
 

Private Attributes

bool m_usePXDHits
 Boolean to select if PXDHits should be used.
 
bool m_useSVDHits
 Boolean to select if SVDHits should be used.
 
bool m_useCDCHits
 Boolean to select if CDCHits should be used.
 
bool m_useOnlyAxialCDCHits
 Boolean to select if only axial CDCHits should be used.
 
bool m_useOnlyBeforeTOP
 Boolean to select if hits after TOP detector are discarded.
 
float m_useNLoops
 Number of loops to include in the MC tracks.
 
bool m_useReassignedHits
 Boolean to select the inclusion of hits form discarded secondary daughters.
 
bool m_useSecondCDCHits
 Also includes the CDC 2nd hit information in the mc tracks.
 
bool m_enforceTrueHit
 If set true only cluster hits that have a relation to a TrueHit will be included in the track candidate.
 
std::vector< std::string > m_whichParticles
 List of keywords to mark what properties particles must have to get a track candidate .
 
int m_particleProperties
 Internal encoding of m_whichParticles to avoid string comparisons.
 
double m_energyCut
 Create track candidates only for MCParticles with energy above this cut.
 
bool m_neutrals
 Boolean to mark if track candidates should also be created for neutral particles.
 
bool m_mergeDecayInFlight
 Boolean to merge decay in flight chains that involve a single charged particle.
 
bool m_setTimeSeed
 Boolean to forward the production time as seed time.
 
double m_smearing
 Smearing of MCMomentum and MCVertex in %.
 
std::vector< double > m_smearingCov
 Covariance matrix used to smear the true pos and mom before passed to track candidate.
 
TMatrixDSym m_initialCov
 The std::vector m_smearingCov will be translated into this TMatrixD.
 
int m_notEnoughtHitsCounter
 will hold number of tracks that do not have enough hits to form a track candidate (total NDF less than 5)
 
int m_noTrueHitCounter
 will hold number of cluster hits that do not have a corresponding true hit
 
int m_nRecoTracks = 0
 will hold the total number of created track candidates
 
std::string m_recoTracksStoreArrayName
 RecoTracks StoreArray name.
 
int m_minPXDHits
 Minimum number of PXD hits per track to allow track candidate creation.
 
int m_minSVDHits
 Minimum number of SVD hits per track to allow track candidate creation.
 
int m_minCDCAxialHits
 Minimum number of CDC hits from axial wires per track to allow track candidate creation.
 
int m_minCDCStereoHits
 Minimum number of CDC hits from stereo wires per track to allow track candidate creation.
 
bool m_allowFirstCDCSuperLayerOnly
 Boolean to allow tracks to pass the stereo hit requirement if they touched only the first (axial) CDC layer.
 
int m_minimalNdf
 Minimum number of total hits per track to allow track candidate creation.
 
std::vector< int > m_fromPdgCodes
 if size() is not 0, only for particles having an ancestor (parent or parent of parent etc) with PDG codes same as in this vector a track candidate be created
 
std::vector< int > m_particlePdgCodes
 if size() is not 0, only for particles with PDG codes same as in this vector a track candidate will be created
 
bool m_onlyCheckDirectParentPdgCode = false
 To be used together with WhichParticles to select the ancestor and daughters.
 
bool m_mcParticlesPresent
 This flag is set to false if there are no MC Particles in the data store (probably data run?) and we can not create MC Reco tracks.
 
double m_splitAfterDeltaT
 Minimal time delay between two sim hits (in ns) after which MC reco track will be split into separate tracks.
 
bool m_discardAuxiliaryHits = false
 if true hits marked as auxiliary will not be included in the RecoTrack
 
std::vector< uint > m_param_useCDCSuperLayers
 List of super layers to be used.
 
std::vector< uint > m_param_useCDCLayers
 List of layers to be used.
 
std::vector< uint > m_param_ignoreCDCLayers
 List of layers to be ignored in tracking.
 
std::array< bool, 9 > m_useCDCSuperLayers {}
 Bits for the used super layers ATTENTION: hardcoded value for number of super layers.
 
std::array< bool, 56 > m_useCDCLayers {}
 Bits for the used layers ATTENTION: hardcoded value for number of layers.
 
StoreArray< MCParticlem_MCParticles
 MCParticles StoreArray.
 
StoreArray< RecoTrackm_RecoTracks
 RecoTracks StoreArray.
 
StoreArray< PXDTrueHitm_PXDTrueHits
 PXDTrueHits StoreArray.
 
StoreArray< PXDClusterm_PXDClusters
 PXDClusters StoreArray.
 
StoreArray< SVDTrueHitm_SVDTrueHits
 SVDTrueHits StoreArray.
 
StoreArray< SVDClusterm_SVDClusters
 SVDTrueHits StoreArray.
 
StoreArray< CDCHitm_CDCHits
 CDCHits StoreArray.
 
StoreArray< CDCSimHitm_CDCSimHits
 CDCSimHits StoreArray.
 
std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Detailed Description

This module uses the simulated truth information (MCParticles and their relations) to determine which hits belong to which particles and writes track candidates filled with necessary information into the DataStore.

The Relations MCParticles -> Hits for PXD, SVD and CDC are used. At the moment CDCHits, PXDTrueHits, SVDTrueHits, PXDCluster hits and SVDCluster hits can be used By default only track candidates for primary particles (= particles from the generator) are created but this can be changed with the WhichParticles option. For every hit the true time information is extracted from the trueHits or simHit hits. This Information is used to sort the hits in the correct order for the fitting of curling tracks. The created genfit::TrackCandidates can be fitted with GenFitterModule.

Definition at line 43 of file TrackFinderMCTruthRecoTracksModule.h.

Member Typedef Documentation

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 88 of file Module.h.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

Each module can be tagged with property flags, which indicate certain features of the module.

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)

c_HistogramManager 

This module is used to manage histograms accumulated by other modules.

c_InternalSerializer 

This module is an internal serializer/deserializer for parallel processing.

c_TerminateInAllProcesses 

When using parallel processing, call this module's terminate() function in all processes().

This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 77 of file Module.h.

77 {
78 c_Input = 1,
79 c_Output = 2,
85 };
@ c_HistogramManager
This module is used to manage histograms accumulated by other modules.
Definition: Module.h:81
@ c_Input
This module is an input module (reads data).
Definition: Module.h:78
@ c_DontCollectStatistics
No statistics is collected for this module.
Definition: Module.h:84
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
@ c_InternalSerializer
This module is an internal serializer/deserializer for parallel processing.
Definition: Module.h:82
@ c_Output
This module is an output module (writes data).
Definition: Module.h:79
@ c_TerminateInAllProcesses
When using parallel processing, call this module's terminate() function in all processes().
Definition: Module.h:83

Constructor & Destructor Documentation

◆ TrackFinderMCTruthRecoTracksModule()

Constructor of the module.

Sets the description of the module.

Definition at line 42 of file TrackFinderMCTruthRecoTracksModule.cc.

42 : Module()
43{
44 //Set module properties
45 setDescription("Uses the MC information to create genfit::TrackCandidates for primary MCParticles and Relations between them. "
46 "Fills the created genfit::TrackCandidates with all information (start values, hit indices) needed for the fitting.");
48
49 // choose which hits to use, all hits assigned to the track candidate will be used in the fit
50 addParam("UsePXDHits",
52 "Set true if PXDHits or PXDClusters should be used",
53 true);
54 addParam("UseSVDHits",
56 "Set true if SVDHits or SVDClusters should be used",
57 true);
58 addParam("UseCDCHits",
60 "Set true if CDCHits should be used",
61 true);
62 addParam("UseOnlyAxialCDCHits",
64 "Set true if only the axial CDCHits should be used",
65 false);
66 addParam("UseNLoops",
68 "Set the number of loops whose hits will be marked as priority hits. All other hits "
69 "will be marked as auxiliary and therefore not considered for efficiency computations "
70 "By default, all hits will be priority hits.",
71 INFINITY);
72 addParam("UseOnlyBeforeTOP",
74 "Mark hits as auxiliary after the track left the CDC and touched the TOP detector.",
75 false);
76 addParam("UseReassignedHits",
78 "Include hits reassigned from discarded secondary daughters in the tracks.",
79 false);
80 addParam("UseSecondCDCHits",
82 "Also includes the CDC 2nd hit information in the MC tracks.",
83 false);
84 addParam("MinPXDHits",
86 "Minimum number of PXD hits needed to allow the created of a track candidate",
87 0);
88 addParam("MinSVDHits",
90 "Minimum number of SVD hits needed to allow the created of a track candidate",
91 0);
92 addParam("MinCDCAxialHits",
94 "Minimum number of CDC hits form an axial wire needed to allow the created of a track candidate",
95 0);
96 addParam("MinCDCStereoHits",
98 "Minimum number of CDC hits form a stereo wire needed to allow the created of a track candidate",
99 0);
100 addParam("AllowFirstCDCSuperLayerOnly",
102 "Allow tracks to pass the stereo hit requirement if they touched only the first (axial) CDC layer",
103 false);
104
105 addParam("MinimalNDF",
107 "Minimum number of total hits needed to allow the creation of a track candidate. "
108 "It is called NDF (number of degrees of freedom) because it counts the dimensionality. "
109 "2D hits are counted as 2",
110 5);
111
112 //choose for which particles a track candidate should be created
113 //this is just an attempt to find out what is the most suitable way to select particles, if you have other/better ideas, communicate it to the tracking group...
114 addParam("WhichParticles",
116 "List of keywords to mark what properties particles must have to get a track candidate. "
117 "If several properties are given all of them must be true: "
118 "\"primary\" particle must come from the generator, "
119 "\"PXD\", \"SVD\", \"CDC\", \"TOP\", \"ARICH\", \"ECL\" or \"KLM\" particle must have hits in the subdetector with that name. "
120 "\"is:X\" where X is a PDG code: particle must have this code. "
121 "\"from:X\" any of the particles's ancestors must have this (X) code",
122 std::vector<std::string>(1, "primary"));
123 addParam("onlyCheckDirectParentPdgCode",
125 "To be used together with WhichParticles to select the ancestor and daughters. "
126 "If true, only check the direct parent to be contained in the list of possible ancestors. "
127 "If false, check all ancestors in in the list of possible ancestors. "
128 "This could be used to e.g. only create MCRecoTracks for slow pions from D* decays instead of creating an MCRecoTrack "
129 "for every pion as long as the D* is one of its ancestors.",
131
132 addParam("EnergyCut",
134 "Track candidates are only created for MCParticles with energy larger than this cut ",
135 double(0.0));
136
137 addParam("Neutrals",
139 "Set true if track candidates should be created also for neutral particles",
140 bool(false));
141
142 addParam("MergeDecayInFlight",
144 "Merge decay in flights that produce a single charged particle to the parent particle",
145 bool(false));
146
147 addParam("SetTimeSeed",
149 "Set true to forward the production time as time seed of the particles to the RecoTrack",
150 true);
151
152 //smearing of MCMomentum
153 addParam("Smearing",
155 "Smearing of MCMomentum/MCVertex prior to storing it in genfit::TrackCandidate (in %). "
156 "A negative value will switch off smearing. This is also the default.",
157 -1.0);
158
159 addParam("SmearingCov",
161 "Covariance matrix used to smear the true pos and mom before passed to track candidate. "
162 "This matrix will also passed to Genfit as the initial covarance matrix. "
163 "If any diagonal value is negative this feature will not be used. "
164 "OFF DIAGONAL ELEMENTS DO NOT HAVE AN EFFECT AT THE MOMENT",
165 std::vector<double>(36, -1.0));
166
167 addParam("SplitAfterDeltaT",
169 "Minimal time delay between two sim hits (in ns) after which MC reco track will be "
170 "split into separate tracks. If < 0, don't do splitting."
171 "This feature was designed to be used in MC cosmics reconstruction to get two MCRecoTracks"
172 "when track pass through empty SVD region, so that number of MCRecoTracks can be compared with"
173 "number of non merged reco tracks. ",
174 -1.0);
175
176 // names of output containers
177 addParam("RecoTracksStoreArrayName",
179 "Name of store array holding the RecoTracks (output)",
180 std::string(""));
181
182 addParam("TrueHitMustExist",
184 "If set true only cluster hits that have a relation to a TrueHit will be included in the track candidate",
185 false);
186
187 addParam("discardAuxiliaryHits",
189 "If set true hits marked as auxiliary (e.g. hits in higher loops) will not be included in the track candidate.",
191
192 addParam("useCDCSuperLayers",
194 "List of CDC super layers to be used.",
196
197 addParam("useCDCLayers",
199 "List of layers to be used. "
200 "If a layer number is given in 'ignoreLayers', too, this will result on a B2FATAL. "
201 "Either use 'useLayers' and provide a set of layers to be used, "
202 "or use 'ignoreLayers' and provide a list of layers to be ignored, but not both at the same time.",
204
205 addParam("ignoreCDCLayers",
207 "List of layers to be ignored. "
208 "If a layer number is given in 'useLayers', too, this will result on a B2FATAL. "
209 "Either use 'useLayers' and provide a set of layers to be used, "
210 "or use 'ignoreLayers' and provide a list of layers to be ignored, but not both at the same time.",
212
213
214
215}
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
Module()
Constructor.
Definition: Module.cc:30
bool m_useCDCHits
Boolean to select if CDCHits should be used.
bool m_enforceTrueHit
If set true only cluster hits that have a relation to a TrueHit will be included in the track candida...
double m_energyCut
Create track candidates only for MCParticles with energy above this cut.
std::vector< std::string > m_whichParticles
List of keywords to mark what properties particles must have to get a track candidate .
bool m_discardAuxiliaryHits
if true hits marked as auxiliary will not be included in the RecoTrack
int m_minimalNdf
Minimum number of total hits per track to allow track candidate creation.
bool m_useReassignedHits
Boolean to select the inclusion of hits form discarded secondary daughters.
std::vector< double > m_smearingCov
Covariance matrix used to smear the true pos and mom before passed to track candidate.
bool m_allowFirstCDCSuperLayerOnly
Boolean to allow tracks to pass the stereo hit requirement if they touched only the first (axial) CDC...
bool m_onlyCheckDirectParentPdgCode
To be used together with WhichParticles to select the ancestor and daughters.
bool m_mergeDecayInFlight
Boolean to merge decay in flight chains that involve a single charged particle.
bool m_setTimeSeed
Boolean to forward the production time as seed time.
float m_useNLoops
Number of loops to include in the MC tracks.
double m_splitAfterDeltaT
Minimal time delay between two sim hits (in ns) after which MC reco track will be split into separate...
bool m_useSecondCDCHits
Also includes the CDC 2nd hit information in the mc tracks.
int m_minCDCStereoHits
Minimum number of CDC hits from stereo wires per track to allow track candidate creation.
bool m_usePXDHits
Boolean to select if PXDHits should be used.
std::vector< uint > m_param_useCDCLayers
List of layers to be used.
bool m_useOnlyBeforeTOP
Boolean to select if hits after TOP detector are discarded.
std::vector< uint > m_param_ignoreCDCLayers
List of layers to be ignored in tracking.
std::vector< uint > m_param_useCDCSuperLayers
List of super layers to be used.
int m_minCDCAxialHits
Minimum number of CDC hits from axial wires per track to allow track candidate creation.
int m_minSVDHits
Minimum number of SVD hits per track to allow track candidate creation.
bool m_useOnlyAxialCDCHits
Boolean to select if only axial CDCHits should be used.
double m_smearing
Smearing of MCMomentum and MCVertex in %.
std::string m_recoTracksStoreArrayName
RecoTracks StoreArray name.
int m_minPXDHits
Minimum number of PXD hits per track to allow track candidate creation.
bool m_neutrals
Boolean to mark if track candidates should also be created for neutral particles.
bool m_useSVDHits
Boolean to select if SVDHits should be used.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560

Member Function Documentation

◆ beginRun()

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Reimplemented from Module.

Definition at line 320 of file TrackFinderMCTruthRecoTracksModule.cc.

321{
324 m_nRecoTracks = 0;
325}
int m_noTrueHitCounter
will hold number of cluster hits that do not have a corresponding true hit
int m_notEnoughtHitsCounter
will hold number of tracks that do not have enough hits to form a track candidate (total NDF less tha...
int m_nRecoTracks
will hold the total number of created track candidates

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtualinherited

Create an independent copy of this module.

Note that parameters are shared, so changing them on a cloned module will also affect the original module.

Implements PathElement.

Definition at line 179 of file Module.cc.

180{
182 newModule->m_moduleParamList.setParameters(getParamList());
183 newModule->setName(getName());
184 newModule->m_package = m_package;
185 newModule->m_propertyFlags = m_propertyFlags;
186 newModule->m_logConfig = m_logConfig;
187 newModule->m_conditions = m_conditions;
188
189 return newModule;
190}
std::shared_ptr< Module > registerModule(const std::string &moduleName, std::string sharedLibPath="") noexcept(false)
Creates an instance of a module and registers it to the ModuleManager.
static ModuleManager & Instance()
Exception is thrown if the requested module could not be created by the ModuleManager.
const ModuleParamList & getParamList() const
Return module param list.
Definition: Module.h:363
const std::string & getName() const
Returns the name of the module.
Definition: Module.h:187
const std::string & getType() const
Returns the type of the module (i.e.
Definition: Module.cc:41
unsigned int m_propertyFlags
The properties of the module as bitwise or (with |) of EModulePropFlags.
Definition: Module.h:512
LogConfig m_logConfig
The log system configuration of the module.
Definition: Module.h:514
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition: Module.h:521
std::string m_package
Package this module is found in (may be empty).
Definition: Module.h:510
std::shared_ptr< Module > ModulePtr
Defines a pointer to a module object as a boost shared pointer.
Definition: Module.h:43

◆ def_beginRun()

virtual void def_beginRun ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 426 of file Module.h.

426{ beginRun(); }
virtual void beginRun()
Called when entering a new run.
Definition: Module.h:147

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

This method can receive that the current run ends as a call from the Python side.

For regular C++-Modules that forwards the call to the regular endRun() method.

Reimplemented in PyModule.

Definition at line 439 of file Module.h.

439{ endRun(); }
virtual void endRun()
This method is called if the current run ends.
Definition: Module.h:166

◆ def_event()

virtual void def_event ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 432 of file Module.h.

432{ event(); }
virtual void event()
This method is the core of the module.
Definition: Module.h:157

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

Wrappers to make the methods without "def_" prefix callable from Python.

Overridden in PyModule. Wrapper method for the virtual function initialize() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 420 of file Module.h.

420{ initialize(); }
virtual void initialize()
Initialize the Module.
Definition: Module.h:109

◆ def_terminate()

virtual void def_terminate ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 445 of file Module.h.

445{ terminate(); }
virtual void terminate()
This method is called at the end of the event processing.
Definition: Module.h:176

◆ didParticleExitCDC()

bool didParticleExitCDC ( const THit *  aHit)
private

helper function which returns true if the current hit has a creation time after the MCParticle left the CDC and entered TOP.

These tracks that re-enter the tracking volume are more difficult to reconstruct due to the energy loss in the CDC outer all and in TOP. The template gives the hit type and the according sim hit type (e.g. CDCHit and CDCSimHit)

Parameters
aHitpointer to the hit under investiation
Returns
: returns true if the the track left CDC and entered TOP before this hit was registered

Definition at line 982 of file TrackFinderMCTruthRecoTracksModule.cc.

983{
984 const TSimHit* simHit = ahit->template getRelated<TSimHit>();
985 if (not simHit) return false;
986
987 const MCParticle* mcParticle = simHit->template getRelated<MCParticle>();
988 if (not mcParticle) return false;
989 if (not mcParticle->hasSeenInDetector(Const::TOP)) return false;
990
991 RelationVector<TOPBarHit> topHits = mcParticle->getRelationsWith<TOPBarHit>();
992 if (topHits.size() == 0) return false;
993
994 // Get hit with the smallest time.
995 auto lessTime = [](const TOPBarHit & lhs, const TOPBarHit & rhs) {
996 return lhs.getTime() < rhs.getTime();
997 };
998 auto itFirstTopHit = std::min_element(topHits.begin(), topHits.end(), lessTime);
999
1000 return simHit->getGlobalTime() > itFirstTopHit->getTime();
1001};
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
iterator end()
Return iterator to last entry +1.
iterator begin()
Return iterator to first entry.
Class to store track parameters of incoming MC particles relation to MCParticle filled in top/simulat...
Definition: TOPBarHit.h:27
double getTime() const
Returns time of impact.
Definition: TOPBarHit.h:128

◆ endRun()

void endRun ( void  )
overridevirtual

This method is called if the current run ends.

Reimplemented from Module.

Definition at line 1005 of file TrackFinderMCTruthRecoTracksModule.cc.

1006{
1007 if (m_notEnoughtHitsCounter != 0) {
1008 B2WARNING(m_notEnoughtHitsCounter << " tracks had not enough hits to have at least " << m_minimalNdf <<
1009 " number of degrees of freedom (NDF). No Track Candidates were created from them so they will not be passed to the track fitter");
1010 }
1011 if (m_noTrueHitCounter != 0) {
1012 B2WARNING(m_noTrueHitCounter <<
1013 " cluster hits did not have a relation to a true hit and were therefore not included in a track candidate");
1014 }
1015 B2INFO("The MCTrackFinder created a total of " << m_nRecoTracks << " track candidates");
1016}

◆ evalCondition()

bool evalCondition ( ) const
inherited

If at least one condition was set, it is evaluated and true returned if at least one condition returns true.

If no condition or result value was defined, the method returns false. Otherwise, the condition is evaluated and true returned, if at least one condition returns true. To speed up the evaluation, the condition strings were already parsed in the method if_value().

Returns
True if at least one condition and return value exists and at least one condition expression was evaluated to true.

Definition at line 96 of file Module.cc.

97{
98 if (m_conditions.empty()) return false;
99
100 //okay, a condition was set for this Module...
101 if (!m_hasReturnValue) {
102 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
103 }
104
105 for (const auto& condition : m_conditions) {
106 if (condition.evaluate(m_returnValue)) {
107 return true;
108 }
109 }
110 return false;
111}
int m_returnValue
The return value.
Definition: Module.h:519
bool m_hasReturnValue
True, if the return value is set.
Definition: Module.h:518

◆ event()

void event ( void  )
overridevirtual

This method is the core of the module.

This method is called for each event. All processing of the event has to take place in this method.

Reimplemented from Module.

Definition at line 328 of file TrackFinderMCTruthRecoTracksModule.cc.

329{
330 // Skip in the case there are no MC particles present.
331 if (not m_mcParticlesPresent) {
332 B2DEBUG(20, "Skipping MC Track Finder as there are no MC Particles registered in the DataStore.");
333 return;
334 }
335
336 StoreObjPtr<EventMetaData> eventMetaDataPtr("EventMetaData", DataStore::c_Event);
337 const int eventCounter = eventMetaDataPtr->getEvent();
338 B2DEBUG(20, "******* MCTrackFinderModule processing event number: " << eventCounter << " *******");
339
340 //all the input containers. First: MCParticles
341 const int nMcParticles = m_MCParticles.getEntries();
342 B2DEBUG(20, "MCTrackFinder: total Number of MCParticles: " << nMcParticles);
343
344 //PXD trueHits
345 const int nPXDHits = m_PXDTrueHits.getEntries();
346 B2DEBUG(20, "MCTrackFinder: Number of PXDTrueHits: " << nPXDHits);
347
348 RelationArray mcPartToPXDTrueHits(m_MCParticles, m_PXDTrueHits);
349 const int nMcPartToPXDHits = mcPartToPXDTrueHits.getEntries();
350 B2DEBUG(20, "MCTrackFinder: Number of relations between MCParticles and PXDHits: " << nMcPartToPXDHits);
351
352 //PXD clusters
353 const int nPXDClusters = m_PXDClusters.getEntries();
354 B2DEBUG(20, "MCTrackFinder: Number of PXDClusters: " << nPXDClusters);
355
356 RelationArray pxdClusterToMCParticle(m_PXDClusters, m_MCParticles);
357 const int nPxdClusterToMCPart = pxdClusterToMCParticle.getEntries();
358 B2DEBUG(20, "MCTrackFinder: Number of relations between PXDCluster and MCParticles: " << nPxdClusterToMCPart);
359
360 //SVD truehits
361 const int nSVDHits = m_SVDTrueHits.getEntries();
362 B2DEBUG(20, "MCTrackFinder: Number of SVDDHits: " << nSVDHits);
363
364 RelationArray mcPartToSVDTrueHits(m_MCParticles, m_SVDTrueHits);
365 const int nMcPartToSVDHits = mcPartToSVDTrueHits.getEntries();
366 B2DEBUG(20, "MCTrackFinder: Number of relations between MCParticles and SVDHits: " << nMcPartToSVDHits);
367
368 //SVD clusters
369 const int nSVDClusters = m_SVDClusters.getEntries();
370 B2DEBUG(20, "MCTrackFinder: Number of SVDClusters: " << nSVDClusters);
371
372 RelationArray svdClusterToMCParticle(m_SVDClusters, m_MCParticles);
373 const int nSvdClusterToMCPart = svdClusterToMCParticle.getEntries();
374 B2DEBUG(20, "MCTrackFinder: Number of relations between SVDCluster and MCParticles: " << nSvdClusterToMCPart);
375
376 //CDC
377 const int nCDCHits = m_CDCHits.getEntries();
378 B2DEBUG(20, "MCTrackFinder: Number of CDCHits: " << nCDCHits);
379
380 RelationArray mcPartToCDCHits(m_MCParticles, m_CDCHits);
381 const int nMcPartToCDCHits = mcPartToCDCHits.getEntries();
382 B2DEBUG(20, "MCTrackFinder: Number of relations between MCParticles and CDCHits: " << nMcPartToCDCHits);
383
384 const int nCDCSimHits = m_CDCSimHits.getEntries();
385 B2DEBUG(20, "MCTrackFinder: Number of CDCSimHits: " << nCDCSimHits);
386
387 RelationArray cdcSimHitToHitRel(m_CDCSimHits, m_CDCHits);
388 const int nCdcSimHitToHitRel = cdcSimHitToHitRel.getEntries();
389 B2DEBUG(20, "MCTrackFinder: Number of relations between CDCSimHit and CDCHits: " << nCdcSimHitToHitRel);
390
391 // prepare rejection of CDC/PXD/SVD hits from higher order loops
392 const double Bz = BFieldManager::getField(0, 0, 0).Z() / Unit::T;
393
394 // loop over MCParticles. And check several user selected properties. Make a track candidate only if MCParticle has properties wanted by user options.
395 std::set<int> alreadyConsumedMCParticles;
396 for (int iPart = 0; iPart < nMcParticles; ++iPart) {
397 if (alreadyConsumedMCParticles.count(iPart)) continue;
398 alreadyConsumedMCParticles.insert(iPart);
399
400 MCParticle* aMcParticlePtr = m_MCParticles[iPart];
401 // Ignore particles that didn't propagate significantly, they cannot make tracks.
402 if ((aMcParticlePtr->getDecayVertex() - aMcParticlePtr->getProductionVertex()).R() < 1 * Unit::cm) {
403 B2DEBUG(20, "Particle that did not propagate significantly cannot make track.");
404 continue;
405 }
406
407 //set the property mask for this particle and compare it to the one generated from user input
408 int mcParticleProperties = 0;
409 if (aMcParticlePtr->hasStatus(MCParticle::c_PrimaryParticle)) {
410 mcParticleProperties += 1;
411 }
412 if (aMcParticlePtr->hasSeenInDetector(Const::PXD)) {
413 mcParticleProperties += 2;
414 }
415 if (aMcParticlePtr->hasSeenInDetector(Const::SVD)) {
416 mcParticleProperties += 4;
417 }
418 if (aMcParticlePtr->hasSeenInDetector(Const::CDC)) {
419 mcParticleProperties += 8;
420 }
421 if (aMcParticlePtr->hasSeenInDetector(Const::TOP)) {
422 mcParticleProperties += 16;
423 }
424 if (aMcParticlePtr->hasSeenInDetector(Const::ARICH)) {
425 mcParticleProperties += 32;
426 }
427 if (aMcParticlePtr->hasSeenInDetector(Const::ECL)) {
428 mcParticleProperties += 64;
429 }
430 if (aMcParticlePtr->hasSeenInDetector(Const::KLM)) {
431 mcParticleProperties += 128;
432 }
433 // check all "seen in" properties that the mcparticle should have in one line.
434 if ((mcParticleProperties bitand m_particleProperties) != m_particleProperties) {
435 B2DEBUG(20, "PDG: " << aMcParticlePtr->getPDG() << " | property mask of particle " << mcParticleProperties <<
436 " demanded property mask " << m_particleProperties);
437 continue; //goto next mcParticle, do not make track candidate
438 }
439 //make links only for interesting MCParticles: energy cut
440 if (aMcParticlePtr->getEnergy() < m_energyCut) {
441 B2DEBUG(20, "particle energy too low. MC particle will be skipped");
442 continue; //goto next mcParticle, do not make track candidate
443 }
444
445 //check if particle has the pdg code the user wants to have. If user did not set any pdg code every code is fine for track candidate creation
446
447 const int nPdgCodes = m_particlePdgCodes.size();
448 if (nPdgCodes not_eq 0) {
449 const int currentPdgCode = aMcParticlePtr->getPDG();
450 int nFalsePdgCodes = 0;
451 for (int i = 0; i not_eq nPdgCodes; ++i) {
452 if (m_particlePdgCodes[i] not_eq currentPdgCode) {
453 ++nFalsePdgCodes;
454 }
455 }
456 if (nFalsePdgCodes == nPdgCodes) {
457 B2DEBUG(20, "particle does not have one of the user provided pdg codes and will therefore be skipped");
458 continue; //goto next mcParticle, do not make track candidate
459 }
460 }
461
462
463 //check if particle has an ancestor selected by the user. If user did not set any pdg code every code is fine for track candidate creation
464 const int nFromPdgCodes = m_fromPdgCodes.size();
465 if (nFromPdgCodes not_eq 0) {
466 MCParticle* currentParent = aMcParticlePtr->getMother();
467 int nFalsePdgCodes = 0;
468 int nAncestor = 0;
469 bool foundParent = false;
470 while (currentParent not_eq nullptr) {
471 int currentParentPdgCode = currentParent->getPDG();
472 for (int i = 0; i not_eq nFromPdgCodes; ++i) {
473 if (m_fromPdgCodes[i] not_eq currentParentPdgCode) {
474 ++nFalsePdgCodes;
475 } else {
476 foundParent = true;
477 // if (m_onlyCheckDirectParentPdgCode) {
478 // break;
479 // }
480 }
481 }
482
484 currentParent = nullptr;
485 } else {
486 currentParent = currentParent->getMother();
487 ++nAncestor;
488 }
489 }
490 if (nFalsePdgCodes == (nAncestor * nFromPdgCodes) or not(m_onlyCheckDirectParentPdgCode and foundParent)) {
491 B2DEBUG(20, "particle does not have and ancestor with one of the user provided pdg codes and will therefore be skipped");
492 continue; //goto next mcParticle, do not make track candidate
493 }
494 }
495
496 // Ignore baryons, except for deuteron. The purpose is mainly to
497 // avoid an error message when getCharge() is called below.
498 if (abs(aMcParticlePtr->getPDG()) > 1000000000
499 && abs(aMcParticlePtr->getPDG()) != Const::deuteron.getPDGCode()) {
500 B2DEBUG(20, "Skipped Baryon.");
501 continue; //goto next mcParticle, do not make track candidate
502
503 }
504
505 // ignore neutrals (unless requested) (and unless monopoles)
506 if (!m_neutrals && (aMcParticlePtr->getCharge() == 0 && abs(aMcParticlePtr->getPDG()) != Monopoles::c_monopolePDGCode)) {
507 B2DEBUG(20, "particle does not have the right charge. MC particle will be skipped");
508 continue; //goto next mcParticle, do not make track candidate
509 }
510
511
512 B2DEBUG(20, "Build a track for the MCParticle with index: " << iPart << " (PDG: " << aMcParticlePtr->getPDG() << ")");
513
514 std::vector<const MCParticle*> trackMCParticles;
515 trackMCParticles.push_back(aMcParticlePtr);
516
517 if (m_mergeDecayInFlight and aMcParticlePtr->getCharge() != 0) {
518 std::vector<MCParticle*> daughters = aMcParticlePtr->getDaughters();
519 std::vector<MCParticle*> decayInFlightParticles;
520 for (MCParticle* daughter : daughters) {
521 if (daughter->getSecondaryPhysicsProcess() > 200 and daughter->getCharge() != 0) {
522 decayInFlightParticles.push_back(daughter);
523 }
524 }
525 if (decayInFlightParticles.size() == 1) {
526 trackMCParticles.push_back(decayInFlightParticles.front());
527 alreadyConsumedMCParticles.insert(trackMCParticles.back()->getArrayIndex());
528 }
529 }
530
531 //assign indices of the Hits from all detectors.
532 // entry 0: global event of each hit
533 // entry 1: indices in the respective hit arrays (PXD, SVD, CDC, ...)
534 // entry 2: the category of the hit: either a high priority and should be found or not so important
535 // entry 3: identifier for the detector type
536 typedef std::tuple<double, int, RecoHitInformation::OriginTrackFinder, Const::EDetector> TimeHitIDDetector;
537 std::vector<TimeHitIDDetector> hitsWithTimeAndDetectorInformation;
538
539 int ndf = 0; // count the ndf of one track candidate
540
541 // create a list containing the indices to the PXDHits that belong to one track
542 if (m_usePXDHits) {
543 int hitCounter = 0;
544 for (const MCParticle* trackMCParticle : trackMCParticles) {
545 const RelationVector<PXDCluster>& relatedClusters = trackMCParticle->getRelationsFrom<PXDCluster>();
546
547 for (size_t i = 0; i < relatedClusters.size(); ++i) {
548 bool isReassigned = relatedClusters.weight(i) < 0;
549 if (!m_useReassignedHits && isReassigned) continue; // skip hits from secondary particles
550
551 // currently only priority Hits for PXD
552 auto mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderPriorityHit;
553
554 // Reassigned hits are auxiliary
555 if (isReassigned) {
556 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
557 }
558
559 // Mark higher order hits as auxiliary, if m_useNLoops has been set
560 if (std::isfinite(m_useNLoops) and not isWithinNLoops<PXDCluster, PXDTrueHit>(Bz, relatedClusters.object(i), m_useNLoops)) {
561 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
562 }
563
564 // check if the particle left hits in TOP and add mark hits after that as auxiliary.
565 if (m_useOnlyBeforeTOP and didParticleExitCDC<PXDCluster, PXDTrueHit>(relatedClusters.object(i))) {
566 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
567 }
568
569 // if flag is set discard all auxiliary hits:
570 if (m_discardAuxiliaryHits and mcFinder == RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit) continue;
571
572 const PXDCluster* pxdCluster = relatedClusters.object(i);
573 const RelationVector<PXDTrueHit>& relatedTrueHits = pxdCluster->getRelationsTo<PXDTrueHit>();
574
575 if (relatedTrueHits.size() == 0 and m_enforceTrueHit) {
576 // there is not trueHit! throw away hit because there is no time information for sorting
578 continue;
579 }
580
581 float time = NAN;
582 for (const PXDTrueHit& pxdTrueHit : relatedTrueHits) {
583 // Make sure only a true hit is taken that really comes from the current mcParticle.
584 // This must be carefully checked because several trueHits from different real tracks can be melted into one cluster
585 const RelationVector<MCParticle>& relatedMCParticles = pxdTrueHit.getRelationsFrom<MCParticle>();
586 if (std::find_if(relatedMCParticles.begin(),
587 relatedMCParticles.end(),
588 [trackMCParticle](const MCParticle & mcParticle) {
589 return &mcParticle == trackMCParticle;
590 }) != relatedMCParticles.end()) {
591 time = pxdTrueHit.getGlobalTime();
592 break;
593 }
594 }
595 if (not std::isnan(time)) {
596 hitsWithTimeAndDetectorInformation.emplace_back(time, pxdCluster->getArrayIndex(), mcFinder, Const::PXD);
597 ++hitCounter;
598 ndf += 2;
599 }
600 }
601
602 B2DEBUG(20, " add " << hitCounter << " PXDClusters. " << relatedClusters.size() - hitCounter <<
603 " PXDClusters were not added because they do not have a corresponding PXDTrueHit");
604 } // next trackMCParticle
605
606 if (hitCounter < m_minPXDHits) {
608 continue; //goto next mcParticle, do not make track candidate
609 }
610 } // end if m_usePXDHits
611
612 // create a list containing the indices to the SVDHits that belong to one track
613 if (m_useSVDHits) {
614 int hitCounter = 0;
615 for (const MCParticle* trackMCParticle : trackMCParticles) {
616 const RelationVector<SVDCluster>& relatedClusters = trackMCParticle->getRelationsFrom<SVDCluster>();
617
618 for (size_t i = 0; i < relatedClusters.size(); ++i) {
619 bool isReassigned = relatedClusters.weight(i) < 0;
620 if (!m_useReassignedHits && isReassigned) continue; // skip hits from secondary particles
621
622 auto mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderPriorityHit;
623
624 // Reassigned hits are auxiliary
625 if (isReassigned) {
626 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
627 }
628
629 // Mark higher order hits as auxiliary, if m_useNLoops has been set
630 if (std::isfinite(m_useNLoops) and not isWithinNLoops<SVDCluster, SVDTrueHit>(Bz, relatedClusters.object(i), m_useNLoops)) {
631 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
632 }
633
634 // check if the particle left hits in TOP and add mark hits after that as auxiliary.
635 if (m_useOnlyBeforeTOP and didParticleExitCDC<SVDCluster, SVDTrueHit>(relatedClusters.object(i))) {
636 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
637 }
638
639 // if flag is set discard all auxiliary hits:
640 if (m_discardAuxiliaryHits and mcFinder == RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit) continue;
641
642 const SVDCluster* svdCluster = relatedClusters.object(i);
643 const RelationVector<SVDTrueHit>& relatedTrueHits = svdCluster->getRelationsTo<SVDTrueHit>();
644
645 if (relatedTrueHits.size() == 0 and m_enforceTrueHit) {
646 // there is not trueHit! throw away hit because there is no time information for sorting
648 continue;
649 }
650
651 float time = NAN;
652 for (const SVDTrueHit& svdTrueHit : relatedTrueHits) {
653 // Make sure only a true hit is taken that really comes from the current mcParticle.
654 // This must be carefully checked because several trueHits from different real tracks can be melted into one cluster
655 const RelationVector<MCParticle>& relatedMCParticles = svdTrueHit.getRelationsFrom<MCParticle>();
656 if (std::find_if(relatedMCParticles.begin(),
657 relatedMCParticles.end(),
658 [trackMCParticle](const MCParticle & mcParticle) {
659 return &mcParticle == trackMCParticle;
660 }) != relatedMCParticles.end()) {
661 time = svdTrueHit.getGlobalTime();
662 break;
663 }
664 }
665 if (not std::isnan(time)) {
666 hitsWithTimeAndDetectorInformation.emplace_back(time, svdCluster->getArrayIndex(), mcFinder, Const::SVD);
667 ++hitCounter;
668 ndf += 1;
669 }
670 }
671
672 B2DEBUG(20, " add " << hitCounter << " SVDClusters. " << relatedClusters.size() - hitCounter <<
673 " SVDClusters were not added because they do not have a corresponding SVDTrueHit");
674 }
675
676 if (hitCounter < m_minSVDHits) {
678 continue; //goto next mcParticle, do not make track candidate
679 }
680 } // end if m_useSVDHits
681
682 if (m_useCDCHits) {
683 // create a list containing the indices to the CDCHits that belong to one track
684 int nAxialHits = 0;
685 int nStereoHits = 0;
686 std::array<int, 9> nHitsBySuperLayerId{};
687
688 for (const MCParticle* trackMCParticle : trackMCParticles) {
689 const RelationVector<CDCHit>& relatedHits = trackMCParticle->getRelationsTo<CDCHit>();
690
691 for (size_t i = 0; i < relatedHits.size(); ++i) {
692 bool isReassigned = relatedHits.weight(i) < 0;
693 if (!m_useReassignedHits && isReassigned) continue; // skip hits from secondary particles
694
695 const CDCHit* cdcHit = relatedHits.object(i);
696
697 unsigned short superLayerId = cdcHit->getISuperLayer();
698 if (not m_useCDCSuperLayers[superLayerId]) continue;
699 unsigned short layerID = cdcHit->getICLayer();
700 if (not m_useCDCLayers[layerID]) continue;
701
702 // continue if this is a 2nd CDC hit information and we do not want to use it
703 if (!m_useSecondCDCHits && cdcHit->is2ndHit()) {
704 continue;
705 }
706
707 auto mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderPriorityHit;
708
709 // Reassigned hits are auxiliary
710 if (isReassigned) {
711 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
712 }
713
714 // Mark higher order hits as auxiliary, if m_useNLoops has been set
715 if (std::isfinite(m_useNLoops) and not isWithinNLoops<CDCHit, CDCSimHit>(Bz, cdcHit, m_useNLoops)) {
716 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
717 }
718
719 // check if the particle left hits in TOP and add mark hits after that as auxiliary.
720 if (m_useOnlyBeforeTOP and didParticleExitCDC<CDCHit, CDCSimHit>(cdcHit)) {
721 mcFinder = RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit;
722 }
723
724 // if flag is set discard all auxiliary hits:
725 if (m_discardAuxiliaryHits and mcFinder == RecoHitInformation::OriginTrackFinder::c_MCTrackFinderAuxiliaryHit) continue;
726
727
728 const CDCSimHit* aCDCSimHitPtr = cdcHit->getRelatedFrom<CDCSimHit>();
729 if (not aCDCSimHitPtr) {
730 B2DEBUG(20, " Skipping CDCHit without related CDCSimHit.");
731 continue;
732 }
733 double time = aCDCSimHitPtr->getFlightTime();
734
735 // Here it is hardcoded what superlayer has axial wires and what has stereo wires.
736 // Maybe it would be better if the WireId would know this
737 if (superLayerId % 2 == 0) {
738 hitsWithTimeAndDetectorInformation.emplace_back(time, cdcHit->getArrayIndex(), mcFinder, Const::CDC);
739 ndf += 1;
740 ++nAxialHits;
741 ++nHitsBySuperLayerId[superLayerId];
742 } else {
743 if (not m_useOnlyAxialCDCHits) {
744 hitsWithTimeAndDetectorInformation.emplace_back(time, cdcHit->getArrayIndex(), mcFinder, Const::CDC);
745 ndf += 1;
746 ++nStereoHits;
747 ++nHitsBySuperLayerId[superLayerId];
748 }
749 }
750 }
751 } // next trackMCParticle
752 B2DEBUG(20, " added " << nAxialHits << " axial and " << nStereoHits << " stereo CDCHits");
753 if (nAxialHits < m_minCDCAxialHits) {
754 // Not enough axial hits. Next MCParticle.
756 continue;
757 }
758
759 if (not m_useOnlyAxialCDCHits and (nStereoHits < m_minCDCStereoHits)) {
761 nHitsBySuperLayerId[0] == nAxialHits and
762 (nAxialHits + nStereoHits >= m_minCDCAxialHits + m_minCDCStereoHits)) {
763 // Special rule for low momentum tracks that only touch the first axial superlayer
764 // If there still enough hits combined from the axial and stereo hit limit -> keep the track.
765 } else {
766 // Not enough stereo hits. Next MCParticle.
768 continue;
769 }
770 }
771 } // end if m_useCDCHits
772
773 if (m_initialCov(0, 0) > 0.0) { //using a user set initial cov and corresponding smearing of initial state adds information
774 ndf += 5;
775 }
776 if (ndf < m_minimalNdf) {
778 continue; //goto next mcParticle, do not make track candidate
779 }
780
781 std::sort(hitsWithTimeAndDetectorInformation.begin(), hitsWithTimeAndDetectorInformation.end(),
782 [](const TimeHitIDDetector & rhs, const TimeHitIDDetector & lhs) {
783 return std::get<0>(rhs) < std::get<0>(lhs);
784 });
785
786 // Now create vectors of vectors, which will either contain hits the full vector WithTimeanddetectorInformation
787 // or slices of it, when cutting SplitAfterDeltaT is positive, each slice corresponding to a (sub-) reco track
788 // created by the MC particle.
789 std::vector< std::vector<TimeHitIDDetector> > hitsWithTimeAndDetectorInformationVectors;
790
791 if (m_splitAfterDeltaT < 0.0) { // no splitting, vector will only contain a single hitInformation vector
792 hitsWithTimeAndDetectorInformationVectors.push_back(hitsWithTimeAndDetectorInformation);
793 } else { // split on delta t
794
795 std::vector<TimeHitIDDetector>::size_type splitFromIdx = 0; // whenever splitting subtrack, start slice from this index
796 for (std::vector<TimeHitIDDetector>::size_type i = 1; i != hitsWithTimeAndDetectorInformation.size(); i++) {
797
798 double delta_t = (std::get<0>(hitsWithTimeAndDetectorInformation[i])
799 - std::get<0>(hitsWithTimeAndDetectorInformation[i - 1]));
800
801 if (delta_t > m_splitAfterDeltaT) {
802 // push slice of `hitsWithTimeAndDetectorInformation' between splitFromidx and previous index
803 hitsWithTimeAndDetectorInformationVectors
804 .emplace_back(hitsWithTimeAndDetectorInformation.begin() + splitFromIdx,
805 hitsWithTimeAndDetectorInformation.begin() + i);
806 splitFromIdx = i;
807 }
808 }
809 // add subtrack after last splitting to list of tracks
810 hitsWithTimeAndDetectorInformationVectors
811 .emplace_back(hitsWithTimeAndDetectorInformation.begin() + splitFromIdx,
812 hitsWithTimeAndDetectorInformation.end());
813 }
814
815 //Now create TrackCandidate
816 int counter = m_RecoTracks.getEntries();
817 B2DEBUG(20, "We came pass all filter of the MCPartile and hit properties. TrackCandidate " << counter <<
818 " will be created from the MCParticle with index: " << iPart << " (PDG: " << aMcParticlePtr->getPDG() << ")");
819
820
821
822 //set track parameters from MCParticle information
823 ROOT::Math::XYZVector positionTrue = aMcParticlePtr->getProductionVertex();
824 ROOT::Math::XYZVector momentumTrue = aMcParticlePtr->getMomentum();
825 double timeTrue = aMcParticlePtr->getProductionTime();
826
827 // if no kind of smearing is activated the initial values (seeds) for track fit will be the simulated truth
828 ROOT::Math::XYZVector momentum = momentumTrue;
829 ROOT::Math::XYZVector position = positionTrue;
830 double time = timeTrue;
831 TVectorD stateSeed(6); //this will
832 TMatrixDSym covSeed(6);
833 covSeed.Zero(); // just to be save
834 covSeed(0, 0) = 1; covSeed(1, 1) = 1; covSeed(2, 2) = 2 * 2;
835 covSeed(3, 3) = 0.1 * 0.1; covSeed(4, 4) = 0.1 * 0.1; covSeed(5, 5) = 0.2 * 0.2;
836 //it may have positive effect on the fit not to start with exactly precise true values (or it may be just interesting to study this)
837 //one can smear the starting momentum values with a gaussian
838 //this calculation is always performed, but with the default value of m_smearing = 0 it has no effect on momentum and position (true values are taken)
839
840 if (m_smearing > 0.0) {
841 double smearing = m_smearing / 100.0; //the module parameter m_smearing goes from 0 to 100, smearing should go from 0 to 1
842
843 double smearedX = gRandom->Gaus(positionTrue.x(), smearing * positionTrue.x());
844 double smearedY = gRandom->Gaus(positionTrue.y(), smearing * positionTrue.y());
845 double smearedZ = gRandom->Gaus(positionTrue.z(), smearing * positionTrue.z());
846 position.SetXYZ(smearedX, smearedY, smearedZ);
847 double smearedPX = gRandom->Gaus(momentumTrue.x(), smearing * momentumTrue.x());
848 double smearedPY = gRandom->Gaus(momentumTrue.y(), smearing * momentumTrue.y());
849 double smearedPZ = gRandom->Gaus(momentumTrue.z(), smearing * momentumTrue.z());
850 momentum.SetXYZ(smearedPX, smearedPY, smearedPZ);
851 }
852
853 //Errors for the position/momentum values can also be passed to genfit::TrackCandidate
854 //Default values in Genfit are (1.,1.,1.,), they seem to be not good!!
855 //The best way to set the 'correct' errors has to be investigated....
856 if (m_initialCov(0, 0) > 0.0) { // alternative seamring with according to a covariance matrix
857 double smearedX = gRandom->Gaus(positionTrue.x(), sqrt(m_initialCov(0, 0)));
858 double smearedY = gRandom->Gaus(positionTrue.y(), sqrt(m_initialCov(1, 1)));
859 double smearedZ = gRandom->Gaus(positionTrue.z(), sqrt(m_initialCov(2, 2)));
860 position.SetXYZ(smearedX, smearedY, smearedZ);
861 double smearedPX = gRandom->Gaus(momentumTrue.x(), sqrt(m_initialCov(3, 3)));
862 double smearedPY = gRandom->Gaus(momentumTrue.y(), sqrt(m_initialCov(4, 4)));
863 double smearedPZ = gRandom->Gaus(momentumTrue.z(), sqrt(m_initialCov(5, 5)));
864 momentum.SetXYZ(smearedPX, smearedPY, smearedPZ);
865 covSeed = m_initialCov;
866 }
867
868 // Finally create RecoTracks for MC particle.
869 // Either only one or multiple tracks, if SplitAfterDeltaT is positive
870 for (const auto& hitInformationVector : hitsWithTimeAndDetectorInformationVectors) {
871
872 // TODO: In former times, the track candidate also stored the PDG code!!!
873 short int charge = static_cast<short int>(aMcParticlePtr->getCharge());
874
875 // extrapolate the position and momentum to the point of the first hit on the helix
876 if (hitInformationVector.size() != 0) {
877 // reset the time to the time of the first hit (assumes time > production time)
878 time = std::get<0>(hitInformationVector.at(0));
879 const double deltaT = time - aMcParticlePtr->getProductionTime();
880 const double energy = sqrt(momentum.Mag2() + aMcParticlePtr->get4Vector().M() * aMcParticlePtr->get4Vector().M());
881 const double beta_xy = momentum.Rho() / energy;
882 // calculate arclength in 2D of the track
883 const double arclength2D = beta_xy * Const::speedOfLight * deltaT;
884
885 // get the position and momentum from the helix at the acrlength corresponding to the first hit
886 Belle2::Helix helix = Belle2::Helix(position, momentum, charge, Bz);
887 momentum = helix.getMomentumAtArcLength2D(arclength2D, Bz);
888 position = helix.getPositionAtArcLength2D(arclength2D);
889 }
890
891
892 RecoTrack* newRecoTrack = m_RecoTracks.appendNew(B2Vector3D(position), B2Vector3D(momentum), charge);
893 if (m_setTimeSeed) {
894 newRecoTrack->setTimeSeed(time);
895 }
897
898 //create relation between the track candidates and the mcParticle (redundant to saving the MCId)
899 newRecoTrack->addRelationTo(aMcParticlePtr);
900 B2DEBUG(20, " --- Create relation between genfit::TrackCand " << counter << " and MCParticle " << iPart);
901
902 int hitCounter = 0;
903 for (const TimeHitIDDetector& hitInformation : hitInformationVector) {
904
905 const Const::EDetector& detectorInformation = std::get<3>(hitInformation);
906 const int hitID = std::get<1>(hitInformation);
907 const auto hitOriginMCFinderType = std::get<2>(hitInformation);
908
909
910 if (detectorInformation == Const::CDC) {
911 const CDCHit* cdcHit = m_CDCHits[hitID];
912 const CDCSimHit* aCDCSimHitPtr = cdcHit->getRelatedFrom<CDCSimHit>();
913
914 //now determine the correct sign to resolve the left right ambiguity in the fitter
915 ROOT::Math::XYZVector simHitPos = aCDCSimHitPtr->getPosTrack();
916 ROOT::Math::XYZVector simMom = aCDCSimHitPtr->getMomentum();
917 ROOT::Math::XYZVector simHitPosOnWire = aCDCSimHitPtr->getPosWire();
918
920 const unsigned short isRightHit = cdcGeometry.getNewLeftRightRaw(simHitPosOnWire, simHitPos, simMom);
921
922 if (isRightHit) {
923 newRecoTrack->addCDCHit(cdcHit, hitCounter, RecoHitInformation::RightLeftInformation::c_right, hitOriginMCFinderType);
924 } else {
925 newRecoTrack->addCDCHit(cdcHit, hitCounter, RecoHitInformation::RightLeftInformation::c_left, hitOriginMCFinderType);
926 }
927 B2DEBUG(20, "CDC hit " << hitID << " has reft/right sign " << isRightHit);
928 } else if (detectorInformation == Const::PXD) {
929 const PXDCluster* pxdCluster = m_PXDClusters[hitID];
930 newRecoTrack->addPXDHit(pxdCluster, hitCounter, hitOriginMCFinderType);
931 } else if (detectorInformation == Const::SVD) {
932 const SVDCluster* svdCluster = m_SVDClusters[hitID];
933 newRecoTrack->addSVDHit(svdCluster, hitCounter, hitOriginMCFinderType);
934 }
935 ++hitCounter;
936 } // end loop over hits
937
938 B2DEBUG(20, "New RecoTrack: #PXDHits: " << newRecoTrack->getPXDHitList().size() <<
939 " #SVDHits: " << newRecoTrack->getSVDHitList().size() <<
940 " #CDCHits: " << newRecoTrack->getCDCHitList().size());
941
942 } // end loop over vector
943 }//end loop over MCParticles
944}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
bool is2ndHit() const
Getter for 2nd hit flag.
Definition: CDCHit.h:205
unsigned short getICLayer() const
Getter for iCLayer (0-55).
Definition: CDCHit.h:178
unsigned short getISuperLayer() const
Getter for iSuperLayer.
Definition: CDCHit.h:184
Example Detector.
Definition: CDCSimHit.h:21
B2Vector3D getPosWire() const
The method to get position on wire.
Definition: CDCSimHit.h:199
B2Vector3D getPosTrack() const
The method to get position on the track.
Definition: CDCSimHit.h:217
B2Vector3D getMomentum() const
The method to get momentum.
Definition: CDCSimHit.h:193
The Class for CDC Geometry Parameters.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
unsigned short getNewLeftRightRaw(const B2Vector3D &posOnWire, const B2Vector3D &posOnTrack, const B2Vector3D &momentum) const
Returns new left/right_raw.
Helix parameter class.
Definition: Helix.h:48
int getPDGCode() const
PDG code.
Definition: Const.h:473
EDetector
Enum for identifying the detector components (detector and subdetector).
Definition: Const.h:42
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
static const ChargedStable deuteron
deuteron particle
Definition: Const.h:664
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Definition: DataStore.h:59
float getEnergy() const
Return particle energy in GeV.
Definition: MCParticle.h:147
@ c_PrimaryParticle
bit 0: Particle is primary particle.
Definition: MCParticle.h:47
ROOT::Math::XYZVector getDecayVertex() const
Return decay vertex.
Definition: MCParticle.h:219
bool hasSeenInDetector(Const::DetectorSet set) const
Return if the seen-in flag for a specific subdetector is set or not.
Definition: MCParticle.h:310
std::vector< Belle2::MCParticle * > getDaughters() const
Get vector of all daughter particles, empty vector if none.
Definition: MCParticle.cc:52
bool hasStatus(unsigned short int bitmask) const
Return if specific status bit is set.
Definition: MCParticle.h:129
ROOT::Math::XYZVector getProductionVertex() const
Return production vertex position.
Definition: MCParticle.h:189
float getCharge() const
Return the particle charge defined in TDatabasePDG.
Definition: MCParticle.cc:36
ROOT::Math::PxPyPzEVector get4Vector() const
Return 4Vector of particle.
Definition: MCParticle.h:207
int getPDG() const
Return PDG code of particle.
Definition: MCParticle.h:112
float getProductionTime() const
Return production time in ns.
Definition: MCParticle.h:159
ROOT::Math::XYZVector getMomentum() const
Return momentum.
Definition: MCParticle.h:198
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:30
Class PXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: PXDTrueHit.h:31
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
bool addCDCHit(const UsedCDCHit *cdcHit, const unsigned int sortingParameter, RightLeftInformation rightLeftInformation=RightLeftInformation::c_undefinedRightLeftInformation, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a cdc hit with the given information to the reco track.
Definition: RecoTrack.h:243
std::vector< Belle2::RecoTrack::UsedPXDHit * > getPXDHitList() const
Return an unsorted list of pxd hits.
Definition: RecoTrack.h:449
std::vector< Belle2::RecoTrack::UsedSVDHit * > getSVDHitList() const
Return an unsorted list of svd hits.
Definition: RecoTrack.h:452
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.
Definition: RecoTrack.h:258
std::vector< Belle2::RecoTrack::UsedCDCHit * > getCDCHitList() const
Return an unsorted list of cdc hits.
Definition: RecoTrack.h:455
void setTimeSeed(const double timeSeed)
Set the time seed. ATTENTION: This is not the fitted time.
Definition: RecoTrack.h:604
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.
Definition: RecoTrack.h:272
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
T * object(int index) const
Get object with index.
float weight(int index) const
Get weight with index.
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).
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
FROM * getRelatedFrom(const std::string &name="", const std::string &namedRelation="") const
Get the object from which this object has a relation.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:29
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: SVDTrueHit.h:33
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:246
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
std::vector< int > m_fromPdgCodes
if size() is not 0, only for particles having an ancestor (parent or parent of parent etc) with PDG c...
std::vector< int > m_particlePdgCodes
if size() is not 0, only for particles with PDG codes same as in this vector a track candidate will b...
StoreArray< SVDCluster > m_SVDClusters
SVDTrueHits StoreArray.
StoreArray< PXDTrueHit > m_PXDTrueHits
PXDTrueHits StoreArray.
int m_particleProperties
Internal encoding of m_whichParticles to avoid string comparisons.
bool m_mcParticlesPresent
This flag is set to false if there are no MC Particles in the data store (probably data run?...
StoreArray< CDCSimHit > m_CDCSimHits
CDCSimHits StoreArray.
StoreArray< PXDCluster > m_PXDClusters
PXDClusters StoreArray.
StoreArray< RecoTrack > m_RecoTracks
RecoTracks StoreArray.
std::array< bool, 56 > m_useCDCLayers
Bits for the used layers ATTENTION: hardcoded value for number of layers.
std::array< bool, 9 > m_useCDCSuperLayers
Bits for the used super layers ATTENTION: hardcoded value for number of super layers.
TMatrixDSym m_initialCov
The std::vector m_smearingCov will be translated into this TMatrixD.
StoreArray< SVDTrueHit > m_SVDTrueHits
SVDTrueHits StoreArray.
StoreArray< MCParticle > m_MCParticles
MCParticles StoreArray.
static const double cm
Standard units with the value = 1.
Definition: Unit.h:47
static const double T
[tesla]
Definition: Unit.h:120
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Definition: BFieldManager.h:91
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
MCParticle * getMother() const
Returns a pointer to the mother particle.
Definition: MCParticle.h:600
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44

◆ exposePythonAPI()

void exposePythonAPI ( )
staticinherited

Exposes methods of the Module class to Python.

Definition at line 325 of file Module.cc.

326{
327 // to avoid confusion between std::arg and boost::python::arg we want a shorthand namespace as well
328 namespace bp = boost::python;
329
330 docstring_options options(true, true, false); //userdef, py sigs, c++ sigs
331
332 void (Module::*setReturnValueInt)(int) = &Module::setReturnValue;
333
334 enum_<Module::EAfterConditionPath>("AfterConditionPath",
335 R"(Determines execution behaviour after a conditional path has been executed:
336
337.. attribute:: END
338
339 End processing of this path after the conditional path. (this is the default for if_value() etc.)
340
341.. attribute:: CONTINUE
342
343 After the conditional path, resume execution after this module.)")
344 .value("END", Module::EAfterConditionPath::c_End)
345 .value("CONTINUE", Module::EAfterConditionPath::c_Continue)
346 ;
347
348 /* Do not change the names of >, <, ... we use them to serialize conditional pathes */
349 enum_<Belle2::ModuleCondition::EConditionOperators>("ConditionOperator")
356 ;
357
358 enum_<Module::EModulePropFlags>("ModulePropFlags",
359 R"(Flags to indicate certain low-level features of modules, see :func:`Module.set_property_flags()`, :func:`Module.has_properties()`. Most useful flags are:
360
361.. attribute:: PARALLELPROCESSINGCERTIFIED
362
363 This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)
364
365.. attribute:: HISTOGRAMMANAGER
366
367 This module is used to manage histograms accumulated by other modules
368
369.. attribute:: TERMINATEINALLPROCESSES
370
371 When using parallel processing, call this module's terminate() function in all processes. This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.
372)")
373 .value("INPUT", Module::EModulePropFlags::c_Input)
374 .value("OUTPUT", Module::EModulePropFlags::c_Output)
375 .value("PARALLELPROCESSINGCERTIFIED", Module::EModulePropFlags::c_ParallelProcessingCertified)
376 .value("HISTOGRAMMANAGER", Module::EModulePropFlags::c_HistogramManager)
377 .value("INTERNALSERIALIZER", Module::EModulePropFlags::c_InternalSerializer)
378 .value("TERMINATEINALLPROCESSES", Module::EModulePropFlags::c_TerminateInAllProcesses)
379 ;
380
381 //Python class definition
382 class_<Module, PyModule> module("Module", R"(
383Base class for Modules.
384
385A module is the smallest building block of the framework.
386A typical event processing chain consists of a Path containing
387modules. By inheriting from this base class, various types of
388modules can be created. To use a module, please refer to
389:func:`Path.add_module()`. A list of modules is available by running
390``basf2 -m`` or ``basf2 -m package``, detailed information on parameters is
391given by e.g. ``basf2 -m RootInput``.
392
393The 'Module Development' section in the manual provides detailed information
394on how to create modules, setting parameters, or using return values/conditions:
395https://xwiki.desy.de/xwiki/rest/p/f4fa4/#HModuleDevelopment
396
397)");
398 module
399 .def("__str__", &Module::getPathString)
400 .def("name", &Module::getName, return_value_policy<copy_const_reference>(),
401 "Returns the name of the module. Can be changed via :func:`set_name() <Module.set_name()>`, use :func:`type() <Module.type()>` for identifying a particular module class.")
402 .def("type", &Module::getType, return_value_policy<copy_const_reference>(),
403 "Returns the type of the module (i.e. class name minus 'Module')")
404 .def("set_name", &Module::setName, args("name"), R"(
405Set custom name, e.g. to distinguish multiple modules of the same type.
406
407>>> path.add_module('EventInfoSetter')
408>>> ro = path.add_module('RootOutput', branchNames=['EventMetaData'])
409>>> ro.set_name('RootOutput_metadata_only')
410>>> print(path)
411[EventInfoSetter -> RootOutput_metadata_only]
412
413)")
414 .def("description", &Module::getDescription, return_value_policy<copy_const_reference>(),
415 "Returns the description of this module.")
416 .def("package", &Module::getPackage, return_value_policy<copy_const_reference>(),
417 "Returns the package this module belongs to.")
418 .def("available_params", &_getParamInfoListPython,
419 "Return list of all module parameters as `ModuleParamInfo` instances")
420 .def("has_properties", &Module::hasProperties, (bp::arg("properties")),
421 R"DOCSTRING(Allows to check if the module has the given properties out of `ModulePropFlags` set.
422
423>>> if module.has_properties(ModulePropFlags.PARALLELPROCESSINGCERTIFIED):
424>>> ...
425
426Parameters:
427 properties (int): bitmask of `ModulePropFlags` to check for.
428)DOCSTRING")
429 .def("set_property_flags", &Module::setPropertyFlags, args("property_mask"),
430 "Set module properties in the form of an OR combination of `ModulePropFlags`.");
431 {
432 // python signature is too crowded, make ourselves
433 docstring_options subOptions(true, false, false); //userdef, py sigs, c++ sigs
434 module
435 .def("if_value", &Module::if_value,
436 (bp::arg("expression"), bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
437 R"DOCSTRING(if_value(expression, condition_path, after_condition_path=AfterConditionPath.END)
438
439Sets a conditional sub path which will be executed after this
440module if the return value set in the module passes the given ``expression``.
441
442Modules can define a return value (int or bool) using ``setReturnValue()``,
443which can be used in the steering file to split the Path based on this value, for example
444
445>>> module_with_condition.if_value("<1", another_path)
446
447In case the return value of the ``module_with_condition`` for a given event is
448less than 1, the execution will be diverted into ``another_path`` for this event.
449
450You could for example set a special return value if an error occurs, and divert
451the execution into a path containing :b2:mod:`RootOutput` if it is found;
452saving only the data producing/produced by the error.
453
454After a conditional path has executed, basf2 will by default stop processing
455the path for this event. This behaviour can be changed by setting the
456``after_condition_path`` argument.
457
458Parameters:
459 expression (str): Expression to determine if the conditional path should be executed.
460 This should be one of the comparison operators ``<``, ``>``, ``<=``,
461 ``>=``, ``==``, or ``!=`` followed by a numerical value for the return value
462 condition_path (Path): path to execute in case the expression is fulfilled
463 after_condition_path (AfterConditionPath): What to do once the ``condition_path`` has been executed.
464)DOCSTRING")
465 .def("if_false", &Module::if_false,
466 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
467 R"DOC(if_false(condition_path, after_condition_path=AfterConditionPath.END)
468
469Sets a conditional sub path which will be executed after this module if
470the return value of the module evaluates to False. This is equivalent to
471calling `if_value` with ``expression=\"<1\"``)DOC")
472 .def("if_true", &Module::if_true,
473 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
474 R"DOC(if_true(condition_path, after_condition_path=AfterConditionPath.END)
475
476Sets a conditional sub path which will be executed after this module if
477the return value of the module evaluates to True. It is equivalent to
478calling `if_value` with ``expression=\">=1\"``)DOC");
479 }
480 module
481 .def("has_condition", &Module::hasCondition,
482 "Return true if a conditional path has been set for this module "
483 "using `if_value`, `if_true` or `if_false`")
484 .def("get_all_condition_paths", &_getAllConditionPathsPython,
485 "Return a list of all conditional paths set for this module using "
486 "`if_value`, `if_true` or `if_false`")
487 .def("get_all_conditions", &_getAllConditionsPython,
488 "Return a list of all conditional path expressions set for this module using "
489 "`if_value`, `if_true` or `if_false`")
490 .add_property("logging", make_function(&Module::getLogConfig, return_value_policy<reference_existing_object>()),
@ c_GE
Greater or equal than: ">=".
@ c_SE
Smaller or equal than: "<=".
@ c_GT
Greater than: ">"
@ c_NE
Not equal: "!=".
@ c_EQ
Equal: "=" or "=="
@ c_ST
Smaller than: "<"
Base class for Modules.
Definition: Module.h:72
LogConfig & getLogConfig()
Returns the log system configuration.
Definition: Module.h:225
void if_value(const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
Add a condition to the module.
Definition: Module.cc:79
void if_true(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to set the condition of the module.
Definition: Module.cc:90
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition: Module.cc:220
void setLogConfig(const LogConfig &logConfig)
Set the log system configuration.
Definition: Module.h:230
const std::string & getDescription() const
Returns the description of the module.
Definition: Module.h:202
void if_false(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to add a condition to the module.
Definition: Module.cc:85
bool hasCondition() const
Returns true if at least one condition was set for the module.
Definition: Module.h:311
const std::string & getPackage() const
Returns the package this module is in.
Definition: Module.h:197
void setName(const std::string &name)
Set the name of the module.
Definition: Module.h:214
bool hasProperties(unsigned int propertyFlags) const
Returns true if all specified property flags are available in this module.
Definition: Module.cc:160
std::string getPathString() const override
return the module name.
Definition: Module.cc:192

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 133 of file Module.cc.

134{
135 if (m_conditions.empty()) return EAfterConditionPath::c_End;
136
137 //okay, a condition was set for this Module...
138 if (!m_hasReturnValue) {
139 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
140 }
141
142 for (const auto& condition : m_conditions) {
143 if (condition.evaluate(m_returnValue)) {
144 return condition.getAfterConditionPath();
145 }
146 }
147
148 return EAfterConditionPath::c_End;
149}

◆ getAllConditionPaths()

std::vector< std::shared_ptr< Path > > getAllConditionPaths ( ) const
inherited

Return all condition paths currently set (no matter if the condition is true or not).

Definition at line 150 of file Module.cc.

151{
152 std::vector<std::shared_ptr<Path>> allConditionPaths;
153 for (const auto& condition : m_conditions) {
154 allConditionPaths.push_back(condition.getPath());
155 }
156
157 return allConditionPaths;
158}

◆ getAllConditions()

const std::vector< ModuleCondition > & getAllConditions ( ) const
inlineinherited

Return all set conditions for this module.

Definition at line 324 of file Module.h.

325 {
326 return m_conditions;
327 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

Return a pointer to the first condition (or nullptr, if none was set)

Definition at line 314 of file Module.h.

315 {
316 if (m_conditions.empty()) {
317 return nullptr;
318 } else {
319 return &m_conditions.front();
320 }
321 }

◆ getConditionPath()

std::shared_ptr< Path > getConditionPath ( ) const
inherited

Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).


Definition at line 113 of file Module.cc.

114{
115 PathPtr p;
116 if (m_conditions.empty()) return p;
117
118 //okay, a condition was set for this Module...
119 if (!m_hasReturnValue) {
120 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
121 }
122
123 for (const auto& condition : m_conditions) {
124 if (condition.evaluate(m_returnValue)) {
125 return condition.getPath();
126 }
127 }
128
129 // if none of the conditions were true, return a null pointer.
130 return p;
131}
std::shared_ptr< Path > PathPtr
Defines a pointer to a path object as a boost shared pointer.
Definition: Path.h:35

◆ getDescription()

const std::string & getDescription ( ) const
inlineinherited

Returns the description of the module.

Definition at line 202 of file Module.h.

202{return m_description;}
std::string m_description
The description of the module.
Definition: Module.h:511

◆ getFileNames()

virtual std::vector< std::string > getFileNames ( bool  outputFiles)
inlinevirtualinherited

Return a list of output filenames for this modules.

This will be called when basf2 is run with "--dry-run" if the module has set either the c_Input or c_Output properties.

If the parameter outputFiles is false (for modules with c_Input) the list of input filenames should be returned (if any). If outputFiles is true (for modules with c_Output) the list of output files should be returned (if any).

If a module has sat both properties this member is called twice, once for each property.

The module should return the actual list of requested input or produced output filenames (including handling of input/output overrides) so that the grid system can handle input/output files correctly.

This function should return the same value when called multiple times. This is especially important when taking the input/output overrides from Environment as they get consumed when obtained so the finalized list of output files should be stored for subsequent calls.

Reimplemented in RootInputModule, StorageRootOutputModule, and RootOutputModule.

Definition at line 134 of file Module.h.

135 {
136 return std::vector<std::string>();
137 }

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 225 of file Module.h.

225{return m_logConfig;}

◆ getModules()

std::list< ModulePtr > getModules ( ) const
inlineoverrideprivatevirtualinherited

no submodules, return empty list

Implements PathElement.

Definition at line 506 of file Module.h.

506{ return std::list<ModulePtr>(); }

◆ getName()

const std::string & getName ( ) const
inlineinherited

Returns the name of the module.

This can be changed via e.g. set_name() in the steering file to give more useful names if there is more than one module of the same type.

For identifying the type of a module, using getType() (or type() in Python) is recommended.

Definition at line 187 of file Module.h.

187{return m_name;}
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition: Module.h:508

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 197 of file Module.h.

197{return m_package;}

◆ getParamInfoListPython()

std::shared_ptr< boost::python::list > getParamInfoListPython ( ) const
inherited

Returns a python list of all parameters.

Each item in the list consists of the name of the parameter, a string describing its type, a python list of all default values and the description of the parameter.

Returns
A python list containing the parameters of this parameter list.

Definition at line 279 of file Module.cc.

280{
282}
std::shared_ptr< boost::python::list > getParamInfoListPython() const
Returns a python list of all parameters.
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition: Module.h:516

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 363 of file Module.h.

363{ return m_moduleParamList; }

◆ getPathString()

std::string getPathString ( ) const
overrideprivatevirtualinherited

return the module name.

Implements PathElement.

Definition at line 192 of file Module.cc.

193{
194
195 std::string output = getName();
196
197 for (const auto& condition : m_conditions) {
198 output += condition.getString();
199 }
200
201 return output;
202}

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 381 of file Module.h.

381{ return m_returnValue; }

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 41 of file Module.cc.

42{
43 if (m_type.empty())
44 B2FATAL("Module type not set for " << getName());
45 return m_type;
46}
std::string m_type
The type of the module, saved as a string.
Definition: Module.h:509

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

Returns true if at least one condition was set for the module.

Definition at line 311 of file Module.h.

311{ return not m_conditions.empty(); };

◆ hasProperties()

bool hasProperties ( unsigned int  propertyFlags) const
inherited

Returns true if all specified property flags are available in this module.

Parameters
propertyFlagsOred EModulePropFlags which should be compared with the module flags.

Definition at line 160 of file Module.cc.

161{
162 return (propertyFlags & m_propertyFlags) == propertyFlags;
163}

◆ hasReturnValue()

bool hasReturnValue ( ) const
inlineinherited

Return true if this module has a valid return value set.

Definition at line 378 of file Module.h.

378{ return m_hasReturnValue; }

◆ hasUnsetForcedParams()

bool hasUnsetForcedParams ( ) const
inherited

Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.

Definition at line 166 of file Module.cc.

167{
169 std::string allMissing = "";
170 for (const auto& s : missing)
171 allMissing += s + " ";
172 if (!missing.empty())
173 B2ERROR("The following required parameters of Module '" << getName() << "' were not specified: " << allMissing <<
174 "\nPlease add them to your steering file.");
175 return !missing.empty();
176}
std::vector< std::string > getUnsetForcedParams() const
Returns list of unset parameters (if they are required to have a value.

◆ if_false()

void if_false ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression "<1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is false.
afterConditionPathWhat to do after executing 'path'.

Definition at line 85 of file Module.cc.

86{
87 if_value("<1", path, afterConditionPath);
88}

◆ if_true()

void if_true ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to set the condition of the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression ">=1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 90 of file Module.cc.

91{
92 if_value(">=1", path, afterConditionPath);
93}

◆ if_value()

void if_value ( const std::string &  expression,
const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

Add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

See https://xwiki.desy.de/xwiki/rest/p/a94f2 or ModuleCondition for a description of the syntax.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

Parameters
expressionThe expression of the condition.
pathShared pointer to the Path which will be executed if the condition is evaluated to true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 79 of file Module.cc.

80{
81 m_conditions.emplace_back(expression, path, afterConditionPath);
82}

◆ initialize()

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called only once before the actual event processing starts.

Reimplemented from Module.

Definition at line 217 of file TrackFinderMCTruthRecoTracksModule.cc.

218{
221
222 //output store arrays have to be registered in initialize()
224
226
228
229 // build a bit mask with all properties a MCParticle should have to lead to the creation of a track candidate
231 int aPdgCode = 0;
232 const int nProperties = m_whichParticles.size();
233 for (int i = 0; i not_eq nProperties; ++i) {
234 if (m_whichParticles[i] == "primary") {
236 } else if (m_whichParticles[i] == "PXD") {
238 } else if (m_whichParticles[i] == "SVD") {
240 } else if (m_whichParticles[i] == "CDC") {
242 } else if (m_whichParticles[i] == "TOP") {
244 } else if (m_whichParticles[i] == "ARICH") {
246 } else if (m_whichParticles[i] == "ECL") {
248 } else if (m_whichParticles[i] == "KLM") {
250 } else if (m_whichParticles[i].substr(0, 3) == "is:") {
251 std::string pdgCodeString = m_whichParticles[i].substr(3);
252 std::stringstream(pdgCodeString) >> aPdgCode;
253 B2DEBUG(20, "PDG code added to m_particlePdgCodes " << aPdgCode << " *******");
254 m_particlePdgCodes.push_back(aPdgCode);
255 } else if (m_whichParticles[i].substr(0, 5) == "from:") {
256 std::string pdgCodeString = m_whichParticles[i].substr(5);
257 std::stringstream(pdgCodeString) >> aPdgCode;
258 B2DEBUG(20, "PDG code added to m_fromPdgCodes " << aPdgCode << " *******");
259 m_fromPdgCodes.push_back(aPdgCode);
260 } else {
261 B2FATAL("Invalid values were given to the MCTrackFinder parameter WhichParticles");
262 }
263 }
264
265
266
267 //transform the smearingCov vector into a TMatrixD
268 //first check if it can be transformed into a 6x6 matrix
269 if (m_smearingCov.size() != 36) {
270 B2FATAL("SmearingCov does not have exactly 36 elements. So 6x6 covariance matrix can be formed from it");
271 }
272 m_initialCov.ResizeTo(6, 6);
273 m_initialCov = TMatrixDSym(6, &m_smearingCov[0]);
274 for (int i = 0; i != 6; ++i) {
275 if (m_initialCov(i, i) < 0.0) {
276 m_initialCov(0, 0) = -1.0; // if first element of matrix is negative this using this matrix will be switched off
277 }
278 }
279
280 if (m_smearing > 0.0 && m_initialCov(0, 0) > 0.0) {
281 B2FATAL("Both relative smearing (Smearing) and using a smearing cov (SmearingCov) is activated but only one of both can be used");
282 }
283 }
284
285 if (not m_param_useCDCSuperLayers.empty()) {
286 for (const uint useSuperLayer : m_param_useCDCSuperLayers) {
287 m_useCDCSuperLayers.at(useSuperLayer) = true;
288 }
289 } else {
290 m_useCDCSuperLayers.fill(true);
291 }
292
293 // Check for common value in the two vectors for using / ignoring layers
294 for (const uint useLayer : m_param_useCDCLayers) {
295 for (const uint ingoreLayer : m_param_ignoreCDCLayers) {
296 if (useLayer == ingoreLayer) {
297 B2FATAL("You chose to use and ignore CDC layer " << useLayer << " at the same time. "
298 "Please decide to either use or to ignore the layer.");
299 }
300 }
301 }
302
303 // fill all layers that should be used
304 if (not m_param_useCDCLayers.empty()) {
305 for (const uint layer : m_param_useCDCLayers) {
306 m_useCDCLayers.at(layer) = true;
307 }
308 } else {
309 m_useCDCLayers.fill(true);
310 }
311 // set layers that should be ignored to false
312 if (not m_param_ignoreCDCLayers.empty()) {
313 for (const uint layer : m_param_ignoreCDCLayers) {
314 m_useCDCLayers.at(layer) = false;
315 }
316 }
317
318}
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition: DataStore.h:72
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.
Definition: RecoTrack.cc:53
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
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.
Definition: StoreArray.h:140

◆ isWithinNLoops()

bool isWithinNLoops ( double  Bz,
const THit *  aHit,
double  nLoops 
)
private

helper function which returns true if the current hit is within n loops the template give the hit type and the according sim hit type (e.g.

CDCHit and CDCSimHit)

Parameters
Bzthe z-component of the B field
aHitpointer to the hit under investiation
nLoopsthe number of loops the hit should be in
Returns
: returns true if the hit is on the < nLoops th loop of the track

Definition at line 949 of file TrackFinderMCTruthRecoTracksModule.cc.

950{
951 // for SVD there are cases with more than one simhit attached
952 const RelationVector<TSimHit>& relatedSimHits = aHit->template getRelationsWith<TSimHit>();
953
954 // take the first best simhit with mcParticle attached
955 const MCParticle* mcParticle = nullptr;
956 const TSimHit* aSimHit = nullptr;
957 for (const auto& thisSimHit : relatedSimHits) {
958 mcParticle = thisSimHit.template getRelated<MCParticle>();
959 aSimHit = &thisSimHit;
960 if (mcParticle) break;
961 }
962 if (not mcParticle or not aSimHit) {
963 return false;
964 }
965
966 // subtract the production time here in order for this classification to also work
967 // for particles produced at times t' > t0
968 const double tof = aSimHit->getGlobalTime() - mcParticle->getProductionTime();
969 const double speed = mcParticle->get4Vector().Beta() * Const::speedOfLight;
970 const float absMom3D = mcParticle->getMomentum().R();
971
972 const double loopLength = 2 * M_PI * absMom3D / (Bz * 0.00299792458);
973 const double loopTOF = loopLength / speed;
974 if (tof > loopTOF * nLoops) {
975 return false;
976 } else {
977 return true;
978 }
979}

◆ setAbortLevel()

void setAbortLevel ( int  abortLevel)
inherited

Configure the abort log level.

Definition at line 67 of file Module.cc.

68{
69 m_logConfig.setAbortLevel(static_cast<LogConfig::ELogLevel>(abortLevel));
70}
ELogLevel
Definition of the supported log levels.
Definition: LogConfig.h:26
void setAbortLevel(ELogLevel abortLevel)
Configure the abort level.
Definition: LogConfig.h:112

◆ setDebugLevel()

void setDebugLevel ( int  debugLevel)
inherited

Configure the debug messaging level.

Definition at line 61 of file Module.cc.

62{
63 m_logConfig.setDebugLevel(debugLevel);
64}
void setDebugLevel(int debugLevel)
Configure the debug messaging level.
Definition: LogConfig.h:98

◆ setDescription()

void setDescription ( const std::string &  description)
protectedinherited

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 214 of file Module.cc.

215{
216 m_description = description;
217}

◆ setLogConfig()

void setLogConfig ( const LogConfig logConfig)
inlineinherited

Set the log system configuration.

Definition at line 230 of file Module.h.

230{m_logConfig = logConfig;}

◆ setLogInfo()

void setLogInfo ( int  logLevel,
unsigned int  logInfo 
)
inherited

Configure the printed log information for the given level.

Parameters
logLevelThe log level (one of LogConfig::ELogLevel)
logInfoWhat kind of info should be printed? ORed combination of LogConfig::ELogInfo flags.

Definition at line 73 of file Module.cc.

74{
75 m_logConfig.setLogInfo(static_cast<LogConfig::ELogLevel>(logLevel), logInfo);
76}
void setLogInfo(ELogLevel logLevel, unsigned int logInfo)
Configure the printed log information for the given level.
Definition: LogConfig.h:127

◆ setLogLevel()

void setLogLevel ( int  logLevel)
inherited

Configure the log level.

Definition at line 55 of file Module.cc.

56{
57 m_logConfig.setLogLevel(static_cast<LogConfig::ELogLevel>(logLevel));
58}
void setLogLevel(ELogLevel logLevel)
Configure the log level.
Definition: LogConfig.cc:25

◆ setName()

void setName ( const std::string &  name)
inlineinherited

Set the name of the module.

Note
The module name is set when using the REG_MODULE macro, but the module can be renamed before calling process() using the set_name() function in your steering file.
Parameters
nameThe name of the module

Definition at line 214 of file Module.h.

214{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 501 of file Module.h.

501{ m_moduleParamList = params; }

◆ setParamPython()

void setParamPython ( const std::string &  name,
const boost::python::object &  pyObj 
)
privateinherited

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done in the ModuleParam class.

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 234 of file Module.cc.

235{
236 LogSystem& logSystem = LogSystem::Instance();
237 logSystem.updateModule(&(getLogConfig()), getName());
238 try {
240 } catch (std::runtime_error& e) {
241 throw std::runtime_error("Cannot set parameter '" + name + "' for module '"
242 + m_name + "': " + e.what());
243 }
244
245 logSystem.updateModule(nullptr);
246}
Class for logging debug, info and error messages.
Definition: LogSystem.h:46
void updateModule(const LogConfig *moduleLogConfig=nullptr, const std::string &moduleName="")
Sets the log configuration to the given module log configuration and sets the module name This method...
Definition: LogSystem.h:191
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition: LogSystem.cc:31
void setParamPython(const std::string &name, const PythonObject &pyObj)
Implements a method for setting boost::python objects.

◆ setParamPythonDict()

void setParamPythonDict ( const boost::python::dict &  dictionary)
privateinherited

Implements a method for reading the parameter values from a boost::python dictionary.

The key of the dictionary has to be the name of the parameter and the value has to be of one of the supported parameter types.

Parameters
dictionaryThe python dictionary from which the parameter values are read.

Definition at line 249 of file Module.cc.

250{
251
252 LogSystem& logSystem = LogSystem::Instance();
253 logSystem.updateModule(&(getLogConfig()), getName());
254
255 boost::python::list dictKeys = dictionary.keys();
256 int nKey = boost::python::len(dictKeys);
257
258 //Loop over all keys in the dictionary
259 for (int iKey = 0; iKey < nKey; ++iKey) {
260 boost::python::object currKey = dictKeys[iKey];
261 boost::python::extract<std::string> keyProxy(currKey);
262
263 if (keyProxy.check()) {
264 const boost::python::object& currValue = dictionary[currKey];
265 setParamPython(keyProxy, currValue);
266 } else {
267 B2ERROR("Setting the module parameters from a python dictionary: invalid key in dictionary!");
268 }
269 }
270
271 logSystem.updateModule(nullptr);
272}
void setParamPython(const std::string &name, const boost::python::object &pyObj)
Implements a method for setting boost::python objects.
Definition: Module.cc:234

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int  propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 208 of file Module.cc.

209{
210 m_propertyFlags = propertyFlags;
211}

◆ setReturnValue() [1/2]

void setReturnValue ( bool  value)
protectedinherited

Sets the return value for this module as bool.

The bool value is saved as an integer with the convention 1 meaning true and 0 meaning false. The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 227 of file Module.cc.

228{
229 m_hasReturnValue = true;
230 m_returnValue = value;
231}

◆ setReturnValue() [2/2]

void setReturnValue ( int  value)
protectedinherited

Sets the return value for this module as integer.

The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 220 of file Module.cc.

221{
222 m_hasReturnValue = true;
223 m_returnValue = value;
224}

◆ setType()

void setType ( const std::string &  type)
protectedinherited

Set the module type.

Only for use by internal modules (which don't use the normal REG_MODULE mechanism).

Definition at line 48 of file Module.cc.

49{
50 if (!m_type.empty())
51 B2FATAL("Trying to change module type from " << m_type << " is not allowed, the value is assumed to be fixed.");
52 m_type = type;
53}

◆ terminate()

virtual void terminate ( void  )
inlinevirtualinherited

This method is called at the end of the event processing.

This method is called only once after the event processing finished. Use this method for cleaning up, closing files, etc.

This method can be implemented by subclasses.

Reimplemented in ARICHBackgroundModule, BeamabortModule, BgoModule, CaveModule, ClawModule, CLAWSModule, DosiModule, FANGSModule, He3tubeModule, MicrotpcModule, Ph1bpipeModule, Ph1sustrModule, PindiodeModule, PlumeModule, QcsmonitorModule, SrsensorModule, GetEventFromSocketModule, CalibrationCollectorModule, CosmicsAlignmentValidationModule, CurlTaggerModule, EventKinematicsModule, FlavorTaggerInfoFillerModule, LowEnergyPi0IdentificationExpertModule, LowEnergyPi0VetoExpertModule, ParticleKinematicFitterModule, ParticleLoaderModule, ParticleMassHypothesesUpdaterModule, ParticleMassUpdaterModule, ParticleMCDecayStringModule, ParticleMomentumUpdaterModule, ParticleStatsModule, ParticleWeightingLookUpCreatorModule, RemoveParticlesNotInListsModule, SkimFilterModule, TreeFitterModule, VariablesToEventBasedTreeModule, VariablesToHistogramModule, VariablesToNtupleModule, arichBtestModule, ARICHNtupleModule, arichToNtupleModule, B2BIIMCParticlesMonitorModule, B2BIIConvertMdstModule, B2BIIFixMdstModule, B2BIIMdstInputModule, BelleMCOutputModule, BeamBkgGeneratorModule, BeamBkgHitRateMonitorModule, BeamBkgMixerModule, BeamBkgTagSetterModule, BGOverlayInputModule, AnalysisPhase1StudyModule, NtuplePhase1_v6Module, ReprocessorModule, BeamabortStudyModule, BeamDigitizerModule, BgoDigitizerModule, BgoStudyModule, ClawDigitizerModule, ClawStudyModule, ClawsDigitizerModule, ClawsStudyModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, DosiDigitizerModule, DosiStudyModule, FANGSDigitizerModule, FANGSStudyModule, He3DigitizerModule, He3tubeStudyModule, MicrotpcStudyModule, TpcDigitizerModule, PinDigitizerModule, PindiodeStudyModule, PlumeDigitizerModule, QcsmonitorDigitizerModule, QcsmonitorStudyModule, CDCCosmicAnalysisModule, CDCCrossTalkAdderModule, CDCCRTestModule, CDCDigitizerModule, cdcDQM7Module, CDCDQMModule, ScanCDCGeoModule, CDCInitialT0DeterminationModule, CDCPackerModule, CDCRecoTrackFilterModule, CDCUnpackerModule, DAQPerfModule, RxSocketModule, TxSocketModule, DqmHistoManagerModule, MonitorDataModule, TrackAnaModule, Ds2SampleModule, ReceiveEventModule, HLTDQM2ZMQModule, HLTDs2ZMQModule, ElapsedTimeModule, DeSerializerModule, DeSerializerPXDModule, GenRawSendModule, Root2RawModule, SerializerModule, CertifyParallelModule, Ds2RawModule, Ds2RbufModule, EvReductionModule, FastRbuf2DsModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, Ds2RawFileModule, PartialSeqRootReaderModule, SeqRootMergerModule, StorageDeserializerModule, StorageRootOutputModule, StorageSerializerModule, DisplayModule, PhysicsObjectsDQMModule, PhysicsObjectsMiraBelleBhabhaModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, PhysicsObjectsMiraBelleHadronModule, PhysicsObjectsMiraBelleModule, ECLBackgroundModule, ECLChargedPIDModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, ECLClusterPSDModule, ECLCompressBGOverlayModule, ECLCovarianceMatrixModule, ECLCRFinderModule, EclCovMatrixNtupleModule, ECLDataAnalysisModule, ECLDigiStudyModule, ECLDigitCalibratorModule, ECLDigitizerModule, ECLDigitizerPureCsIModule, EclDisplayModule, ECLDQMModule, ECLDQMEXTENDEDModule, ECLFillCellIdMappingModule, ECLFinalizerModule, ECLHitDebugModule, ECLLocalMaximumFinderModule, ECLLOMModule, ECLMatchingPerformanceExpertModule, ECLPackerModule, ECLShowerCorrectorModule, ECLShowerShapeModule, ECLSplitterN1Module, ECLSplitterN2Module, ECLTrackClusterMatchingModule, ECLTrackClusterMatchingParametrizationExpertModule, ECLTrackClusterMatchingPerformanceModule, ECLTRGInformationModule, ECLTrimShowersAndDigitsModule, ECLUnpackerModule, eclWaveformCalibCollectorModule, ECLWaveformFitModule, HistoModule, MergeDataStoreModule, SubEventModule, SwitchDataStoreModule, ProgressBarModule, RandomBarrierModule, HistoManagerModule, ProfileModule, RootInputModule, RootOutputModule, SeqRootInputModule, SeqRootOutputModule, AsyncWrapper, RxModule, TxModule, ZMQRxOutputModule, ZMQRxWorkerModule, ZMQTxInputModule, ZMQTxWorkerModule, AafhInputModule, BabayagaNLOInputModule, BBBremInputModule, BHWideInputModule, CRYInputModule, EvtGenDecayModule, FragmentationModule, HepMCInputModule, HepMCOutputModule, GeneratedVertexDisplacerModule, GeneratorPreselectionModule, HepevtOutputModule, OverrideGenerationFlagsModule, RemoveMCParticlesModule, KKGenInputModule, KoralWInputModule, PhokharaInputModule, TeeggInputModule, TrepsInputModule, GeometryModule, SoftwareTriggerModule, SoftwareTriggerResultPrinterModule, BKLMAnaModule, BKLMDigitAnalyzerModule, BKLMSimHistogrammerModule, BKLMTrackingModule, EKLMDataCheckerModule, KLMClusterEfficiencyModule, KLMClustersReconstructorModule, KLMDigitizerModule, KLMDQMModule, KLMDQM2Module, KLMPackerModule, KLMReconstructorModule, KLMScintillatorSimulatorModule, KLMUnpackerModule, MasterClassModule, MVAExpertModule, MVAMultipleExpertsModule, AWESOMEBasicModule, PXDBackgroundModule, PXDClustersFromTracksModule, PXDPerformanceModule, PXDSpacePointCreatorModule, CheckErrorEventModule, Convert2RawDetModule, Root2BinaryModule, CDCDedxCorrectionModule, CDCDedxDQMModule, CDCDedxPIDModule, CDCDedxScanModule, CDCDedxSkimModule, CDCDedxSkimCDSTModule, CDCDedxValidationModule, HitLevelInfoWriterModule, DataWriterModule, ECLExpertModule, KLMExpertModule, KlongValidationModule, KLMMuonIDDNNExpertModule, PIDNtupleModule, VXDDedxPIDModule, FullSimModule, FullSimTimingModule, SVDBackgroundModule, SVDChannelMappingModule, SVDHotStripFinderModule, SVDChargeSharingAnalysisModule, SVDClusterQualityEstimatorCalibrationModule, SVDClusterQualityEstimatorModule, SVDCrossTalkFinderModule, svdDumpModule, SVDPackerModule, SVDClusterEvaluationTrueInfoModule, SVDClusterFilterModule, SVDEventT0PerformanceTTreeModule, SVDMaxStripTTreeModule, SVDPerformanceTTreeModule, SVDShaperDigitsFromTracksModule, SVDCoGTimeEstimatorModule, SVDDataFormatCheckModule, SVD3SamplesEmulatorModule, SVDDigitizerModule, SVDTriggerQualityGeneratorModule, SVDSpacePointCreatorModule, SVDSpacePointQICalibrationModule, TOPAlignerModule, TOPBackgroundModule, TOPBunchFinderModule, TOPChannelT0CalibratorModule, TOPChannelT0MCModule, TOPCommonT0CalibratorModule, TOPCosmicT0FinderModule, TOPTriggerDigitizerModule, TOPDoublePulseGeneratorModule, TOPGainEfficiencyCalculatorModule, TOPLaserHitSelectorModule, TOPInterimFENtupleModule, TOPLaserCalibratorModule, TOPLLScannerModule, TOPMCTrackMakerModule, TOPModuleT0CalibratorModule, TOPNtupleModule, TOPPackerModule, TOPPDFCheckerModule, TOPRawDigitConverterModule, TOPRingPlotterModule, TOPTBCComparatorModule, TOPTimeBaseCalibratorModule, TOPUnpackerModule, TOPWaveformFeatureExtractorModule, TOPXTalkChargeShareSetterModule, ExtModule, GenfitVisModule, BeamSpotMonitorModule, KinkFinderModule, Chi2MCTrackMatcherModule, MCV0MatcherModule, MCTrackCandClassifierModule, MuidModule, ROIReadTestModule, SVDROIFinderAnalysisDataModule, SVDROIFinderAnalysisModule, SVDROIFinderModule, CurlingTrackCandSplitterModule, GFTC2SPTCConverterModule, PhaseSpaceAnalysisModule, RT2SPTCConverterModule, SpacePoint2TrueHitConnectorModule, SpacePointCreatorTestModule, SPTC2GFTCConverterModule, SPTCRefereeModule, TCConvertersTestModule, StandardTrackingPerformanceModule, TrackFilterModule, CollectorTestModule, StudyMaterialEffectsModule, EffPlotsModule, FillTrackFitNtupleModule, HitXPModule, TrackingPerformanceEvaluationModule, V0findingPerformanceEvaluationModule, TrackQETrainingDataCollectorModule, V0FinderModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, TrackFinderVXDAnalizerModule, VXDQETrainingDataCollectorModule, FastBDTClassifierAnalyzerModule, FastBDTClassifierTrainingModule, MLSegmentNetworkProducerModule, NoKickCutsEvalModule, SegmentNetworkAnalyzerModule, SPTC2RTConverterModule, VXDTFTrainingDataCollectorModule, FindletModule< AFindlet >, FindletModule< HitBasedT0Extractor >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< FacetCreator >, FindletModule< HitReclaimer >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinder >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CDCTriggerHoughETFModule, CDCTrigger2DFinderModule, CDCTriggerNDFinderModule, CDCTriggerNeuroDataModule, CDCTriggerNeuroIDHistModule, CDCTriggerTSFFirmwareModule, CDCTriggerTSFModule, TRGCDCModule, TRGCDCETFUnpackerModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSFUnpackerModule, TRGCDCTSStreamModule, CDCTriggerUnpackerModule, MCMatcherTRGECLModule, TRGECLFAMModule, TRGECLModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLModule, TRGEFFDQMModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLSummaryModule, TRGGDLUnpackerModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLDQMModule, GRLNeuroModule, GRLNeuroTrainerModule, TRGGRLUnpackerModule, KLMTriggerModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TRGRAWDATAModule, VXDMisalignmentModule, DQMHistAnalysisARICHModule, DQMHistAnalysisARICHMonObjModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLOutOfTimeDigitsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisEventT0EfficiencyModule, DQMHistAnalysisEventT0TriggerJitterModule, DQMHistAnalysisExampleModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisHLTModule, DQMHistAnalysisHLTMonObjModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLMModule, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisMonObjModule, DQMHistAnalysisOutputFileModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisPeakModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDGeneralModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTrackingAbortModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGEFFModule, DQMHistAnalysisTRGGDLModule, DQMHistAutoCanvasModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DQMHistReferenceModule, DQMHistSnapshotsModule, PyModule, PXDBgTupleProducerModule, PXDMCBgTupleProducerModule, PXDDQMEfficiencyNtupleModule, PXDDQMEfficiencyNtupleSelftrackModule, PXDDQMTrackRawNtupleModule, PXDPackerErrModule, PXDPackerModule, PXDReadRawBonnDAQModule, PXDReadRawBonnDAQMatchedModule, PXDReadRawONSENModule, PXDUnpackerModule, PXDUnpackerOldModule, PXDUnpackerOTModule, SVDDQMClustersOnTrackModule, SVDDQMExpressRecoModule, PXDROIFinderAnalysisModule, ROISenderModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDCMModule, DQMHistAnalysisPXDDAQModule, DQMHistAnalysisPXDEffModule, DQMHistAnalysisPXDERModule, DQMHistAnalysisPXDInjectionModule, DQMHistAnalysisPXDReductionModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisRunNrModule, DQMHistAnalysisTRGModule, DQMHistOutputToEPICSModule, and ROIDQMModule.

Definition at line 176 of file Module.h.

176{};

Member Data Documentation

◆ m_allowFirstCDCSuperLayerOnly

bool m_allowFirstCDCSuperLayerOnly
private

Boolean to allow tracks to pass the stereo hit requirement if they touched only the first (axial) CDC layer.

Definition at line 125 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_CDCHits

StoreArray<CDCHit> m_CDCHits
private

CDCHits StoreArray.

Definition at line 160 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_CDCSimHits

StoreArray<CDCSimHit> m_CDCSimHits
private

CDCSimHits StoreArray.

Definition at line 161 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 521 of file Module.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 511 of file Module.h.

◆ m_discardAuxiliaryHits

bool m_discardAuxiliaryHits = false
private

if true hits marked as auxiliary will not be included in the RecoTrack

Definition at line 142 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_energyCut

double m_energyCut
private

Create track candidates only for MCParticles with energy above this cut.

Definition at line 105 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_enforceTrueHit

bool m_enforceTrueHit
private

If set true only cluster hits that have a relation to a TrueHit will be included in the track candidate.

Definition at line 100 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_fromPdgCodes

std::vector<int> m_fromPdgCodes
private

if size() is not 0, only for particles having an ancestor (parent or parent of parent etc) with PDG codes same as in this vector a track candidate be created

Definition at line 128 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 518 of file Module.h.

◆ m_initialCov

TMatrixDSym m_initialCov
private

The std::vector m_smearingCov will be translated into this TMatrixD.

Definition at line 114 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 514 of file Module.h.

◆ m_MCParticles

StoreArray<MCParticle> m_MCParticles
private

MCParticles StoreArray.

Definition at line 154 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_mcParticlesPresent

bool m_mcParticlesPresent
private
Initial value:
=
false

This flag is set to false if there are no MC Particles in the data store (probably data run?) and we can not create MC Reco tracks.

Definition at line 138 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_mergeDecayInFlight

bool m_mergeDecayInFlight
private

Boolean to merge decay in flight chains that involve a single charged particle.

Definition at line 107 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_minCDCAxialHits

int m_minCDCAxialHits
private

Minimum number of CDC hits from axial wires per track to allow track candidate creation.

Definition at line 123 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_minCDCStereoHits

int m_minCDCStereoHits
private

Minimum number of CDC hits from stereo wires per track to allow track candidate creation.

Definition at line 124 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_minimalNdf

int m_minimalNdf
private

Minimum number of total hits per track to allow track candidate creation.

2D hits are counted as 2

Definition at line 126 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_minPXDHits

int m_minPXDHits
private

Minimum number of PXD hits per track to allow track candidate creation.

Definition at line 121 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_minSVDHits

int m_minSVDHits
private

Minimum number of SVD hits per track to allow track candidate creation.

Definition at line 122 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 516 of file Module.h.

◆ m_name

std::string m_name
privateinherited

The name of the module, saved as a string (user-modifiable)

Definition at line 508 of file Module.h.

◆ m_neutrals

bool m_neutrals
private

Boolean to mark if track candidates should also be created for neutral particles.

Definition at line 106 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_notEnoughtHitsCounter

int m_notEnoughtHitsCounter
private
Initial value:
=
0

will hold number of tracks that do not have enough hits to form a track candidate (total NDF less than 5)

Definition at line 115 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_noTrueHitCounter

int m_noTrueHitCounter
private
Initial value:
=
0

will hold number of cluster hits that do not have a corresponding true hit

Definition at line 117 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_nRecoTracks

int m_nRecoTracks = 0
private

will hold the total number of created track candidates

Definition at line 119 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_onlyCheckDirectParentPdgCode

bool m_onlyCheckDirectParentPdgCode = false
private

To be used together with WhichParticles to select the ancestor and daughters.

If true, only check the direct parent to be contained in the list of possible ancestors. If false, check all ancestors in in the list of possible ancestors. This could be used to e.g. only create MCRecoTracks for slow pions from D* decays.

Definition at line 136 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_package

std::string m_package
privateinherited

Package this module is found in (may be empty).

Definition at line 510 of file Module.h.

◆ m_param_ignoreCDCLayers

std::vector<uint> m_param_ignoreCDCLayers
private

List of layers to be ignored in tracking.

Definition at line 148 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_param_useCDCLayers

std::vector<uint> m_param_useCDCLayers
private

List of layers to be used.

Definition at line 146 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_param_useCDCSuperLayers

std::vector<uint> m_param_useCDCSuperLayers
private

List of super layers to be used.

Definition at line 144 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_particlePdgCodes

std::vector<int> m_particlePdgCodes
private

if size() is not 0, only for particles with PDG codes same as in this vector a track candidate will be created

Definition at line 130 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_particleProperties

int m_particleProperties
private
Initial value:
=
0

Internal encoding of m_whichParticles to avoid string comparisons.

Definition at line 103 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_propertyFlags

unsigned int m_propertyFlags
privateinherited

The properties of the module as bitwise or (with |) of EModulePropFlags.

Definition at line 512 of file Module.h.

◆ m_PXDClusters

StoreArray<PXDCluster> m_PXDClusters
private

PXDClusters StoreArray.

Definition at line 157 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_PXDTrueHits

StoreArray<PXDTrueHit> m_PXDTrueHits
private

PXDTrueHits StoreArray.

Definition at line 156 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_RecoTracks

StoreArray<RecoTrack> m_RecoTracks
private

RecoTracks StoreArray.

Definition at line 155 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_recoTracksStoreArrayName

std::string m_recoTracksStoreArrayName
private

RecoTracks StoreArray name.

Definition at line 120 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 519 of file Module.h.

◆ m_setTimeSeed

bool m_setTimeSeed
private

Boolean to forward the production time as seed time.

Definition at line 109 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_smearing

double m_smearing
private

Smearing of MCMomentum and MCVertex in %.

This adds a relative error to the initial values without changing the default large initial covariance matrix using for fitting

Definition at line 110 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_smearingCov

std::vector<double> m_smearingCov
private

Covariance matrix used to smear the true pos and mom before passed to track candidate.

This matrix will also passed to Genfit as the initial covarance matrix. If any diagonal value is negative this feature will not be used. OFF DIAGNOLA ELEMENTS DO NOT HAVE AN EFFECT AT THE MOMENT

Definition at line 112 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_splitAfterDeltaT

double m_splitAfterDeltaT
private

Minimal time delay between two sim hits (in ns) after which MC reco track will be split into separate tracks.

If < 0, don't do splitting.

Definition at line 140 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_SVDClusters

StoreArray<SVDCluster> m_SVDClusters
private

SVDTrueHits StoreArray.

Definition at line 159 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_SVDTrueHits

StoreArray<SVDTrueHit> m_SVDTrueHits
private

SVDTrueHits StoreArray.

Definition at line 158 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 509 of file Module.h.

◆ m_useCDCHits

bool m_useCDCHits
private

Boolean to select if CDCHits should be used.

Definition at line 93 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useCDCLayers

std::array<bool, 56> m_useCDCLayers {}
private

Bits for the used layers ATTENTION: hardcoded value for number of layers.

Definition at line 152 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useCDCSuperLayers

std::array<bool, 9> m_useCDCSuperLayers {}
private

Bits for the used super layers ATTENTION: hardcoded value for number of super layers.

Definition at line 150 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useNLoops

float m_useNLoops
private

Number of loops to include in the MC tracks.

Definition at line 96 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useOnlyAxialCDCHits

bool m_useOnlyAxialCDCHits
private

Boolean to select if only axial CDCHits should be used.

Definition at line 94 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useOnlyBeforeTOP

bool m_useOnlyBeforeTOP
private

Boolean to select if hits after TOP detector are discarded.

Definition at line 95 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_usePXDHits

bool m_usePXDHits
private

Boolean to select if PXDHits should be used.

Definition at line 91 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useReassignedHits

bool m_useReassignedHits
private

Boolean to select the inclusion of hits form discarded secondary daughters.

Definition at line 97 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useSecondCDCHits

bool m_useSecondCDCHits
private

Also includes the CDC 2nd hit information in the mc tracks.

Definition at line 98 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_useSVDHits

bool m_useSVDHits
private

Boolean to select if SVDHits should be used.

Definition at line 92 of file TrackFinderMCTruthRecoTracksModule.h.

◆ m_whichParticles

std::vector<std::string> m_whichParticles
private

List of keywords to mark what properties particles must have to get a track candidate .

Definition at line 102 of file TrackFinderMCTruthRecoTracksModule.h.


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