Belle II Software development
TRGGRLMatchModule Class Reference

Match between CDC trigger track and ECL trigger cluster. More...

#include <TRGGRLMatchModule.h>

Inheritance diagram for TRGGRLMatchModule:
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

 TRGGRLMatchModule ()
 Constructor: Sets the description, the properties and the parameters of the module.
 
virtual ~TRGGRLMatchModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the parameters.
 
virtual void beginRun () override
 Called when entering a new run.
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action.
 
virtual void terminate () override
 Termination action.
 
void calculationdistance (CDCTriggerTrack *track, TRGECLCluster *cluster, double *ds, int _match3D)
 calculate dr and dz between track and cluster
 
void calculationphiangle (CDCTriggerTrack *track, TRGECLCluster *cluster, int &dphi_d, std::vector< bool > &track_phimap, std::vector< bool > &track_phimap_i)
 calculate dphi_d between track and cluster
 
void sectormatching_klm (CDCTriggerTrack *track, StoreObjPtr< KLMTrgSummary > klmtrgsummary, double &dphi, int &klmtrack_ind_phi)
 calculate dphi between 2D track and KLM track
 
bool photon_cluster (TRGECLCluster *cluster, std::vector< bool > track_phimap, double e_threshold)
 determine photon from isolated cluster
 
int N64 (int x)
 Force an int to be witnin 0 to 63.
 
int N36 (int x)
 Force an int to be witnin 0 to 35.
 
void fill_pattern_base2 (std::vector< std::vector< int > > &patt)
 Fill the patterns in short tracking logic.
 
void make_veto_map (StoreArray< CDCTriggerTrack > track2Dlist, std::vector< bool > &map_veto)
 Make the full track phi veto map for short tracking.
 
void make_eecl_map (StoreArray< TRGECLCluster > clusterlist, std::vector< bool > &ecl_phimap, std::vector< bool > &ecl_phimap_fwd, std::vector< bool > &ecl_phimap_bwd, std::vector< bool > &ecl_sectormap_fwd, std::vector< bool > &ecl_sectormap_bwd)
 Make the ecl endcap phi map for inner/short track matching.
 
void make_eklm_map (StoreObjPtr< KLMTrgSummary > klmtrgsummary, std::vector< bool > &eklm_sectormap, std::vector< bool > &eklm_sectormap_fwd, std::vector< bool > &eklm_sectormap_bwd)
 Make the klm endcap phi map for inner/short track matching.
 
void short_tracking (StoreArray< CDCTriggerSegmentHit > tslist, std::vector< bool > map_veto, std::vector< bool > phimap_i, std::vector< bool > ecl_phimap_fwd, std::vector< bool > ecl_phimap_bwd, std::vector< bool > klm_sectormap_fwd, std::vector< bool > klm_sectormap_bwd, std::vector< std::vector< int > > &pattern_base0, std::vector< std::vector< int > > &pattern_base2, StoreArray< TRGGRLShortTrack > grlst, StoreObjPtr< TRGGRLInfo > trgInfo)
 Short tracking logic.
 
void inner_tracking (StoreArray< CDCTriggerSegmentHit > tslist, std::vector< bool > phimap_i, std::vector< bool > ecl_phimap, std::vector< bool > klm_sectormap, StoreArray< TRGGRLInnerTrack > grlit, StoreObjPtr< TRGGRLInfo > trgInfo)
 
void matching_eecl_eklm (std::vector< bool > eecl_sectormap_fw, std::vector< bool > eecl_setormap_bw, std::vector< bool > eklm_sectormap_fw, std::vector< bool > eklm_sectormap_bw, StoreObjPtr< TRGGRLInfo > trgInfo)
 
void extrapolation (int pattern, int &l, int &r, int &ec)
 Short track extrapolation (to endcap) function.
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules.
 
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

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

StoreObjPtr< TRGGRLInfom_TRGGRLInfo
 output for TRGGRLInfo
 
int m_simulationMode
 Mode for TRGGRL simulation.
 
int m_fastSimulationMode
 Switch for the fast simulation.
 
int m_firmwareSimulationMode
 Switch for the firmware simulation. 0:do nothing, 1:do everything.
 
double m_dr_threshold
 max value of dr to be identified as match
 
double m_dz_threshold
 max value of dz to be identified as match
 
int m_dphi_d_threshold
 max value of dphi_d to be identified as match, 1 digit = 10 degrees
 
double m_e_threshold
 min value of isolated cluster energy
 
double m_dphi_klm_threshold
 max value of dphi (CDC track to KLM sector) to be identified as match (in degrees)
 
std::vector< bool > track_phimap
 36 bits phi map of all 2D tracks
 
std::vector< bool > track_phimap_i
 36 bits phi map of all 2D tracks
 
std::vector< bool > eecl_phimap
 36 bits phi map of ECL clusters at endcap
 
std::vector< bool > eecl_phimap_fwd
 36 bits phi map of ECL clusters at forward endcap
 
std::vector< bool > eecl_phimap_bwd
 36 bits phi map of ECL clusters at backward endcap
 
std::vector< bool > eecl_sectormap_fwd
 8 bits sector map of ECL clusters at forward endcap
 
std::vector< bool > eecl_sectormap_bwd
 8 bits sector map of ECL clusters at backward endcap
 
std::vector< bool > eklm_sectormap
 8 bits phi map of KLM clusters at endcap
 
std::vector< bool > eklm_sectormap_fwd
 8 bits sector map of KLM clusters at forward endcap
 
std::vector< bool > eklm_sectormap_bwd
 8 bits sector map of KLM clusters at backward endcap
 
std::string m_2d_tracklist
 the 2D finder track list
 
std::string m_3d_tracklist
 the 3D NN track list
 
std::string m_clusterlist
 the ecl cluster list
 
std::string m_klmtrgsummarylist
 the KLM track list
 
std::string m_2dmatch_tracklist
 the distance in phi direction between track and cluster
 
std::string m_phimatch_tracklist
 the matched 2d track list by phi matching
 
std::string m_3dmatch_tracklist
 the matched 3d track list
 
std::string m_klmmatch_tracklist
 the matched 2d track list by KLM matching
 
std::string m_grlphotonlist
 Non-matched cluster list at GRL.
 
std::string m_hitCollectionName
 Track Segment list.
 
std::string m_grlstCollectionName
 GRL short track list.
 
std::string m_grlitCollectionName
 GRL inner track list.
 
std::string m_TrgGrlInformationName
 Name of the StoreArray holding projects information from grl.
 
std::vector< std::vector< int > > patterns_base0
 Short tracking patterns based on SL0.
 
std::vector< std::vector< int > > patterns_base2
 Short tracking patterns based on SL2.
 
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

Match between CDC trigger track and ECL trigger cluster.

Definition at line 36 of file TRGGRLMatchModule.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,
80 c_ParallelProcessingCertified = 4,
81 c_HistogramManager = 8,
82 c_InternalSerializer = 16,
83 c_TerminateInAllProcesses = 32,
84 c_DontCollectStatistics = 64,
85 };
@ c_Output
Output Process.
Definition ProcHelper.h:19
@ c_Input
Input Process.
Definition ProcHelper.h:17

Constructor & Destructor Documentation

◆ TRGGRLMatchModule()

Constructor: Sets the description, the properties and the parameters of the module.

Definition at line 43 of file TRGGRLMatchModule.cc.

43 : Module()
44{
45 // Set module properties
46 setDescription("match CDC trigger tracks and ECL trigger clusters");
48 addParam("SimulationMode", m_simulationMode, "TRGGRL simulation switch", 1);
49 addParam("FastSimulationMode", m_fastSimulationMode, "TRGGRL fast simulation mode", 0);
50 addParam("FirmwareSimulationMode", m_firmwareSimulationMode, "TRGGRL firmware simulation mode", 0);
51
52 addParam("DrMatch", m_dr_threshold, "the threshold of dr between track and cluster if they are matched successfully", 25.);
53 addParam("DzMatch", m_dz_threshold, "the threshold of dz between track and cluster if they are matched successfully", 30.);
54 addParam("DphidMatch", m_dphi_d_threshold, "the threshold of dphi_d between track and cluster if they are matched successfully", 2);
55 addParam("Ephoton", m_e_threshold, "the threshold of cluster energy as a photon", 1.0);
57 "the threshold of dphi (in degree) between track and KLM sector if they are matched successfully", 32.5);
58 addParam("2DtrackCollection", m_2d_tracklist, "the 2d track list used in the match", std::string("TRGCDC2DFinderTracks"));
59 addParam("3DtrackCollection", m_3d_tracklist, "the 3d track list used in the match", std::string("TRGCDCNeuroTracks"));
60 addParam("TRGECLClusterCollection", m_clusterlist, "the cluster list used in the match", std::string("TRGECLClusters"));
61 addParam("KLMTrgrSummary", m_klmtrgsummarylist, "the KLM track list used in the match", std::string("KLMTrgSummary"));
62 addParam("2DmatchCollection", m_2dmatch_tracklist, "the 2d tracklist with associated cluster", std::string("TRG2DMatchTracks"));
63 addParam("PhimatchCollection", m_phimatch_tracklist, "the 2d tracklist with associated cluster", std::string("TRGPhiMatchTracks"));
64 addParam("3DmatchCollection", m_3dmatch_tracklist, "the 3d NN tracklist with associated cluster", std::string("TRG3DMatchTracks"));
65 addParam("KLMmatchCollection", m_klmmatch_tracklist, "the 2d tracklist with associated KLM track",
66 std::string("TRGKLMMatchTracks"));
67 addParam("GRLphotonCollection", m_grlphotonlist, "the isolated cluster list", std::string("TRGGRLPhotons"));
68 addParam("hitCollectionName", m_hitCollectionName, "Name of the input StoreArray of CDCTriggerSegmentHits.",
69 std::string(""));
70 addParam("TrgGrlInformation", m_TrgGrlInformationName,
71 "Name of the StoreArray holding the information of tracks and clusters from cdc ecl klm.",
72 std::string("TRGGRLObjects"));
73 addParam("grlstCollectionName", m_grlstCollectionName, "Name of the output StoreArray of TRGGRLShortTrack.",
74 std::string("TRGGRLShortTracks"));
75 addParam("grlitCollectionName", m_grlitCollectionName, "Name of the output StoreArray of TRGGRLInnerTrack.",
76 std::string("TRGGRLInnerTracks"));
77
78
79}
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
@ 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
std::string m_klmtrgsummarylist
the KLM track list
std::string m_2dmatch_tracklist
the distance in phi direction between track and cluster
int m_fastSimulationMode
Switch for the fast simulation.
int m_simulationMode
Mode for TRGGRL simulation.
std::string m_grlitCollectionName
GRL inner track list.
int m_firmwareSimulationMode
Switch for the firmware simulation. 0:do nothing, 1:do everything.
double m_dr_threshold
max value of dr to be identified as match
int m_dphi_d_threshold
max value of dphi_d to be identified as match, 1 digit = 10 degrees
std::string m_phimatch_tracklist
the matched 2d track list by phi matching
double m_dz_threshold
max value of dz to be identified as match
std::string m_2d_tracklist
the 2D finder track list
std::string m_grlstCollectionName
GRL short track list.
std::string m_klmmatch_tracklist
the matched 2d track list by KLM matching
double m_dphi_klm_threshold
max value of dphi (CDC track to KLM sector) to be identified as match (in degrees)
std::string m_TrgGrlInformationName
Name of the StoreArray holding projects information from grl.
std::string m_grlphotonlist
Non-matched cluster list at GRL.
std::string m_3d_tracklist
the 3D NN track list
double m_e_threshold
min value of isolated cluster energy
std::string m_clusterlist
the ecl cluster list
std::string m_hitCollectionName
Track Segment list.
std::string m_3dmatch_tracklist
the matched 3d track list
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:559

◆ ~TRGGRLMatchModule()

~TRGGRLMatchModule ( )
virtual

Destructor.

Definition at line 81 of file TRGGRLMatchModule.cc.

82{
83}

Member Function Documentation

◆ beginRun()

void beginRun ( void )
overridevirtual

Called when entering a new run.

Reimplemented from Module.

Definition at line 154 of file TRGGRLMatchModule.cc.

155{
156}

◆ calculationdistance()

void calculationdistance ( CDCTriggerTrack * track,
TRGECLCluster * cluster,
double * ds,
int _match3D )

calculate dr and dz between track and cluster

Definition at line 342 of file TRGGRLMatchModule.cc.

343{
344
345//double _pt = _track->getTransverseMomentum(1.5);
346 double _r = 1.0 / _track->getOmega() ;
347 double _phi = _track->getPhi0() ;
348
349 //-- cluster/TRGECL information
350 double _cluster_x = _cluster->getPositionX();
351 double _cluster_y = _cluster->getPositionY();
352 double _cluster_z = _cluster->getPositionZ();
353 double _R = sqrt(_cluster_x * _cluster_x + _cluster_y * _cluster_y);
354//double _D = sqrt(_cluster_x * _cluster_x + _cluster_y * _cluster_y + _cluster_z * _cluster_z);
355//double _re_scaled_p = _pt * _D / _R;
356
357 //-- calculation
358 if (_R > abs(2 * _r)) {
359 ds[0] = 99999.;
360 } else {
361 double theta0 = _phi - asin(_R / (2 * _r));
362
363 double ex_x0 = _R * cos(theta0), ex_y0 = _R * sin(theta0);
364 ds[0] = sqrt((ex_x0 - _cluster_x) * (ex_x0 - _cluster_x) + (ex_y0 - _cluster_y) * (ex_y0 - _cluster_y));
365 }
366 //z information
367 if (_match3D == 1) {
368 double _z0 = _track->getZ0();
369 double _slope = _track->getCotTheta();
370 double _ex_z = _z0 + _slope * 2 * _r * asin(_R / (2 * _r));
371 ds[1] = fabs(_cluster_z - _ex_z);
372
373 }
374
375}
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28

◆ calculationphiangle()

void calculationphiangle ( CDCTriggerTrack * track,
TRGECLCluster * cluster,
int & dphi_d,
std::vector< bool > & track_phimap,
std::vector< bool > & track_phimap_i )

calculate dphi_d between track and cluster

Definition at line 377 of file TRGGRLMatchModule.cc.

