Belle II Software development
CDCTriggerHoughETFModule Class Reference
Inheritance diagram for CDCTriggerHoughETFModule:
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 ,
  c_NoParallelWork = 128
}
 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

 CDCTriggerHoughETFModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the module and check module parameters.
 
virtual void event () override
 Run tracking.
 
virtual void terminate () override
 Clean up.
 
int fastInterceptFinder (CDCHitMap &hits, double x1_s, double x2_s, double y1_s, double y2_s, unsigned iterations, unsigned ix_s, unsigned iy_s)
 Fast intercept finder Divide Hough plane recursively to find cells with enough crossing lines.
 
bool shortTrack (std::bitset< 9 > &superLayers)
 check the short track condition (= hits in the inner super layers rather than any super layers)
 
void connectedRegions ()
 Combine Hough candidates to tracks by merging connected cells.
 
void addNeighbors (const CDCTriggerHoughCand &center, const std::vector< CDCTriggerHoughCand > &candidates, std::vector< CDCTriggerHoughCand > &merged, std::vector< CDCTriggerHoughCand > &rejected, unsigned short nSLmax) const
 Recursive function to add combine connected cells.
 
bool inList (const CDCTriggerHoughCand &a, const std::vector< CDCTriggerHoughCand > &list) const
 Check if candidate is in list.
 
bool connected (const CDCTriggerHoughCand &a, const CDCTriggerHoughCand &b) const
 Check if candidates are connected.
 
void mergeIdList (std::vector< unsigned > &merged, std::vector< unsigned > &a, std::vector< unsigned > &b)
 Merge lists a and b and put the result in merged.
 
bool patternClustering (const CDCHitMap &inputMap)
 Combine Hough candidates to tracks by a fixed pattern algorithm.
 
bool connectedLR (unsigned patternL, unsigned patternR)
 Check for left/right connection of patterns in 2 x 2 squares.
 
bool connectedUD (unsigned patternD, unsigned patternU)
 Check for up/down connection of patterns in 2 x 2 squares.
 
bool connectedDiag (unsigned patternLD, unsigned patternRU)
 Check for diagonal connected of patterns in 2 x 2 squares.
 
unsigned topRightSquare (std::vector< unsigned > &pattern)
 Find the top right square within a cluster of 2 x 2 squares In case of ambiguity, top is favored over right @ return index of corner within pattern vector.
 
unsigned topRightCorner (unsigned pattern)
 Find the top right corner within 2 x 2 square.
 
unsigned bottomLeftCorner (unsigned pattern)
 Find the bottom left corner within 2 x 2 square.
 
void findAllCrossingHits (std::vector< unsigned > &list, double x1, double x2, double y1, double y2, const CDCHitMap &inputMap)
 Find all hits in inputMap whose Hough curve crosses the rectangle with corners (x1, y1) and (x2, y2) and add the hit indices to list.
 
void selectHits (std::vector< unsigned > &list, std::vector< unsigned > &selected, std::vector< unsigned > &unselected)
 Select one hit per super layer.
 
int getSector (int id, int sl)
 
std::vector< int > sectorTimingList ()
 
std::vector< int > highPassTimingList ()
 
int calcEventTiming ()
 
int median (std::vector< int > v)
 
int medianInTimeWindow (std::vector< int > v)
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules.
 
virtual void beginRun ()
 Called when entering a new run.
 
virtual void endRun ()
 This method is called if the current run ends.
 
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.
 
LogConfig & getLogConfig ()
 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 ModuleCondition * getCondition () 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< Path > getConditionPath () 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 ModuleParamList & getParamList () 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< PathElement > clone () 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.
 

Protected Attributes

StoreObjPtr< BinnedEventT0 > m_eventTime
 StoreObjPtr holding the event time.
 
std::string m_EventTimeName
 Name of the StoreObject containing the trigger event time.
 
bool m_storeTracks
 Switch to save the 2D Hough track reconstructed in this module.
 
StoreArray< CDCTriggerSegmentHit > m_hits
 list of input track segment hits
 
std::vector< std::vector< CDCTriggerSegmentHit * > > m_associatedTSHitsList
 list of fastest timing of TS associated with Track
 
bool m_usePriorityTiming
 Switch to use priority timing instead of fastest timing.
 
bool m_useHighPassTimingList
 Use associated fastest timings track-by-track.
 
unsigned m_t0CalcMethod
 Switch method to determine the event timing.
 
unsigned m_arrivalOrder
 arrival order of fastest timing used as t0 (effective when t0CalcMEthod == 0)
 
short m_timeWindowBegin
 Start time of time window relative to median.
 
short m_timeWindowEnd
 End time of time window relative to median.
 
std::string m_hitCollectionName
 Name of the StoreArray containing the input track segment hits.
 
std::string m_outputCollectionName
 Name of the StoreArray containing the tracks found by the Hough tracking.
 
std::string m_clusterCollectionName
 Name of the StoreArray containing the clusters formed in the Hough plane.
 
unsigned m_nCellsPhi
 number of Hough cells in phi
 
unsigned m_nCellsR
 number of Hough cells in 1/r
 
double m_minPt
 Hough plane limit in Pt [GeV].
 
int m_shiftPt
 shift the Hough plane in 1/r to avoid curvature 0 tracks < 0: shift in negative direction (negative half is larger) 0: no shift (same limits for negative and positive half)
 
double m_maxR = 0.
 Hough plane limit in 1/r [1/cm].
 
double m_shiftR = 0.
 Hough plane shift in 1/r [1/cm].
 
unsigned m_maxIterations = 0
 number of iterations for the fast peak finder, smallest n such that 2^(n+1) > max(nCellsPhi, nCellsR).
 
unsigned m_nCells = 0
 number of cells for the fast peak finder: 2^(maxIterations + 1).
 
double m_rectX = 0
 Store the rectangle size in x.
 
double m_rectY = 0
 Store the rectangle size in y.
 
unsigned m_minHits
 minimum number of hits from different super layers in a Hough cell to form a candidate
 
unsigned m_minHitsShort
 short tracks require hits in the first minHitsShort super layers to form a candidate
 
unsigned m_minCells
 minimum number of cells in a cluster to form a track
 
bool m_onlyLocalMax
 switch to ignore candidates connected to cells with higher super layer count
 
unsigned m_connect
 number of neighbors to check for connection (4: direct, 6: direct + upper right and lower left corner, 8: direct + all corners)
 
bool m_ignore2nd
 switch to skip second priority hits
 
bool m_usePriority
 switch between priority position and center position of track segment
 
bool m_requireSL0
 switch to check separately for a hit in the innermost super layer
 
bool m_suppressClone
 switch to send only the first found track and suppress the subsequent clones
 
unsigned m_storePlane
 switch to save the Hough plane in DataStore (0: don't save, 1: save only peaks, 2: save full plane)
 
bool m_clusterPattern
 switch for clustering algorithm (if true use nested patterns)
 
unsigned m_clusterSizeX
 maximum cluster size for pattern algorithm
 
unsigned m_clusterSizeY
 maximum cluster size for pattern algorithm
 
bool m_hitRelationsFromCorners
 switch for creating relations to hits in the pattern clustering algorithm.
 
int m_offset = 0
 offset for ETF simulation
 
std::string m_testFilename
 filename for test output for firmware debugging
 
std::ofstream m_testFile
 filestream for test output for firmware debugging
 
CDCHitMap m_hitMap
 map of TS hits containing <iHit, <iSL, (x, y)>> with iHit: hit index in StoreArray iSL: super layer index
 
std::vector< CDCTriggerHoughCand > m_houghCand
 Hough Candidates.
 
double m_radius [9][2] = {{0.}}
 Radius of the CDC layers with priority wires (2 per super layer).
 
unsigned m_TSoffset [10] = {0}
 Number of track segments up to super layer.
 
const int m_NTS [9] = {160, 160, 192, 224, 256, 288, 320, 352, 384}
 Number of track segments in each super layers.
 
const int m_NSEC [9] = {16, 0, 16, 0, 16, 0, 8, 0, 8}
 Number of sector in each super layer.
 
int m_NSecOffset [9] = {0}
 Number of sector offset of each super layer.
 
StoreArray< CDCTriggerSegmentHit > m_segmentHits
 list of track segment hits
 
StoreArray< CDCTriggerTrack > m_tracks
 list of found tracks
 
StoreArray< CDCTriggerHoughCluster > m_clusters
 list of clusters in the Hough map
 
StoreObjPtr< TMatrix > m_houghPlane
 matrix containing the Hough plane
 

Private Member Functions

std::list< ModulePtr > getModules () 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

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< ModuleCondition > m_conditions
 Module condition, only non-null if set.
 

Detailed Description

Definition at line 84 of file CDCTriggerHoughETFModule.h.

Member Typedef Documentation

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 89 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.

c_NoParallelWork 

This module does no per-event work that is worth running in parallel.

A parallel section made up only of such modules is merged back into the input path, so that a single uncertified module in between does not prevent the modules after it from being parallelised.

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_NoParallelWork = 128,
86 };
@ c_Output
Output Process.
Definition ProcHelper.h:19
@ c_Input
Input Process.
Definition ProcHelper.h:17

Constructor & Destructor Documentation

◆ CDCTriggerHoughETFModule()

Constructor.

Definition at line 36 of file CDCTriggerHoughETFModule.cc.