379{
380
381 //-- 2D track information
382 double _r = 1.0 / _track->getOmega() ;
383 double _phi = _track->getPhi0() ;
384
385 //-- 2D phi angle calculation
386 double phi_p = acos(126.0 / (2 * fabs(_r))); // adjustment angle between 0 to 0.5*M_PI
387 int charge = 0;
388 if (_r > 0) {charge = 1;}
389 else if (_r < 0) {charge = -1;}
390 else {charge = 0;}
391
392 double phi_CDC = 0.0;
393 if (charge == 1) {
394 phi_CDC = _phi + phi_p - 0.5 * M_PI;
395 } else if (charge == -1) {
396 phi_CDC = _phi - phi_p + 0.5 * M_PI;
397 } else {
398 phi_CDC = _phi;
399 }
400
401 if (phi_CDC > 2 * M_PI) {phi_CDC = phi_CDC - 2 * M_PI;}
402 else if (phi_CDC < 0) {phi_CDC = phi_CDC + 2 * M_PI;}
403 if (_phi > 2 * M_PI) {_phi = _phi - 2 * M_PI;}
404 else if (_phi < 0) {_phi = _phi + 2 * M_PI;}
405
406 //-- cluster/TRGECL information
407 double _cluster_x = _cluster->getPositionX();
408 double _cluster_y = _cluster->getPositionY();
409
410 // -- ECL phi angle
411 double phi_ECL = 0.0;
412 if (_cluster_x >= 0 && _cluster_y >= 0) {phi_ECL = atan(_cluster_y / _cluster_x);}
413 else if (_cluster_x < 0 && _cluster_y >= 0) {phi_ECL = atan(_cluster_y / _cluster_x) + M_PI;}
414 else if (_cluster_x < 0 && _cluster_y < 0) {phi_ECL = atan(_cluster_y / _cluster_x) + M_PI;}
415 else if (_cluster_x >= 0 && _cluster_y < 0) {phi_ECL = atan(_cluster_y / _cluster_x) + 2 * M_PI;}
416
417 int phi_ECL_d = 0, phi_CDC_d = 0, phi_i_d = 0;
418 // digitization on both angle
419 for (int i = 0; i < 36; i++) {
420 if (phi_ECL > i * M_PI / 18 && phi_ECL < (i + 1)*M_PI / 18) {phi_ECL_d = i;}
421 if (_phi > i * M_PI / 18 && _phi < (i + 1)*M_PI / 18) {phi_i_d = i;}
422 if (phi_CDC > i * M_PI / 18 && phi_CDC < (i + 1)*M_PI / 18) {phi_CDC_d = i;}
423 }
424
425 phimap[phi_CDC_d] = true;
426 phimap_i[phi_i_d] = true;
427
428 if (abs(phi_ECL_d - phi_CDC_d) == 0 || abs(phi_ECL_d - phi_CDC_d) == 36) {dphi_d = 0;}
429 else if (abs(phi_ECL_d - phi_CDC_d) == 1 || abs(phi_ECL_d - phi_CDC_d) == 35) {dphi_d = 1;}
430 else if (abs(phi_ECL_d - phi_CDC_d) == 2 || abs(phi_ECL_d - phi_CDC_d) == 34) {dphi_d = 2;}
431 else if (abs(phi_ECL_d - phi_CDC_d) == 3 || abs(phi_ECL_d - phi_CDC_d) == 33) {dphi_d = 3;}
432 else if (abs(phi_ECL_d - phi_CDC_d) == 4 || abs(phi_ECL_d - phi_CDC_d) == 32) {dphi_d = 4;}
433 else if (abs(phi_ECL_d - phi_CDC_d) == 5 || abs(phi_ECL_d - phi_CDC_d) == 31) {dphi_d = 5;}
434 else if (abs(phi_ECL_d - phi_CDC_d) == 6 || abs(phi_ECL_d - phi_CDC_d) == 30) {dphi_d = 6;}
435 else if (abs(phi_ECL_d - phi_CDC_d) == 7 || abs(phi_ECL_d - phi_CDC_d) == 29) {dphi_d = 7;}
436 else if (abs(phi_ECL_d - phi_CDC_d) == 8 || abs(phi_ECL_d - phi_CDC_d) == 28) {dphi_d = 8;}
437 else if (abs(phi_ECL_d - phi_CDC_d) == 9 || abs(phi_ECL_d - phi_CDC_d) == 27) {dphi_d = 9;}
438 else if (abs(phi_ECL_d - phi_CDC_d) == 10 || abs(phi_ECL_d - phi_CDC_d) == 26) {dphi_d = 10;}
439 else if (abs(phi_ECL_d - phi_CDC_d) == 11 || abs(phi_ECL_d - phi_CDC_d) == 25) {dphi_d = 11;}
440 else if (abs(phi_ECL_d - phi_CDC_d) == 12 || abs(phi_ECL_d - phi_CDC_d) == 24) {dphi_d = 12;}
441 else if (abs(phi_ECL_d - phi_CDC_d) == 13 || abs(phi_ECL_d - phi_CDC_d) == 23) {dphi_d = 13;}
442 else if (abs(phi_ECL_d - phi_CDC_d) == 14 || abs(phi_ECL_d - phi_CDC_d) == 22) {dphi_d = 14;}
443 else if (abs(phi_ECL_d - phi_CDC_d) == 15 || abs(phi_ECL_d - phi_CDC_d) == 21) {dphi_d = 15;}
444 else if (abs(phi_ECL_d - phi_CDC_d) == 16 || abs(phi_ECL_d - phi_CDC_d) == 20) {dphi_d = 16;}
445 else if (abs(phi_ECL_d - phi_CDC_d) == 17 || abs(phi_ECL_d - phi_CDC_d) == 19) {dphi_d = 17;}
446 else if (abs(phi_ECL_d - phi_CDC_d) == 18) {dphi_d = 18;}
447
448}
double atan(double a)
atan for double
Definition beamHelpers.h:34
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition EvtPDLUtil.cc:44

◆ 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{
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.
void setParameters(const ModuleParamList &params)
Set values for parameters from other parameter list.
const ModuleParamList & getParamList() const
Return module param list.
Definition Module.h:362
const std::string & getName() const
Returns the name of the module.
Definition Module.h:186
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:511
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition Module.h:515
void setName(const std::string &name)
Set the name of the module.
Definition Module.h:213
LogConfig m_logConfig
The log system configuration of the module.
Definition Module.h:513
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition Module.h:520
std::string m_package
Package this module is found in (may be empty).
Definition Module.h:509
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 425 of file Module.h.

425{ beginRun(); }

◆ 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 438 of file Module.h.

438{ endRun(); }

◆ 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 431 of file Module.h.

431{ event(); }

◆ 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 419 of file Module.h.

419{ initialize(); }

◆ 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 444 of file Module.h.

444{ terminate(); }

◆ endRun()

void endRun ( void )
overridevirtual

End-of-run action.

Reimplemented from Module.

Definition at line 334 of file TRGGRLMatchModule.cc.

335{
336}

◆ 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:518
bool m_hasReturnValue
True, if the return value is set.
Definition Module.h:517

◆ event()

void event ( void )
overridevirtual

Event processor.

Reimplemented from Module.

Definition at line 158 of file TRGGRLMatchModule.cc.

159{
160
161 StoreArray<CDCTriggerTrack> track2Dlist(m_2d_tracklist);
162 StoreArray<CDCTriggerTrack> track3Dlist(m_3d_tracklist);
163 StoreArray<TRGECLCluster> clusterlist(m_clusterlist);
164 StoreObjPtr<KLMTrgSummary> klmtrgsummary(m_klmtrgsummarylist);
165 StoreArray<CDCTriggerSegmentHit> tslist(m_hitCollectionName);
166 StoreArray<TRGGRLMATCH> track2Dmatch(m_2dmatch_tracklist);
167 StoreArray<TRGGRLMATCH> trackphimatch(m_phimatch_tracklist);
168 StoreArray<TRGGRLMATCH> track3Dmatch(m_3dmatch_tracklist);
169 StoreArray<TRGGRLMATCHKLM> trackKLMmatch(m_klmmatch_tracklist);
170 StoreArray<TRGGRLPHOTON> grlphoton(m_grlphotonlist);
171 StoreArray<TRGGRLShortTrack> grlst(m_grlstCollectionName);
172 StoreArray<TRGGRLInnerTrack> grlit(m_grlitCollectionName);
173 StoreObjPtr<TRGGRLInfo> trgInfo(m_TrgGrlInformationName);
174 trgInfo.create();
175
176//initialize the phi map
177
178 track_phimap.clear();
179 track_phimap_i.clear();
180 eecl_phimap.clear();
181 eecl_phimap_fwd.clear();
182 eecl_phimap_bwd.clear();
183 eecl_sectormap_fwd.clear();
184 eecl_sectormap_bwd.clear();
185 eklm_sectormap.clear();
186 eklm_sectormap_fwd.clear();
187 eklm_sectormap_bwd.clear();
188
189 for (int i = 0; i < 36; i++) {
190 track_phimap.push_back(false);
191 track_phimap_i.push_back(false);
192 eecl_phimap.push_back(false);
193 eecl_phimap_fwd.push_back(false);
194 eecl_phimap_bwd.push_back(false);
195 }
196 for (int i = 0; i < 4; i++) {
197 eecl_sectormap_fwd.push_back(false);
198 eecl_sectormap_bwd.push_back(false);
199 eklm_sectormap.push_back(false);
200 eklm_sectormap_fwd.push_back(false);
201 eklm_sectormap_bwd.push_back(false);
202 }
203
204//do 2d track match with ECL and KLM cluster
205 int klmtrack_ind_phi_map[8] = {};
206 for (int i = 0; i < track2Dlist.getEntries(); i++) {
207
208 double dr_tmp = 99999.;
209 int dphi_d_tmp = 100;
210 double dphi_klm_tmp = 100;
211 int cluster_ind = -1;
212 int cluster_ind_phi = -1;
213 int klmtrack_ind_phi = -1;
214
215// do 2d track match with KLMTrgSummary
216 sectormatching_klm(track2Dlist[i], klmtrgsummary, dphi_klm_tmp, klmtrack_ind_phi);
217
218 for (int j = 0; j < clusterlist.getEntries(); j++) {
219 // skip the end-cap cluster
220 double _cluster_x = clusterlist[j]->getPositionX();
221 double _cluster_y = clusterlist[j]->getPositionY();
222 double _cluster_z = clusterlist[j]->getPositionZ();
223 double _cluster_theta = atan(_cluster_z / (sqrt(_cluster_x * _cluster_x + _cluster_y * _cluster_y)));
224 _cluster_theta = 0.5 * M_PI - _cluster_theta;
225 if (_cluster_theta < M_PI * 35.0 / 180.0 || _cluster_theta > M_PI * 126.0 / 180.0) continue;
226
227 double ds_ct[2] = {99999., 99999.};
228 calculationdistance(track2Dlist[i], clusterlist[j], ds_ct, 0);
229 int dphi_d = 0;
230 calculationphiangle(track2Dlist[i], clusterlist[j], dphi_d, track_phimap, track_phimap_i);
231
232 if (dr_tmp > ds_ct[0]) {
233 dr_tmp = ds_ct[0];
234 cluster_ind = j;
235 }
236 if (dphi_d_tmp > dphi_d) {
237 dphi_d_tmp = dphi_d;
238 cluster_ind_phi = j;
239 }
240
241 }
242
243 if (dr_tmp < m_dr_threshold && cluster_ind != -1) {
244 TRGGRLMATCH* mat2d = track2Dmatch.appendNew();
245 mat2d->setDeltaR(dr_tmp);
246 mat2d->addRelationTo(track2Dlist[i]);
247 mat2d->addRelationTo(clusterlist[cluster_ind]);
248 // track2Dlist[i]->addRelationTo(clusterlist[cluster_ind]);
249 clusterlist[cluster_ind]->addRelationTo(track2Dlist[i]);
250 }
251 if (dphi_d_tmp < m_dphi_d_threshold && cluster_ind_phi != -1) {
252 TRGGRLMATCH* matphi = trackphimatch.appendNew();
253 matphi->set_dphi_d(dphi_d_tmp);
254 matphi->addRelationTo(track2Dlist[i]);
255 matphi->addRelationTo(clusterlist[cluster_ind_phi]);
256 matphi->set_e(clusterlist[cluster_ind_phi]->getEnergyDep());
257 // track2Dlist[i]->addRelationTo(clusterlist[cluster_ind]);
258 clusterlist[cluster_ind_phi]->addRelationTo(track2Dlist[i]);
259 }
260
261 if (dphi_klm_tmp < m_dphi_klm_threshold * M_PI / 180.0 && klmtrack_ind_phi > -1 && klmtrack_ind_phi < 8) {
262 if (klmtrack_ind_phi_map[klmtrack_ind_phi] == 0) {
263 TRGGRLMATCHKLM* matklm = trackKLMmatch.appendNew();
264 matklm->set_dphi(dphi_klm_tmp);
265 matklm->set_sector(klmtrack_ind_phi);
266 matklm->addRelationTo(track2Dlist[i]);
267 klmtrack_ind_phi_map[klmtrack_ind_phi] = 1;
268 }
269 }
270
271 }
272
273
274//do 3d track match with cluster
275 for (int i = 0; i < track3Dlist.getEntries(); i++) {
276
277 double dr_tmp = 99999.;
278 double dz_tmp = 99999.;
279 int cluster_ind = -1;
280 for (int j = 0; j < clusterlist.getEntries(); j++) {
281 // skip the end-cap cluster
282 double _cluster_x = clusterlist[j]->getPositionX();
283 double _cluster_y = clusterlist[j]->getPositionY();
284 double _cluster_z = clusterlist[j]->getPositionZ();
285 double _cluster_theta = atan(_cluster_z / (sqrt(_cluster_x * _cluster_x + _cluster_y * _cluster_y)));
286 _cluster_theta = 0.5 * M_PI - _cluster_theta;
287 if (_cluster_theta < M_PI * 35.0 / 180.0 || _cluster_theta > M_PI * 126.0 / 180.0) continue;
288
289 double ds_ct[2] = {99999., 99999.};
290 calculationdistance(track3Dlist[i], clusterlist[j], ds_ct, 1);
291 if (dr_tmp > ds_ct[0]) {
292 dr_tmp = ds_ct[0];
293 dz_tmp = ds_ct[1];
294 cluster_ind = j;
295 }
296 }
297 if (dr_tmp < m_dr_threshold && dz_tmp < m_dz_threshold && cluster_ind != -1) {
298 TRGGRLMATCH* mat3d = track3Dmatch.appendNew();
299 mat3d->setDeltaR(dr_tmp);
300 mat3d->setDeltaZ(dz_tmp);
301 mat3d->addRelationTo(track3Dlist[i]);
302 mat3d->addRelationTo(clusterlist[cluster_ind]);
303 clusterlist[cluster_ind]->addRelationTo(track3Dlist[i]);
304 }
305 }
306
307//pick up isolated clusters as photons with energy threshold
308 for (int j = 0; j < clusterlist.getEntries(); j++) {
309 if (photon_cluster(clusterlist[j], track_phimap, m_e_threshold)) {
310 TRGGRLPHOTON* photon = grlphoton.appendNew();
311 photon->set_e(clusterlist[j]->getEnergyDep());
312 photon->addRelationTo(clusterlist[j]);
313 }
314 }
315
316//endcap cluster map
319
320// Short tracking
321 std::vector<bool> map_veto(64, 0);
322 make_veto_map(track2Dlist, map_veto);
324 patterns_base0, patterns_base2, grlst, trgInfo);
325
326// Inner tracking
327 inner_tracking(tslist, track_phimap_i, eecl_phimap, eklm_sectormap, grlit, trgInfo);
328
329// EECL-EKLM matching
331
332}
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).
void set_sector(int sector)
set the klm sector id
void set_dphi(double dphi)
set the dphi
void set_dphi_d(double dphi_d)
set the dphi_d
Definition TRGGRLMATCH.h:49
void setDeltaZ(double deltaz)
set the Delta Z
Definition TRGGRLMATCH.h:46
void set_e(double e)
set the cluster energy
Definition TRGGRLMATCH.h:52
void setDeltaR(double deltar)
set the Delta R
Definition TRGGRLMATCH.h:43
std::vector< bool > eklm_sectormap
8 bits phi map of KLM clusters at endcap
std::vector< std::vector< int > > patterns_base2
Short tracking patterns based on SL2.
std::vector< std::vector< int > > patterns_base0
Short tracking patterns based on SL0.
std::vector< bool > track_phimap_i
36 bits phi map of all 2D tracks
bool photon_cluster(TRGECLCluster *cluster, std::vector< bool > track_phimap, double e_threshold)
determine photon from isolated cluster
std::vector< bool > eecl_phimap
36 bits phi map of ECL clusters at endcap
void make_veto_map(StoreArray< CDCTriggerTrack > track2Dlist, std::vector< bool > &map_veto)
Make the full track phi veto map for short tracking.
std::vector< bool > eklm_sectormap_fwd
8 bits sector map of KLM clusters at forward endcap
void calculationdistance(CDCTriggerTrack *track, TRGECLCluster *cluster, double *ds, int _match3D)
calculate dr and dz between track and cluster
void calculationphiangle(CDCTriggerTrack *track, TRGECLCluster *cluster, int &dphi_d, std::vector< bool > &track_phimap, std::vector< bool > &track_phimap_i)
calculate dphi_d between track and cluster
void short_tracking(StoreArray< CDCTriggerSegmentHit > tslist, std::vector< bool > map_veto, std::vector< bool > phimap_i, std::vector< bool > ecl_phimap_fwd, std::vector< bool > ecl_phimap_bwd, std::vector< bool > klm_sectormap_fwd, std::vector< bool > klm_sectormap_bwd, std::vector< std::vector< int > > &pattern_base0, std::vector< std::vector< int > > &pattern_base2, StoreArray< TRGGRLShortTrack > grlst, StoreObjPtr< TRGGRLInfo > trgInfo)
Short tracking logic.
std::vector< bool > eecl_sectormap_fwd
8 bits sector map of ECL clusters at forward endcap
std::vector< bool > track_phimap
36 bits phi map of all 2D tracks
void make_eecl_map(StoreArray< TRGECLCluster > clusterlist, std::vector< bool > &ecl_phimap, std::vector< bool > &ecl_phimap_fwd, std::vector< bool > &ecl_phimap_bwd, std::vector< bool > &ecl_sectormap_fwd, std::vector< bool > &ecl_sectormap_bwd)
Make the ecl endcap phi map for inner/short track matching.
void sectormatching_klm(CDCTriggerTrack *track, StoreObjPtr< KLMTrgSummary > klmtrgsummary, double &dphi, int &klmtrack_ind_phi)
calculate dphi between 2D track and KLM track
std::vector< bool > eecl_phimap_bwd
36 bits phi map of ECL clusters at backward endcap
std::vector< bool > eecl_phimap_fwd
36 bits phi map of ECL clusters at forward endcap
std::vector< bool > eklm_sectormap_bwd
8 bits sector map of KLM clusters at backward endcap
std::vector< bool > eecl_sectormap_bwd
8 bits sector map of ECL clusters at backward endcap
void make_eklm_map(StoreObjPtr< KLMTrgSummary > klmtrgsummary, std::vector< bool > &eklm_sectormap, std::vector< bool > &eklm_sectormap_fwd, std::vector< bool > &eklm_sectormap_bwd)
Make the klm endcap phi map for inner/short track matching.
void set_e(double e)
set energy