36 : Module()
37{
38 //Set module properties
39 setDescription("Hough tracking algorithm for CDC trigger.");
41
42 // Define module parameters
43 // 2D ETF specified parameters
44 // ----- PARAMETERS : GRL t0 finder with fastest priority timing (current at 2020.2.7)-----
45 // t0CalcMethod = 0
46 // usePriorityPosition = true
47 // arrivalOrder = 0
48 //
49 addParam("outputEventTimeName", m_EventTimeName,
50 "Name of the output StoreObjPtr.",
51 std::string(""));
52 addParam("storeTracks", m_storeTracks,
53 "store tracks",
54 false);
55 addParam("usePriorityTiming", m_usePriorityTiming,
56 "Use priority timing instead of fastest timing.",
57 true);
58 addParam("useHighPassTimingList", m_useHighPassTimingList,
59 "Use associated fastest timings track-by-track",
60 true);
61 addParam("t0CalcMethod", m_t0CalcMethod,
62 "0: Nth fastest fastest time."
63 "1: median of all timings."
64 "2: median of timings in timing window.",
65 (unsigned)(0));
66 addParam("arrivalOrder", m_arrivalOrder,
67 "When t0CalcMethod == 0: Nth fastest ft is used as T0. (i.e. 0 is fastest)",
68 (unsigned)(0));
69 addParam("timeWindowBegin", m_timeWindowBegin,
70 "When t0CalcMethod == 2: start time of time window relative to median. (in ns)",
71 (short)(40));
72 addParam("timeWindowEnd", m_timeWindowEnd,
73 "When t0CalcMethod == 2: end time of time window relative to median. (in ns)",
74 (short)(0));
75
76 //common as CDCTrigger2DFinderModule
77 addParam("hitCollectionName", m_hitCollectionName,
78 "Name of the input StoreArray of CDCTriggerSegmentHits.",
79 std::string(""));
80 addParam("outputCollectionName", m_outputCollectionName,
81 "Name of the StoreArray holding the tracks found in the Hough tracking.",
82 std::string("TRGCDCETFTracks"));
83 addParam("clusterCollectionName", m_clusterCollectionName,
84 "Name of the StoreArray holding the clusters formed in the Hough plane.",
85 std::string(""));
86 addParam("nCellsPhi", m_nCellsPhi,
87 "Number of Hough cells in phi (limits: [-180, 180]). Must be an even number.",
88 (unsigned)(160));
89 addParam("nCellsR", m_nCellsR,
90 "Number of Hough cells in 1/r. Must be an even number.",
91 (unsigned)(34));
92 addParam("minPt", m_minPt,
93 "Minimum Pt [GeV]. "
94 "Hough plane limits in 1/r are [-1/r(minPt), 1/r(minPt)]", (double)(0.3));
95 addParam("shiftPt", m_shiftPt,
96 "Shift the Hough plane by 1/4 cell size in 1/r to avoid "
97 "curvature 0 tracks (<0: shift in negative direction, "
98 "0: no shift, >0: shift in positive direction).", 0);
99
100 addParam("minHits", m_minHits,
101 "Minimum hits from different super layers required in a peak cell.",
102 (unsigned)(4));
103 addParam("minHitsShort", m_minHitsShort,
104 "Minimum hits required required in a peak cell for a short track"
105 " (must be in the first minHitsShort super layers).",
106 (unsigned)(4));
107 addParam("minCells", m_minCells,
108 "Peaks with less than mim_nCells connected cells are ignored.",
109 (unsigned)(2));
110 addParam("onlyLocalMax", m_onlyLocalMax,
111 "Switch to remove cells connected to a cell with higher super layer count.",
112 false);
113 addParam("connect", m_connect,
114 "Definition for connected cells. 4: direct (left/right/top/bottom), "
115 "6: direct + 2 diagonal (top right/bottom left), "
116 "8: direct + all diagonal (top right/top left/bottom right/bottom left)",
117 (unsigned)(6));
118 addParam("ignore2ndPriority", m_ignore2nd,
119 "Switch to skip second priority hits.", false);
120 addParam("usePriorityPosition", m_usePriority,
121 "If true, use wire position of priority cell in track segment, "
122 "otherwise use wire position of center cell.", true);
123 addParam("requireSL0", m_requireSL0,
124 "Switch to check separately for a hit in the innermost superlayer.", false);
125 addParam("storeHoughPlane", m_storePlane,
126 "Switch for saving Hough plane as TMatrix in DataStore. "
127 "0: don't store anything, 1: store only peaks, 2: store full plane "
128 "(will increase runtime).", (unsigned)(0));
129 addParam("clusterPattern", m_clusterPattern,
130 "use nested pattern algorithm to find clusters", true);
131 addParam("clusterSizeX", m_clusterSizeX,
132 "maximum number of 2 x 2 squares in cluster for pattern algorithm",
133 (unsigned)(3));
134 addParam("clusterSizeY", m_clusterSizeY,
135 "maximum number of 2 x 2 squares in cluster for pattern algorithm",
136 (unsigned)(3));
137 addParam("hitRelationsFromCorners", m_hitRelationsFromCorners,
138 "Switch for creating relations to hits in the pattern algorithm. "
139 "If true, create relations from cluster corners, otherwise "
140 "from estimated cluster center (might not have relations).", false);
141
142 addParam("testFilename", m_testFilename,
143 "If not empty, a file with input (hits) and output (tracks) "
144 "for each event is written (for firmware debugging).", std::string(""));
145
146 addParam("suppressClone", m_suppressClone,
147 "Switch to send only the first found track and suppress the "
148 "subsequent clones.", false);
149
150 addParam("offset", m_offset,
151 "Set certain time offset for ETFHough simulation"
152 "Default as -10", -10);
153}
std::string m_EventTimeName
Name of the StoreObject containing the trigger event time.
std::string m_testFilename
filename for test output for firmware debugging
bool m_useHighPassTimingList
Use associated fastest timings track-by-track.
unsigned m_minCells
minimum number of cells in a cluster to form a track
unsigned m_minHitsShort
short tracks require hits in the first minHitsShort super layers to form a candidate
unsigned m_nCellsR
number of Hough cells in 1/r
int m_shiftPt
shift the Hough plane in 1/r to avoid curvature 0 tracks < 0: shift in negative direction (negative h...
std::string m_outputCollectionName
Name of the StoreArray containing the tracks found by the Hough tracking.
unsigned m_nCellsPhi
number of Hough cells in phi
bool m_usePriority
switch between priority position and center position of track segment
short m_timeWindowEnd
End time of time window relative to median.
bool m_clusterPattern
switch for clustering algorithm (if true use nested patterns)
bool m_hitRelationsFromCorners
switch for creating relations to hits in the pattern clustering algorithm.
unsigned m_storePlane
switch to save the Hough plane in DataStore (0: don't save, 1: save only peaks, 2: save full plane)
bool m_ignore2nd
switch to skip second priority hits
unsigned m_connect
number of neighbors to check for connection (4: direct, 6: direct + upper right and lower left corner...
bool m_suppressClone
switch to send only the first found track and suppress the subsequent clones
unsigned m_t0CalcMethod
Switch method to determine the event timing.
int m_offset
offset for ETF simulation
unsigned m_arrivalOrder
arrival order of fastest timing used as t0 (effective when t0CalcMEthod == 0)
unsigned m_clusterSizeX
maximum cluster size for pattern algorithm
double m_minPt
Hough plane limit in Pt [GeV].
bool m_requireSL0
switch to check separately for a hit in the innermost super layer
short m_timeWindowBegin
Start time of time window relative to median.
unsigned m_minHits
minimum number of hits from different super layers in a Hough cell to form a candidate
std::string m_clusterCollectionName
Name of the StoreArray containing the clusters formed in the Hough plane.
bool m_storeTracks
Switch to save the 2D Hough track reconstructed in this module.
std::string m_hitCollectionName
Name of the StoreArray containing the input track segment hits.
bool m_onlyLocalMax
switch to ignore candidates connected to cells with higher super layer count
bool m_usePriorityTiming
Switch to use priority timing instead of fastest timing.
unsigned m_clusterSizeY
maximum cluster size for pattern algorithm
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
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition Module.h:560

Member Function Documentation

◆ addNeighbors()

void addNeighbors ( const CDCTriggerHoughCand & center,
const std::vector< CDCTriggerHoughCand > & candidates,
std::vector< CDCTriggerHoughCand > & merged,
std::vector< CDCTriggerHoughCand > & rejected,
unsigned short nSLmax ) const

Recursive function to add combine connected cells.

All candidates are compared to center. Connected candidates are added to the merged list. If the module option onlyLocalMax is on, connected cells with SLcount lower than the cluster maximum are added to the rejected list instead. The function is called recursively for all connected candidates.

Parameters
centerstarting candidate
candidateslist of candidates compared to center
mergedlist for storing all candidates belonging to the cluster
rejectedlist for storing rejected candidates (connected, but lower SLcount, not in any other cluster either)
nSLmaxhighest SLcount for this cluster

Definition at line 297 of file CDCTriggerHoughtrafoForETF.cc.

302{
303 for (unsigned icand = 0; icand < candidates.size(); ++icand) {
304 B2DEBUG(120, "compare center " << center.getID()
305 << " to " << candidates[icand].getID());
306 if (inList(candidates[icand], merged) || inList(candidates[icand], rejected)) {
307 B2DEBUG(120, " " << candidates[icand].getID() << " already in list");
308 continue;
309 }
310 bool reject = inList(center, rejected);
311 if (connected(center, candidates[icand])) {
312 if (m_onlyLocalMax && candidates[icand].getSLcount() < nSLmax) {
313 B2DEBUG(100, " lower than highest SLcount, rejected");
314 rejected.push_back(candidates[icand]);
315 } else if (m_onlyLocalMax && !reject && candidates[icand].getSLcount() > nSLmax) {
316 B2DEBUG(100, " new highest SLcount, clearing list");
317 nSLmax = candidates[icand].getSLcount();
318 for (unsigned imerged = 0; imerged < merged.size(); ++imerged) {
319 rejected.push_back(merged[imerged]);
320 }
321 merged.clear();
322 merged.push_back(candidates[icand]);
323 } else if (m_onlyLocalMax && candidates[icand].getSLcount() > center.getSLcount()) {
324 B2DEBUG(100, " connected to rejected cell, skip");
325 continue;
326 } else if (m_onlyLocalMax && reject) {
327 B2DEBUG(100, " connected to rejected cell, rejected");
328 rejected.push_back(candidates[icand]);
329 } else {
330 B2DEBUG(100, " connected");
331 merged.push_back(candidates[icand]);
332 }
333 std::vector<CDCTriggerHoughCand> cpyCand = candidates;
334 cpyCand.erase(cpyCand.begin() + icand);
335 addNeighbors(candidates[icand], cpyCand, merged, rejected, nSLmax);
336 }
337 }
338}
unsigned getID() const
Get candidate number.
unsigned short getSLcount() const
Get super layer count.
bool inList(const CDCTriggerHoughCand &a, const std::vector< CDCTriggerHoughCand > &list) const
Check if candidate is in list.
bool connected(const CDCTriggerHoughCand &a, const CDCTriggerHoughCand &b) const
Check if candidates are connected.
void addNeighbors(const CDCTriggerHoughCand &center, const std::vector< CDCTriggerHoughCand > &candidates, std::vector< CDCTriggerHoughCand > &merged, std::vector< CDCTriggerHoughCand > &rejected, unsigned short nSLmax) const
Recursive function to add combine connected cells.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
Definition calibTools.h:60

◆ beginRun()

virtual void beginRun ( void )
inlinevirtualinherited

Called when entering a new run.

Called at the beginning of each run, the method gives you the chance to change run dependent constants like alignment parameters, etc.

This method can be implemented by subclasses.

Reimplemented in AnalysisPhase1StudyModule, ARICHBackgroundModule, arichBtestModule, ARICHDigitizerModule, ARICHDQMModule, ARICHRateCalModule, ARICHReconstructorModule, AWESOMEBasicModule, B2BIIConvertBeamParamsModule, B2BIIConvertMdstModule, B2BIIFixMdstModule, B2BIIMCParticlesMonitorModule, B2BIIMdstInputModule, BeamabortModule, BeamabortStudyModule, BeamDigitizerModule, BeamBkgHitRateMonitorModule, BeamBkgNeutronModule, BeamSpotMonitorModule, BelleMCOutputModule, BgoDigitizerModule, BgoModule, BgoStudyModule, BGOverlayInputModule, BKLMDigitAnalyzerModule, BKLMSimHistogrammerModule, BKLMTrackingModule, CalibrationCollectorModule, CATFinderModule, CaveModule, CDCCosmicAnalysisModule, CDCPackerModule, CDCUnpackerModule, CDCDedxDQMModule, CDCDedxValidationModule, cdcDQM7Module, CDCDQMModule, CDCTrigger2DFinderModule, CDCTriggerNDFinderModule, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CDCTriggerTSFModule, CDCTriggerUnpackerModule, CertifyParallelModule, ChargedPidMVAModule, ChargedPidMVAMulticlassModule, ClawDigitizerModule, ClawModule, ClawStudyModule, ClawsDigitizerModule, CLAWSModule, ClawsStudyModule, Convert2RawDetModule, CreateFieldMapModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, CurlTaggerModule, DAQMonitorModule, DelayDQMModule, DeSerializerPXDModule, DetectorOccupanciesDQMModule, DosiDigitizerModule, DosiModule, DosiStudyModule, DQMHistAnalysisARICHModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEcmsMonObjModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisEpicsOutputModule, DQMHistAnalysisEventT0EfficiencyModule, DQMHistAnalysisEventT0TriggerJitterModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisExampleModule, DQMHistAnalysisHLTModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputRootFileModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLM2Module, DQMHistAnalysisKLMModule, DQMHistAnalysisKLMMonObjModule, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisPeakModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDBowModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDCMModule, DQMHistAnalysisPXDDAQModule, DQMHistAnalysisPXDEffModule, DQMHistAnalysisPXDERModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisPXDInjectionModule, DQMHistAnalysisPXDReductionModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisRunNrModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDDoseModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTrackingAbortModule, DQMHistAnalysisTrackingHLTModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGGDLModule, DQMHistAnalysisTRGModule, DQMHistAutoCanvasModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DQMHistInjectionModule, DqmHistoManagerModule, DQMHistoModuleBase, DQMHistOutputToEPICSModule, DQMHistReferenceModule, DQMHistSnapshotsModule, Ds2RawFileModule, Ds2RawModule, Ds2RbufModule, Ds2SampleModule, ECLDQMInjectionModule, EclBackgroundStudyModule, ECLChargedPIDModule, ECLChargedPIDMVAModule, ECLClusterPSDModule, ECLCovarianceMatrixModule, ECLCRFinderModule, ECLDigitCalibratorModule, ECLDigitizerModule, EclDisplayModule, ECLDQMConnectedRegionsModule, ECLDQMEXTENDEDModule, ECLDQMModule, ECLDQMOutOfTimeDigitsModule, ECLExpertModule, ECLFinalizerModule, ECLLocalMaximumFinderModule, ECLLocalRunCalibratorModule, ECLPackerModule, ECLShowerCorrectorModule, ECLShowerShapeModule, ECLSplitterN1Module, ECLSplitterN2Module, ECLUnpackerModule, ECLWaveformFitModule, EffPlotsModule, ElapsedTimeModule, EnergyBiasCorrectionModule, EventInfoPrinterModule, EventLimiterModule, EventsOfDoomBusterModule, EventT0DQMModule, EventT0ValidationModule, EvReductionModule, EvtGenDecayModule, EvtGenInputModule, ExportGeometryModule, ExtModule, FANGSDigitizerModule, FANGSModule, FANGSStudyModule, FastRbuf2DsModule, FlippedRecoTracksMergerModule, FlipQualityModule, TRGGDLUnpackerModule, GearboxModule, GetEventFromSocketModule, GRLNeuroModule, He3DigitizerModule, He3tubeModule, He3tubeStudyModule, HistoManagerModule, HLTDQM2ZMQModule, IoVDependentConditionModule, IPDQMModule, KinkFinderModule, KKGenInputModule, KLMDigitizerModule, KLMDigitTimeShifterModule, KLMDQM2Module, KLMDQMModule, KLMEventT0EstimatorModule, KLMExpertModule, KLMMuonIDDNNExpertModule, KLMPackerModule, KLMReconstructorModule, KLMTrackingModule, KLMTriggerModule, KLMUnpackerModule, LowEnergyPi0IdentificationExpertModule, LowEnergyPi0VetoExpertModule, MaterialScanModule, MCMatcherTRGECLModule, MCTrackCandClassifierModule, MicrotpcModule, MicrotpcStudyModule, TpcDigitizerModule, MonitorDataModule, MuidModule, MVAExpertModule, MVAMultipleExpertsModule, MVAPrototypeModule, NtuplePhase1_v6Module, OverrideGenerationFlagsModule, PartialSeqRootReaderModule, ParticleVertexFitterModule, Ph1bpipeModule, Ph1sustrModule, PhotonEfficiencySystematicsModule, PhysicsObjectsDQMModule, PhysicsObjectsMiraBelleBhabhaModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, PhysicsObjectsMiraBelleEcmsBBModule, PhysicsObjectsMiraBelleHadronModule, PhysicsObjectsMiraBelleModule, PhysicsObjectsMiraBelleTauModule, PinDigitizerModule, PindiodeModule, PindiodeStudyModule, PlumeDigitizerModule, PlumeModule, ProgressModule, PXDBgTupleProducerModule, PXDClusterizerModule, PXDDAQDQMModule, PXDDigitizerModule, PXDGatedDHCDQMModule, PXDGatedModeDQMModule, PXDInjectionDQMModule, PXDMCBgTupleProducerModule, PXDPackerModule, PXDRawDQMChipsModule, PXDRawDQMModule, PXDROIDQMModule, PXDUnpackerModule, PXDclusterFilterModule, PXDdigiFilterModule, PXDDQMBowingModule, PXDDQMClustersModule, PXDDQMCorrModule, PXDDQMEfficiencyModule, PXDDQMEfficiencySelftrackModule, PXDDQMExpressRecoModule, PXDPerformanceModule, PXDRawDQMCorrModule, PXDROIFinderAnalysisModule, PXDROIFinderModule, PXDTrackClusterDQMModule, PyModule, QcsmonitorDigitizerModule, QcsmonitorModule, QcsmonitorStudyModule, QualityEstimatorVXDModule, RandomBarrierModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, ReceiveEventModule, RecoTracksReverterModule, ReprocessorModule, RxSocketModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, SegmentNetworkProducerModule, SeqRootInputModule, SeqRootMergerModule, SeqRootOutputModule, SerializerModule, SoftwareTriggerHLTDQMModule, SoftwareTriggerModule, StatisticsTimingHLTDQMModule, SPTCmomentumSeedRetrieverModule, SPTCvirtualIPRemoverModule, SrsensorModule, StatisticsSummaryModule, StorageDeserializerModule, StorageSerializerModule, SubEventModule, SVDClusterizerModule, SVDDigitizerModule, SVDDQMDoseModule, SVDDQMInjectionModule, SVDMissingAPVsClusterCreatorModule, SVDPackerModule, SVDRecoDigitCreatorModule, SVDUnpackerModule, SVDB4CommissioningPlotsModule, SVDClusterCalibrationsMonitorModule, SVDClusterEvaluationModule, SVDDataFormatCheckModule, SVDDQMClustersOnTrackModule, SVDDQMExpressRecoModule, SVDDQMHitTimeModule, svdDumpModule, SVDEventInfoSetterModule, SVDEventT0EstimatorModule, SVDHotStripFinderModule, SVDLatencyCalibrationModule, SVDLocalCalibrationsCheckModule, SVDLocalCalibrationsMonitorModule, SVDMaxStripTTreeModule, SVDOccupancyAnalysisModule, SVDPerformanceModule, SVDPerformanceTTreeModule, SVDPositionErrorScaleFactorImporterModule, SVDROIFinderAnalysisModule, SVDROIFinderModule, SVDSpacePointCreatorModule, SVDTimeCalibrationsMonitorModule, SVDTimeGroupingModule, SVDUnpackerDQMModule, SwitchDataStoreModule, ToCDCCKFModule, TOPBackgroundModule, TOPBunchFinderModule, TOPChannelMaskerModule, TOPDigitizerModule, TOPDoublePulseGeneratorModule, TOPDQMModule, TOPModuleT0CalibratorModule, TOPRawDigitConverterModule, TOPTimeRecalibratorModule, TOPUnpackerModule, TrackAnaModule, TrackCreatorModule, TrackFinderMCTruthRecoTracksModule, TrackFinderVXDBasicPathFinderModule, TrackFinderVXDCellOMatModule, TrackingAbortDQMModule, TrackingEnergyLossCorrectionModule, TrackingMomentumScaleFactorsModule, TrackingPerformanceEvaluationModule, FindletModule< AFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< AxialTrackFinderLegendre >, FindletModule< CDCHitsRemover >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< FacetCreator >, FindletModule< FacetCreator >, FindletModule< HitBasedT0Extractor >, FindletModule< HitBasedT0Extractor >, FindletModule< HitReclaimer >, FindletModule< HitReclaimer >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackExporter >, FindletModule< TrackFinder >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackLinker >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< TrackRejecter >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, FindletModule< WireHitPreparer >, TrackQualityEstimatorMVAModule, TreeFitterModule, TRGCDCETFUnpackerModule, TRGCDCModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSStreamModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLEventTimingDQMModule, TRGECLFAMModule, TRGECLModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLModule, TRGGDLSummaryModule, TRGGRLDQMModule, TRGGRLInjectionVetoFromOverlayModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLUnpackerModule, TRGRAWDATAModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TTDDQMModule, TxModule, TxSocketModule, V0findingPerformanceEvaluationModule, V0ObjectsDQMModule, VXDMisalignmentModule, vxdDigitMaskingModule, VXDDQMExpressRecoModule, VXDQETrainingDataCollectorModule, VXDQualityEstimatorMVAModule, and VXDSimpleClusterizerModule.

Definition at line 147 of file Module.h.

147{};

◆ bottomLeftCorner()

unsigned bottomLeftCorner ( unsigned pattern)

Find the bottom left corner within 2 x 2 square.

In case of ambiguity left corner is returned. x . -> return this one . x @ return index of corner within pattern

Definition at line 825 of file CDCTriggerHoughtrafoForETF.cc.

826{
827 // scan pattern from left to right:
828 // 2 3
829 // 0 1
830 if (pattern & 1) return 0;
831 if ((pattern >> 2) & 1) {
832 if ((pattern >> 1) & 1) {
833 setReturnValue(false);
834 B2DEBUG(100, "bottomLeftCorner not unique");
835 }
836 return 2;
837 }
838 if ((pattern >> 1) & 1) return 1;
839 return 3;
840}
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition Module.cc:220

◆ calcEventTiming()

int calcEventTiming ( )

Definition at line 900 of file CDCTriggerHoughtrafoForETF.cc.

901{
902 std::vector<int> ftlists;
904 ftlists = highPassTimingList();
905 } else {
906 ftlists = sectorTimingList();
907 }
908
909 if (m_t0CalcMethod == 0) {
910 std::sort(ftlists.begin(), ftlists.end());
911 return ftlists[m_arrivalOrder];
912 } else if (m_t0CalcMethod == 1) {
913 return median(ftlists);
914 } else {
915 return medianInTimeWindow(ftlists);
916 }
917}

◆ 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:363
const std::string & getName() const
Returns the name of the module.
Definition Module.h:187
const std::string & getType() const
Returns the type of the module (i.e.
Definition Module.cc:41
unsigned int m_propertyFlags
The properties of the module as bitwise or (with |) of EModulePropFlags.
Definition Module.h:512
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition Module.h:516
void setName(const std::string &name)
Set the name of the module.
Definition Module.h:214
LogConfig m_logConfig
The log system configuration of the module.
Definition Module.h:514
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition Module.h:521
std::string m_package
Package this module is found in (may be empty).
Definition Module.h:510
std::shared_ptr< Module > ModulePtr
Defines a pointer to a module object as a boost shared pointer.
Definition Module.h:43

◆ connected()

bool connected ( const CDCTriggerHoughCand & a,
const CDCTriggerHoughCand & b ) const

Check if candidates are connected.

Definition at line 351 of file CDCTriggerHoughtrafoForETF.cc.

353{
354 double ax1 = a.getCoord().first.X();
355 double ax2 = a.getCoord().second.X();
356 double ay1 = a.getCoord().first.Y();
357 double ay2 = a.getCoord().second.Y();
358 double bx1 = b.getCoord().first.X();
359 double bx2 = b.getCoord().second.X();
360 double by1 = b.getCoord().first.Y();
361 double by2 = b.getCoord().second.Y();
362 // direct neighbors
363 bool direct = ((ax2 == bx1 && ay1 == by1) || // right
364 (ax1 == bx2 && ay1 == by1) || // left
365 (ax1 == bx1 && ay2 == by1) || // above
366 (ax1 == bx1 && ay1 == by2) || // below
367 (ax1 + 2. * M_PI == bx2 && ay1 == by1) ||
368 (ax2 == bx1 + 2. * M_PI && ay1 == by1));
369 // diagonal connections
370 bool diagRise = ((ax2 == bx1 && ay2 == by1) || // right above
371 (ax1 == bx2 && ay1 == by2) || // left below
372 (ax1 + 2. * M_PI == bx2 && ay1 == by2) ||
373 (ax2 == bx1 + 2. * M_PI && ay2 == by1));
374 bool diagFall = ((ax1 == bx2 && ay2 == by1) || // left above
375 (ax2 == bx1 && ay1 == by2) || // right below
376 (ax2 == bx1 + 2. * M_PI && ay1 == by2) ||
377 (ax1 + 2. * M_PI == bx2 && ay2 == by1));
378 if (m_connect == 4) return direct;
379 else if (m_connect == 6) return (direct || diagRise);
380 else if (m_connect == 8) return (direct || diagRise || diagFall);
381 else B2WARNING("Unknown option for connect " << m_connect << ", using default.");
382 return (direct || diagRise);
383}

◆ connectedDiag()

bool connectedDiag ( unsigned patternLD,
unsigned patternRU )

Check for diagonal connected of patterns in 2 x 2 squares.

Definition at line 764 of file CDCTriggerHoughtrafoForETF.cc.

765{
766 if (m_connect == 4) return false;
767
768 // connected if
769 // . .
770 // x .
771 // . x
772 // . .
773 return (((patternRU >> 0) & 1) && ((patternLD >> 3) & 1));
774}

◆ connectedLR()

bool connectedLR ( unsigned patternL,
unsigned patternR )

Check for left/right connection of patterns in 2 x 2 squares.

Definition at line 707 of file CDCTriggerHoughtrafoForETF.cc.

708{
709 // connected if
710 // . x | x . or . . | . .
711 // . . | . . . x | x .
712 bool connectDirect = (((patternL >> 3) & 1) && ((patternR >> 2) & 1)) ||
713 (((patternL >> 1) & 1) && ((patternR >> 0) & 1));
714 // connected if
715 // . . | x .
716 // . x | . .
717 bool connectRise = ((patternL >> 1) & 1) && ((patternR >> 2) & 1);
718 // connected if
719 // . x | . .
720 // . . | x .
721 bool connectFall = ((patternL >> 3) & 1) && ((patternR >> 0) & 1);
722
723 if (m_connect == 4) return connectDirect;
724 else if (m_connect == 6) return (connectDirect || connectRise);
725 else if (m_connect == 8) return (connectDirect || connectRise || connectFall);
726 else B2WARNING("Unknown option for connect " << m_connect << ", using default.");
727 return (connectDirect || connectRise);
728}

◆ connectedRegions()

void connectedRegions ( )

Combine Hough candidates to tracks by merging connected cells.

The track coordinate is the center of gravity of the resulting cell cluster.

Definition at line 180 of file CDCTriggerHoughtrafoForETF.cc.

181{
182 std::vector<std::vector<CDCTriggerHoughCand>> regions;
183 std::vector<CDCTriggerHoughCand> cpyCand = m_houghCand;
184
185 // debug: print candidate list
186 B2DEBUG(50, "m_houghCand number " << cpyCand.size());
187 for (unsigned icand = 0; icand < m_houghCand.size(); ++icand) {
188 Coord2dPair coord = m_houghCand[icand].getCoord();
189 B2DEBUG(100, m_houghCand[icand].getID()
190 << " nSL " << m_houghCand[icand].getSLcount()
191 << " x1 " << coord.first.X() << " x2 " << coord.second.X()
192 << " y1 " << coord.first.Y() << " y2 " << coord.second.Y());
193 }
194
195 regions.reserve(cpyCand.size());
196 // combine connected cells to regions
197 while (cpyCand.size() > 0) {
198 B2DEBUG(100, "make new region");
199 std::vector<CDCTriggerHoughCand> region;
200 std::vector<CDCTriggerHoughCand> rejected;
201 region.reserve(cpyCand.size());
202 rejected.reserve(cpyCand.size());
203 CDCTriggerHoughCand start = cpyCand[0];
204 cpyCand.erase(cpyCand.begin());
205 region.push_back(start);
206 addNeighbors(start, cpyCand, region, rejected, start.getSLcount());
207 regions.push_back(region);
208 for (auto cand = cpyCand.begin(); cand != cpyCand.end();) {
209 if (inList(*cand, region) || inList(*cand, rejected))
210 cpyCand.erase(cand);
211 else
212 ++cand;
213 }
214 }
215
216 std::vector<ROOT::Math::XYVector> cellIds = {};
217
218 // find center of gravity for each region
219 for (unsigned ir = 0; ir < regions.size(); ++ir) {
220 B2DEBUG(50, "region " << ir << " (" << regions[ir].size() << " cells).");
221 // skip regions with size below cut
222 if (regions[ir].size() < m_minCells) {
223 B2DEBUG(50, "Skipping region with " << regions[ir].size() << " cells.");
224 continue;
225 }
226 double xfirst = regions[ir][0].getCoord().first.X();
227 double x = 0;
228 double y = 0;
229 int n = 0;
230 std::vector<unsigned> mergedList;
231 int xmin = m_nCellsPhi;
232 int xmax = 0;
233 int ymin = m_nCellsR;
234 int ymax = 0;
235 cellIds.clear();
236 cellIds.reserve(regions[ir].size());
237 for (unsigned ir2 = 0; ir2 < regions[ir].size(); ++ir2) {
238 Coord2dPair hc = regions[ir][ir2].getCoord();
239 B2DEBUG(100, " " << regions[ir][ir2].getID()
240 << " nSL " << regions[ir][ir2].getSLcount()
241 << " x1 " << hc.first.X() << " x2 " << hc.second.X()
242 << " y1 " << hc.first.Y() << " y2 " << hc.second.Y());
243 int ix = floor((hc.first.X() + M_PI) / 2. / M_PI * m_nCellsPhi + 0.5);
244 int iy = floor((hc.first.Y() + m_maxR - m_shiftR) / 2. / m_maxR * m_nCellsR + 0.5);
245 x += (hc.first.X() + hc.second.X());
246 if (xfirst - hc.first.X() > M_PI) {
247 x += 4 * M_PI;
248 ix += m_nCellsPhi;
249 } else if (hc.first.X() - xfirst > M_PI) {
250 x -= 4 * M_PI;
251 ix -= m_nCellsPhi;
252 }
253 y += (hc.first.Y() + hc.second.Y());
254 n += 1;
255 std::vector<unsigned> idList = regions[ir][ir2].getIdList();
256 mergeIdList(mergedList, mergedList, idList);
257 xmin = std::min(xmin, ix);
258 xmax = std::max(xmax, ix);
259 ymin = std::min(ymin, iy);
260 ymax = std::max(ymax, iy);
261 cellIds.push_back(ROOT::Math::XYVector(ix, iy));
262 }
263 x *= 0.5 / n;
264 if (x > M_PI)
265 x -= 2 * M_PI;
266 else if (x <= -M_PI)
267 x += 2 * M_PI;
268 y *= 0.5 / n;
269 B2DEBUG(50, "x " << x << " y " << y);
270
271 // select 1 hit per super layer
272 std::vector<unsigned> selectedList = {};
273 std::vector<unsigned> unselectedList = {};
274 selectHits(mergedList, selectedList, unselectedList);
275
276 // save track
277 const CDCTriggerTrack* track =
278 m_tracks.appendNew(x, 2. * y, 0.);
279 // relations to selected hits
280 for (unsigned i = 0; i < selectedList.size(); ++i) {
281 unsigned its = selectedList[i];
282 if (m_storeTracks) track->addRelationTo(m_segmentHits[its]);
283 }
284 // relations to additional hits get a negative weight
285 for (unsigned i = 0; i < unselectedList.size(); ++i) {
286 unsigned its = unselectedList[i];
287 if (m_storeTracks) track->addRelationTo(m_segmentHits[its], -1.);
288 }
289 // save detail information about the cluster
290 const CDCTriggerHoughCluster* cluster =
291 m_clusters.appendNew(xmin, xmax, ymin, ymax, cellIds);
292 if (m_storeTracks) track->addRelationTo(cluster);
293 }
294}
double m_shiftR
Hough plane shift in 1/r [1/cm].
StoreArray< CDCTriggerSegmentHit > m_segmentHits
list of track segment hits
std::vector< CDCTriggerHoughCand > m_houghCand
Hough Candidates.
void selectHits(std::vector< unsigned > &list, std::vector< unsigned > &selected, std::vector< unsigned > &unselected)
Select one hit per super layer.
StoreArray< CDCTriggerTrack > m_tracks
list of found tracks
void mergeIdList(std::vector< unsigned > &merged, std::vector< unsigned > &a, std::vector< unsigned > &b)
Merge lists a and b and put the result in merged.
StoreArray< CDCTriggerHoughCluster > m_clusters
list of clusters in the Hough map
double m_maxR
Hough plane limit in 1/r [1/cm].
std::pair< ROOT::Math::XYVector, ROOT::Math::XYVector > Coord2dPair
Hough Tuples.

◆ connectedUD()

bool connectedUD ( unsigned patternD,
unsigned patternU )

Check for up/down connection of patterns in 2 x 2 squares.

Definition at line 731 of file CDCTriggerHoughtrafoForETF.cc.

732{
733 // connected if
734 // . . . .
735 // x . . x
736 // --- or ---
737 // x . . x
738 // . . . .
739 bool connectDirect = (((patternU >> 0) & 1) && ((patternD >> 2) & 1)) ||
740 (((patternU >> 1) & 1) && ((patternD >> 3) & 1));
741 // connected if
742 // . .
743 // . x
744 // ---
745 // x .
746 // . .
747 bool connectRise = ((patternU >> 1) & 1) && ((patternD >> 2) & 1);
748 // connected if
749 // . .
750 // x .
751 // ---
752 // . x
753 // . .
754 bool connectFall = ((patternU >> 0) & 1) && ((patternD >> 3) & 1);
755
756 if (m_connect == 4) return connectDirect;
757 else if (m_connect == 6) return (connectDirect || connectRise);
758 else if (m_connect == 8) return (connectDirect || connectRise || connectFall);
759 else B2WARNING("Unknown option for connect " << m_connect << ", using default.");
760 return (connectDirect || connectRise);
761}

◆ def_beginRun()

virtual void def_beginRun ( )
inlineprotectedvirtualinherited

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

Reimplemented in PyModule.

Definition at line 426 of file Module.h.

426{ beginRun(); }

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

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

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

Reimplemented in PyModule.

Definition at line 439 of file Module.h.

439{ endRun(); }

◆ def_event()

virtual void def_event ( )
inlineprotectedvirtualinherited

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

Reimplemented in PyModule.

Definition at line 432 of file Module.h.

432{ event(); }

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

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

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

Reimplemented in PyModule.

Definition at line 420 of file Module.h.

420{ initialize(); }

◆ def_terminate()

virtual void def_terminate ( )
inlineprotectedvirtualinherited

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

Reimplemented in PyModule.

Definition at line 445 of file Module.h.

445{ terminate(); }

◆ endRun()

virtual void endRun ( void )
inlinevirtualinherited

This method is called if the current run ends.

Use this method to store information, which should be aggregated over one run.

This method can be implemented by subclasses.

Reimplemented in AlignDQMModule, AnalysisPhase1StudyModule, arichBtestModule, ARICHDQMModule, AWESOMEBasicModule, B2BIIConvertMdstModule, B2BIIMCParticlesMonitorModule, B2BIIMdstInputModule, BeamabortModule, BeamabortStudyModule, BeamDigitizerModule, BeamBkgHitRateMonitorModule, BelleMCOutputModule, BgoDigitizerModule, BgoModule, BgoStudyModule, BKLMDigitAnalyzerModule, BKLMTrackingModule, CalibrationCollectorModule, CaveModule, CDCPackerModule, CDCUnpackerModule, CDCDedxDQMModule, CDCDedxValidationModule, CDCDQMModule, CDCTriggerNDFinderModule, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CertifyParallelModule, ClawDigitizerModule, ClawModule, ClawStudyModule, ClawsDigitizerModule, CLAWSModule, ClawsStudyModule, Convert2RawDetModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, DeSerializerPXDModule, DosiDigitizerModule, DosiModule, DosiStudyModule, DQMHistAnalysisARICHModule, DQMHistAnalysisARICHMonObjModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLOutOfTimeDigitsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEcmsMonObjModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisEpicsOutputModule, DQMHistAnalysisEventT0TriggerJitterModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisExampleModule, DQMHistAnalysisHLTMonObjModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLM2Module, DQMHistAnalysisKLMModule, DQMHistAnalysisKLMMonObjModule, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisMonObjModule, DQMHistAnalysisOutputFileModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDDoseModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGEFFModule, DQMHistAnalysisTRGGDLModule, DQMHistAnalysisTRGModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DqmHistoManagerModule, DQMHistOutputToEPICSModule, DQMHistSnapshotsModule, Ds2RawFileModule, Ds2RawModule, Ds2RbufModule, Ds2SampleModule, ECLBackgroundModule, ECLCovarianceMatrixModule, ECLCRFinderModule, ECLFinalizerModule, ECLHitDebugModule, ECLLocalMaximumFinderModule, ECLLocalRunCalibratorModule, ECLShowerCorrectorModule, ECLSplitterN2Module, EffPlotsModule, ElapsedTimeModule, EventInfoPrinterModule, EventT0ValidationModule, EvReductionModule, EvtGenDecayModule, ExtModule, FANGSDigitizerModule, FANGSModule, FANGSStudyModule, FastRbuf2DsModule, TRGGDLUnpackerModule, GenfitVisModule, GetEventFromSocketModule, He3DigitizerModule, He3tubeModule, He3tubeStudyModule, HistoManagerModule, HitXPModule, HLTDQM2ZMQModule, HLTDs2ZMQModule, KLMDigitizerModule, KLMTrackingModule, KLMTriggerModule, MCMatcherTRGECLModule, MCTrackCandClassifierModule, MicrotpcModule, MicrotpcStudyModule, TpcDigitizerModule, TPCStudyModule, MonitorDataModule, MuidModule, NoKickCutsEvalModule, NtuplePhase1_v6Module, OverrideGenerationFlagsModule, PartialSeqRootReaderModule, Ph1bpipeModule, Ph1sustrModule, PinDigitizerModule, PindiodeModule, PindiodeStudyModule, PlumeDigitizerModule, PlumeModule, PrintDataModule, PrintEventRateModule, PXDROIFinderModule, PyModule, QcsmonitorDigitizerModule, QcsmonitorModule, QcsmonitorStudyModule, RandomBarrierModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, ReceiveEventModule, ReprocessorModule, Root2BinaryModule, Root2RawModule, RT2SPTCConverterModule, RxSocketModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, SectorMapBootstrapModule, SeqRootInputModule, SeqRootMergerModule, SeqRootOutputModule, SerializerModule, SPTCmomentumSeedRetrieverModule, SPTCvirtualIPRemoverModule, SrsensorModule, StatisticsSummaryModule, StorageDeserializerModule, StorageRootOutputModule, StorageSerializerModule, SubEventModule, SVDClusterizerModule, SVDRecoDigitCreatorModule, SVDUnpackerModule, SVDB4CommissioningPlotsModule, SVDClusterCalibrationsMonitorModule, SVDClusterEvaluationModule, SVDClusterEvaluationTrueInfoModule, SVDDataFormatCheckModule, svdDumpModule, SVDHotStripFinderModule, SVDLatencyCalibrationModule, SVDLocalCalibrationsMonitorModule, SVDOccupancyAnalysisModule, SVDPerformanceModule, SVDPositionErrorScaleFactorImporterModule, SVDROIDQMModule, SVDROIFinderModule, SVDTimeCalibrationsMonitorModule, SVDUnpackerDQMModule, SwitchDataStoreModule, TOPBackgroundModule, TOPTBCComparatorModule, TOPUnpackerModule, TOPWaveformQualityPlotterModule, TrackFinderMCTruthRecoTracksModule, TrackFinderVXDAnalizerModule, TrackingPerformanceEvaluationModule, FindletModule< AFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< AxialTrackFinderLegendre >, FindletModule< CDCHitsRemover >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< FacetCreator >, FindletModule< FacetCreator >, FindletModule< HitBasedT0Extractor >, FindletModule< HitBasedT0Extractor >, FindletModule< HitReclaimer >, FindletModule< HitReclaimer >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackExporter >, FindletModule< TrackFinder >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackLinker >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< TrackRejecter >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, FindletModule< WireHitPreparer >, TrackSetEvaluatorHopfieldNNDEVModule, TRGCDCETFUnpackerModule, TRGCDCModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSStreamModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLFAMModule, TRGECLModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLModule, TRGGDLSummaryModule, TRGGRLDQMModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLUnpackerModule, TRGRAWDATAModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TxModule, TxSocketModule, V0findingPerformanceEvaluationModule, vxdDigitMaskingModule, VXDSimpleClusterizerModule, ZMQTxInputModule, and ZMQTxWorkerModule.

Definition at line 166 of file Module.h.

166{};

◆ evalCondition()

bool evalCondition ( ) const
inherited

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

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

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

Definition at line 96 of file Module.cc.

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

◆ event()

void event ( void )
overridevirtual

Run tracking.

Pair of <counter, CDCPair>, for hits with indices

Reimplemented from Module.

Definition at line 218 of file CDCTriggerHoughETFModule.cc.

219{
220 /* Clean hits */
221 m_hitMap.clear();
222 m_houghCand.clear();
224
225 if (!m_eventTime.isValid()) m_eventTime.create();
226 /* set default return value */
227 setReturnValue(true);
228
229 if (m_testFilename != "") {
231 << m_segmentHits.getEntries() << std::endl;
232 }
233
234 if (m_segmentHits.getEntries() == 0) {
235 //B2WARNING("CDCTracking: tsHitsCollection is empty!");
236 return;
237 }
238
239 /* get CDCHits coordinates in conformal space */
240 for (int iHit = 0; iHit < m_segmentHits.getEntries(); iHit++) {
241 unsigned short iSL = m_segmentHits[iHit]->getISuperLayer();
242 if (m_testFilename != "") {
243 m_testFile << iSL << " " << m_segmentHits[iHit]->getSegmentID() - m_TSoffset[iSL] << " "
244 << m_segmentHits[iHit]->getPriorityPosition() << std::endl;
245 }
246 if (iSL % 2) continue;
247 if (m_ignore2nd && m_segmentHits[iHit]->getPriorityPosition() < 3) continue;
248 double phi = m_segmentHits[iHit]->getSegmentID() - m_TSoffset[iSL];
249 if (m_usePriority) {
250 phi += 0.5 * (((m_segmentHits[iHit]->getPriorityPosition() >> 1) & 1)
251 - (m_segmentHits[iHit]->getPriorityPosition() & 1));
252 }
253 phi = phi * 2. * M_PI / (m_TSoffset[iSL + 1] - m_TSoffset[iSL]);
254 double r = m_radius[iSL][int(m_usePriority &&
255 m_segmentHits[iHit]->getPriorityPosition() < 3)];
256 ROOT::Math::XYVector pos(std::cos(phi) / r, std::sin(phi) / r);
257 m_hitMap.insert(std::make_pair(iHit, std::make_pair(iSL, pos)));
258 }
259
260 B2DEBUG(50, "extending Hough plane to " << m_maxIterations << " iterations, "
261 << m_nCells << " cells: phi in ["
262 << -m_rectX * 180. / M_PI << ", " << m_rectX * 180. / M_PI
263 << "] deg, 1/r in [" << -m_rectY + m_shiftR << ", " << m_rectY + m_shiftR << "] /cm");
264
265 /* prepare matrix for storing the Hough plane */
266 if (m_storePlane > 0) {
267 m_houghPlane.create();
269 }
270
271 // hit map containing only the early hits
272 CDCHitMap fastHitMap;
273 if (m_suppressClone && !m_hitMap.empty()) {
274 // find the first track candidates in Hough plane
275 // only for z0 resolution study with single-track events
276 // This will surely fail with multi-track ones,
277 // in which case we really need tick-by-tick simulation for all hits.
278
280 typedef std::pair<int, CDCPair> CDCHitPair;
281 // sequential hit map, ordered by TS found time
282 typedef std::vector<CDCHitPair> CDCSeqMap;
283 CDCSeqMap seqHitMap;
284 // copy hit map to sequential hit map and sort it by TS found time
285 seqHitMap.reserve(m_hitMap.size());
286 for (auto hit : m_hitMap) {
287 seqHitMap.push_back(hit);
288 }
289 sort(seqHitMap.begin(), seqHitMap.end(), [this](CDCHitPair i, CDCHitPair j) {
290 return m_segmentHits[i.first]->foundTime() < m_segmentHits[j.first]->foundTime();
291 });
292 auto seqHitItr = seqHitMap.begin();
293 /* layer filter */
294 std::vector<bool> layerHit(CDC_SUPER_LAYERS, false);
295 // data clock cycle in unit of 2ns
296 short period = 16;
297 short firstTick = m_segmentHits[(*seqHitMap.begin()).first]->foundTime() / period + 1;
298 short lastTick = m_segmentHits[(*(seqHitMap.end() - 1)).first]->foundTime() / period + 1;
299 // add TS hits in every clock cycle until a track candidate is found
300 for (auto tick = firstTick * period; tick < lastTick * period; tick += period) {
301 int nHitInCycle = 0;
302 for (auto itr = seqHitItr; itr < seqHitMap.end(); ++itr) {
303 CDCHitPair currentHit = *itr;
304 // start from the first hit over SL threshold
305 if (count(layerHit.begin(), layerHit.end(), true) >= m_minHits &&
306 m_segmentHits[currentHit.first]->foundTime() > tick) {
307 break;
308 }
309 nHitInCycle++;
310 layerHit[m_segmentHits[currentHit.first]->getISuperLayer()] = true;
311 }
312 copy_n(seqHitItr, nHitInCycle, inserter(fastHitMap, fastHitMap.end()));
313 fastInterceptFinder(fastHitMap, -m_rectX, m_rectX, -m_rectY + m_shiftR, m_rectY + m_shiftR, 0, 0, 0);
314 B2DEBUG(20, "at tick " << tick << ", number of candidates: " << m_houghCand.size());
315 if (!m_houghCand.empty()) {
316 B2DEBUG(10, "found a track at clock " << tick << " with "
317 << fastHitMap.size() << "hits");
318 break;
319 }
320 advance(seqHitItr, nHitInCycle);
321 }
322 } else {
323 /* find track candidates in Hough plane using all TS hits */
325 if (!m_houghCand.empty()) {
326 B2DEBUG(10, "found a track with " << m_hitMap.size() << "hits");
327 }
328 }
329
330 /* merge track candidates */
331 if (m_clusterPattern) {
332 if (patternClustering(fastHitMap))
333 m_eventTime->addBinnedEventT0(calcEventTiming() + m_offset, Const::CDC);
334 } else {
336 }
337
338 if (m_testFilename != "") {
339 m_testFile << m_tracks.getEntries() << std::endl;
340 for (int i = 0; i < m_tracks.getEntries(); ++i) {
341 float ix = (m_tracks[i]->getPhi0() - M_PI_4) * m_nCellsPhi / 2. / M_PI - 0.5;
342 float iy = (m_tracks[i]->getOmega() / 2. + m_maxR - m_shiftR) * m_nCellsR / 2. / m_maxR - 0.5;
343 m_testFile << round(2 * ix) / 2. << " " << round(2 * iy) / 2. << " "
344 << m_tracks[i]->getChargeSign() << std::endl;
345 RelationVector<CDCTriggerSegmentHit> hits =
346 m_tracks[i]->getRelationsTo<CDCTriggerSegmentHit>(m_hitCollectionName);
347 m_testFile << hits.size() << std::endl;
348 for (unsigned ihit = 0; ihit < hits.size(); ++ihit) {
349 unsigned short iSL = hits[ihit]->getISuperLayer();
350 m_testFile << iSL << " " << hits[ihit]->getSegmentID() - m_TSoffset[iSL] << " "
351 << hits[ihit]->getPriorityPosition() << " "
352 << hits.weight(ihit) << std::endl;
353 }
354 }
355 }
356}
unsigned m_maxIterations
number of iterations for the fast peak finder, smallest n such that 2^(n+1) > max(nCellsPhi,...
bool patternClustering(const CDCHitMap &inputMap)
Combine Hough candidates to tracks by a fixed pattern algorithm.
StoreObjPtr< TMatrix > m_houghPlane
matrix containing the Hough plane
std::vector< std::vector< CDCTriggerSegmentHit * > > m_associatedTSHitsList
list of fastest timing of TS associated with Track
std::ofstream m_testFile
filestream for test output for firmware debugging
unsigned m_nCells
number of cells for the fast peak finder: 2^(maxIterations + 1).
unsigned m_TSoffset[10]
Number of track segments up to super layer.
int fastInterceptFinder(CDCHitMap &hits, double x1_s, double x2_s, double y1_s, double y2_s, unsigned iterations, unsigned ix_s, unsigned iy_s)
Fast intercept finder Divide Hough plane recursively to find cells with enough crossing lines.
double m_radius[9][2]
Radius of the CDC layers with priority wires (2 per super layer).
StoreObjPtr< BinnedEventT0 > m_eventTime
StoreObjPtr holding the event time.
double m_rectX
Store the rectangle size in x.
double m_rectY
Store the rectangle size in y.
CDCHitMap m_hitMap
map of TS hits containing <iHit, <iSL, (x, y)>> with iHit: hit index in StoreArray iSL: super layer i...
void connectedRegions()
Combine Hough candidates to tracks by merging connected cells.
size_t size() const
Get number of relations.
float weight(int index) const
Get weight with index.
std::unordered_map< int, CDCPair > CDCHitMap
Map of <counter, CDCPair>, for hits with indices.

◆ 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.. attribute:: NOPARALLELWORK
374
375 This module does no per-event work that is worth running in parallel, for example because it only sets something up. It can still be parallel processing certified: the flag only says that a parallel section consisting of nothing but such modules is not worth creating, so it is merged back into the input path and the search for a parallel section continues after it.
376)")
377 .value("INPUT", Module::EModulePropFlags::c_Input)
378 .value("OUTPUT", Module::EModulePropFlags::c_Output)
379 .value("PARALLELPROCESSINGCERTIFIED", Module::EModulePropFlags::c_ParallelProcessingCertified)
380 .value("HISTOGRAMMANAGER", Module::EModulePropFlags::c_HistogramManager)
381 .value("INTERNALSERIALIZER", Module::EModulePropFlags::c_InternalSerializer)
382 .value("TERMINATEINALLPROCESSES", Module::EModulePropFlags::c_TerminateInAllProcesses)
383 .value("NOPARALLELWORK", Module::EModulePropFlags::c_NoParallelWork)
384 ;
385
386 //Python class definition
387 class_<Module, PyModule> module("Module", R"(
388Base class for Modules.
389
390A module is the smallest building block of the framework.
391A typical event processing chain consists of a Path containing
392modules. By inheriting from this base class, various types of
393modules can be created. To use a module, please refer to
394:func:`Path.add_module()`. A list of modules is available by running
395``basf2 -m`` or ``basf2 -m package``, detailed information on parameters is
396given by e.g. ``basf2 -m RootInput``.
397
398The 'Module Development' section in the manual provides detailed information
399on how to create modules, setting parameters, or using return values/conditions:
400https://xwiki.desy.de/xwiki/rest/p/f4fa4/#HModuleDevelopment
401
402)");
403 module
404 .def("__str__", &Module::getPathString)
405 .def("name", &Module::getName, return_value_policy<copy_const_reference>(),
406 "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.")
407 .def("type", &Module::getType, return_value_policy<copy_const_reference>(),
408 "Returns the type of the module (i.e. class name minus 'Module')")
409 .def("set_name", &Module::setName, args("name"), R"(
410Set custom name, e.g. to distinguish multiple modules of the same type.
411
412>>> path.add_module('EventInfoSetter')
413>>> ro = path.add_module('RootOutput', branchNames=['EventMetaData'])
414>>> ro.set_name('RootOutput_metadata_only')
415>>> print(path)
416[EventInfoSetter -> RootOutput_metadata_only]
417
418)")
419 .def("description", &Module::getDescription, return_value_policy<copy_const_reference>(),
420 "Returns the description of this module.")
421 .def("package", &Module::getPackage, return_value_policy<copy_const_reference>(),
422 "Returns the package this module belongs to.")
423 .def("available_params", &_getParamInfoListPython,
424 "Return list of all module parameters as `ModuleParamInfo` instances")
425 .def("has_properties", &Module::hasProperties, (bp::arg("properties")),
426 R"DOCSTRING(Allows to check if the module has the given properties out of `ModulePropFlags` set.
427
428>>> if module.has_properties(ModulePropFlags.PARALLELPROCESSINGCERTIFIED):
429>>> ...
430
431Parameters:
432 properties (int): bitmask of `ModulePropFlags` to check for.
433)DOCSTRING")
434 .def("set_property_flags", &Module::setPropertyFlags, args("property_mask"),
435 "Set module properties in the form of an OR combination of `ModulePropFlags`.");
436 {
437 // python signature is too crowded, make ourselves
438 docstring_options subOptions(true, false, false); //userdef, py sigs, c++ sigs
439 module
440 .def("if_value", &Module::if_value,
441 (bp::arg("expression"), bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
442 R"DOCSTRING(if_value(expression, condition_path, after_condition_path=AfterConditionPath.END)
443
444Sets a conditional sub path which will be executed after this
445module if the return value set in the module passes the given ``expression``.
446
447Modules can define a return value (int or bool) using ``setReturnValue()``,
448which can be used in the steering file to split the Path based on this value, for example
449
450>>> module_with_condition.if_value("<1", another_path)
451
452In case the return value of the ``module_with_condition`` for a given event is
453less than 1, the execution will be diverted into ``another_path`` for this event.
454
455You could for example set a special return value if an error occurs, and divert
456the execution into a path containing :b2:mod:`RootOutput` if it is found;
457saving only the data producing/produced by the error.
458
459After a conditional path has executed, basf2 will by default stop processing
460the path for this event. This behaviour can be changed by setting the
461``after_condition_path`` argument.
462
463Parameters:
464 expression (str): Expression to determine if the conditional path should be executed.
465 This should be one of the comparison operators ``<``, ``>``, ``<=``,
466 ``>=``, ``==``, or ``!=`` followed by a numerical value for the return value
467 condition_path (Path): path to execute in case the expression is fulfilled
468 after_condition_path (AfterConditionPath): What to do once the ``condition_path`` has been executed.
469)DOCSTRING")
470 .def("if_false", &Module::if_false,
471 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
472 R"DOC(if_false(condition_path, after_condition_path=AfterConditionPath.END)
473
474Sets a conditional sub path which will be executed after this module if
475the return value of the module evaluates to False. This is equivalent to
476calling `if_value` with ``expression=\"<1\"``)DOC")
477 .def("if_true", &Module::if_true,
478 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
479 R"DOC(if_true(condition_path, after_condition_path=AfterConditionPath.END)
480
481Sets a conditional sub path which will be executed after this module if
482the return value of the module evaluates to True. It is equivalent to
483calling `if_value` with ``expression=\">=1\"``)DOC");
484 }
485 module
486 .def("has_condition", &Module::hasCondition,
487 "Return true if a conditional path has been set for this module "
488 "using `if_value`, `if_true` or `if_false`")
489 .def("get_all_condition_paths", &_getAllConditionPathsPython,
490 "Return a list of all conditional paths set for this module using "
491 "`if_value`, `if_true` or `if_false`")
492 .def("get_all_conditions", &_getAllConditionsPython,
@ 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
@ c_HistogramManager
This module is used to manage histograms accumulated by other modules.
Definition Module.h:81
@ c_NoParallelWork
This module does no per-event work that is worth running in parallel.
Definition Module.h:85
@ 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:89

◆ fastInterceptFinder()

int fastInterceptFinder ( CDCHitMap & hits,
double x1_s,
double x2_s,
double y1_s,
double y2_s,
unsigned iterations,
unsigned ix_s,
unsigned iy_s )

Fast intercept finder Divide Hough plane recursively to find cells with enough crossing lines.

Parameters
hitsmap of hit coordinates in conformal space
x1_s,x2_s,y1_s,y2_slimits of starting rectangle
iterationscurrent iteration index
ix_s,iy_sindices of starting rectangle

Definition at line 48 of file CDCTriggerHoughtrafoForETF.cc.

53{
54 std::string indent = "";
55 for (unsigned i = 0; i < iterations; ++i) indent += " ";
56 B2DEBUG(150, indent << "intercept finder iteration " << iterations
57 << " x1 " << x1_s * 180 / M_PI << " x2 " << x2_s * 180 / M_PI
58 << " y1 " << y1_s << " y2 " << y2_s
59 << " ix " << ix_s << " iy " << iy_s);
60
61 int i, j, iHit;
62 double unitx, unity;
63 double y1, y2;
64 double m, a;
65 CDCPair hp;
66 unsigned short iSL;
67 // list of hit indices crossing the current rectangle
68 std::vector<unsigned> idx_list;
69 idx_list.reserve(hits.size());
70
71 // limits of divided rectangles
72 double x1_d, x2_d, y1_d, y2_d;
73
74 // cell indices in full plane
75 unsigned ix, iy;
76
77 unitx = ((x2_s - x1_s) / 2.0);
78 unity = ((y2_s - y1_s) / 2.0);
79
80 CDCHitMap containedHits;
81 containedHits.reserve(hits.size());
82
83 std::bitset<CDC_SUPER_LAYERS> layerHit; /* For layer filter */
84
85 // divide x axis in half
86 for (i = 0; i < 2 ; ++i) {
87 // divide y axis in half
88 for (j = 0; j < 2; ++j) {
89 x1_d = x1_s + i * unitx;
90 x2_d = x1_s + (i + 1) * unitx;
91 y1_d = y1_s + j * unity;
92 y2_d = y1_s + (j + 1) * unity;
93
94 ix = 2 * ix_s + i;
95 iy = 2 * iy_s + j;
96
97 // skip extra cells outside of the Hough plane
98 if (x2_d <= -M_PI || x1_d >= M_PI || y2_d <= -m_maxR + m_shiftR || y1_d >= m_maxR + m_shiftR) {
99 B2DEBUG(150, indent << "skip Hough cell outside of plane limits");
100 continue;
101 }
102
103 // if the cell size in phi is too large, the hit calculation is not reliable
104 // -> continue to next iteration without hit check
105 if (iterations != m_maxIterations && unitx > M_PI / 2.) {
106 fastInterceptFinder(hits, x1_d, x2_d, y1_d, y2_d, iterations + 1, ix, iy);
107 continue;
108 }
109
110 const double sin_x1d = std::sin(x1_d - 1e-10);
111 const double cos_x1d = std::cos(x1_d - 1e-10);
112 const double sin_x2d = std::sin(x2_d + 1e-10);
113 const double cos_x2d = std::cos(x2_d + 1e-10);
114
115 idx_list.clear();
116 layerHit.reset();
117 containedHits.clear();
118 for (auto it = hits.begin(); it != hits.end(); ++it) {
119 iHit = it->first;
120 hp = it->second;
121 iSL = hp.first;
122 m = hp.second.X();
123 a = hp.second.Y();
124
125 // calculate Hough curve with slightly enlarged limits to avoid errors due to rounding
126 y1 = m * sin_x1d - a * cos_x1d;
127 y2 = m * sin_x2d - a * cos_x2d;
128 // skip decreasing half of the sine (corresponds to curl back half of the track)
129 if (iterations == m_maxIterations && y1 > y2) continue;
130 if (!((y1 > y2_d && y2 > y2_d) || (y1 < y1_d && y2 < y1_d))) {
131 if (iterations == m_maxIterations) {
132 idx_list.push_back(iHit);
133 }
134 layerHit[iSL] = true; /* layer filter */
135 containedHits.insert(*it);
136 }
137 }
138 // if a hit in the first SL is required but not present, set nSL to 0, otherwise count the number of layers
139 unsigned short nSL = (m_requireSL0 && !layerHit[0]) ? 0 : layerHit.count();
140 B2DEBUG(150, indent << "i " << i << " j " << j
141 << " layerHit " << int(layerHit[0]) << int(layerHit[2])
142 << int(layerHit[4]) << int(layerHit[6]) << int(layerHit[8])
143 << " nSL " << nSL);
144 if (nSL >= m_minHits || shortTrack(layerHit)) {
145 if (iterations != m_maxIterations) {
146 fastInterceptFinder(containedHits, x1_d, x2_d, y1_d, y2_d, iterations + 1, ix, iy);
147 } else {
148 ROOT::Math::XYVector v1(x1_d, y1_d);
149 ROOT::Math::XYVector v2(x2_d, y2_d);
150 m_houghCand.push_back(CDCTriggerHoughCand(idx_list, std::make_pair(v1, v2),
151 nSL, m_houghCand.size()));
152 if (m_storePlane > 0) {
153 (*m_houghPlane)[ix - (m_nCells - m_nCellsPhi) / 2][iy - (m_nCells - m_nCellsR) / 2] = nSL;
154 }
155 }
156 } else if (m_storePlane > 1) {
157 // to store the full Hough plane, we need to continue the iteration
158 // to minimal cell size everywhere
159 for (unsigned min = m_minHits - 1; min > 0; --min) {
160 if (nSL >= min) {
161 if (iterations != m_maxIterations) {
162 fastInterceptFinder(containedHits, x1_d, x2_d, y1_d, y2_d, iterations + 1, ix, iy);
163 } else {
164 (*m_houghPlane)[ix - (m_nCells - m_nCellsPhi) / 2][iy - (m_nCells - m_nCellsR) / 2] = nSL;
165 }
166 break;
167 }
168 }
169 }
170 }
171 }
172
173 return 0;
174}
bool shortTrack(std::bitset< 9 > &superLayers)
check the short track condition (= hits in the inner super layers rather than any super layers)
std::pair< unsigned short, ROOT::Math::XYVector > CDCPair
Pair of <iSuperLayer, (x, y)>, for hits in conformal space.

◆ findAllCrossingHits()

void findAllCrossingHits ( std::vector< unsigned > & list,
double x1,
double x2,
double y1,
double y2,
const CDCHitMap & inputMap )

Find all hits in inputMap whose Hough curve crosses the rectangle with corners (x1, y1) and (x2, y2) and add the hit indices to list.

Definition at line 424 of file CDCTriggerHoughtrafoForETF.cc.

428{
429 double m, a, y1_h, y2_h;
430
431 const double sin_x1 = std::sin(x1 - 1e-10);
432 const double cos_x1 = std::cos(x1 - 1e-10);
433 const double sin_x2 = std::sin(x2 + 1e-10);
434 const double cos_x2 = std::cos(x2 + 1e-10);
435
436 std::array<double, 3> phi = {0, 0, 0};
437
438 for (int iHit = 0; iHit < m_segmentHits.getEntries(); iHit++) {
439 unsigned short iSL = m_segmentHits[iHit]->getISuperLayer();
440 if (iSL % 2) continue;
441 // associate only the hits actually used to form the cluster
442 if (m_suppressClone && inputMap.find(iHit) == inputMap.end()) continue;
443 //TODO: add options: center cell / active priority cell / all priority cells
444 phi[0] = m_segmentHits[iHit]->getSegmentID() - m_TSoffset[iSL];
445 phi[1] = phi[0] + 0.5;
446 phi[2] = phi[0] - 0.5;
447 const auto& m_radiusISL = m_radius[iSL];
448 for (unsigned i = 0; i < 3; ++i) {
449 phi[i] *= 2. * M_PI / (m_TSoffset[iSL + 1] - m_TSoffset[iSL]);
450 m = std::cos(phi[i]) / m_radiusISL[std::min(i, 1u)];
451 a = std::sin(phi[i]) / m_radiusISL[std::min(i, 1u)];
452 // calculate Hough curve with slightly enlarged limits to avoid errors due to rounding
453 y1_h = m * sin_x1 - a * cos_x1;
454 y2_h = m * sin_x2 - a * cos_x2;
455 // skip decreasing half of the sine (corresponds to curl back half of the track)
456 if (y1_h > y2_h) continue;
457 if (!((y1_h > y2 && y2_h > y2) || (y1_h < y1 && y2_h < y1))) {
458 list.push_back(iHit);
459 break;
460 }
461 }
462 }
463}

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 133 of file Module.cc.

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

◆ getAllConditionPaths()

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

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

Definition at line 150 of file Module.cc.

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

◆ getAllConditions()

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

Return all set conditions for this module.

Definition at line 324 of file Module.h.

325 {
326 return m_conditions;
327 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

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

Definition at line 314 of file Module.h.

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

◆ getConditionPath()

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

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

Definition at line 113 of file Module.cc.

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

◆ getDescription()

const std::string & getDescription ( ) const
inlineinherited

Returns the description of the module.

Definition at line 202 of file Module.h.

202{return m_description;}

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

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

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 225 of file Module.h.

225{return m_logConfig;}

◆ getModules()

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

no submodules, return empty list

Implements PathElement.

Definition at line 506 of file Module.h.

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

◆ getName()

const std::string & getName ( ) const
inlineinherited

Returns the name of the module.

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

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

Definition at line 187 of file Module.h.

187{return m_name;}

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 197 of file Module.h.

197{return m_package;}

◆ getParamInfoListPython()

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

Returns a python list of all parameters.

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

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

Definition at line 279 of file Module.cc.

280{
282}
std::shared_ptr< boost::python::list > getParamInfoListPython() const
Returns a python list of all parameters.

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 363 of file Module.h.

363{ return m_moduleParamList; }

◆ getPathString()

std::string getPathString ( ) const
overrideprivatevirtualinherited

return the module name.

Implements PathElement.

Definition at line 192 of file Module.cc.

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

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 381 of file Module.h.

381{ return m_returnValue; }

◆ getSector()

int getSector ( int id,
int sl )

Definition at line 857 of file CDCTriggerHoughtrafoForETF.cc.

858{
859 unsigned int localid = id - m_TSoffset[sl];
860 unsigned int base = m_NTS[sl] / m_NSEC[sl];
861 return localid / base + m_NSecOffset[sl];
862}
int m_NSecOffset[9]
Number of sector offset of each super layer.
const int m_NTS[9]
Number of track segments in each super layers.
const int m_NSEC[9]
Number of sector in each super layer.

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 41 of file Module.cc.

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

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

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

Definition at line 311 of file Module.h.

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

◆ hasProperties()

bool hasProperties ( unsigned int propertyFlags) const
inherited

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

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

Definition at line 160 of file Module.cc.

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

◆ hasReturnValue()

bool hasReturnValue ( ) const
inlineinherited

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

Definition at line 378 of file Module.h.

378{ return m_hasReturnValue; }

◆ hasUnsetForcedParams()

bool hasUnsetForcedParams ( ) const
inherited

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

Definition at line 166 of file Module.cc.

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

◆ highPassTimingList()

std::vector< int > highPassTimingList ( )

Definition at line 842 of file CDCTriggerHoughtrafoForETF.cc.

843{
844 std::vector<int> ftlists;
845
846 for (long unsigned int iTrack = 0; iTrack < m_associatedTSHitsList.size(); iTrack++) {
847 for (long unsigned int iHit = 0; iHit < m_associatedTSHitsList[iTrack].size(); iHit++) {
848 short ft = (!m_usePriorityTiming) ? m_associatedTSHitsList[iTrack][iHit]->fastestTime()
849 : m_associatedTSHitsList[iTrack][iHit]->priorityTime();
850 ftlists.push_back(ft * 2);
851 }
852 }
853 return ftlists;
854}

◆ if_false()

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

A simplified version to add a condition to the module.

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

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

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

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

Definition at line 85 of file Module.cc.

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

◆ if_true()

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

A simplified version to set the condition of the module.

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

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

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

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

Definition at line 90 of file Module.cc.

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

◆ if_value()

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

Add a condition to the module.

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

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

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

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

Definition at line 79 of file Module.cc.

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

◆ initialize()

void initialize ( void )
overridevirtual

Initialize the module and check module parameters.

Reimplemented from Module.

Definition at line 156 of file CDCTriggerHoughETFModule.cc.

157{
158 // register DataStore elements
159 m_eventTime.registerInDataStore(m_EventTimeName);
161
162 if (m_storeTracks) {
163 m_tracks.registerInDataStore(m_outputCollectionName);
164 m_clusters.registerInDataStore(m_clusterCollectionName);
165
166 m_tracks.registerRelationTo(m_segmentHits);
167 m_tracks.registerRelationTo(m_clusters);
168 }
169
170 if (m_storePlane > 0) m_houghPlane.registerInDataStore("HoughPlane");
171
172 const CDCGeometryPar& cdc = CDCGeometryPar::Instance();
173 int layerId = 3;
174 int nTS = 0;
175 for (int iSL = 0; iSL < 9; ++iSL) {
176 m_TSoffset[iSL] = nTS;
177 nTS += cdc.nWiresInLayer(layerId);
178 m_TSoffset[iSL + 1] = nTS;
179 for (int priority = 0; priority < 2; ++ priority) {
180 m_radius[iSL][priority] = cdc.senseWireR(layerId + priority);
181 }
182 layerId += (iSL > 0 ? 6 : 7);
183 }
184
185 for (int sl = 1; sl < 9; sl++) {
186 m_NSecOffset[sl] = m_NSEC[sl - 1] + m_NSecOffset[sl - 1];
187 }
188
189 if (m_testFilename != "") {
191 }
192
193 if (m_suppressClone) {
194 B2INFO("2D finder will exit with the first track candidate in time.");
195 }
196
197 if (m_t0CalcMethod != 0 && m_t0CalcMethod != 1) B2WARNING("t0CalcMethod is invalid. calculate as default.");
198
199 /* Extent the Hough plane such that the cell number is a power of 2 (same for x and y).
200 * This is for the fast peak finder, which divides the Hough plane in half in each step.
201 * Peaks found outside of the actual limits are ignored. */
202 m_maxIterations = std::ceil(std::log2(std::max(m_nCellsPhi, m_nCellsR))) - 1;
203 m_nCells = std::pow(2, m_maxIterations + 1);
204 /* limits in phi: [-pi, pi] + extra cells */
205 m_rectX = M_PI * m_nCells / m_nCellsPhi;
206 /* limits in R: [-R(minPt), R(minPt)] + extra cells + shift */
207 m_maxR = 0.5 * Const::speedOfLight * 1.5e-4 / m_minPt;
209 m_shiftR = 0;
210 if (m_shiftPt < 0) {
211 m_shiftR = -m_maxR / 2. / m_nCellsR;
212 } else if (m_shiftPt > 0) {
213 m_shiftR = m_maxR / 2. / m_nCellsR;
214 }
215}
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
static const double speedOfLight
[cm/ns]
Definition Const.h:696

◆ inList()

bool inList ( const CDCTriggerHoughCand & a,
const std::vector< CDCTriggerHoughCand > & list ) const

Check if candidate is in list.

Definition at line 341 of file CDCTriggerHoughtrafoForETF.cc.

343{
344 for (unsigned i = 0; i < list.size(); ++i) {
345 if (a == list[i]) return true;
346 }
347 return false;
348}

◆ median()

int median ( std::vector< int > v)

Definition at line 920 of file CDCTriggerHoughtrafoForETF.cc.

921{
922 int size = v.size();
923 std::vector<int> _v;
924 copy(v.begin(), v.end(), back_inserter(_v));
925 std::sort(_v.begin(), _v.end());
926 if (size % 2) {
927 return _v[(size - 1) / 2];
928 } else {
929 return (_v[(size / 2) - 1] + _v[size / 2]) / 2;
930 }
931}

◆ medianInTimeWindow()

int medianInTimeWindow ( std::vector< int > v)

Definition at line 934 of file CDCTriggerHoughtrafoForETF.cc.

935{
936 int med = median(v);
937 int tbegin = med - abs(m_timeWindowBegin);
938 int tend = med + abs(m_timeWindowEnd);
939
940 std::vector<int> _inWindow;
941
942 for (auto& t : v) if (t > tbegin && t < tend) _inWindow.push_back(t);
943
944 if (_inWindow.size()) {
945 return median(_inWindow);
946 } else {
947 return med;
948 }
949}

◆ mergeIdList()

void mergeIdList ( std::vector< unsigned > & merged,
std::vector< unsigned > & a,
std::vector< unsigned > & b )

Merge lists a and b and put the result in merged.

Definition at line 389 of file CDCTriggerHoughtrafoForETF.cc.

392{
393 bool found;
394
395 merged.reserve(a.size() + b.size());
396 for (auto it = a.begin(); it != a.end(); ++it) {
397 found = false;
398 for (auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
399 if (*it_in == *it) {
400 found = true;
401 break;
402 }
403 }
404 if (!found) {
405 merged.push_back(*it);
406 }
407 }
408
409 for (auto it = b.begin(); it != b.end(); ++it) {
410 found = false;
411 for (auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
412 if (*it_in == *it) {
413 found = true;
414 break;
415 }
416 }
417 if (!found) {
418 merged.push_back(*it);
419 }
420 }
421}

◆ patternClustering()

bool patternClustering ( const CDCHitMap & inputMap)

Combine Hough candidates to tracks by a fixed pattern algorithm.

The Hough plane is first divided in 2 x 2 squares, then squares are combined.

Definition at line 503 of file CDCTriggerHoughtrafoForETF.cc.

504{
505 bool foundTrack = false;
506 std::vector<CDCTriggerSegmentHit*> associatedTSHits;
507
508 // fill a matrix of 2 x 2 squares
509 TMatrix plane2(m_nCellsPhi / 2, m_nCellsR / 2);
510 TMatrix planeIcand(m_nCellsPhi, m_nCellsR);
511 for (unsigned icand = 0; icand < m_houghCand.size(); ++icand) {
512 double x = (m_houghCand[icand].getCoord().first.X() +
513 m_houghCand[icand].getCoord().second.X()) / 2.;
514 unsigned ix = floor((x + M_PI) / 2. / M_PI * m_nCellsPhi);
515 double y = (m_houghCand[icand].getCoord().first.Y() +
516 m_houghCand[icand].getCoord().second.Y()) / 2.;
517 unsigned iy = floor((y + m_maxR - m_shiftR) / 2. / m_maxR * m_nCellsR);
518 plane2[ix / 2][iy / 2] += 1 << ((ix % 2) + 2 * (iy % 2));
519 planeIcand[ix][iy] = icand;
520 B2DEBUG(100, "candidate " << icand << " at ix " << ix << " iy " << iy);
521 }
522 // look for clusters of 2 x 2 squares in a (rX x rY) region
523 unsigned nX = m_nCellsPhi / 2;
524 unsigned nY = m_nCellsR / 2;
525 unsigned rX = m_clusterSizeX;
526 unsigned rY = m_clusterSizeY;
527 std::vector<unsigned> pattern(rX * rY, 0);
528 std::vector<ROOT::Math::XYVector> cellIds;
529 cellIds.reserve(rX * rY);
530 for (unsigned ix = 0; ix < nX; ++ix) {
531 for (unsigned iy = 0; iy < nY; ++iy) {
532 if (!plane2[ix][iy]) continue;
533 // check if we are in a lower left corner
534 unsigned ileft = (ix - 1 + nX) % nX;
535 B2DEBUG(100, "ix " << ix << " iy " << iy);
536 if (connectedLR(plane2[ileft][iy], plane2[ix][iy]) ||
537 (iy > 0 && connectedUD(plane2[ix][iy - 1], plane2[ix][iy])) ||
538 (iy > 0 && connectedDiag(plane2[ileft][iy - 1], plane2[ix][iy]))) {
539 B2DEBUG(100, "skip connected square");
540 continue;
541 }
542 // form cluster
543 pattern.assign(rX * rY, 0); // reset pattern to 0
544 pattern[0] = plane2[ix][iy];
545 cellIds.clear();
546 cellIds[0] = {ROOT::Math::XYVector(2 * ix, 2 * iy)};
547 for (unsigned ix2 = 0; ix2 < rX; ++ix2) {
548 for (unsigned iy2 = 0; iy2 < rY; ++iy2) {
549 if (iy + iy2 >= nY) continue;
550 unsigned ip = ix2 + rX * iy2;
551 unsigned iright = (ix + ix2 + nX) % nX;
552 ileft = (iright - 1 + nX) % nX;
553 B2DEBUG(100, "ix2 " << ix2 << " ileft " << ileft << " iright " << iright);
554 if ((ix2 > 0 && // check left/right connection
555 pattern[ip - 1] &&
556 connectedLR(plane2[ileft][iy + iy2], plane2[iright][iy + iy2])) ||
557 (iy2 > 0 && // check up/down connection
558 pattern[ip - rX] &&
559 connectedUD(plane2[iright][iy + iy2 - 1], plane2[iright][iy + iy2])) ||
560 (ix2 > 0 && iy2 > 0 && // check diagonal connection
561 pattern[ip - rX - 1] &&
562 connectedDiag(plane2[ileft][iy + iy2 - 1], plane2[iright][iy + iy2]))) {
563 pattern[ip] = plane2[iright][iy + iy2];
564 B2DEBUG(100, "connect cell " << iright << " " << iy + iy2);
565 cellIds.push_back(ROOT::Math::XYVector(2 * (ix + ix2), 2 * (iy + iy2)));
566 }
567 }
568 }
569 B2DEBUG(100, "cluster starting at " << ix << " " << iy);
570 // check if cluster continues beyond defined area
571 bool overflowRight = false;
572 bool overflowTop = false;
573 for (unsigned iy2 = 0; iy2 < rY; ++iy2) {
574 unsigned ip = rX - 1 + rX * iy2;
575 if (!pattern[ip]) continue;
576 unsigned iright = (ix + rX + nX) % nX;
577 ileft = (iright - 1 + nX) % nX;
578 if (connectedLR(plane2[ileft][iy + iy2], plane2[iright][iy + iy2]) ||
579 ((iy + iy2 + 1 < nY) &&
580 connectedDiag(plane2[ileft][iy + iy2], plane2[iright][iy + iy2 + 1]))) {
581 setReturnValue(false);
582 overflowRight = true;
583 }
584 }
585 if (iy + rY < nY) {
586 for (unsigned ix2 = 0; ix2 < rX; ++ix2) {
587 unsigned ip = ix2 + rX * (rY - 1);
588 if (!pattern[ip]) continue;
589 unsigned iright = (ix + ix2 + 1 + nX) % nX;
590 ileft = (iright - 1 + nX) % nX;
591 if (connectedUD(plane2[ileft][iy + rY - 1], plane2[ileft][iy + rY]) ||
592 connectedDiag(plane2[ileft][iy + rY - 1], plane2[iright][iy + rY])) {
593 setReturnValue(false);
594 overflowTop = true;
595 }
596 }
597 }
598 if (overflowRight && !overflowTop) {
599 B2DEBUG(100, "cluster extends right of " << rX << " x " << rY << " area");
600 } else if (overflowTop && !overflowRight) {
601 B2DEBUG(100, "cluster extends above " << rX << " x " << rY << " area");
602 } else if (overflowRight && overflowTop) {
603 B2DEBUG(100, "cluster extends right and above " << rX << " x " << rY << " area");
604 }
605 // find corners of cluster
606 unsigned topRight2 = topRightSquare(pattern);
607 unsigned topRight = topRightCorner(pattern[topRight2]);
608 unsigned bottomLeft = bottomLeftCorner(pattern[0]);
609 B2DEBUG(100, "topRight2 " << topRight2 << " topRight " << topRight << " bottomLeft " << bottomLeft);
610 // average over corners to find cluster center
611 unsigned ixTR = 2 * (topRight2 % m_clusterSizeX) + (topRight % 2);
612 unsigned ixBL = bottomLeft % 2;
613 unsigned iyTR = 2 * (topRight2 / m_clusterSizeX) + (topRight / 2);
614 unsigned iyBL = bottomLeft / 2;
615 B2DEBUG(100, "ixTR " << ixTR << " ixBL " << ixBL << " iyTR " << iyTR << " iyBL " << iyBL);
616 // skip size 1 clusters
617 if (m_minCells > 1 && ixTR == ixBL && iyTR == iyBL) {
618 B2DEBUG(100, "skipping cluster of size 1");
619 continue;
620 }
621 float centerX = 2 * ix + (ixTR + ixBL) / 2.;
622 if (centerX >= m_nCellsPhi) centerX -= m_nCellsPhi;
623 float centerY = 2 * iy + (iyTR + iyBL) / 2.;
624 B2DEBUG(100, "center at cell (" << centerX << ", " << centerY << ")");
625 // convert to coordinates
626 double x = -M_PI + (centerX + 0.5) * 2. * M_PI / m_nCellsPhi;
627 double y = -m_maxR + m_shiftR + (centerY + 0.5) * 2. * m_maxR / m_nCellsR;
628 B2DEBUG(100, "center coordinates (" << x << ", " << y << ")");
629 // get list of related hits
630 std::vector <unsigned> idList = {};
632 unsigned icandTR = planeIcand[(ixTR + 2 * ix) % m_nCellsPhi][iyTR + 2 * iy];
633 unsigned icandBL = planeIcand[ixBL + 2 * ix][iyBL + 2 * iy];
634 std::vector<unsigned> candIdListTR = m_houghCand[icandTR].getIdList();
635 std::vector<unsigned> candIdListBL = m_houghCand[icandBL].getIdList();
636 mergeIdList(idList, candIdListTR, candIdListBL);
637 B2DEBUG(100, "merge id lists from candidates " << icandTR << " and " << icandBL);
638 } else {
639 double dx = M_PI / m_nCellsPhi;
640 double dy = m_maxR / m_nCellsR;
641 double x1 = (round(centerX) == centerX) ? x - dx : x - 2 * dx;
642 double x2 = (round(centerX) == centerX) ? x + dx : x + 2 * dx;
643 double y1 = (round(centerY) == centerY) ? y - dy : y - 2 * dy;
644 double y2 = (round(centerY) == centerY) ? y + dy : y + 2 * dy;
645 findAllCrossingHits(idList, x1, x2, y1, y2, inputMap);
646 }
647 if (idList.size() == 0) {
648 setReturnValue(false);
649 B2DEBUG(100, "id list empty");
650 }
651
652 foundTrack = true;
653
654 // select 1 hit per super layer
655 std::vector<unsigned> selectedList = {};
656 std::vector<unsigned> unselectedList = {};
657 selectHits(idList, selectedList, unselectedList);
658
659 associatedTSHits.clear();
661 for (unsigned i = 0; i < selectedList.size(); ++i)
662 associatedTSHits.push_back(m_segmentHits[selectedList[i]]);
663 m_associatedTSHitsList.push_back(associatedTSHits);
664 } else {
665 for (unsigned i = 0; i < idList.size(); ++i)
666 associatedTSHits.push_back(m_segmentHits[idList[i]]);
667 m_associatedTSHitsList.push_back(associatedTSHits);
668 }
669
670 // save track
671 if (m_storeTracks) {
672 const CDCTriggerTrack* track =
673 m_tracks.appendNew(x, 2. * y, 0.);
675 // relations to selected hits
676 for (unsigned i = 0; i < selectedList.size(); ++i) {
677 unsigned its = selectedList[i];
678 track->addRelationTo(m_segmentHits[its]);
679 }
680 // relations to additional hits get a negative weight
681 for (unsigned i = 0; i < unselectedList.size(); ++i) {
682 unsigned its = unselectedList[i];
683 track->addRelationTo(m_segmentHits[its], -1.);
684 }
685 } else {
686 for (unsigned i = 0; i < idList.size(); ++i) {
687 unsigned its = idList[i];
688 track->addRelationTo(m_segmentHits[its], -1.);
689 }
690 }
691 // save detail information about the cluster
692 const CDCTriggerHoughCluster* cluster =
693 m_clusters.appendNew(2 * ix, 2 * (ix + m_clusterSizeX) - 1,
694 2 * iy, 2 * (iy + m_clusterSizeY) - 1,
695 cellIds);
696 track->addRelationTo(cluster);
697 }
698 }
699 }
700 return foundTrack;
701}
void findAllCrossingHits(std::vector< unsigned > &list, double x1, double x2, double y1, double y2, const CDCHitMap &inputMap)
Find all hits in inputMap whose Hough curve crosses the rectangle with corners (x1,...
bool connectedLR(unsigned patternL, unsigned patternR)
Check for left/right connection of patterns in 2 x 2 squares.
unsigned topRightCorner(unsigned pattern)
Find the top right corner within 2 x 2 square.
bool connectedUD(unsigned patternD, unsigned patternU)
Check for up/down connection of patterns in 2 x 2 squares.
unsigned bottomLeftCorner(unsigned pattern)
Find the bottom left corner within 2 x 2 square.
bool connectedDiag(unsigned patternLD, unsigned patternRU)
Check for diagonal connected of patterns in 2 x 2 squares.
unsigned topRightSquare(std::vector< unsigned > &pattern)
Find the top right square within a cluster of 2 x 2 squares In case of ambiguity, top is favored over...

◆ sectorTimingList()

std::vector< int > sectorTimingList ( )

Definition at line 865 of file CDCTriggerHoughtrafoForETF.cc.

866{
867 std::vector<int> ftlists;
868 std::array<std::vector<std::pair<int, int>>, CDC_ETF_SECTOR> arr_sector;
869
870 // distribute into each sector
871 for (long unsigned int iTrack = 0; iTrack < m_associatedTSHitsList.size(); iTrack++) {
872 for (long unsigned int iHit = 0; iHit < m_associatedTSHitsList[iTrack].size(); iHit++) {
873 int sl = m_associatedTSHitsList[iTrack][iHit]->getISuperLayer();
874 int id = m_associatedTSHitsList[iTrack][iHit]->getSegmentID();
875 int pp = m_associatedTSHitsList[iTrack][iHit]->getPriorityPosition();
876 int ft = m_associatedTSHitsList[iTrack][iHit]->fastestTime() * 2; // 2ns -> 1ns
877
878 arr_sector [getSector(id, sl)].push_back(std::make_pair(ft, pp));
879 }
880 }
881
882 //fastest && 1st pp in each sector
883 for (int sec = 0; sec < CDC_ETF_SECTOR; sec++) {
884 if (!arr_sector[sec].size()) continue;
885 int minft = 1e9;
886 int pp = 0;
887 for (auto& ift : arr_sector[sec]) {
888 if ((minft > ift.first) && (pp <= ift.second)) {
889 minft = ift.first;
890 pp = ift.second;
891 }
892 }
893 ftlists.push_back(minft);
894 }
895
896 return ftlists;
897}

◆ selectHits()

void selectHits ( std::vector< unsigned > & list,
std::vector< unsigned > & selected,
std::vector< unsigned > & unselected )

Select one hit per super layer.

Parameters
listinput list of hit Ids
selectedselected hit Ids are added to selected
unselectedthe rest of the hit Ids are added to unselected

Definition at line 469 of file CDCTriggerHoughtrafoForETF.cc.

472{
473 std::vector<int> bestPerSL(5, -1);
474 for (unsigned i = 0; i < list.size(); ++i) {
475 unsigned iax = m_segmentHits[list[i]]->getISuperLayer() / 2;
476 bool firstPriority = (m_segmentHits[list[i]]->getPriorityPosition() == 3);
477 if (bestPerSL[iax] < 0) {
478 bestPerSL[iax] = i;
479 } else {
480 unsigned itsBest = list[bestPerSL[iax]];
481 bool firstBest = (m_segmentHits[itsBest]->getPriorityPosition() == 3);
482 // selection rules:
483 // first priority, higher ID
484 if ((firstPriority && !firstBest) ||
485 (firstPriority == firstBest &&
486 m_segmentHits[list[i]]->getSegmentID() > m_segmentHits[itsBest]->getSegmentID())) {
487 bestPerSL[iax] = i;
488 }
489 }
490 }
491
492 for (unsigned i = 0; i < list.size(); ++i) {
493 unsigned iax = m_segmentHits[list[i]]->getISuperLayer() / 2;
494 if (int(i) == bestPerSL[iax]) selected.push_back(list[i]);
495 else unselected.push_back(list[i]);
496 }
497}

◆ 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:511

◆ setLogConfig()

void setLogConfig ( const LogConfig & logConfig)
inlineinherited

Set the log system configuration.

Definition at line 230 of file Module.h.

230{m_logConfig = logConfig;}

◆ setLogInfo()

void setLogInfo ( int logLevel,
unsigned int logInfo )
inherited

Configure the printed log information for the given level.

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

Definition at line 73 of file Module.cc.

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

◆ setLogLevel()

void setLogLevel ( int logLevel)
inherited

Configure the log level.

Definition at line 55 of file Module.cc.

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

◆ setName()

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

Set the name of the module.

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

Definition at line 214 of file Module.h.

214{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList & params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 501 of file Module.h.

501{ m_moduleParamList = params; }

◆ setParamPython()

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

Implements a method for setting boost::python objects.

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

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

Definition at line 234 of file Module.cc.

235{
236 LogSystem& logSystem = LogSystem::Instance();
237 logSystem.updateModule(&(getLogConfig()), getName());
238 try {
240 } catch (std::runtime_error& e) {
241 throw std::runtime_error("Cannot set parameter '" + name + "' for module '"
242 + m_name + "': " + e.what());
243 }
244
245 logSystem.updateModule(nullptr);
246}
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:225
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition Module.h:508
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}

◆ shortTrack()

bool shortTrack ( std::bitset< 9 > & superLayers)

check the short track condition (= hits in the inner super layers rather than any super layers)

Parameters
superLayersarray of hit/no hit for all super layers

Definition at line 26 of file CDCTriggerHoughtrafoForETF.cc.

27{
28 unsigned short lcnt = 0;
29 // check axial super layers (even layer number),
30 // break at first layer without hit
31 for (int i = 0; i < CDC_SUPER_LAYERS; i += 2) {
32 if (layer[i] == true) ++lcnt;
33 else break;
34 }
35 return (lcnt >= m_minHitsShort);
36}

◆ terminate()

void terminate ( void )
overridevirtual

Clean up.

Reimplemented from Module.

Definition at line 359 of file CDCTriggerHoughETFModule.cc.

360{
361 if (m_testFilename != "") m_testFile.close();
362}

◆ topRightCorner()

unsigned topRightCorner ( unsigned pattern)

Find the top right corner within 2 x 2 square.

In case of ambiguity right corner is returned. x . . x -> return this one @ return index of corner within pattern

Definition at line 807 of file CDCTriggerHoughtrafoForETF.cc.

808{
809 // scan pattern from right to left:
810 // 2 3
811 // 0 1
812 if ((pattern >> 3) & 1) return 3;
813 if ((pattern >> 1) & 1) {
814 if ((pattern >> 2) & 1) {
815 setReturnValue(false);
816 B2DEBUG(100, "topRightCorner not unique");
817 }
818 return 1;
819 }
820 if ((pattern >> 2) & 1) return 2;
821 return 0;
822}

◆ topRightSquare()

unsigned topRightSquare ( std::vector< unsigned > & pattern)

Find the top right square within a cluster of 2 x 2 squares In case of ambiguity, top is favored over right @ return index of corner within pattern vector.

Definition at line 777 of file CDCTriggerHoughtrafoForETF.cc.

778{
779 // scan from top right corner until an active square is found
780 for (unsigned index = pattern.size() - 1; index > 0; --index) {
781 if (!pattern[index]) continue;
782 // check for ambiguity
783 unsigned ix = index % m_clusterSizeX;
784 unsigned iy = index / m_clusterSizeX;
785 if (ix < m_clusterSizeX - 1 && iy > 0) {
786 bool unique = true;
787 for (unsigned index2 = index - 1; index2 > 0; --index2) {
788 if (!pattern[index2]) continue;
789 unsigned ix2 = index2 % m_clusterSizeX;
790 unsigned iy2 = index2 / m_clusterSizeX;
791 if (iy2 < iy && ix2 > ix) {
792 unique = false;
793 break;
794 }
795 }
796 if (!unique) {
797 setReturnValue(false);
798 B2DEBUG(100, "topRightSquare not unique");
799 }
800 }
801 return index;
802 }
803 return 0;
804}

Member Data Documentation

◆ m_arrivalOrder

unsigned m_arrivalOrder
protected

arrival order of fastest timing used as t0 (effective when t0CalcMEthod == 0)

Definition at line 205 of file CDCTriggerHoughETFModule.h.

◆ m_associatedTSHitsList

std::vector<std::vector<CDCTriggerSegmentHit*> > m_associatedTSHitsList
protected

list of fastest timing of TS associated with Track

Definition at line 196 of file CDCTriggerHoughETFModule.h.

◆ m_clusterCollectionName

std::string m_clusterCollectionName
protected

Name of the StoreArray containing the clusters formed in the Hough plane.

Definition at line 219 of file CDCTriggerHoughETFModule.h.

◆ m_clusterPattern

bool m_clusterPattern
protected

switch for clustering algorithm (if true use nested patterns)

Definition at line 274 of file CDCTriggerHoughETFModule.h.

◆ m_clusters

StoreArray<CDCTriggerHoughCluster> m_clusters
protected

list of clusters in the Hough map

Definition at line 320 of file CDCTriggerHoughETFModule.h.

◆ m_clusterSizeX

unsigned m_clusterSizeX
protected

maximum cluster size for pattern algorithm

Definition at line 276 of file CDCTriggerHoughETFModule.h.

◆ m_clusterSizeY

unsigned m_clusterSizeY
protected

maximum cluster size for pattern algorithm

Definition at line 278 of file CDCTriggerHoughETFModule.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 521 of file Module.h.

◆ m_connect

unsigned m_connect
protected

number of neighbors to check for connection (4: direct, 6: direct + upper right and lower left corner, 8: direct + all corners)

Definition at line 259 of file CDCTriggerHoughETFModule.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 511 of file Module.h.

◆ m_eventTime

StoreObjPtr<BinnedEventT0> m_eventTime
protected

StoreObjPtr holding the event time.

Definition at line 188 of file CDCTriggerHoughETFModule.h.

◆ m_EventTimeName

std::string m_EventTimeName
protected

Name of the StoreObject containing the trigger event time.

Definition at line 190 of file CDCTriggerHoughETFModule.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 518 of file Module.h.

◆ m_hitCollectionName

std::string m_hitCollectionName
protected

Name of the StoreArray containing the input track segment hits.

Definition at line 215 of file CDCTriggerHoughETFModule.h.

◆ m_hitMap

CDCHitMap m_hitMap
protected

map of TS hits containing <iHit, <iSL, (x, y)>> with iHit: hit index in StoreArray iSL: super layer index

(x, y): coordinates in conformal space

Definition at line 300 of file CDCTriggerHoughETFModule.h.

◆ m_hitRelationsFromCorners

bool m_hitRelationsFromCorners
protected

switch for creating relations to hits in the pattern clustering algorithm.

true: create relations for all hits passing through the corners of a cluster, false: create relations for all hits passing though the estimated center of the cluster (can be 0 hits if center is not part of the cluster)

Definition at line 285 of file CDCTriggerHoughETFModule.h.

◆ m_hits

StoreArray<CDCTriggerSegmentHit> m_hits
protected

list of input track segment hits

Definition at line 194 of file CDCTriggerHoughETFModule.h.

◆ m_houghCand

std::vector<CDCTriggerHoughCand> m_houghCand
protected

Hough Candidates.

Definition at line 302 of file CDCTriggerHoughETFModule.h.

◆ m_houghPlane

StoreObjPtr<TMatrix> m_houghPlane
protected

matrix containing the Hough plane

Definition at line 322 of file CDCTriggerHoughETFModule.h.

◆ m_ignore2nd

bool m_ignore2nd
protected

switch to skip second priority hits

Definition at line 261 of file CDCTriggerHoughETFModule.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 514 of file Module.h.

◆ m_maxIterations

unsigned m_maxIterations = 0
protected

number of iterations for the fast peak finder, smallest n such that 2^(n+1) > max(nCellsPhi, nCellsR).

Initialized at 0 by the SW shifter

Definition at line 237 of file CDCTriggerHoughETFModule.h.

◆ m_maxR

double m_maxR = 0.
protected

Hough plane limit in 1/r [1/cm].

Initialized at 0 by the SW shifter

Definition at line 232 of file CDCTriggerHoughETFModule.h.

◆ m_minCells

unsigned m_minCells
protected

minimum number of cells in a cluster to form a track

Definition at line 253 of file CDCTriggerHoughETFModule.h.

◆ m_minHits

unsigned m_minHits
protected

minimum number of hits from different super layers in a Hough cell to form a candidate

Definition at line 248 of file CDCTriggerHoughETFModule.h.

◆ m_minHitsShort

unsigned m_minHitsShort
protected

short tracks require hits in the first minHitsShort super layers to form a candidate

Definition at line 251 of file CDCTriggerHoughETFModule.h.

◆ m_minPt

double m_minPt
protected

Hough plane limit in Pt [GeV].

Definition at line 225 of file CDCTriggerHoughETFModule.h.

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 516 of file Module.h.

◆ m_name

std::string m_name
privateinherited

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

Definition at line 508 of file Module.h.

◆ m_nCells

unsigned m_nCells = 0
protected

number of cells for the fast peak finder: 2^(maxIterations + 1).

Initialized at 0 by the SW shifter

Definition at line 239 of file CDCTriggerHoughETFModule.h.

◆ m_nCellsPhi

unsigned m_nCellsPhi
protected

number of Hough cells in phi

Definition at line 221 of file CDCTriggerHoughETFModule.h.

◆ m_nCellsR

unsigned m_nCellsR
protected

number of Hough cells in 1/r

Definition at line 223 of file CDCTriggerHoughETFModule.h.

◆ m_NSEC

const int m_NSEC[9] = {16, 0, 16, 0, 16, 0, 8, 0, 8}
protected

Number of sector in each super layer.

Definition at line 311 of file CDCTriggerHoughETFModule.h.

311{16, 0, 16, 0, 16, 0, 8, 0, 8};

◆ m_NSecOffset

int m_NSecOffset[9] = {0}
protected

Number of sector offset of each super layer.

Definition at line 313 of file CDCTriggerHoughETFModule.h.

313{0};

◆ m_NTS

const int m_NTS[9] = {160, 160, 192, 224, 256, 288, 320, 352, 384}
protected

Number of track segments in each super layers.

Definition at line 309 of file CDCTriggerHoughETFModule.h.

309{160, 160, 192, 224, 256, 288, 320, 352, 384};

◆ m_offset

int m_offset = 0
protected

offset for ETF simulation

Definition at line 288 of file CDCTriggerHoughETFModule.h.

◆ m_onlyLocalMax

bool m_onlyLocalMax
protected

switch to ignore candidates connected to cells with higher super layer count

Definition at line 255 of file CDCTriggerHoughETFModule.h.

◆ m_outputCollectionName

std::string m_outputCollectionName
protected

Name of the StoreArray containing the tracks found by the Hough tracking.

Definition at line 217 of file CDCTriggerHoughETFModule.h.

◆ m_package

std::string m_package
privateinherited

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

Definition at line 510 of file Module.h.

◆ m_propertyFlags

unsigned int m_propertyFlags
privateinherited

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

Definition at line 512 of file Module.h.

◆ m_radius

double m_radius[9][2] = {{0.}}
protected

Radius of the CDC layers with priority wires (2 per super layer).

Initialized at 0 by the SW shifter

Definition at line 305 of file CDCTriggerHoughETFModule.h.

305{{0.}};

◆ m_rectX

double m_rectX = 0
protected

Store the rectangle size in x.

Definition at line 242 of file CDCTriggerHoughETFModule.h.

◆ m_rectY

double m_rectY = 0
protected

Store the rectangle size in y.

Definition at line 244 of file CDCTriggerHoughETFModule.h.

◆ m_requireSL0

bool m_requireSL0
protected

switch to check separately for a hit in the innermost super layer

Definition at line 265 of file CDCTriggerHoughETFModule.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 519 of file Module.h.

◆ m_segmentHits

StoreArray<CDCTriggerSegmentHit> m_segmentHits
protected

list of track segment hits

Definition at line 316 of file CDCTriggerHoughETFModule.h.

◆ m_shiftPt

int m_shiftPt
protected

shift the Hough plane in 1/r to avoid curvature 0 tracks < 0: shift in negative direction (negative half is larger) 0: no shift (same limits for negative and positive half)

0: shift in positive direction (positive half is larger)

Definition at line 230 of file CDCTriggerHoughETFModule.h.

◆ m_shiftR

double m_shiftR = 0.
protected

Hough plane shift in 1/r [1/cm].

Initialized at 0 by the SW shifter

Definition at line 234 of file CDCTriggerHoughETFModule.h.

◆ m_storePlane

unsigned m_storePlane
protected

switch to save the Hough plane in DataStore (0: don't save, 1: save only peaks, 2: save full plane)

Definition at line 272 of file CDCTriggerHoughETFModule.h.

◆ m_storeTracks

bool m_storeTracks
protected

Switch to save the 2D Hough track reconstructed in this module.

Definition at line 192 of file CDCTriggerHoughETFModule.h.

◆ m_suppressClone

bool m_suppressClone
protected

switch to send only the first found track and suppress the subsequent clones

Definition at line 268 of file CDCTriggerHoughETFModule.h.

◆ m_t0CalcMethod

unsigned m_t0CalcMethod
protected

Switch method to determine the event timing.

Definition at line 202 of file CDCTriggerHoughETFModule.h.

◆ m_testFile

std::ofstream m_testFile
protected

filestream for test output for firmware debugging

Definition at line 293 of file CDCTriggerHoughETFModule.h.

◆ m_testFilename

std::string m_testFilename
protected

filename for test output for firmware debugging

Definition at line 291 of file CDCTriggerHoughETFModule.h.

◆ m_timeWindowBegin

short m_timeWindowBegin
protected

Start time of time window relative to median.

(in ns) (effective when t0CalcMEthod == 2)

Definition at line 208 of file CDCTriggerHoughETFModule.h.

◆ m_timeWindowEnd

short m_timeWindowEnd
protected

End time of time window relative to median.

(in ns) (effective when t0CalcMEthod == 2)

Definition at line 211 of file CDCTriggerHoughETFModule.h.

◆ m_tracks

StoreArray<CDCTriggerTrack> m_tracks
protected

list of found tracks

Definition at line 318 of file CDCTriggerHoughETFModule.h.

◆ m_TSoffset

unsigned m_TSoffset[10] = {0}
protected

Number of track segments up to super layer.

Initialized at 0 by the SW shifter

Definition at line 307 of file CDCTriggerHoughETFModule.h.

307{0};

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 509 of file Module.h.

◆ m_useHighPassTimingList

bool m_useHighPassTimingList
protected

Use associated fastest timings track-by-track.

Definition at line 200 of file CDCTriggerHoughETFModule.h.

◆ m_usePriority

bool m_usePriority
protected

switch between priority position and center position of track segment

Definition at line 263 of file CDCTriggerHoughETFModule.h.

◆ m_usePriorityTiming

bool m_usePriorityTiming
protected

Switch to use priority timing instead of fastest timing.

Definition at line 198 of file CDCTriggerHoughETFModule.h.


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