◆ 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 paths */
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>()),
491 &Module::setLogConfig)
@ 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: "<".
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
@ 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_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
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
ModuleCondition::EAfterConditionPath EAfterConditionPath
Forward the EAfterConditionPath definition from the ModuleCondition.
Definition Module.h:88

◆ extrapolation()

void extrapolation ( int pattern,
int & l,
int & r,
int & ec )

Short track extrapolation (to endcap) function.

Definition at line 1532 of file TRGGRLMatchModule.cc.

1533{
1534 if (pattern == 6) {ec = 1; l = 0; r = 1;}
1535 if (pattern == 7) {ec = 1; l = 0; r = 1;}
1536 if (pattern == 8) {ec = 1; l = 0; r = 1;}
1537 if (pattern == 9) {ec = 1; l = 0; r = 2;}
1538 if (pattern == 10) {ec = 1; l = 0; r = 2;}
1539 if (pattern == 11) {ec = 1; l = 0; r = 1;}
1540 if (pattern == 12) {ec = 1; l = 0; r = 2;}
1541 if (pattern == 18) {ec = 1; l = 0; r = 2;}
1542 if (pattern == 19) {ec = 1; l = 0; r = 2;}
1543 if (pattern == 20) {ec = 1; l = 0; r = 4;}
1544 if (pattern == 21) {ec = 1; l = 0; r = 4;}
1545 if (pattern == 28) {ec = 1; l = -4; r = 0;}
1546 if (pattern == 29) {ec = 1; l = -3; r = 0;}
1547 if (pattern == 34) {ec = 1; l = 0; r = 1;}
1548 if (pattern == 35) {ec = 1; l = 0; r = 3;}
1549 if (pattern == 36) {ec = 1; l = 1; r = 3;}
1550 if (pattern == 37) {ec = 1; l = 0; r = 3;}
1551 if (pattern == 44) {ec = 1; l = -4; r = 0;}
1552 if (pattern == 45) {ec = 1; l = -2; r = 0;}
1553 if (pattern == 46) {ec = 1; l = -3; r = 0;}
1554 if (pattern == 54) {ec = 1; l = 1; r = 7;}
1555 if (pattern == 55) {ec = 1; l = 1; r = 6;}
1556 if (pattern == 56) {ec = 1; l = 1; r = 5;}
1557 if (pattern == 57) {ec = 1; l = 1; r = 5;}
1558 if (pattern == 64) {ec = 1; l = -6; r = -1;}
1559 if (pattern == 73) {ec = 1; l = 3; r = 13;}
1560 if (pattern == 81) {ec = 1; l = -10; r = -3;}
1561 if (pattern == 86) {ec = 1; l = 3; r = 12;}
1562 if (pattern == 87) {ec = 1; l = 3; r = 6;}
1563 if (pattern == 100) {ec = 1; l = 7; r = 20;}
1564 if (pattern == 101) {ec = 1; l = 5; r = 20;}
1565 if (pattern == 102) {ec = 1; l = 5; r = 20;}
1566 if (pattern == 103) {ec = 1; l = 4; r = 14;}
1567 if (pattern == 111) {ec = 1; l = -12; r = -5;}
1568 if (pattern == 112) {ec = 1; l = -18; r = -5;}
1569 if (pattern == 116) {ec = 1; l = -11; r = -6;}
1570 if (pattern == 120) {ec = 1; l = 7; r = 21;}
1571 if (pattern == 121) {ec = 1; l = 7; r = 14;}
1572 if (pattern == 122) {ec = 1; l = 7; r = 21;}
1573 if (pattern == 127) {ec = 1; l = -21; r = -8;}
1574 if (pattern == 128) {ec = 1; l = -15; r = -7;}
1575 if (pattern == 129) {ec = 1; l = -12; r = -7;}
1576 if (pattern == 132) {ec = 1; l = 10; r = 18;}
1577 if (pattern == 133) {ec = 1; l = 8; r = 18;}
1578
1579 if (pattern == 0) {ec = 2; l = -3; r = 1;}
1580 if (pattern == 1) {ec = 2; l = -3; r = 1;}
1581 if (pattern == 3) {ec = 2; l = -3; r = 0;}
1582 if (pattern == 13) {ec = 2; l = 0; r = 3;}
1583 if (pattern == 14) {ec = 2; l = 0; r = 4;}
1584 if (pattern == 15) {ec = 2; l = 0; r = 5;}
1585 if (pattern == 22) {ec = 2; l = -4; r = -1;}
1586 if (pattern == 23) {ec = 2; l = -5; r = -1;}
1587 if (pattern == 24) {ec = 2; l = -3; r = 0;}
1588 if (pattern == 25) {ec = 2; l = -4; r = 0;}
1589 if (pattern == 30) {ec = 2; l = 1; r = 5;}
1590 if (pattern == 39) {ec = 2; l = -2; r = 0;}
1591 if (pattern == 40) {ec = 2; l = -2; r = 0;}
1592 if (pattern == 48) {ec = 2; l = 2; r = 6;}
1593 if (pattern == 49) {ec = 2; l = 3; r = 8;}
1594 if (pattern == 58) {ec = 2; l = -9; r = -3;}
1595 if (pattern == 59) {ec = 2; l = -9; r = -3;}
1596 if (pattern == 67) {ec = 2; l = 5; r = 11;}
1597 if (pattern == 75) {ec = 2; l = -13; r = -6;}
1598 if (pattern == 82) {ec = 2; l = 5; r = 9;}
1599 if (pattern == 83) {ec = 2; l = 5; r = 9;}
1600 if (pattern == 89) {ec = 2; l = -10; r = -4;}
1601 if (pattern == 92) {ec = 2; l = -10; r = -4;}
1602 if (pattern == 97) {ec = 2; l = 7; r = 19;}
1603 if (pattern == 105) {ec = 2; l = -16; r = -10;}
1604 if (pattern == 106) {ec = 2; l = -17; r = -7;}
1605 if (pattern == 109) {ec = 2; l = -17; r = -6;}
1606 if (pattern == 111) {ec = 2; l = -16; r = -7;}
1607 if (pattern == 117) {ec = 2; l = 9; r = 19;}
1608 if (pattern == 118) {ec = 2; l = 9; r = 19;}
1609 if (pattern == 124) {ec = 2; l = -17; r = -8;}
1610 if (pattern == 125) {ec = 2; l = -17; r = -8;}
1611 if (pattern == 126) {ec = 2; l = -17; r = -8;}
1612
1613}

◆ fill_pattern_base2()

void fill_pattern_base2 ( std::vector< std::vector< int > > & patt)

Fill the patterns in short tracking logic.

Definition at line 546 of file TRGGRLMatchModule.cc.

547{
548 patt.push_back({ 0, 0, 0, 0});
549 patt.push_back({ 0, -1, 0, 0});
550 patt.push_back({ 0, -1, 1, 0});
551 patt.push_back({ 0, -1, -1, 0});
552 patt.push_back({ 0, -2, 0, 0});
553 patt.push_back({ 0, -2, 1, 0});
554 patt.push_back({ 0, -2, 2, 0});
555 patt.push_back({ 0, -2, 3, 0});
556 patt.push_back({ 0, -3, 1, 0});
557 patt.push_back({ 0, -3, 2, 0});
558 patt.push_back({ 0, -3, 3, 0});
559 patt.push_back({ 0, -4, 2, 0});
560 patt.push_back({ 0, -4, 3, 0});
561 patt.push_back({ 0, 0, 0, 1});
562 patt.push_back({ 0, 0, 1, 1});
563 patt.push_back({ 0, -1, 0, 1});
564 patt.push_back({ 0, -1, 1, 1});
565 patt.push_back({ 0, -1, 2, 1});
566 patt.push_back({ 0, -2, 2, 1});
567 patt.push_back({ 0, -2, 3, 1});
568 patt.push_back({ 0, -3, 2, 1});
569 patt.push_back({ 0, -3, 3, 1});
570 patt.push_back({ 0, 0, 0, -1});
571 patt.push_back({ 0, 0, -1, -1});
572 patt.push_back({ 0, -1, 0, -1});
573 patt.push_back({ 0, -1, -1, -1});
574 patt.push_back({ 0, -2, 0, -1});
575 patt.push_back({ 0, -2, 1, -1});
576 patt.push_back({ 0, -3, 1, -1});
577 patt.push_back({ 0, -3, 2, -1});
578 patt.push_back({ -1, -1, 0, 0});
579 patt.push_back({ -1, -1, 1, 0});
580 patt.push_back({ -1, -2, 0, 0});
581 patt.push_back({ -1, -2, 1, 0});
582 patt.push_back({ -1, -3, 1, 0});
583 patt.push_back({ -1, -3, 2, 0});
584 patt.push_back({ -1, -3, 3, 0});
585 patt.push_back({ -1, -4, 2, 0});
586 patt.push_back({ -1, -4, 3, 0});
587 patt.push_back({ 1, 0, 1, 0});
588 patt.push_back({ 1, 0, 0, 0});
589 patt.push_back({ 1, 0, -1, 0});
590 patt.push_back({ 1, -1, 0, 0});
591 patt.push_back({ 1, -1, 1, 0});
592 patt.push_back({ 1, -2, 2, 0});
593 patt.push_back({ 1, -2, 3, 0});
594 patt.push_back({ 1, -3, 2, 0});
595 patt.push_back({ 1, -3, 3, 0});
596 patt.push_back({ -1, -1, 0, 1});
597 patt.push_back({ -1, -1, 1, 1});
598 patt.push_back({ -1, -2, 0, 1});
599 patt.push_back({ -1, -2, 1, 1});
600 patt.push_back({ -1, -2, 2, 1});
601 patt.push_back({ -1, -3, 1, 1});
602 patt.push_back({ -1, -3, 2, 1});
603 patt.push_back({ -1, -3, 3, 1});
604 patt.push_back({ -1, -4, 2, 1});
605 patt.push_back({ -1, -4, 3, 1});
606 patt.push_back({ 1, 0, -1, -1});
607 patt.push_back({ 1, 0, 0, -1});
608 patt.push_back({ 1, -1, -1, -1});
609 patt.push_back({ 1, -1, 0, -1});
610 patt.push_back({ 1, -1, 1, -1});
611 patt.push_back({ 1, -2, 1, -1});
612 patt.push_back({ 1, -2, 2, -1});
613 patt.push_back({ 1, -3, 1, -1});
614 patt.push_back({ 1, -3, 2, -1});
615 patt.push_back({ -1, -1, 1, 2});
616 patt.push_back({ -1, -1, 2, 2});
617 patt.push_back({ -1, -2, 1, 2});
618 patt.push_back({ -1, -2, 2, 2});
619 patt.push_back({ -1, -2, 3, 2});
620 patt.push_back({ -1, -3, 2, 2});
621 patt.push_back({ -1, -3, 3, 2});
622 patt.push_back({ -1, -3, 4, 2});
623 patt.push_back({ 1, 0, -1, -2});
624 patt.push_back({ 1, 0, 0, -2});
625 patt.push_back({ 1, -1, 1, -2});
626 patt.push_back({ 1, -1, 0, -2});
627 patt.push_back({ 1, -1, -1, -2});
628 patt.push_back({ 1, -2, 0, -2});
629 patt.push_back({ 1, -2, 1, -2});
630 patt.push_back({ -2, -2, 0, 1});
631 patt.push_back({ -2, -2, 1, 1});
632 patt.push_back({ -2, -3, 1, 1});
633 patt.push_back({ -2, -3, 2, 1});
634 patt.push_back({ -2, -4, 2, 1});
635 patt.push_back({ -2, -4, 3, 1});
636 patt.push_back({ -2, -5, 3, 1});
637 patt.push_back({ 2, 1, 0, -1});
638 patt.push_back({ 2, 0, 1, -1});
639 patt.push_back({ 2, 0, 0, -1});
640 patt.push_back({ 2, 0, -1, -1});
641 patt.push_back({ 2, -1, 1, -1});
642 patt.push_back({ 2, -1, 0, -1});
643 patt.push_back({ 2, -2, 2, -1});
644 patt.push_back({ 2, -2, 1, -1});
645 patt.push_back({ -2, -2, 1, 2});
646 patt.push_back({ -2, -2, 2, 2});
647 patt.push_back({ -2, -3, 1, 2});
648 patt.push_back({ -2, -3, 2, 2});
649 patt.push_back({ -2, -3, 3, 2});
650 patt.push_back({ -2, -4, 2, 2});
651 patt.push_back({ -2, -4, 3, 2});
652 patt.push_back({ -2, -4, 4, 2});
653 patt.push_back({ 2, 1, 0, -2});
654 patt.push_back({ 2, 1, -1, -2});
655 patt.push_back({ 2, 0, 1, -2});
656 patt.push_back({ 2, 0, 0, -2});
657 patt.push_back({ 2, 0, -1, -2});
658 patt.push_back({ 2, 0, -2, -2});
659 patt.push_back({ 2, -1, 2, -2});
660 patt.push_back({ 2, -1, 1, -2});
661 patt.push_back({ 2, -1, 0, -2});
662 patt.push_back({ 2, -1, -1, -2});
663 patt.push_back({ 2, -2, 0, -2});
664 patt.push_back({ 2, -2, 1, -2});
665 patt.push_back({ -2, -2, 1, 3});
666 patt.push_back({ -2, -2, 2, 3});
667 patt.push_back({ -2, -3, 2, 3});
668 patt.push_back({ -2, -3, 3, 3});
669 patt.push_back({ -2, -3, 4, 3});
670 patt.push_back({ -2, -4, 3, 3});
671 patt.push_back({ -2, -4, 4, 3});
672 patt.push_back({ 2, 1, -1, -3});
673 patt.push_back({ 2, 0, -1, -3});
674 patt.push_back({ 2, 0, -2, -3});
675 patt.push_back({ 2, -1, 0, -3});
676 patt.push_back({ 2, -2, 0, -3});
677 patt.push_back({ 2, -2, 1, -3});
678 patt.push_back({ -2, -2, 2, 4});
679 patt.push_back({ -2, -3, 3, 4});
680 patt.push_back({ -2, -3, 4, 4});
681 patt.push_back({ -2, -4, 4, 4});
682 patt.push_back({ 2, -1, 0, 4});
683 patt.push_back({ 2, -1, -1, 4});
684 patt.push_back({ 2, -2, 0, 4});
685
686}

◆ 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 323 of file Module.h.

324 {
325 return m_conditions;
326 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

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

Definition at line 313 of file Module.h.

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

◆ 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 201 of file Module.h.

201{return m_description;}

◆ 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, RootOutputModule, and StorageRootOutputModule.

Definition at line 133 of file Module.h.

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

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 224 of file Module.h.

224{return m_logConfig;}

◆ getModules()

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

no submodules, return empty list

Implements PathElement.

Definition at line 505 of file Module.h.

505{ 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 186 of file Module.h.

186{return m_name;}

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 196 of file Module.h.

196{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.

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 362 of file Module.h.

362{ 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 380 of file Module.h.

380{ 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:508

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

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

Definition at line 310 of file Module.h.

310{ 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 377 of file Module.h.

377{ 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 parameters.

Reimplemented from Module.

Definition at line 85 of file TRGGRLMatchModule.cc.

86{
87 B2DEBUG(100, "TRGGRLMatchModule processing");
88 StoreArray<CDCTriggerTrack> track2Dlist(m_2d_tracklist);
89 StoreArray<CDCTriggerTrack> track3Dlist(m_3d_tracklist);
90 track2Dlist.isRequired();
91 track3Dlist.isRequired();
92 StoreArray<TRGECLCluster> clusterslist(m_clusterlist);
93 clusterslist.isRequired();
94 clusterslist.registerRelationTo(track2Dlist);
95 clusterslist.registerRelationTo(track3Dlist);
96 StoreObjPtr<KLMTrgSummary> klmtrgsummary(m_klmtrgsummarylist);
97 klmtrgsummary.isRequired();
98
99 StoreArray<CDCTriggerSegmentHit> tslist(m_hitCollectionName);
100 tslist.isRequired();
101
102 StoreArray<TRGGRLMATCH> track2Dmatch;
104 track2Dmatch.registerRelationTo(track2Dlist);
105 track2Dmatch.registerRelationTo(clusterslist);
106
107 StoreArray<TRGGRLMATCH> trackphimatch;
109 trackphimatch.registerRelationTo(track2Dlist);
110 trackphimatch.registerRelationTo(clusterslist);
111
112 StoreArray<TRGGRLMATCH> track3Dmatch;
114 track3Dmatch.registerRelationTo(clusterslist);
115 track3Dmatch.registerRelationTo(track3Dlist);
116
117 StoreArray<TRGGRLMATCHKLM> trackKLMmatch;
119 trackKLMmatch.registerRelationTo(track2Dlist);
120
121 StoreArray<TRGGRLPHOTON> grlphoton;
123 grlphoton.registerRelationTo(clusterslist);
124
125 StoreArray<TRGGRLShortTrack> grlst;
127
128 StoreArray<TRGGRLInnerTrack> grlit;
130
131 m_TRGGRLInfo.registerInDataStore(m_TrgGrlInformationName);
132
133//-- Fill the patterns for short tracking
134
136
137 for (int p = 0; p < 137; p++) {
138 int x0 = patterns_base2[p][0];
139 int x1 = patterns_base2[p][1];
140 int x2 = 0;
141 int x3 = patterns_base2[p][2];
142 int x4 = patterns_base2[p][3];
143 int d = x2 - x0;
144 x1 += d;
145 x2 += d;
146 x3 += d;
147 x4 += d;
148 patterns_base0.push_back({x1, x2, x3, x4});
149 }
150
151
152}
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
StoreObjPtr< TRGGRLInfo > m_TRGGRLInfo
output for TRGGRLInfo
void fill_pattern_base2(std::vector< std::vector< int > > &patt)
Fill the patterns in short tracking logic.

◆ inner_tracking()

void inner_tracking ( StoreArray< CDCTriggerSegmentHit > tslist,
std::vector< bool > phimap_i,
std::vector< bool > ecl_phimap,
std::vector< bool > klm_sectormap,
StoreArray< TRGGRLInnerTrack > grlit,
StoreObjPtr< TRGGRLInfo > trgInfo )

Definition at line 1316 of file TRGGRLMatchModule.cc.

1322{
1323 std::vector<bool> SL0(64, 0);
1324 std::vector<bool> SL1(64, 0);
1325 std::vector<bool> SL2(64, 0);
1326 std::vector<bool> IT0(64, 0);
1327 std::vector<bool> IT0_36b(36, 0);
1328 std::vector<bool> IT0_4b(4, 0);
1329
1330 //-- collecting TSF info in SL0~2
1331 for (int i = 0; i < tslist.getEntries(); i++) {
1332 int id = tslist[i]->getSegmentID();
1333 int sl = 0;
1334 if (id >= 0 * 32 && id < 5 * 32) {sl = 0; id -= 0;}
1335 else if (id >= 5 * 32 && id < 10 * 32) {sl = 1; id -= 5 * 32;}
1336 else if (id >= 10 * 32 && id < 16 * 32) {sl = 2; id -= 10 * 32;}
1337 else continue;
1338
1339 if (sl == 0) {
1340 int X = (int)(id / 5), Y = id % 5;
1341 if (Y == 0 || Y == 1) { SL0[2 * X] = true; }
1342 else if (Y == 3 || Y == 4) { SL0[2 * X + 1] = true; }
1343 else { SL0[2 * X] = true; SL0[2 * X + 1] = true; }
1344 } else if (sl == 1) {
1345 int X = (int)(id / 5), Y = id % 5;
1346 if (Y == 0 || Y == 1) { SL1[2 * X] = true; }
1347 else if (Y == 3 || Y == 4) { SL1[2 * X + 1] = true; }
1348 else { SL1[2 * X] = true; SL1[2 * X + 1] = true; }
1349 } else if (sl == 2) {
1350 int X = (int)(id / 3);
1351 SL2[X] = true;
1352 }
1353 }
1354
1355
1356 // -- Inner Track finding with SL0
1357 for (int i = 0; i < 64; i++) {
1358 int j1 = i - 4;
1359 if (j1 < 0) j1 = j1 + 64;
1360 int j2 = i - 3;
1361 if (j2 < 0) j2 = j2 + 64;
1362 int j3 = i - 2;
1363 if (j3 < 0) j3 = j3 + 64;
1364 int j4 = i - 1;
1365 if (j4 < 0) j4 = j4 + 64;
1366 int j5 = i;
1367 int j6 = i + 1;
1368 if (j6 > 63)j6 = j6 - 64;
1369 int j7 = i + 2;
1370 if (j7 > 63)j7 = j7 - 64;
1371 if (
1372 SL0[i] &&
1373 (SL1[j1] || SL1[j2] || SL1[j3] || SL1[j4] || SL1[j5]) &&
1374 (SL2[j3] || SL2[j4] || SL2[j5] || SL2[j6] || SL2[j7])
1375 ) {
1376 IT0[i] = true;
1377 } else {
1378 IT0[i] = false;
1379 }
1380 }
1381
1382 //-- 64b into 36b
1383 for (int i = 0; i < 4; i++) {
1384 IT0_36b[0 + 9 * i] = IT0[0 + 16 * i] or IT0[1 + 16 * i];
1385 IT0_36b[1 + 9 * i] = IT0[1 + 16 * i] or IT0[2 + 16 * i] or IT0[3 + 16 * i];
1386 IT0_36b[2 + 9 * i] = IT0[3 + 16 * i] or IT0[4 + 16 * i] or IT0[5 + 16 * i];
1387 IT0_36b[3 + 9 * i] = IT0[5 + 16 * i] or IT0[6 + 16 * i] or IT0[7 + 16 * i];
1388 IT0_36b[4 + 9 * i] = IT0[7 + 16 * i] or IT0[8 + 16 * i];
1389 IT0_36b[5 + 9 * i] = IT0[8 + 16 * i] or IT0[9 + 16 * i] or IT0[10 + 16 * i];
1390 IT0_36b[6 + 9 * i] = IT0[10 + 16 * i] or IT0[11 + 16 * i] or IT0[12 + 16 * i];
1391 IT0_36b[7 + 9 * i] = IT0[12 + 16 * i] or IT0[13 + 16 * i] or IT0[14 + 16 * i];
1392 IT0_36b[8 + 9 * i] = IT0[14 + 16 * i] or IT0[15 + 16 * i];
1393 }
1394
1395 //-- 36b into 4b
1396 IT0_4b[0] = IT0_36b[35] or IT0_36b[0] or IT0_36b[1] or IT0_36b[2] or IT0_36b[3] or IT0_36b[4] or IT0_36b[5] or IT0_36b[6]
1397 or IT0_36b[7] or IT0_36b[8] or IT0_36b[9];
1398 IT0_4b[1] = IT0_36b[8] or IT0_36b[9] or IT0_36b[10] or IT0_36b[11] or IT0_36b[12] or IT0_36b[13] or IT0_36b[14] or IT0_36b[15]
1399 or IT0_36b[16] or IT0_36b[17] or IT0_36b[18] or IT0_36b[19];
1400 IT0_4b[2] = IT0_36b[18] or IT0_36b[19] or IT0_36b[20] or IT0_36b[21] or IT0_36b[22] or IT0_36b[23] or IT0_36b[24] or IT0_36b[25]
1401 or IT0_36b[26] or IT0_36b[27] or IT0_36b[28];
1402 IT0_4b[3] = IT0_36b[26] or IT0_36b[27] or IT0_36b[28] or IT0_36b[29] or IT0_36b[30] or IT0_36b[31] or IT0_36b[32] or IT0_36b[33]
1403 or IT0_36b[34] or IT0_36b[36] or IT0_36b[0];
1404
1405 //-- Summary info
1406 int N_IT = 0;
1407 bool i2fo = false;
1408 bool i2io = false;
1409 int iecl = 0;
1410 int iklm = 0;
1411
1412 //-- inner track counting
1413 for (int i = 0; i < 64; i++) {
1414 if (IT0[i]) N_IT++;
1415 TRGGRLInnerTrack* it = grlit.appendNew();
1416 it->set_TS_ID(0, i);
1417 }
1418
1419 //-- b2b info with IT0 and phi_i map
1420 for (int i = 0; i < 36; i++) {
1421 i2fo = (phimap_i[i] and (IT0_36b[N36(i + 18)] or IT0_36b[N36(i + 17)] or IT0_36b[N36(i + 19)]
1422 or IT0_36b[N36(i + 16)] or IT0_36b[N36(i + 20)]
1423 or IT0_36b[N36(i + 15)] or IT0_36b[N36(i + 21)]
1424 or IT0_36b[N36(i + 14)] or IT0_36b[N36(i + 22)]
1425 or IT0_36b[N36(i + 13)] or IT0_36b[N36(i + 23)]
1426 or IT0_36b[N36(i + 12)] or IT0_36b[N36(i + 24)]
1427 or IT0_36b[N36(i + 11)] or IT0_36b[N36(i + 25)]
1428 or IT0_36b[N36(i + 10)] or IT0_36b[N36(i + 26)]
1429 or IT0_36b[N36(i + 9)] or IT0_36b[N36(i + 27)])) or i2fo ;
1430 }
1431 //-- b2b info with IT0
1432 for (int i = 0; i < 36; i++) {
1433 i2io = (IT0_36b[i] and (IT0_36b[N36(i + 18)] or IT0_36b[N36(i + 17)] or IT0_36b[N36(i + 19)]
1434 or IT0_36b[N36(i + 16)] or IT0_36b[N36(i + 20)]
1435 or IT0_36b[N36(i + 15)] or IT0_36b[N36(i + 21)]
1436 or IT0_36b[N36(i + 14)] or IT0_36b[N36(i + 22)]
1437 or IT0_36b[N36(i + 13)] or IT0_36b[N36(i + 23)]
1438 or IT0_36b[N36(i + 12)] or IT0_36b[N36(i + 24)]
1439 or IT0_36b[N36(i + 11)] or IT0_36b[N36(i + 25)]
1440 or IT0_36b[N36(i + 10)] or IT0_36b[N36(i + 26)]
1441 or IT0_36b[N36(i + 9)] or IT0_36b[N36(i + 27)])) or i2io ;
1442 }
1443 //inner-ecl matching at endcap
1444
1445 bool IT0_36b_temp[44] = {false};
1446 for (int i = 4; i < 40; i++) {
1447 IT0_36b_temp[i] = IT0_36b[i - 4];
1448 }
1449 IT0_36b_temp[0] = IT0_36b[32];
1450 IT0_36b_temp[1] = IT0_36b[33];
1451 IT0_36b_temp[2] = IT0_36b[34];
1452 IT0_36b_temp[3] = IT0_36b[35];
1453 IT0_36b_temp[40] = IT0_36b[0];
1454 IT0_36b_temp[41] = IT0_36b[1];
1455 IT0_36b_temp[42] = IT0_36b[2];
1456 IT0_36b_temp[43] = IT0_36b[3];
1457
1458 for (int i = 4; i < 40; i++) {
1459 if (ecl_phimap[i - 4] and (IT0_36b_temp[i - 4] or IT0_36b_temp[i - 3] or IT0_36b_temp[i - 2] or IT0_36b_temp[i - 1]
1460 or IT0_36b_temp[i] or IT0_36b_temp[i + 1] or IT0_36b_temp[i + 2] or IT0_36b_temp[i + 3] or IT0_36b_temp[i + 4])) {
1461 iecl++;
1462 }
1463 }
1464
1465
1466 //std::cout << "sector map " ;
1467 //for (int i = 0; i < 4; i++) {
1468 // std::cout << " " << i << " " << IT0_4b[i] << " " << klm_sectormap[i];
1469 //}
1470 //std::cout << std::endl;
1471
1472 //inner-klm matching at endcap
1473 for (int i = 0; i < 4; i++) {
1474 if (klm_sectormap[i] and IT0_4b[i])iklm++;
1475 }
1476 //-- set results
1477 trgInfo->setNinnertrk(N_IT);
1478 trgInfo->seti2fo(i2fo);
1479 trgInfo->seti2io(i2io);
1480 trgInfo->setNiecl(iecl);
1481 trgInfo->setNiklm(iklm);
1482
1483 //for (int i = 0; i < 64; i++) {
1484 // std::cout << SL0[i] << " ";
1485 //}
1486 //std::cout << std::endl;
1487 //for (int i = 0; i < 64; i++) {
1488 // std::cout << SL1[i] << " ";
1489 //}
1490 //std::cout << std::endl;
1491 //for (int i = 0; i < 64; i++) {
1492 // std::cout << SL2[i] << " ";
1493 //}
1494 //std::cout << std::endl;
1495 //for (int i = 0; i < 64; i++) {
1496 // std::cout << IT0[i] << " ";
1497 //}
1498 //std::cout << std::endl;
1499 //for (int i = 0; i < 36; i++) {
1500 // std::cout << IT0_36b[i] << " ";
1501 //}
1502 //std::cout << std::endl;
1503 //for (int i = 0; i < 36; i++) {
1504 // std::cout << phimap_i[i] << " ";
1505 //}
1506 //std::cout << std::endl;
1507 //for (int i = 0; i < 36; i++) {
1508 // std::cout << ecl_phimap[i] << " ";
1509 //}
1510 //std::cout << std::endl;
1511 //std::cout << i2fo << " " << iecl << std::endl;
1512
1513}
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
void set_TS_ID(int i, int id)
set TS ID of SL i
int N36(int x)
Force an int to be witnin 0 to 35.

◆ make_eecl_map()

void make_eecl_map ( StoreArray< TRGECLCluster > clusterlist,
std::vector< bool > & ecl_phimap,
std::vector< bool > & ecl_phimap_fwd,
std::vector< bool > & ecl_phimap_bwd,
std::vector< bool > & ecl_sectormap_fwd,
std::vector< bool > & ecl_sectormap_bwd )

Make the ecl endcap phi map for inner/short track matching.

Definition at line 757 of file TRGGRLMatchModule.cc.

760{
761 bool ecl_phimap_loose_fwd[36];
762 bool ecl_phimap_loose_bwd[36];
763 for (int i = 0; i < 36; i++) {
764 ecl_phimap_loose_fwd[i] = false;
765 ecl_phimap_loose_bwd[i] = false;
766 }
767
768 for (int iclst = 0; iclst < clusterlist.getEntries(); iclst++) {
769 //-- cluster/TRGECL information
770 double _cluster_x = clusterlist[iclst]->getPositionX();
771 double _cluster_y = clusterlist[iclst]->getPositionY();
772
773 // -- ECL phi angle
774 double phi_ECL = 0.0;
775 if (_cluster_x >= 0 && _cluster_y >= 0) {phi_ECL = atan(_cluster_y / _cluster_x);}
776 else if (_cluster_x < 0 && _cluster_y >= 0) {phi_ECL = atan(_cluster_y / _cluster_x) + M_PI;}
777 else if (_cluster_x < 0 && _cluster_y < 0) {phi_ECL = atan(_cluster_y / _cluster_x) + M_PI;}
778 else if (_cluster_x >= 0 && _cluster_y < 0) {phi_ECL = atan(_cluster_y / _cluster_x) + 2 * M_PI;}
779
780 int phi_ECL_d = 0;
781 // digitization on both angle
782 for (int i = 0; i < 36; i++) {
783 if (phi_ECL > i * M_PI / 18 && phi_ECL < (i + 1)*M_PI / 18) {phi_ECL_d = i;}
784 }
785
786 //fill endcap only
787 int _cluster_thetaid = clusterlist[iclst]->getMaxThetaId();
788 if (_cluster_thetaid < 4 || _cluster_thetaid > 15) ecl_phimap[phi_ECL_d] = true;
789 if (_cluster_thetaid < 4) ecl_phimap_fwd[phi_ECL_d] = true;
790 if (_cluster_thetaid > 15) ecl_phimap_bwd[phi_ECL_d] = true;
791 if (_cluster_thetaid < 5) ecl_phimap_loose_fwd[phi_ECL_d] = true;
792 if (_cluster_thetaid > 14) ecl_phimap_loose_bwd[phi_ECL_d] = true;
793 }
794
795 //-- 36b into 4b
796 ecl_sectormap_fwd[0] = ecl_phimap_loose_fwd[35] or ecl_phimap_loose_fwd[0] or ecl_phimap_loose_fwd[1] or ecl_phimap_loose_fwd[2] or
797 ecl_phimap_loose_fwd[3] or ecl_phimap_loose_fwd[4] or ecl_phimap_loose_fwd[5] or ecl_phimap_loose_fwd[6] or
798 ecl_phimap_loose_fwd[7] or ecl_phimap_loose_fwd[8] or ecl_phimap_loose_fwd[9];
799 ecl_sectormap_fwd[1] = ecl_phimap_loose_fwd[8] or ecl_phimap_loose_fwd[9] or ecl_phimap_loose_fwd[10] or ecl_phimap_loose_fwd[11]
800 or
801 ecl_phimap_loose_fwd[12] or ecl_phimap_loose_fwd[13] or ecl_phimap_loose_fwd[14] or ecl_phimap_loose_fwd[15] or
802 ecl_phimap_loose_fwd[16] or ecl_phimap_loose_fwd[17] or ecl_phimap_loose_fwd[18] or ecl_phimap_loose_fwd[19];
803 ecl_sectormap_fwd[2] = ecl_phimap_loose_fwd[18] or ecl_phimap_loose_fwd[19] or ecl_phimap_loose_fwd[20]
804 or ecl_phimap_loose_fwd[21] or
805 ecl_phimap_loose_fwd[22] or ecl_phimap_loose_fwd[23] or ecl_phimap_loose_fwd[24] or ecl_phimap_loose_fwd[25] or
806 ecl_phimap_loose_fwd[26] or ecl_phimap_loose_fwd[27] or ecl_phimap_loose_fwd[28];
807 ecl_sectormap_fwd[3] = ecl_phimap_loose_fwd[26] or ecl_phimap_loose_fwd[27] or ecl_phimap_loose_fwd[28]
808 or ecl_phimap_loose_fwd[29] or
809 ecl_phimap_loose_fwd[30] or ecl_phimap_loose_fwd[31] or ecl_phimap_loose_fwd[32] or ecl_phimap_loose_fwd[33] or
810 ecl_phimap_loose_fwd[34] or ecl_phimap_loose_fwd[35] or ecl_phimap_loose_fwd[0];
811 //-- 36b into 4b
812 ecl_sectormap_bwd[0] = ecl_phimap_loose_bwd[35] or ecl_phimap_loose_bwd[0] or ecl_phimap_loose_bwd[1] or ecl_phimap_loose_bwd[2] or
813 ecl_phimap_loose_bwd[3] or ecl_phimap_loose_bwd[4] or ecl_phimap_loose_bwd[5] or ecl_phimap_loose_bwd[6] or
814 ecl_phimap_loose_bwd[7] or ecl_phimap_loose_bwd[8] or ecl_phimap_loose_bwd[9];
815 ecl_sectormap_bwd[1] = ecl_phimap_loose_bwd[8] or ecl_phimap_loose_bwd[9] or ecl_phimap_loose_bwd[10] or ecl_phimap_loose_bwd[11]
816 or
817 ecl_phimap_loose_bwd[12] or ecl_phimap_loose_bwd[13] or ecl_phimap_loose_bwd[14] or ecl_phimap_loose_bwd[15] or
818 ecl_phimap_loose_bwd[16] or ecl_phimap_loose_bwd[17] or ecl_phimap_loose_bwd[18] or ecl_phimap_loose_bwd[19];
819 ecl_sectormap_bwd[2] = ecl_phimap_loose_bwd[18] or ecl_phimap_loose_bwd[19] or ecl_phimap_loose_bwd[20]
820 or ecl_phimap_loose_bwd[21] or
821 ecl_phimap_loose_bwd[22] or ecl_phimap_loose_bwd[23] or ecl_phimap_loose_bwd[24] or ecl_phimap_loose_bwd[25] or
822 ecl_phimap_loose_bwd[26] or ecl_phimap_loose_bwd[27] or ecl_phimap_loose_bwd[28];
823 ecl_sectormap_bwd[3] = ecl_phimap_loose_bwd[26] or ecl_phimap_loose_bwd[27] or ecl_phimap_loose_bwd[28]
824 or ecl_phimap_loose_bwd[29] or
825 ecl_phimap_loose_bwd[30] or ecl_phimap_loose_bwd[31] or ecl_phimap_loose_bwd[32] or ecl_phimap_loose_bwd[33] or
826 ecl_phimap_loose_bwd[34] or ecl_phimap_loose_bwd[35] or ecl_phimap_loose_bwd[0];
827
828}

◆ make_eklm_map()

void make_eklm_map ( StoreObjPtr< KLMTrgSummary > klmtrgsummary,
std::vector< bool > & eklm_sectormap,
std::vector< bool > & eklm_sectormap_fwd,
std::vector< bool > & eklm_sectormap_bwd )

Make the klm endcap phi map for inner/short track matching.

Definition at line 830 of file TRGGRLMatchModule.cc.

832{
833
834 int _sector_mask_fw = _klmtrgsummary->getSector_mask_Forward_Endcap();
835 int _sector_mask_bw = _klmtrgsummary->getSector_mask_Backward_Endcap();
836
837 for (int _sector = 0; _sector < 4; _sector++) {
838 //if(_sector_mask_fw & (1<<_sector) ) _eklm_sectormap_fwd[_sector]=true;
839 if (_sector_mask_bw & (1 << _sector)) _eklm_sectormap_bwd[_sector] = true;
840 //if(_sector_mask & (1<<_sector) ) _eklm_sectormap[_sector]=true;
841 }
842 if (_sector_mask_fw & (1 << 0)) _eklm_sectormap_fwd[1] = true;
843 if (_sector_mask_fw & (1 << 1)) _eklm_sectormap_fwd[0] = true;
844 if (_sector_mask_fw & (1 << 2)) _eklm_sectormap_fwd[3] = true;
845 if (_sector_mask_fw & (1 << 3)) _eklm_sectormap_fwd[2] = true;
846
847 for (int _sector = 0; _sector < 4; _sector++) {
848 _eklm_sectormap[_sector] = (_eklm_sectormap_fwd[_sector] || _eklm_sectormap_bwd[_sector]);
849 }
850}

◆ make_veto_map()

void make_veto_map ( StoreArray< CDCTriggerTrack > track2Dlist,
std::vector< bool > & map_veto )

Make the full track phi veto map for short tracking.

Definition at line 688 of file TRGGRLMatchModule.cc.

689{
690 for (int i = 0; i < track2Dlist.getEntries(); i++) {
691 int _w = (int)(2271.7 * track2Dlist[i]->getOmega()) ; // omega from -33 to 33
692 if (_w >= 33) { _w = 33;}
693 else if (_w <= -33) { _w = -33;}
694 int _phi = (int)((track2Dlist[i]->getPhi0() + 2 * M_PI) / (M_PI / 32.0)); // phi_i digitized to 0 ~ 63
695
696 int charge = 0;
697 if (_w > 0) {charge = 1;}
698 else if (_w < 0) {charge = -1;}
699 else {charge = 0;}
700
701 _w = abs(_w);
702
703 int L;
704 // cppcheck-suppress knownConditionTrueFalse
705 if (_w >= 0 && _w <= 8) { L = _phi; }
706 else if (_w >= 9 && _w <= 15) {
707 if (charge < 0) { L = _phi + 1; }
708 else { L = _phi; }
709 } else if (_w >= 16 && _w <= 24) {
710 if (charge < 0) { L = _phi + 2; }
711 else { L = _phi; }
712 } else if (_w >= 25 && _w <= 27) {
713 if (charge < 0) { L = _phi + 3; }
714 else { L = _phi; }
715 } else if (_w >= 28 && _w <= 30) {
716 if (charge < 0) { L = _phi + 3; }
717 else { L = _phi + 1; }
718 } else if (_w >= 31 && _w <= 32) {
719 if (charge < 0) { L = _phi + 4; }
720 else { L = _phi + 1; }
721 } else {
722 if (charge < 0) { L = _phi + 5; }
723 else { L = _phi + 1; }
724 }
725
726 int R;
727 // cppcheck-suppress knownConditionTrueFalse
728 if (_w >= 0 && _w <= 8) { R = _phi; }
729 else if (_w >= 9 && _w <= 15) {
730 if (charge < 0) { R = _phi; }
731 else { R = _phi - 1; }
732 } else if (_w >= 16 && _w <= 24) {
733 if (charge < 0) { R = _phi; }
734 else { R = _phi - 2; }
735 } else if (_w >= 25 && _w <= 27) {
736 if (charge < 0) { R = _phi; }
737 else { R = _phi - 3; }
738 } else if (_w >= 28 && _w <= 30) {
739 if (charge < 0) { R = _phi + 1; }
740 else { R = _phi - 3; }
741 } else if (_w >= 21 && _w <= 32) {
742 if (charge < 0) { R = _phi + 1; }
743 else { R = _phi - 4; }
744 } else {
745 if (charge < 0) { R = _phi + 1; }
746 else { R = _phi - 5; }
747 }
748
749 // L should be > R
750 for (int j = R - 1; j < L + 2; j++) {
751 map_veto[N64(j)] = true;
752 }
753 }
754
755}
double R
typedef autogenerated by FFTW
int N64(int x)
Force an int to be witnin 0 to 63.

◆ matching_eecl_eklm()

void matching_eecl_eklm ( std::vector< bool > eecl_sectormap_fw,
std::vector< bool > eecl_setormap_bw,
std::vector< bool > eklm_sectormap_fw,
std::vector< bool > eklm_sectormap_bw,
StoreObjPtr< TRGGRLInfo > trgInfo )

Definition at line 1515 of file TRGGRLMatchModule.cc.

1520{
1521 int ieclklm = 0;
1522 for (int i = 0; i < 4; i++) {
1523 if (_eklm_sectormap_fw[i] && _eecl_sectormap_fw[i])ieclklm++;
1524 if (_eklm_sectormap_bw[i] && _eecl_sectormap_bw[i])ieclklm++;
1525 }
1526
1527 trgInfo->setNeecleklm(ieclklm);
1528
1529}

◆ N36()

int N36 ( int x)

Force an int to be witnin 0 to 35.

Definition at line 539 of file TRGGRLMatchModule.cc.

540{
541 if (x > 35) x -= 36;
542 if (x < 0) x += 36;
543 return x;
544}

◆ N64()

int N64 ( int x)

Force an int to be witnin 0 to 63.

Definition at line 532 of file TRGGRLMatchModule.cc.

533{
534 if (x > 63) x -= 64;
535 if (x < 0) x += 64;
536 return x;
537}

◆ photon_cluster()

bool photon_cluster ( TRGECLCluster * cluster,
std::vector< bool > track_phimap,
double e_threshold )

determine photon from isolated cluster

Definition at line 496 of file TRGGRLMatchModule.cc.

497{
498
499 //-- cluster/TRGECL information
500 double _cluster_x = _cluster->getPositionX();
501 double _cluster_y = _cluster->getPositionY();
502 double _cluster_z = _cluster->getPositionZ();
503 double _cluster_theta = atan(_cluster_z / (sqrt(_cluster_x * _cluster_x + _cluster_y * _cluster_y)));
504 _cluster_theta = 0.5 * M_PI - _cluster_theta;
505 bool barrel = true;
506 if (_cluster_theta < M_PI * 35.0 / 180.0 || _cluster_theta > M_PI * 126.0 / 180.0) {barrel = false;}
507 double _cluster_e = _cluster->getEnergyDep();
508
509 // -- ECL phi angle
510 double phi_ECL = 0.0;
511 if (_cluster_x >= 0 && _cluster_y >= 0) {phi_ECL = atan(_cluster_y / _cluster_x);}
512 else if (_cluster_x < 0 && _cluster_y >= 0) {phi_ECL = atan(_cluster_y / _cluster_x) + M_PI;}
513 else if (_cluster_x < 0 && _cluster_y < 0) {phi_ECL = atan(_cluster_y / _cluster_x) + M_PI;}
514 else if (_cluster_x >= 0 && _cluster_y < 0) {phi_ECL = atan(_cluster_y / _cluster_x) + 2 * M_PI;}
515
516 int phi_ECL_d = 0;
517 // digitization on both angle
518 for (int i = 0; i < 36; i++) {
519 if (phi_ECL > i * M_PI / 18 && phi_ECL < (i + 1)*M_PI / 18) {phi_ECL_d = i;}
520 }
521
522 int index = phi_ECL_d, index_p = phi_ECL_d + 1, index_m = phi_ECL_d - 1;
523 if (index_p > 35) {index_p = index_p - 36;}
524 if (index_m < 0) {index_m = index_m + 36;}
525
526 if (!phimap[index] && !phimap[index_p] && !phimap[index_m] && _cluster_e >= e_threshold && barrel) {return true;}
527 else if (!barrel) {return true;}
528 else {return false;}
529
530}

◆ sectormatching_klm()

void sectormatching_klm ( CDCTriggerTrack * track,
StoreObjPtr< KLMTrgSummary > klmtrgsummary,
double & dphi,
int & klmtrack_ind_phi )

calculate dphi between 2D track and KLM track

Definition at line 450 of file TRGGRLMatchModule.cc.

452{
453
454 //-- 2D track information
455 double _r = 1.0 / _track->getOmega() ;
456 double _phi = _track->getPhi0() ;
457
458 //-- 2D phi angle calculation (extrapolating up to superconducting coil)
459 double phi_p = acos(176.0 / (2 * fabs(_r))); // adjustment angle between 0 to 0.5*M_PI
460 int charge = 0;
461 if (_r > 0) {charge = 1;}
462 else if (_r < 0) {charge = -1;}
463 else {charge = 0;}
464
465 double phi_CDC = 0.0;
466 if (charge == 1) {
467 phi_CDC = _phi + phi_p - 0.5 * M_PI;
468 } else if (charge == -1) {
469 phi_CDC = _phi - phi_p + 0.5 * M_PI;
470 } else {
471 phi_CDC = _phi;
472 }
473
474 if (phi_CDC > 2 * M_PI) {phi_CDC = phi_CDC - 2 * M_PI;}
475 else if (phi_CDC < 0) {phi_CDC = phi_CDC + 2 * M_PI;}
476
477 // KLM track's sector central phi
478 int _sector_mask_fw = _klmtrgsummary->getSector_mask_Forward_Barrel();
479 int _sector_mask_bw = _klmtrgsummary->getSector_mask_Backward_Barrel();
480 int _sector_mask = _sector_mask_fw | _sector_mask_bw;
481 for (int _sector = 0; _sector < 8; _sector++) {
482 if (_sector_mask & (1 << _sector)) {
483 double _sector_central = 0.25 * M_PI * _sector;
484 double dphi_temp;
485 if (fabs(phi_CDC - _sector_central) < M_PI) { dphi_temp = fabs(phi_CDC - _sector_central); }
486 else { dphi_temp = 2 * M_PI - fabs(phi_CDC - _sector_central); }
487 if (dphi_temp < dphi) {
488 dphi = dphi_temp;
489 phiid_klm = _sector;
490 }
491 }
492 }
493
494}

◆ 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}
std::string m_description
The description of the module.
Definition Module.h:510

◆ setLogConfig()

void setLogConfig ( const LogConfig & logConfig)
inlineinherited

Set the log system configuration.

Definition at line 229 of file Module.h.

229{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 213 of file Module.h.

213{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList & params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 500 of file Module.h.

500{ 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}
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:200
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition LogSystem.cc:28
LogConfig & getLogConfig()
Returns the log system configuration.
Definition Module.h:224
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition Module.h:507
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}

◆ short_tracking()

void short_tracking ( StoreArray< CDCTriggerSegmentHit > tslist,
std::vector< bool > map_veto,
std::vector< bool > phimap_i,
std::vector< bool > ecl_phimap_fwd,
std::vector< bool > ecl_phimap_bwd,
std::vector< bool > klm_sectormap_fwd,
std::vector< bool > klm_sectormap_bwd,
std::vector< std::vector< int > > & pattern_base0,
std::vector< std::vector< int > > & pattern_base2,
StoreArray< TRGGRLShortTrack > grlst,
StoreObjPtr< TRGGRLInfo > trgInfo )

Short tracking logic.

Definition at line 853 of file TRGGRLMatchModule.cc.

862{
863 std::vector<bool> SL0(64, 0);
864 std::vector<bool> SL1(64, 0);
865 std::vector<bool> SL2(64, 0);
866 std::vector<bool> SL3(64, 0);
867 std::vector<bool> SL4(64, 0);
868 std::vector<bool> ST0(64, 0);
869 std::vector<bool> ST0_36b(36, 0);
870 std::vector<bool> ST2(64, 0);
871 std::vector<int> patt_ID(64, -1);
872
873 std::vector<bool> st_ec1(64, 0);
874 std::vector<bool> st_ec1_36b(36, 0);
875 std::vector<bool> st_ec1_4b(4, 0);
876 std::vector<bool> st_ec2(64, 0);
877 std::vector<bool> st_ec2_36b(36, 0);
878 std::vector<bool> st_ec2_4b(4, 0);
879
880//-- collecting TSF info in SL0~4
881 for (int i = 0; i < tslist.getEntries(); i++) {
882 int id = tslist[i]->getSegmentID();
883 int sl = 0;
884 if (id >= 0 * 32 && id < 5 * 32) {sl = 0; id -= 0;}
885 else if (id >= 5 * 32 && id < 10 * 32) {sl = 1; id -= 5 * 32;}
886 else if (id >= 10 * 32 && id < 16 * 32) {sl = 2; id -= 10 * 32;}
887 else if (id >= 16 * 32 && id < 23 * 32) {sl = 3; id -= 16 * 32;}
888 else if (id >= 23 * 32 && id < 31 * 32) {sl = 4; id -= 23 * 32;}
889 else continue;
890
891 if (sl == 0) {
892 int X = (int)(id / 5), Y = id % 5;
893 if (Y == 0 || Y == 1) { SL0[2 * X] = true; }
894 else if (Y == 3 || Y == 4) { SL0[2 * X + 1] = true; }
895 else { SL0[2 * X] = true; SL0[2 * X + 1] = true; }
896 } else if (sl == 1) {
897 int X = (int)(id / 5), Y = id % 5;
898 if (Y == 0 || Y == 1) { SL1[2 * X] = true; }
899 else if (Y == 3 || Y == 4) { SL1[2 * X + 1] = true; }
900 else { SL1[2 * X] = true; SL1[2 * X + 1] = true; }
901 } else if (sl == 2) {
902 int X = (int)(id / 3);
903 SL2[X] = true;
904 } else if (sl == 3) {
905 int X = (int)(id / 7), Y = id % 7;
906 if (Y == 0 || Y == 1 || Y == 2) { SL3[2 * X] = true; }
907 else if (Y == 4 || Y == 5 || Y == 6) { SL3[2 * X + 1] = true; }
908 else { SL3[2 * X] = true; SL3[2 * X + 1] = true; }
909 } else if (sl == 4) {
910 int X = (int)(id / 4);
911 SL4[X] = true;
912 }
913
914 }
915
916//-- making veto
917 for (int i = 0; i < 64; i++) {
918 if (map_veto[i]) {SL0[i] = false; SL1[i] = false; SL2[i] = false;}
919 }
920 /*
921 for (int i = 0; i < 64; i++) { std::cout<<map_veto[63-i]; if((64-i)%10==1) std::cout<<" ";}
922 std::cout<<std::endl;
923 for (int i = 0; i < 64; i++) { std::cout<<SL4[63-i]; if((64-i)%10==1) std::cout<<" ";}
924 std::cout<<std::endl;
925 for (int i = 0; i < 64; i++) { std::cout<<SL3[63-i]; if((64-i)%10==1) std::cout<<" ";}
926 std::cout<<std::endl;
927 for (int i = 0; i < 64; i++) { std::cout<<SL2[63-i]; if((64-i)%10==1) std::cout<<" ";}
928 std::cout<<std::endl;
929 for (int i = 0; i < 64; i++) { std::cout<<SL1[63-i]; if((64-i)%10==1) std::cout<<" ";}
930 std::cout<<std::endl;
931 for (int i = 0; i < 64; i++) { std::cout<<SL0[63-i]; if((64-i)%10==1) std::cout<<" ";}
932 std::cout<<std::endl;
933 */
934//-- doing short tracking
935
936 std::vector< std::vector<int> > stlist_buf(0);
937
938 // -- ST finding with SL2
939 for (int i = 0; i < 64; i++) {
940
941 int ID0 = 0;
942 int ID1 = 0;
943 int ID2 = 0;
944 int ID3 = 0;
945 int ID4 = 0;
946 stlist_buf.push_back({0, 0, 0, 0, 0, 0});
947
948 if (!SL2[i]) continue;
949 bool SL2_already_found = false;
950
951 for (int p = 0; p < 137; p++) {
952
953 // following patterns will not be used.
954 if (p == 4) continue;
955 if (p == 5) continue;
956 if (p == 17) continue;
957 if (p == 26) continue;
958 if (p == 38) continue;
959 if (p == 41) continue;
960 if (p == 42) continue;
961 if (p == 47) continue;
962 if (p == 50) continue;
963 if (p == 60) continue;
964 if (p == 63) continue;
965 if (p == 64) continue;
966 if (p == 74) continue;
967 if (p == 93) continue;
968 if (p == 94) continue;
969 if (p == 95) continue;
970 if (p == 96) continue;
971 if (p == 104) continue;
972 if (p == 113) continue;
973 if (p == 114) continue;
974 if (p == 115) continue;
975 if (p == 123) continue;
976 if (p == 134) continue;
977 if (p == 135) continue;
978 if (p == 136) continue;
979
980 int x0 = pattern_base2[p][0];
981 int x1 = pattern_base2[p][1];
982 int x3 = pattern_base2[p][2];
983 int x4 = pattern_base2[p][3];
984
985
986 if (SL2[i] && SL0[N64(i + x0)] && SL1[N64(i + x1)] && SL3[N64(i + x3)] && SL4[N64(i + x4)] && !SL2_already_found) {
987 ST2[i] = true;
988 ID0 = N64(i + x0);
989 ID1 = N64(i + x1);
990 ID2 = i;
991 ID3 = N64(i + x3);
992 ID4 = N64(i + x4);
993 SL2_already_found = true; // if it has been found in previous pattern, no need to do it again.
994 }
995
996 // if a pattern is found, no need to look for other pattern
997 if (SL2_already_found) break;
998
999 }
1000
1001 if (SL2_already_found) {
1002 stlist_buf[i][0] = 1;
1003 stlist_buf[i][1] = ID0;
1004 stlist_buf[i][2] = ID1;
1005 stlist_buf[i][3] = ID2;
1006 stlist_buf[i][4] = ID3;
1007 stlist_buf[i][5] = ID4;
1008 }
1009 }
1011//-- ST finding with SL0
1012 for (int i = 0; i < 64; i++) {
1013
1014 if (!SL0[i]) continue;
1015 bool SL0_already_found = false;
1016
1017 for (int p = 0; p < 137; p++) {
1018
1019 // following patterns will not be used.
1020 if (p == 4) continue;
1021 if (p == 5) continue;
1022 if (p == 17) continue;
1023 if (p == 26) continue;
1024 if (p == 38) continue;
1025 if (p == 41) continue;
1026 if (p == 42) continue;
1027 if (p == 47) continue;
1028 if (p == 50) continue;
1029 if (p == 60) continue;
1030 if (p == 63) continue;
1031 if (p == 64) continue;
1032 if (p == 74) continue;
1033 if (p == 93) continue;
1034 if (p == 94) continue;
1035 if (p == 95) continue;
1036 if (p == 96) continue;
1037 if (p == 104) continue;
1038 if (p == 113) continue;
1039 if (p == 114) continue;
1040 if (p == 115) continue;
1041 if (p == 123) continue;
1042 if (p == 134) continue;
1043 if (p == 135) continue;
1044 if (p == 136) continue;
1045
1046 int y1 = pattern_base0[p][0];
1047 int y2 = pattern_base0[p][1];
1048 int y3 = pattern_base0[p][2];
1049 int y4 = pattern_base0[p][3];
1050
1051 if (SL0[i] && SL1[N64(i + y1)] && SL2[N64(i + y2)] && SL3[N64(i + y3)] && SL4[N64(i + y4)] && !SL0_already_found) {
1052 ST0[i] = true;
1053 if (patt_ID[i] < 0) { patt_ID[i] = p; }
1054 SL0_already_found = true; // if it has been found in previous pattern, no need to do it again.
1055 }
1056
1057 // if a pattern is found, no need to look for other pattern
1058 if (SL0_already_found) break;
1059
1060 }
1061
1062 }
1064//-- extrapolation
1065 for (int i = 0; i < 64; i++) {
1066 if (patt_ID[i] == -1) continue;
1067
1068 int ec = 0, l = 0, r = 0;
1069 extrapolation(patt_ID[i], l, r, ec);
1070 if (ec == 1) {
1071 for (int e = l; e <= r; e++) { st_ec1[N64(i + e)] = true; }
1072 }
1073 if (ec == 2) {
1074 for (int e = l; e <= r; e++) { st_ec2[N64(i + e)] = true; }
1075 }
1076
1077 }
1078//-- 64b into 36b
1079 for (int i = 0; i < 4; i++) {
1080 ST0_36b[0 + 9 * i] = ST0[0 + 16 * i] or ST0[1 + 16 * i];
1081 ST0_36b[1 + 9 * i] = ST0[1 + 16 * i] or ST0[2 + 16 * i] or ST0[3 + 16 * i];
1082 ST0_36b[2 + 9 * i] = ST0[3 + 16 * i] or ST0[4 + 16 * i] or ST0[5 + 16 * i];
1083 ST0_36b[3 + 9 * i] = ST0[5 + 16 * i] or ST0[6 + 16 * i] or ST0[7 + 16 * i];
1084 ST0_36b[4 + 9 * i] = ST0[7 + 16 * i] or ST0[8 + 16 * i];
1085 ST0_36b[5 + 9 * i] = ST0[8 + 16 * i] or ST0[9 + 16 * i] or ST0[10 + 16 * i];
1086 ST0_36b[6 + 9 * i] = ST0[10 + 16 * i] or ST0[11 + 16 * i] or ST0[12 + 16 * i];
1087 ST0_36b[7 + 9 * i] = ST0[12 + 16 * i] or ST0[13 + 16 * i] or ST0[14 + 16 * i];
1088 ST0_36b[8 + 9 * i] = ST0[14 + 16 * i] or ST0[15 + 16 * i];
1089 st_ec1_36b[0 + 9 * i] = st_ec1[0 + 16 * i] or st_ec1[1 + 16 * i];
1090 st_ec1_36b[1 + 9 * i] = st_ec1[1 + 16 * i] or st_ec1[2 + 16 * i] or st_ec1[3 + 16 * i];
1091 st_ec1_36b[2 + 9 * i] = st_ec1[3 + 16 * i] or st_ec1[4 + 16 * i] or st_ec1[5 + 16 * i];
1092 st_ec1_36b[3 + 9 * i] = st_ec1[5 + 16 * i] or st_ec1[6 + 16 * i] or st_ec1[7 + 16 * i];
1093 st_ec1_36b[4 + 9 * i] = st_ec1[7 + 16 * i] or st_ec1[8 + 16 * i];
1094 st_ec1_36b[5 + 9 * i] = st_ec1[8 + 16 * i] or st_ec1[9 + 16 * i] or st_ec1[10 + 16 * i];
1095 st_ec1_36b[6 + 9 * i] = st_ec1[10 + 16 * i] or st_ec1[11 + 16 * i] or st_ec1[12 + 16 * i];
1096 st_ec1_36b[7 + 9 * i] = st_ec1[12 + 16 * i] or st_ec1[13 + 16 * i] or st_ec1[14 + 16 * i];
1097 st_ec1_36b[8 + 9 * i] = st_ec1[14 + 16 * i] or st_ec1[15 + 16 * i];
1098
1099 st_ec2_36b[0 + 9 * i] = st_ec2[0 + 16 * i] or st_ec2[1 + 16 * i];
1100 st_ec2_36b[1 + 9 * i] = st_ec2[1 + 16 * i] or st_ec2[2 + 16 * i] or st_ec2[3 + 16 * i];
1101 st_ec2_36b[2 + 9 * i] = st_ec2[3 + 16 * i] or st_ec2[4 + 16 * i] or st_ec2[5 + 16 * i];
1102 st_ec2_36b[3 + 9 * i] = st_ec2[5 + 16 * i] or st_ec2[6 + 16 * i] or st_ec2[7 + 16 * i];
1103 st_ec2_36b[4 + 9 * i] = st_ec2[7 + 16 * i] or st_ec2[8 + 16 * i];
1104 st_ec2_36b[5 + 9 * i] = st_ec2[8 + 16 * i] or st_ec2[9 + 16 * i] or st_ec2[10 + 16 * i];
1105 st_ec2_36b[6 + 9 * i] = st_ec2[10 + 16 * i] or st_ec2[11 + 16 * i] or st_ec2[12 + 16 * i];
1106 st_ec2_36b[7 + 9 * i] = st_ec2[12 + 16 * i] or st_ec2[13 + 16 * i] or st_ec2[14 + 16 * i];
1107 st_ec2_36b[8 + 9 * i] = st_ec2[14 + 16 * i] or st_ec2[15 + 16 * i];
1108 }
1109//-- 36b into 4b
1110 st_ec1_4b[0] = st_ec1_36b[35] or st_ec1_36b[0] or st_ec1_36b[1] or st_ec1_36b[2] or st_ec1_36b[3] or st_ec1_36b[4] or st_ec1_36b[5]
1111 or st_ec1_36b[6] or st_ec1_36b[7] or st_ec1_36b[8] or st_ec1_36b[9];
1112 st_ec1_4b[1] = st_ec1_36b[8] or st_ec1_36b[9] or st_ec1_36b[10] or st_ec1_36b[11] or st_ec1_36b[12] or st_ec1_36b[13]
1113 or st_ec1_36b[14] or st_ec1_36b[15] or st_ec1_36b[16] or st_ec1_36b[17] or st_ec1_36b[18] or st_ec1_36b[19];
1114 st_ec1_4b[2] = st_ec1_36b[18] or st_ec1_36b[19] or st_ec1_36b[20] or st_ec1_36b[21] or st_ec1_36b[22] or st_ec1_36b[23]
1115 or st_ec1_36b[24] or st_ec1_36b[25] or st_ec1_36b[26] or st_ec1_36b[27] or st_ec1_36b[28];
1116 st_ec1_4b[3] = st_ec1_36b[26] or st_ec1_36b[27] or st_ec1_36b[28] or st_ec1_36b[29] or st_ec1_36b[30] or st_ec1_36b[31]
1117 or st_ec1_36b[32] or st_ec1_36b[33] or st_ec1_36b[34] or st_ec1_36b[35] or st_ec1_36b[0];
1118 st_ec2_4b[0] = st_ec2_36b[35] or st_ec2_36b[0] or st_ec2_36b[1] or st_ec2_36b[2] or st_ec2_36b[3] or st_ec2_36b[4] or st_ec2_36b[5]
1119 or st_ec2_36b[6] or st_ec2_36b[7] or st_ec2_36b[8] or st_ec2_36b[9];
1120 st_ec2_4b[1] = st_ec2_36b[8] or st_ec2_36b[9] or st_ec2_36b[10] or st_ec2_36b[11] or st_ec2_36b[12] or st_ec2_36b[13]
1121 or st_ec2_36b[14] or st_ec2_36b[15] or st_ec2_36b[16] or st_ec2_36b[17] or st_ec2_36b[18] or st_ec2_36b[19];
1122 st_ec2_4b[2] = st_ec2_36b[18] or st_ec2_36b[19] or st_ec2_36b[20] or st_ec2_36b[21] or st_ec2_36b[22] or st_ec2_36b[23]
1123 or st_ec2_36b[24] or st_ec2_36b[25] or st_ec2_36b[26] or st_ec2_36b[27] or st_ec2_36b[28];
1124 st_ec2_4b[3] = st_ec2_36b[26] or st_ec2_36b[27] or st_ec2_36b[28] or st_ec2_36b[29] or st_ec2_36b[30] or st_ec2_36b[31]
1125 or st_ec2_36b[32] or st_ec2_36b[33] or st_ec2_36b[34] or st_ec2_36b[35] or st_ec2_36b[0];
1126
1127
1128
1129
1130//-- Summary info
1131
1132 int N_ST = 0;
1133 int N_ST_fwd = 0;
1134 int N_ST_bwd = 0;
1135 bool s2s3 = false;
1136 bool s2s5 = false;
1137 bool s2so = false;
1138 bool s2s30 = false;
1139 bool s2f3 = false;
1140 bool s2f5 = false;
1141 bool s2fo = false;
1142 bool s2f30 = false;
1143 int secl = 0;
1144 int secl_fwd = 0;
1145 int secl_bwd = 0;
1146 int sklm = 0;
1147 int sklm_fwd = 0;
1148 int sklm_bwd = 0;
1149
1150//-- short track counting on ST2
1151 for (int i = 0; i < 64; i++) {
1152 if (ST2[i]) {
1153 N_ST++;
1154 ST2[i] = false;
1155 int L = i - 1, R = i + 1;
1156 while (ST2[N64(L)]) {
1157 ST2[N64(L)] = false;
1158 L--;
1159 }
1160 while (ST2[N64(R)]) {
1161 ST2[N64(R)] = false;
1162 R++;
1163 }
1164
1165 //-- Fill the store array
1166 L++; R--;
1167 int index = N64((L + R) / 2); // fill the middle one when multiple ST is found continuously in the map
1168 TRGGRLShortTrack* st = grlst.appendNew();
1169 st->set_TS_ID(0, stlist_buf[index][1]);
1170 st->set_TS_ID(1, stlist_buf[index][2]);
1171 st->set_TS_ID(2, stlist_buf[index][3]);
1172 st->set_TS_ID(3, stlist_buf[index][4]);
1173 st->set_TS_ID(4, stlist_buf[index][5]);
1174 }
1175 }
1176 for (int i = 0; i < 64; i++) {
1177 if (st_ec1[i]) N_ST_fwd++;
1178 }
1179 for (int i = 0; i < 64; i++) {
1180 if (st_ec2[i]) N_ST_bwd++;
1181 }
1182
1183//-- b2b info with ST0 and phi_i map
1184 for (int i = 0; i < 36; i++) {
1185 s2s3 = (ST0_36b[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)])) or s2s3;
1186 s2s5 = (ST0_36b[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)]
1187 or ST0_36b[N36(i + 16)] or ST0_36b[N36(i + 20)])) or s2s5;
1188 s2so = (ST0_36b[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)]
1189 or ST0_36b[N36(i + 16)] or ST0_36b[N36(i + 20)]
1190 or ST0_36b[N36(i + 15)] or ST0_36b[N36(i + 21)]
1191 or ST0_36b[N36(i + 14)] or ST0_36b[N36(i + 22)]
1192 or ST0_36b[N36(i + 13)] or ST0_36b[N36(i + 23)]
1193 or ST0_36b[N36(i + 12)] or ST0_36b[N36(i + 24)]
1194 or ST0_36b[N36(i + 11)] or ST0_36b[N36(i + 25)]
1195 or ST0_36b[N36(i + 10)] or ST0_36b[N36(i + 26)]
1196 or ST0_36b[N36(i + 9)] or ST0_36b[N36(i + 27)])) or s2so ;
1197 s2s30 = (ST0_36b[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)]
1198 or ST0_36b[N36(i + 16)] or ST0_36b[N36(i + 20)]
1199 or ST0_36b[N36(i + 15)] or ST0_36b[N36(i + 21)]
1200 or ST0_36b[N36(i + 14)] or ST0_36b[N36(i + 22)]
1201 or ST0_36b[N36(i + 13)] or ST0_36b[N36(i + 23)]
1202 or ST0_36b[N36(i + 12)] or ST0_36b[N36(i + 24)]
1203 or ST0_36b[N36(i + 11)] or ST0_36b[N36(i + 25)]
1204 or ST0_36b[N36(i + 10)] or ST0_36b[N36(i + 26)]
1205 or ST0_36b[N36(i + 9)] or ST0_36b[N36(i + 27)]
1206 or ST0_36b[N36(i + 8)] or ST0_36b[N36(i + 28)]
1207 or ST0_36b[N36(i + 7)] or ST0_36b[N36(i + 29)]
1208 or ST0_36b[N36(i + 6)] or ST0_36b[N36(i + 30)]
1209 or ST0_36b[N36(i + 5)] or ST0_36b[N36(i + 31)]
1210 or ST0_36b[N36(i + 4)] or ST0_36b[N36(i + 32)]
1211 or ST0_36b[N36(i + 3)] or ST0_36b[N36(i + 33)])) or s2s30 ;
1212
1213
1214 s2f3 = (phimap_i[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)])) or s2f3;
1215 s2f5 = (phimap_i[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)]
1216 or ST0_36b[N36(i + 16)] or ST0_36b[N36(i + 20)])) or s2f5;
1217 s2fo = (phimap_i[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)]
1218 or ST0_36b[N36(i + 16)] or ST0_36b[N36(i + 20)]
1219 or ST0_36b[N36(i + 15)] or ST0_36b[N36(i + 21)]
1220 or ST0_36b[N36(i + 14)] or ST0_36b[N36(i + 22)]
1221 or ST0_36b[N36(i + 13)] or ST0_36b[N36(i + 23)]
1222 or ST0_36b[N36(i + 12)] or ST0_36b[N36(i + 24)]
1223 or ST0_36b[N36(i + 11)] or ST0_36b[N36(i + 25)]
1224 or ST0_36b[N36(i + 10)] or ST0_36b[N36(i + 26)]
1225 or ST0_36b[N36(i + 9)] or ST0_36b[N36(i + 27)])) or s2fo ;
1226 s2f30 = (phimap_i[i] and (ST0_36b[N36(i + 18)] or ST0_36b[N36(i + 17)] or ST0_36b[N36(i + 19)]
1227 or ST0_36b[N36(i + 16)] or ST0_36b[N36(i + 20)]
1228 or ST0_36b[N36(i + 15)] or ST0_36b[N36(i + 21)]
1229 or ST0_36b[N36(i + 14)] or ST0_36b[N36(i + 22)]
1230 or ST0_36b[N36(i + 13)] or ST0_36b[N36(i + 23)]
1231 or ST0_36b[N36(i + 12)] or ST0_36b[N36(i + 24)]
1232 or ST0_36b[N36(i + 11)] or ST0_36b[N36(i + 25)]
1233 or ST0_36b[N36(i + 10)] or ST0_36b[N36(i + 26)]
1234 or ST0_36b[N36(i + 9)] or ST0_36b[N36(i + 27)]
1235 or ST0_36b[N36(i + 8)] or ST0_36b[N36(i + 28)]
1236 or ST0_36b[N36(i + 7)] or ST0_36b[N36(i + 29)]
1237 or ST0_36b[N36(i + 6)] or ST0_36b[N36(i + 30)]
1238 or ST0_36b[N36(i + 5)] or ST0_36b[N36(i + 31)]
1239 or ST0_36b[N36(i + 4)] or ST0_36b[N36(i + 32)]
1240 or ST0_36b[N36(i + 3)] or ST0_36b[N36(i + 33)])) or s2f30 ;
1241
1242 }
1243
1244//short-ecl matching at endcap
1245 for (int i = 0; i < 36; i++) {
1246 if (ecl_phimap_fwd[i] and st_ec1_36b[i])secl_fwd++;
1247 }
1248 for (int i = 0; i < 36; i++) {
1249 if (ecl_phimap_bwd[i] and st_ec2_36b[i])secl_bwd++;
1250 }
1251 secl = secl_fwd + secl_bwd;
1252
1253//short-klm matching at endcap
1254 for (int i = 0; i < 4; i++) {
1255 if (klm_sectormap_fwd[i] and st_ec1_4b[i])sklm_fwd++;
1256 }
1257 for (int i = 0; i < 4; i++) {
1258 if (klm_sectormap_bwd[i] and st_ec2_4b[i])sklm_bwd++;
1259 }
1260 sklm = sklm_fwd + sklm_bwd;
1261
1262//-- set results
1263 trgInfo->setNshorttrk(N_ST);
1264 trgInfo->setNshorttrk_fwd(N_ST_fwd);
1265 trgInfo->setNshorttrk_bwd(N_ST_bwd);
1266 trgInfo->sets2s3(s2s3);
1267 trgInfo->sets2s5(s2s5);
1268 trgInfo->sets2so(s2so);
1269 trgInfo->sets2s30(s2s30);
1270 trgInfo->sets2f3(s2f3);
1271 trgInfo->sets2f5(s2f5);
1272 trgInfo->sets2fo(s2fo);
1273 trgInfo->sets2f30(s2f30);
1274 trgInfo->setbwdsb(0);
1275 trgInfo->setbwdnb(0);
1276 trgInfo->setfwdsb(0);
1277 trgInfo->setfwdnb(0);
1278 trgInfo->setbrlfb(0);
1279 trgInfo->setbrlnb(0);
1280 trgInfo->setNsecl(secl);
1281 trgInfo->setNsecl_fwd(secl_fwd);
1282 trgInfo->setNsecl_bwd(secl_bwd);
1283 trgInfo->setNsklm(sklm);
1284 trgInfo->setNsklm_fwd(sklm_fwd);
1285 trgInfo->setNsklm_bwd(sklm_bwd);
1286
1287 //for (int i = 0; i < 64; i++) {
1288 // std::cout << st_ec1[i] << " ";
1289 //}
1290 //std::cout << std::endl;
1291 //for (int i = 0; i < 64; i++) {
1292 // std::cout << st_ec2[i] << " ";
1293 //}
1294 //std::cout << std::endl;
1295 //for (int i = 0; i < 36; i++) {
1296 // std::cout << st_ec1_36b[i] << " ";
1297 //}
1298 //std::cout << std::endl;
1299 //for (int i = 0; i < 36; i++) {
1300 // std::cout << st_ec2_36b[i] << " ";
1301 //}
1302 //std::cout << std::endl;
1303 //for (int i = 0; i < 36; i++) {
1304 // std::cout << ecl_phimap_fwd[i] << " ";
1305 //}
1306 //std::cout << std::endl;
1307 //for (int i = 0; i < 36; i++) {
1308 // std::cout << ecl_phimap_bwd[i] << " ";
1309 //}
1310 //std::cout << std::endl;
1311 //std::cout << secl << " " << secl_fwd << " " << secl_bwd << std::endl;
1312
1313}
void extrapolation(int pattern, int &l, int &r, int &ec)
Short track extrapolation (to endcap) function.

◆ terminate()

void terminate ( void )
overridevirtual

Termination action.

Reimplemented from Module.

Definition at line 338 of file TRGGRLMatchModule.cc.

339{
340}

Member Data Documentation

◆ eecl_phimap

std::vector<bool> eecl_phimap
private

36 bits phi map of ECL clusters at endcap

Definition at line 147 of file TRGGRLMatchModule.h.

◆ eecl_phimap_bwd

std::vector<bool> eecl_phimap_bwd
private

36 bits phi map of ECL clusters at backward endcap

Definition at line 151 of file TRGGRLMatchModule.h.

◆ eecl_phimap_fwd

std::vector<bool> eecl_phimap_fwd
private

36 bits phi map of ECL clusters at forward endcap

Definition at line 149 of file TRGGRLMatchModule.h.

◆ eecl_sectormap_bwd

std::vector<bool> eecl_sectormap_bwd
private

8 bits sector map of ECL clusters at backward endcap

Definition at line 155 of file TRGGRLMatchModule.h.

◆ eecl_sectormap_fwd

std::vector<bool> eecl_sectormap_fwd
private

8 bits sector map of ECL clusters at forward endcap

Definition at line 153 of file TRGGRLMatchModule.h.

◆ eklm_sectormap

std::vector<bool> eklm_sectormap
private

8 bits phi map of KLM clusters at endcap

Definition at line 157 of file TRGGRLMatchModule.h.

◆ eklm_sectormap_bwd

std::vector<bool> eklm_sectormap_bwd
private

8 bits sector map of KLM clusters at backward endcap

Definition at line 161 of file TRGGRLMatchModule.h.

◆ eklm_sectormap_fwd

std::vector<bool> eklm_sectormap_fwd
private

8 bits sector map of KLM clusters at forward endcap

Definition at line 159 of file TRGGRLMatchModule.h.

◆ m_2d_tracklist

std::string m_2d_tracklist
private

the 2D finder track list

Definition at line 163 of file TRGGRLMatchModule.h.

◆ m_2dmatch_tracklist

std::string m_2dmatch_tracklist
private

the distance in phi direction between track and cluster

the distance in z direction between track and cluster the matched 2d track list

Definition at line 175 of file TRGGRLMatchModule.h.

◆ m_3d_tracklist

std::string m_3d_tracklist
private

the 3D NN track list

Definition at line 165 of file TRGGRLMatchModule.h.

◆ m_3dmatch_tracklist

std::string m_3dmatch_tracklist
private

the matched 3d track list

Definition at line 179 of file TRGGRLMatchModule.h.

◆ m_clusterlist

std::string m_clusterlist
private

the ecl cluster list

Definition at line 167 of file TRGGRLMatchModule.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 520 of file Module.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 510 of file Module.h.

◆ m_dphi_d_threshold

int m_dphi_d_threshold
private

max value of dphi_d to be identified as match, 1 digit = 10 degrees

Definition at line 137 of file TRGGRLMatchModule.h.

◆ m_dphi_klm_threshold

double m_dphi_klm_threshold
private

max value of dphi (CDC track to KLM sector) to be identified as match (in degrees)

Definition at line 141 of file TRGGRLMatchModule.h.

◆ m_dr_threshold

double m_dr_threshold
private

max value of dr to be identified as match

Definition at line 133 of file TRGGRLMatchModule.h.

◆ m_dz_threshold

double m_dz_threshold
private

max value of dz to be identified as match

Definition at line 135 of file TRGGRLMatchModule.h.

◆ m_e_threshold

double m_e_threshold
private

min value of isolated cluster energy

Definition at line 139 of file TRGGRLMatchModule.h.

◆ m_fastSimulationMode

int m_fastSimulationMode
private

Switch for the fast simulation.

0:do everything, 1:stop after the track segment simulation. Default is 0.

Definition at line 127 of file TRGGRLMatchModule.h.

◆ m_firmwareSimulationMode

int m_firmwareSimulationMode
private

Switch for the firmware simulation. 0:do nothing, 1:do everything.

Definition at line 130 of file TRGGRLMatchModule.h.

◆ m_grlitCollectionName

std::string m_grlitCollectionName
private

GRL inner track list.

Definition at line 189 of file TRGGRLMatchModule.h.

◆ m_grlphotonlist

std::string m_grlphotonlist
private

Non-matched cluster list at GRL.

Definition at line 183 of file TRGGRLMatchModule.h.

◆ m_grlstCollectionName

std::string m_grlstCollectionName
private

GRL short track list.

Definition at line 187 of file TRGGRLMatchModule.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 517 of file Module.h.

◆ m_hitCollectionName

std::string m_hitCollectionName
private

Track Segment list.

Definition at line 185 of file TRGGRLMatchModule.h.

◆ m_klmmatch_tracklist

std::string m_klmmatch_tracklist
private

the matched 2d track list by KLM matching

Definition at line 181 of file TRGGRLMatchModule.h.

◆ m_klmtrgsummarylist

std::string m_klmtrgsummarylist
private

the KLM track list

Definition at line 169 of file TRGGRLMatchModule.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 513 of file Module.h.

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 515 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 507 of file Module.h.

◆ m_package

std::string m_package
privateinherited

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

Definition at line 509 of file Module.h.

◆ m_phimatch_tracklist

std::string m_phimatch_tracklist
private

the matched 2d track list by phi matching

Definition at line 177 of file TRGGRLMatchModule.h.

◆ m_propertyFlags

unsigned int m_propertyFlags
privateinherited

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

Definition at line 511 of file Module.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 518 of file Module.h.

◆ m_simulationMode

int m_simulationMode
private

Mode for TRGGRL simulation.

0th bit : fast simulation switch, 1st bit : firmware simulation switch.

Definition at line 123 of file TRGGRLMatchModule.h.

◆ m_TRGGRLInfo

StoreObjPtr<TRGGRLInfo> m_TRGGRLInfo
private

output for TRGGRLInfo

Definition at line 119 of file TRGGRLMatchModule.h.

◆ m_TrgGrlInformationName

std::string m_TrgGrlInformationName
private

Name of the StoreArray holding projects information from grl.

Definition at line 191 of file TRGGRLMatchModule.h.

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 508 of file Module.h.

◆ patterns_base0

std::vector< std::vector<int> > patterns_base0
private

Short tracking patterns based on SL0.

Definition at line 193 of file TRGGRLMatchModule.h.

◆ patterns_base2

std::vector< std::vector<int> > patterns_base2
private

Short tracking patterns based on SL2.

Definition at line 195 of file TRGGRLMatchModule.h.

◆ track_phimap

std::vector<bool> track_phimap
private

36 bits phi map of all 2D tracks

Definition at line 143 of file TRGGRLMatchModule.h.

◆ track_phimap_i

std::vector<bool> track_phimap_i
private

36 bits phi map of all 2D tracks

Definition at line 145 of file TRGGRLMatchModule.h.


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