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
}
 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 (cdcMap &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.
 
unsigned short countSL (bool *superLayers)
 count the number of super layers with hits
 
bool shortTrack (bool *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 cdcMap &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 cdcMap &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.
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level.
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module.
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module.
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module.
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true.
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished.
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module.
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T >
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter.
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module.
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module.
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters.
 

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

StoreObjPtr< BinnedEventT0m_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< CDCTriggerSegmentHitm_hits
 list of input track segment hits
 
std::vector< std::vector< CDCTriggerSegmentHit * > > 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)

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


 
double maxR = 0.
 Hough plane limit in 1/r [1/cm].
 
double shiftR = 0.
 Hough plane shift in 1/r [1/cm].
 
unsigned maxIterations = 0
 number of iterations for the fast peak finder, smallest n such that 2^(n+1) > max(nCellsPhi, nCellsR).
 
unsigned nCells = 0
 number of cells for the fast peak finder: 2^(maxIterations + 1).
 
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 testFile
 filestream for test output for firmware debugging
 
cdcMap hitMap
 map of TS hits containing <iHit, <iSL, (x, y)>> with iHit: hit index in StoreArray iSL: super layer index
 
std::vector< CDCTriggerHoughCandhoughCand
 Hough Candidates.
 
double radius [9][2] = {{0.}}
 Radius of the CDC layers with priority wires (2 per super layer).
 
unsigned TSoffset [10] = {0}
 Number of track segments up to super layer.
 
const int NTS [9] = {160, 160, 192, 224, 256, 288, 320, 352, 384}
 Number of track segments in each super layers.
 
const int NSEC [9] = {16, 0, 16, 0, 16, 0, 8, 0, 8}
 Number of sector in each super layer.
 
int NSecOffset [9] = {0}
 Number of sector offset of each super layer.
 
StoreArray< CDCTriggerSegmentHitm_segmentHits
 list of track segment hits
 
StoreArray< CDCTriggerTrackm_tracks
 list of found tracks
 
StoreArray< CDCTriggerHoughClusterm_clusters
 list of clusters in the Hough map
 
StoreObjPtr< TMatrix > m_houghPlane
 matrix containing the Hough plane
 

Private Member Functions

std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects.
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary.
 

Private Attributes

std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Detailed Description

Definition at line 84 of file CDCTriggerHoughETFModule.h.

Member Typedef Documentation

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 88 of file Module.h.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

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

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

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

c_HistogramManager 

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

c_InternalSerializer 

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

c_TerminateInAllProcesses 

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

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

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 77 of file Module.h.

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

Constructor & Destructor Documentation

◆ CDCTriggerHoughETFModule()

Constructor.


Definition at line 37 of file CDCTriggerHoughETFModule.cc.

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

297{
298 for (unsigned icand = 0; icand < candidates.size(); ++icand) {
299 B2DEBUG(120, "compare center " << center.getID()
300 << " to " << candidates[icand].getID());
301 if (inList(candidates[icand], merged) || inList(candidates[icand], rejected)) {
302 B2DEBUG(120, " " << candidates[icand].getID() << " already in list");
303 continue;
304 }
305 bool reject = inList(center, rejected);
306 if (connected(center, candidates[icand])) {
307 if (m_onlyLocalMax && candidates[icand].getSLcount() < nSLmax) {
308 B2DEBUG(100, " lower than highest SLcount, rejected");
309 rejected.push_back(candidates[icand]);
310 } else if (m_onlyLocalMax && !reject && candidates[icand].getSLcount() > nSLmax) {
311 B2DEBUG(100, " new highest SLcount, clearing list");
312 nSLmax = candidates[icand].getSLcount();
313 for (unsigned imerged = 0; imerged < merged.size(); ++imerged) {
314 rejected.push_back(merged[imerged]);
315 }
316 merged.clear();
317 merged.push_back(candidates[icand]);
318 } else if (m_onlyLocalMax && candidates[icand].getSLcount() > center.getSLcount()) {
319 B2DEBUG(100, " connected to rejected cell, skip");
320 continue;
321 } else if (m_onlyLocalMax && reject) {
322 B2DEBUG(100, " connected to rejected cell, rejected");
323 rejected.push_back(candidates[icand]);
324 } else {
325 B2DEBUG(100, " connected");
326 merged.push_back(candidates[icand]);
327 }
328 vector<CDCTriggerHoughCand> cpyCand = candidates;
329 cpyCand.erase(cpyCand.begin() + icand);
330 addNeighbors(candidates[icand], cpyCand, merged, rejected, nSLmax);
331 }
332 }
333}
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 ARICHBackgroundModule, BeamabortModule, BgoModule, CaveModule, ClawModule, CLAWSModule, DosiModule, FANGSModule, He3tubeModule, MicrotpcModule, Ph1bpipeModule, Ph1sustrModule, PindiodeModule, PlumeModule, QcsmonitorModule, SrsensorModule, GetEventFromSocketModule, CalibrationCollectorModule, EventsOfDoomBusterModule, CosmicsAlignmentValidationModule, EnergyBiasCorrectionModule, ChargedPidMVAModule, ChargedPidMVAMulticlassModule, CurlTaggerModule, LowEnergyPi0IdentificationExpertModule, LowEnergyPi0VetoExpertModule, ParticleVertexFitterModule, PhotonEfficiencySystematicsModule, TagVertexModule, TreeFitterModule, arichBtestModule, ARICHDigitizerModule, ARICHDQMModule, ARICHRateCalModule, ARICHReconstructorModule, B2BIIMCParticlesMonitorModule, B2BIIConvertBeamParamsModule, B2BIIConvertMdstModule, B2BIIFixMdstModule, B2BIIMdstInputModule, BelleMCOutputModule, BeamBkgGeneratorModule, BeamBkgHitRateMonitorModule, BeamBkgMixerModule, BeamBkgTagSetterModule, BGOverlayInputModule, AnalysisPhase1StudyModule, NtuplePhase1_v6Module, ReprocessorModule, BeamabortStudyModule, BeamDigitizerModule, BgoDigitizerModule, BgoStudyModule, ClawDigitizerModule, ClawStudyModule, ClawsDigitizerModule, ClawsStudyModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, DosiDigitizerModule, DosiStudyModule, FANGSDigitizerModule, FANGSStudyModule, He3DigitizerModule, He3tubeStudyModule, MicrotpcStudyModule, TpcDigitizerModule, PinDigitizerModule, PindiodeStudyModule, PlumeDigitizerModule, QcsmonitorDigitizerModule, QcsmonitorStudyModule, CDCCosmicAnalysisModule, CDCCRTestModule, cdcDQM7Module, CDCDQMModule, CDCPackerModule, CDCRecoTrackFilterModule, CDCUnpackerModule, DAQPerfModule, RxSocketModule, TxSocketModule, DqmHistoManagerModule, MonitorDataModule, TrackAnaModule, Ds2SampleModule, ReceiveEventModule, HLTDQM2ZMQModule, ElapsedTimeModule, DeSerializerPXDModule, GenRawSendModule, SerializerModule, CertifyParallelModule, Ds2RawModule, Ds2RbufModule, EvReductionModule, FastRbuf2DsModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, Ds2RawFileModule, PartialSeqRootReaderModule, SeqRootMergerModule, StorageDeserializerModule, StorageSerializerModule, IPDQMModule, PhysicsObjectsDQMModule, PhysicsObjectsMiraBelleBhabhaModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, PhysicsObjectsMiraBelleHadronModule, PhysicsObjectsMiraBelleModule, ECLBackgroundModule, ECLChargedPIDModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, ECLChargedPIDMVAModule, ECLClusterPSDModule, ECLCovarianceMatrixModule, ECLCRFinderModule, ECLDataAnalysisModule, ECLDigitCalibratorModule, ECLDigitizerModule, ECLDigitizerPureCsIModule, EclDisplayModule, ECLDQMModule, ECLDQMConnectedRegionsModule, ECLDQMEXTENDEDModule, ECLDQMOutOfTimeDigitsModule, ECLFinalizerModule, ECLHitDebugModule, ECLLocalMaximumFinderModule, ECLLocalRunCalibratorModule, ECLLOMModule, ECLPackerModule, ECLShowerCorrectorModule, ECLShowerShapeModule, ECLSplitterN1Module, ECLSplitterN2Module, ECLUnpackerModule, ECLWaveformFitModule, HistoModule, SubEventModule, SwitchDataStoreModule, EventInfoPrinterModule, EventLimiterModule, IoVDependentConditionModule, ProgressModule, RandomBarrierModule, GearboxModule, HistoManagerModule, StatisticsSummaryModule, SeqRootInputModule, SeqRootOutputModule, RxModule, TxModule, EvtGenDecayModule, EvtGenInputModule, OverrideGenerationFlagsModule, KKGenInputModule, CreateFieldMapModule, ExportGeometryModule, SoftwareTriggerModule, SoftwareTriggerHLTDQMModule, StatisticsTimingHLTDQMModule, BKLMAnaModule, BKLMDigitAnalyzerModule, BKLMSimHistogrammerModule, BKLMTrackingModule, EKLMDataCheckerModule, KLMClusterAnaModule, KLMClusterEfficiencyModule, KLMClustersReconstructorModule, KLMDigitizerModule, KLMDigitTimeShifterModule, KLMDQMModule, KLMDQM2Module, KLMPackerModule, KLMReconstructorModule, KLMScintillatorSimulatorModule, KLMUnpackerModule, MVAExpertModule, MVAMultipleExpertsModule, MVAPrototypeModule, AWESOMEBasicModule, PXDBackgroundModule, PXDRawDQMChipsModule, PXDClustersFromTracksModule, PXDPerformanceModule, PXDClusterizerModule, Convert2RawDetModule, CDCDedxDQMModule, CDCDedxValidationModule, EventT0DQMModule, EventT0ValidationModule, DataWriterModule, ECLExpertModule, KLMExpertModule, KlongValidationModule, KLMMuonIDDNNExpertModule, FullSimModule, MaterialScanModule, SVDBackgroundModule, SVDClusterCalibrationsMonitorModule, SVDHotStripFinderModule, SVDLatencyCalibrationModule, SVDLocalCalibrationsCheckModule, SVDLocalCalibrationsMonitorModule, SVDPositionErrorScaleFactorImporterModule, SVDTimeCalibrationsMonitorModule, SVDDQMHitTimeModule, svdDumpModule, SVDPackerModule, SVDB4CommissioningPlotsModule, SVDClusterEvaluationModule, SVDClusterEvaluationTrueInfoModule, SVDClusterFilterModule, SVDMaxStripTTreeModule, SVDOccupancyAnalysisModule, SVDPerformanceModule, SVDPerformanceTTreeModule, SVDShaperDigitsFromTracksModule, SVDClusterizerModule, SVDCoGTimeEstimatorModule, SVDDataFormatCheckModule, SVDMissingAPVsClusterCreatorModule, SVDRecoDigitCreatorModule, SVD3SamplesEmulatorModule, SVDDigitizerModule, SVDEventInfoSetterModule, SVDTriggerQualityGeneratorModule, SVDSpacePointCreatorModule, SVDTimeGroupingModule, SVDUnpackerModule, TOPBackgroundModule, TOPBunchFinderModule, TOPChannelMaskerModule, TOPChannelT0MCModule, TOPDigitizerModule, TOPTriggerDigitizerModule, TOPDoublePulseGeneratorModule, TOPDQMModule, TOPGainEfficiencyCalculatorModule, TOPLaserHitSelectorModule, TOPInterimFENtupleModule, TOPLaserCalibratorModule, TOPMCTrackMakerModule, TOPModuleT0CalibratorModule, TOPNtupleModule, TOPPackerModule, TOPRawDigitConverterModule, TOPTBCComparatorModule, TOPTimeBaseCalibratorModule, TOPTimeRecalibratorModule, TOPUnpackerModule, TOPWaveformFeatureExtractorModule, TOPXTalkChargeShareSetterModule, DQMHistoModuleBase, SVDEventT0EstimatorModule, ExtModule, FlipQualityModule, BeamSpotMonitorModule, KinkFinderModule, MCV0MatcherModule, MCTrackCandClassifierModule, MuidModule, PXDROIFinderModule, SVDROIFinderAnalysisModule, SVDROIFinderModule, SPTCmomentumSeedRetrieverModule, SPTCvirtualIPRemoverModule, TrackCreatorModule, TrackFinderMCTruthRecoTracksModule, EffPlotsModule, HitXPModule, TrackingPerformanceEvaluationModule, V0findingPerformanceEvaluationModule, TrackQETrainingDataCollectorModule, TrackQualityEstimatorMVAModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, TrackFinderVXDAnalizerModule, VXDSimpleClusterizerModule, QualityEstimatorVXDModule, VXDQETrainingDataCollectorModule, VXDQualityEstimatorMVAModule, SectorMapBootstrapModule, SegmentNetworkProducerModule, TrackFinderVXDBasicPathFinderModule, TrackFinderVXDCellOMatModule, VXDTFTrainingDataCollectorModule, FindletModule< AFindlet >, FindletModule< HitBasedT0Extractor >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< FacetCreator >, FindletModule< HitReclaimer >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinder >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CDCTriggerNDFinderModule, CDCTriggerTSFModule, TRGCDCModule, TRGCDCETFUnpackerModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSFUnpackerModule, TRGCDCTSStreamModule, CDCTriggerUnpackerModule, MCMatcherTRGECLModule, TRGECLFAMModule, TRGECLModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLEventTimingDQMModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLSummaryModule, TRGGDLUnpackerModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLDQMModule, TRGGRLUnpackerModule, KLMTriggerModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TRGRAWDATAModule, VXDMisalignmentModule, DQMHistAnalysisARICHModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisEventT0EfficiencyModule, DQMHistAnalysisEventT0TriggerJitterModule, DQMHistAnalysisExampleModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisHLTModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputRootFileModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLMModule, DQMHistAnalysisKLM2Module, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisPeakModule, DQMHistAnalysisPXDERModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDDoseModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDGeneralModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTrackingAbortModule, DQMHistAnalysisTrackingHLTModule, DQMHistAnalysisTRGECLModule, DQMHistAutoCanvasModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DQMHistReferenceModule, DQMHistSnapshotsModule, DAQMonitorModule, DelayDQMModule, V0ObjectsDQMModule, ECLDQMInjectionModule, PyModule, PXDBgTupleProducerModule, PXDMCBgTupleProducerModule, PXDDAQDQMModule, PXDDQMClustersModule, PXDDQMCorrModule, PXDDQMEfficiencyModule, PXDDQMEfficiencySelftrackModule, PXDDQMExpressRecoModule, PXDGatedDHCDQMModule, PXDGatedModeDQMModule, PXDInjectionDQMModule, PXDRawDQMCorrModule, PXDRawDQMModule, PXDROIDQMModule, PXDTrackClusterDQMModule, PXDDigitizerModule, PXDPackerModule, PXDUnpackerModule, TTDDQMModule, SVDDQMClustersOnTrackModule, SVDDQMDoseModule, SVDDQMExpressRecoModule, SVDDQMInjectionModule, SVDUnpackerDQMModule, PXDclusterFilterModule, PXDdigiFilterModule, PXDROIFinderAnalysisModule, TrackingAbortDQMModule, VXDDQMExpressRecoModule, vxdDigitMaskingModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisEpicsOutputModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDCMModule, DQMHistAnalysisPXDDAQModule, DQMHistAnalysisPXDEffModule, DQMHistAnalysisPXDInjectionModule, DQMHistAnalysisPXDReductionModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisRunNrModule, DQMHistAnalysisTRGModule, DQMHistInjectionModule, and DQMHistOutputToEPICSModule.

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 808 of file CDCTriggerHoughtrafoForETF.cc.

809{
810 // scan pattern from left to right:
811 // 2 3
812 // 0 1
813 if (pattern & 1) return 0;
814 if ((pattern >> 2) & 1) {
815 if ((pattern >> 1) & 1) {
816 setReturnValue(false);
817 B2DEBUG(100, "bottomLeftCorner not unique");
818 }
819 return 2;
820 }
821 if ((pattern >> 1) & 1) return 1;
822 return 3;
823}
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition: Module.cc:220

◆ calcEventTiming()

int calcEventTiming ( )

Definition at line 883 of file CDCTriggerHoughtrafoForETF.cc.

884{
885 std::vector<int> ftlists;
887 ftlists = highPassTimingList();
888 } else {
889 ftlists = sectorTimingList();
890 }
891
892 if (m_t0CalcMethod == 0) {
893 std::sort(ftlists.begin(), ftlists.end());
894 return ftlists[m_arrivalOrder];
895 } else if (m_t0CalcMethod == 1) {
896 return median(ftlists);
897 } else {
898 return medianInTimeWindow(ftlists);
899 }
900}

◆ clone()

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

Create an independent copy of this module.

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

Implements PathElement.

Definition at line 179 of file Module.cc.

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

◆ connected()

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

Check if candidates are connected.

Definition at line 346 of file CDCTriggerHoughtrafoForETF.cc.

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

◆ connectedDiag()

bool connectedDiag ( unsigned  patternLD,
unsigned  patternRU 
)

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

Definition at line 747 of file CDCTriggerHoughtrafoForETF.cc.

748{
749 if (m_connect == 4) return false;
750
751 // connected if
752 // . .
753 // x .
754 // . x
755 // . .
756 return (((patternRU >> 0) & 1) && ((patternLD >> 3) & 1));
757}

◆ connectedLR()

bool connectedLR ( unsigned  patternL,
unsigned  patternR 
)

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

Definition at line 690 of file CDCTriggerHoughtrafoForETF.cc.

691{
692 // connected if
693 // . x | x . or . . | . .
694 // . . | . . . x | x .
695 bool connectDirect = (((patternL >> 3) & 1) && ((patternR >> 2) & 1)) ||
696 (((patternL >> 1) & 1) && ((patternR >> 0) & 1));
697 // connected if
698 // . . | x .
699 // . x | . .
700 bool connectRise = ((patternL >> 1) & 1) && ((patternR >> 2) & 1);
701 // connected if
702 // . x | . .
703 // . . | x .
704 bool connectFall = ((patternL >> 3) & 1) && ((patternR >> 0) & 1);
705
706 if (m_connect == 4) return connectDirect;
707 else if (m_connect == 6) return (connectDirect || connectRise);
708 else if (m_connect == 8) return (connectDirect || connectRise || connectFall);
709 else B2WARNING("Unknown option for connect " << m_connect << ", using default.");
710 return (connectDirect || connectRise);
711}

◆ 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 181 of file CDCTriggerHoughtrafoForETF.cc.

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

715{
716 // connected if
717 // . . . .
718 // x . . x
719 // --- or ---
720 // x . . x
721 // . . . .
722 bool connectDirect = (((patternU >> 0) & 1) && ((patternD >> 2) & 1)) ||
723 (((patternU >> 1) & 1) && ((patternD >> 3) & 1));
724 // connected if
725 // . .
726 // . x
727 // ---
728 // x .
729 // . .
730 bool connectRise = ((patternU >> 1) & 1) && ((patternD >> 2) & 1);
731 // connected if
732 // . .
733 // x .
734 // ---
735 // . x
736 // . .
737 bool connectFall = ((patternU >> 0) & 1) && ((patternD >> 3) & 1);
738
739 if (m_connect == 4) return connectDirect;
740 else if (m_connect == 6) return (connectDirect || connectRise);
741 else if (m_connect == 8) return (connectDirect || connectRise || connectFall);
742 else B2WARNING("Unknown option for connect " << m_connect << ", using default.");
743 return (connectDirect || connectRise);
744}

◆ countSL()

unsigned short countSL ( bool *  superLayers)

count the number of super layers with hits

Parameters
superLayersarray of hit/no hit for all super layers

Definition at line 31 of file CDCTriggerHoughtrafoForETF.cc.

32{
33 if (m_requireSL0 && !layer[0]) return 0;
34 unsigned short lcnt = 0;
35 for (int i = 0; i < CDC_SUPER_LAYERS; ++i) {
36 if (layer[i] == true) ++lcnt;
37 }
38 return lcnt;
39}

◆ def_beginRun()

virtual void def_beginRun ( )
inlineprotectedvirtualinherited

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

Reimplemented in PyModule.

Definition at line 426 of file Module.h.

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

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

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

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

Reimplemented in PyModule.

Definition at line 439 of file Module.h.

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

◆ def_event()

virtual void def_event ( )
inlineprotectedvirtualinherited

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

Reimplemented in PyModule.

Definition at line 432 of file Module.h.

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

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

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

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

Reimplemented in PyModule.

Definition at line 420 of file Module.h.

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

◆ def_terminate()

virtual void def_terminate ( )
inlineprotectedvirtualinherited

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

Reimplemented in PyModule.

Definition at line 445 of file Module.h.

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

◆ 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 BeamabortModule, BgoModule, CaveModule, ClawModule, CLAWSModule, DosiModule, FANGSModule, He3tubeModule, MicrotpcModule, Ph1bpipeModule, Ph1sustrModule, PindiodeModule, PlumeModule, QcsmonitorModule, SrsensorModule, GetEventFromSocketModule, CalibrationCollectorModule, AlignDQMModule, CosmicsAlignmentValidationModule, CurlTaggerModule, LowEnergyPi0IdentificationExpertModule, LowEnergyPi0VetoExpertModule, arichBtestModule, ARICHDQMModule, B2BIIMCParticlesMonitorModule, B2BIIConvertMdstModule, B2BIIMdstInputModule, BelleMCOutputModule, BeamBkgGeneratorModule, BeamBkgHitRateMonitorModule, BeamBkgMixerModule, BeamBkgTagSetterModule, BGOverlayInputModule, AnalysisPhase1StudyModule, NtuplePhase1_v6Module, ReprocessorModule, BeamabortStudyModule, BeamDigitizerModule, BgoDigitizerModule, BgoStudyModule, ClawDigitizerModule, ClawStudyModule, ClawsDigitizerModule, ClawsStudyModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, DosiDigitizerModule, DosiStudyModule, FANGSDigitizerModule, FANGSStudyModule, He3DigitizerModule, He3tubeStudyModule, MicrotpcStudyModule, TpcDigitizerModule, TPCStudyModule, PinDigitizerModule, PindiodeStudyModule, PlumeDigitizerModule, QcsmonitorDigitizerModule, QcsmonitorStudyModule, CDCCosmicAnalysisModule, CDCCRTestModule, cdcDQM7Module, CDCDQMModule, CDCPackerModule, CDCRecoTrackFilterModule, CDCUnpackerModule, DAQPerfModule, RxSocketModule, TxSocketModule, DqmHistoManagerModule, MonitorDataModule, TrackAnaModule, Ds2SampleModule, ReceiveEventModule, HLTDQM2ZMQModule, HLTDs2ZMQModule, ElapsedTimeModule, DeSerializerPXDModule, GenRawSendModule, Root2RawModule, SerializerModule, CertifyParallelModule, Ds2RawModule, Ds2RbufModule, EvReductionModule, FastRbuf2DsModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, Ds2RawFileModule, PartialSeqRootReaderModule, SeqRootMergerModule, StorageDeserializerModule, StorageRootOutputModule, StorageSerializerModule, PhysicsObjectsDQMModule, PhysicsObjectsMiraBelleBhabhaModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, PhysicsObjectsMiraBelleHadronModule, PhysicsObjectsMiraBelleModule, ECLBackgroundModule, ECLChargedPIDModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, ECLClusterPSDModule, ECLCovarianceMatrixModule, ECLCRFinderModule, ECLDataAnalysisModule, ECLDigitCalibratorModule, ECLDigitizerModule, ECLDigitizerPureCsIModule, EclDisplayModule, ECLDQMModule, ECLDQMEXTENDEDModule, ECLDQMOutOfTimeDigitsModule, ECLFinalizerModule, ECLHitDebugModule, ECLLocalMaximumFinderModule, ECLLocalRunCalibratorModule, ECLLOMModule, ECLPackerModule, ECLShowerCorrectorModule, ECLShowerShapeModule, ECLSplitterN1Module, ECLSplitterN2Module, ECLUnpackerModule, ECLWaveformFitModule, HistoModule, SubEventModule, SwitchDataStoreModule, EventInfoPrinterModule, RandomBarrierModule, HistoManagerModule, StatisticsSummaryModule, SeqRootInputModule, SeqRootOutputModule, RxModule, TxModule, ZMQTxInputModule, ZMQTxWorkerModule, EvtGenDecayModule, OverrideGenerationFlagsModule, BKLMAnaModule, BKLMDigitAnalyzerModule, BKLMSimHistogrammerModule, BKLMTrackingModule, EKLMDataCheckerModule, KLMClusterEfficiencyModule, KLMClustersReconstructorModule, KLMDigitizerModule, KLMDQMModule, KLMDQM2Module, KLMPackerModule, KLMReconstructorModule, KLMScintillatorSimulatorModule, KLMUnpackerModule, AWESOMEBasicModule, PXDBackgroundModule, PXDClustersFromTracksModule, PXDPerformanceModule, Convert2RawDetModule, PrintDataModule, PrintEventRateModule, Root2BinaryModule, CDCDedxDQMModule, CDCDedxValidationModule, EventT0ValidationModule, DataWriterModule, KlongValidationModule, KLMMuonIDDNNExpertModule, FullSimModule, SVDBackgroundModule, SVDClusterCalibrationsMonitorModule, SVDHotStripFinderModule, SVDLatencyCalibrationModule, SVDLocalCalibrationsMonitorModule, SVDPositionErrorScaleFactorImporterModule, SVDTimeCalibrationsMonitorModule, svdDumpModule, SVDPackerModule, SVDB4CommissioningPlotsModule, SVDClusterEvaluationModule, SVDClusterEvaluationTrueInfoModule, SVDClusterFilterModule, SVDOccupancyAnalysisModule, SVDPerformanceModule, SVDShaperDigitsFromTracksModule, SVDClusterizerModule, SVDCoGTimeEstimatorModule, SVDDataFormatCheckModule, SVDRecoDigitCreatorModule, SVD3SamplesEmulatorModule, SVDTriggerQualityGeneratorModule, SVDUnpackerModule, TOPBackgroundModule, TOPChannelT0MCModule, TOPTriggerDigitizerModule, TOPDoublePulseGeneratorModule, TOPGainEfficiencyCalculatorModule, TOPLaserHitSelectorModule, TOPInterimFENtupleModule, TOPLaserCalibratorModule, TOPMCTrackMakerModule, TOPNtupleModule, TOPPackerModule, TOPRawDigitConverterModule, TOPTBCComparatorModule, TOPTimeBaseCalibratorModule, TOPUnpackerModule, TOPWaveformFeatureExtractorModule, TOPWaveformQualityPlotterModule, TOPXTalkChargeShareSetterModule, ExtModule, GenfitVisModule, MCV0MatcherModule, MCTrackCandClassifierModule, MuidModule, MCSlowPionPXDROICreatorModule, PXDROIFinderModule, SVDROIDQMModule, SVDROIFinderAnalysisModule, SVDROIFinderModule, RT2SPTCConverterModule, SPTCmomentumSeedRetrieverModule, SPTCvirtualIPRemoverModule, TrackFinderMCTruthRecoTracksModule, EffPlotsModule, HitXPModule, TrackingPerformanceEvaluationModule, V0findingPerformanceEvaluationModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, TrackFinderVXDAnalizerModule, VXDSimpleClusterizerModule, NoKickCutsEvalModule, SectorMapBootstrapModule, VXDTFTrainingDataCollectorModule, FindletModule< AFindlet >, FindletModule< HitBasedT0Extractor >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< FacetCreator >, FindletModule< HitReclaimer >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinder >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CDCTriggerNDFinderModule, TRGCDCModule, TRGCDCETFUnpackerModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSFUnpackerModule, TRGCDCTSStreamModule, MCMatcherTRGECLModule, TRGECLFAMModule, TRGECLModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLSummaryModule, TRGGDLUnpackerModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLDQMModule, TRGGRLUnpackerModule, KLMTriggerModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TRGRAWDATAModule, DQMHistAnalysisARICHModule, DQMHistAnalysisARICHMonObjModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLOutOfTimeDigitsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisExampleModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisHLTMonObjModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLMModule, DQMHistAnalysisKLM2Module, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisMonObjModule, DQMHistAnalysisOutputFileModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDDoseModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDGeneralModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGGDLModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DQMHistReferenceModule, DQMHistSnapshotsModule, PyModule, SVDUnpackerDQMModule, TrackSetEvaluatorHopfieldNNDEVModule, vxdDigitMaskingModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisEpicsOutputModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisTRGModule, and DQMHistOutputToEPICSModule.

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 202 of file CDCTriggerHoughETFModule.cc.

203{
204 /* Clean hits */
205 hitMap.clear();
206 houghCand.clear();
207 associatedTSHitsList.clear();
208
210 /* set default return value */
211 setReturnValue(true);
212
213 if (m_testFilename != "") {
214 testFile << StoreObjPtr<EventMetaData>()->getEvent() << " "
215 << m_segmentHits.getEntries() << endl;
216 }
217
218 if (m_segmentHits.getEntries() == 0) {
219 //B2WARNING("CDCTracking: tsHitsCollection is empty!");
220 return;
221 }
222
223 /* get CDCHits coordinates in conformal space */
224 for (int iHit = 0; iHit < m_segmentHits.getEntries(); iHit++) {
225 unsigned short iSL = m_segmentHits[iHit]->getISuperLayer();
226 if (m_testFilename != "") {
227 testFile << iSL << " " << m_segmentHits[iHit]->getSegmentID() - TSoffset[iSL] << " "
228 << m_segmentHits[iHit]->getPriorityPosition() << endl;
229 }
230 if (iSL % 2) continue;
231 if (m_ignore2nd && m_segmentHits[iHit]->getPriorityPosition() < 3) continue;
232 double phi = m_segmentHits[iHit]->getSegmentID() - TSoffset[iSL];
233 if (m_usePriority) {
234 phi += 0.5 * (((m_segmentHits[iHit]->getPriorityPosition() >> 1) & 1)
235 - (m_segmentHits[iHit]->getPriorityPosition() & 1));
236 }
237 phi = phi * 2. * M_PI / (TSoffset[iSL + 1] - TSoffset[iSL]);
238 double r = radius[iSL][int(m_usePriority &&
239 m_segmentHits[iHit]->getPriorityPosition() < 3)];
240 ROOT::Math::XYVector pos(cos(phi) / r, sin(phi) / r);
241 hitMap.insert(std::make_pair(iHit, std::make_pair(iSL, pos)));
242 }
243
244 /* Extent the Hough plane such that the cell number is a power of 2 (same for x and y).
245 * This is for the fast peak finder, which divides the Hough plane in half in each step.
246 * Peaks found outside of the actual limits are ignored. */
247 maxIterations = ceil(log2(max(m_nCellsPhi, m_nCellsR))) - 1;
248 nCells = pow(2, maxIterations + 1);
249 /* limits in phi: [-pi, pi] + extra cells */
250 double rectX = M_PI * nCells / m_nCellsPhi;
251 /* limits in R: [-R(minPt), R(minPt)] + extra cells + shift */
252 maxR = 0.5 * Const::speedOfLight * 1.5e-4 / m_minPt;
253 double rectY = maxR * nCells / m_nCellsR;
254 shiftR = 0;
255 if (m_shiftPt < 0) {
256 shiftR = -maxR / 2. / m_nCellsR;
257 } else if (m_shiftPt > 0) {
258 shiftR = maxR / 2. / m_nCellsR;
259 }
260
261 B2DEBUG(50, "extending Hough plane to " << maxIterations << " iterations, "
262 << nCells << " cells: phi in ["
263 << -rectX * 180. / M_PI << ", " << rectX * 180. / M_PI
264 << "] deg, 1/r in [" << -rectY + shiftR << ", " << rectY + shiftR << "] /cm");
265
266 /* prepare matrix for storing the Hough plane */
267 if (m_storePlane > 0) {
270 }
271
272 // hit map containing only the early hits
273 cdcMap fastHitMap;
274 if (m_suppressClone && !hitMap.empty()) {
275 // find the first track candidates in Hough plane
276 // only for z0 resolution study with single-track events
277 // This will surely fail with multi-track ones,
278 // in which case we really need tick-by-tick simulation for all hits.
279
281 typedef pair<int, cdcPair> cdcHitPair;
282 // sequential hit map, ordered by TS found time
283 typedef vector<cdcHitPair> cdcSeqMap;
284 cdcSeqMap seqHitMap;
285 // copy hit map to sequential hit map and sort it by TS found time
286 for (auto hit : 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 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, -rectX, rectX, -rectY + shiftR, rectY + shiftR, 0, 0, 0);
314 B2DEBUG(20, "at tick " << tick << ", number of candidates: " << houghCand.size());
315 if (!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 */
324 fastInterceptFinder(hitMap, -rectX, rectX, -rectY + shiftR, rectY + shiftR, 0, 0, 0);
325 if (!houghCand.empty()) {
326 B2DEBUG(10, "found a track with " << 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 testFile << m_tracks.getEntries() << 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. + maxR - shiftR) * m_nCellsR / 2. / maxR - 0.5;
343 testFile << round(2 * ix) / 2. << " " << round(2 * iy) / 2. << " "
344 << m_tracks[i]->getChargeSign() << endl;
347 testFile << hits.size() << endl;
348 for (unsigned ihit = 0; ihit < hits.size(); ++ihit) {
349 unsigned short iSL = hits[ihit]->getISuperLayer();
350 testFile << iSL << " " << hits[ihit]->getSegmentID() - TSoffset[iSL] << " "
351 << hits[ihit]->getPriorityPosition() << " "
352 << hits.weight(ihit) << endl;
353 }
354 }
355 }
356}
void addBinnedEventT0(int eventT0, Const::EDetector detector)
Store a binned event t0 for the given detector replacing any other hypothesis for this detector.
int fastInterceptFinder(cdcMap &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.
std::ofstream testFile
filestream for test output for firmware debugging
unsigned maxIterations
number of iterations for the fast peak finder, smallest n such that 2^(n+1) > max(nCellsPhi,...
std::vector< std::vector< CDCTriggerSegmentHit * > > associatedTSHitsList
list of fastest timing of TS associated with Track
StoreObjPtr< TMatrix > m_houghPlane
matrix containing the Hough plane
unsigned nCells
number of cells for the fast peak finder: 2^(maxIterations + 1).
double radius[9][2]
Radius of the CDC layers with priority wires (2 per super layer).
cdcMap hitMap
map of TS hits containing <iHit, <iSL, (x, y)>> with iHit: hit index in StoreArray iSL: super layer i...
StoreObjPtr< BinnedEventT0 > m_eventTime
StoreObjPtr holding the event time.
unsigned TSoffset[10]
Number of track segments up to super layer.
bool patternClustering(const cdcMap &inputMap)
Combine Hough candidates to tracks by a fixed pattern algorithm.
void connectedRegions()
Combine Hough candidates to tracks by merging connected cells.
Combination of several CDCHits to a track segment hit for the trigger.
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
Class for type safe access to objects that are referred to in relations.
bool create(bool replace=false)
Create a default object in the data store.
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
bool isValid() const
Check whether the object was created.
Definition: StoreObjPtr.h:111
std::map< int, cdcPair > cdcMap
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 pathes */
349 enum_<Belle2::ModuleCondition::EConditionOperators>("ConditionOperator")
356 ;
357
358 enum_<Module::EModulePropFlags>("ModulePropFlags",
359 R"(Flags to indicate certain low-level features of modules, see :func:`Module.set_property_flags()`, :func:`Module.has_properties()`. Most useful flags are:
360
361.. attribute:: PARALLELPROCESSINGCERTIFIED
362
363 This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)
364
365.. attribute:: HISTOGRAMMANAGER
366
367 This module is used to manage histograms accumulated by other modules
368
369.. attribute:: TERMINATEINALLPROCESSES
370
371 When using parallel processing, call this module's terminate() function in all processes. This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.
372)")
373 .value("INPUT", Module::EModulePropFlags::c_Input)
374 .value("OUTPUT", Module::EModulePropFlags::c_Output)
375 .value("PARALLELPROCESSINGCERTIFIED", Module::EModulePropFlags::c_ParallelProcessingCertified)
376 .value("HISTOGRAMMANAGER", Module::EModulePropFlags::c_HistogramManager)
377 .value("INTERNALSERIALIZER", Module::EModulePropFlags::c_InternalSerializer)
378 .value("TERMINATEINALLPROCESSES", Module::EModulePropFlags::c_TerminateInAllProcesses)
379 ;
380
381 //Python class definition
382 class_<Module, PyModule> module("Module", R"(
383Base class for Modules.
384
385A module is the smallest building block of the framework.
386A typical event processing chain consists of a Path containing
387modules. By inheriting from this base class, various types of
388modules can be created. To use a module, please refer to
389:func:`Path.add_module()`. A list of modules is available by running
390``basf2 -m`` or ``basf2 -m package``, detailed information on parameters is
391given by e.g. ``basf2 -m RootInput``.
392
393The 'Module Development' section in the manual provides detailed information
394on how to create modules, setting parameters, or using return values/conditions:
395https://confluence.desy.de/display/BI/Software+Basf2manual#Module_Development
396
397)");
398 module
399 .def("__str__", &Module::getPathString)
400 .def("name", &Module::getName, return_value_policy<copy_const_reference>(),
401 "Returns the name of the module. Can be changed via :func:`set_name() <Module.set_name()>`, use :func:`type() <Module.type()>` for identifying a particular module class.")
402 .def("type", &Module::getType, return_value_policy<copy_const_reference>(),
403 "Returns the type of the module (i.e. class name minus 'Module')")
404 .def("set_name", &Module::setName, args("name"), R"(
405Set custom name, e.g. to distinguish multiple modules of the same type.
406
407>>> path.add_module('EventInfoSetter')
408>>> ro = path.add_module('RootOutput', branchNames=['EventMetaData'])
409>>> ro.set_name('RootOutput_metadata_only')
410>>> print(path)
411[EventInfoSetter -> RootOutput_metadata_only]
412
413)")
414 .def("description", &Module::getDescription, return_value_policy<copy_const_reference>(),
415 "Returns the description of this module.")
416 .def("package", &Module::getPackage, return_value_policy<copy_const_reference>(),
417 "Returns the package this module belongs to.")
418 .def("available_params", &_getParamInfoListPython,
419 "Return list of all module parameters as `ModuleParamInfo` instances")
420 .def("has_properties", &Module::hasProperties, (bp::arg("properties")),
421 R"DOCSTRING(Allows to check if the module has the given properties out of `ModulePropFlags` set.
422
423>>> if module.has_properties(ModulePropFlags.PARALLELPROCESSINGCERTIFIED):
424>>> ...
425
426Parameters:
427 properties (int): bitmask of `ModulePropFlags` to check for.
428)DOCSTRING")
429 .def("set_property_flags", &Module::setPropertyFlags, args("property_mask"),
430 "Set module properties in the form of an OR combination of `ModulePropFlags`.");
431 {
432 // python signature is too crowded, make ourselves
433 docstring_options subOptions(true, false, false); //userdef, py sigs, c++ sigs
434 module
435 .def("if_value", &Module::if_value,
436 (bp::arg("expression"), bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
437 R"DOCSTRING(if_value(expression, condition_path, after_condition_path=AfterConditionPath.END)
438
439Sets a conditional sub path which will be executed after this
440module if the return value set in the module passes the given ``expression``.
441
442Modules can define a return value (int or bool) using ``setReturnValue()``,
443which can be used in the steering file to split the Path based on this value, for example
444
445>>> module_with_condition.if_value("<1", another_path)
446
447In case the return value of the ``module_with_condition`` for a given event is
448less than 1, the execution will be diverted into ``another_path`` for this event.
449
450You could for example set a special return value if an error occurs, and divert
451the execution into a path containing :b2:mod:`RootOutput` if it is found;
452saving only the data producing/produced by the error.
453
454After a conditional path has executed, basf2 will by default stop processing
455the path for this event. This behaviour can be changed by setting the
456``after_condition_path`` argument.
457
458Parameters:
459 expression (str): Expression to determine if the conditional path should be executed.
460 This should be one of the comparison operators ``<``, ``>``, ``<=``,
461 ``>=``, ``==``, or ``!=`` followed by a numerical value for the return value
462 condition_path (Path): path to execute in case the expression is fulfilled
463 after_condition_path (AfterConditionPath): What to do once the ``condition_path`` has been executed.
464)DOCSTRING")
465 .def("if_false", &Module::if_false,
466 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
467 R"DOC(if_false(condition_path, after_condition_path=AfterConditionPath.END)
468
469Sets a conditional sub path which will be executed after this module if
470the return value of the module evaluates to False. This is equivalent to
471calling `if_value` with ``expression=\"<1\"``)DOC")
472 .def("if_true", &Module::if_true,
473 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
474 R"DOC(if_true(condition_path, after_condition_path=AfterConditionPath.END)
475
476Sets a conditional sub path which will be executed after this module if
477the return value of the module evaluates to True. It is equivalent to
478calling `if_value` with ``expression=\">=1\"``)DOC");
479 }
480 module
481 .def("has_condition", &Module::hasCondition,
482 "Return true if a conditional path has been set for this module "
483 "using `if_value`, `if_true` or `if_false`")
484 .def("get_all_condition_paths", &_getAllConditionPathsPython,
485 "Return a list of all conditional paths set for this module using "
486 "`if_value`, `if_true` or `if_false`")
487 .def("get_all_conditions", &_getAllConditionsPython,
488 "Return a list of all conditional path expressions set for this module using "
489 "`if_value`, `if_true` or `if_false`")
490 .add_property("logging", make_function(&Module::getLogConfig, return_value_policy<reference_existing_object>()),
@ c_GE
Greater or equal than: ">=".
@ c_SE
Smaller or equal than: "<=".
@ c_GT
Greater than: ">"
@ c_NE
Not equal: "!=".
@ c_EQ
Equal: "=" or "=="
@ c_ST
Smaller than: "<"
Base class for Modules.
Definition: Module.h:72
LogConfig & getLogConfig()
Returns the log system configuration.
Definition: Module.h:225
void if_value(const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
Add a condition to the module.
Definition: Module.cc:79
void if_true(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to set the condition of the module.
Definition: Module.cc:90
void setLogConfig(const LogConfig &logConfig)
Set the log system configuration.
Definition: Module.h:230
const std::string & getDescription() const
Returns the description of the module.
Definition: Module.h:202
void if_false(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to add a condition to the module.
Definition: Module.cc:85
bool hasCondition() const
Returns true if at least one condition was set for the module.
Definition: Module.h:311
const std::string & getPackage() const
Returns the package this module is in.
Definition: Module.h:197
void setName(const std::string &name)
Set the name of the module.
Definition: Module.h:214
bool hasProperties(unsigned int propertyFlags) const
Returns true if all specified property flags are available in this module.
Definition: Module.cc:160
std::string getPathString() const override
return the module name.
Definition: Module.cc:192

◆ fastInterceptFinder()

int fastInterceptFinder ( cdcMap 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 64 of file CDCTriggerHoughtrafoForETF.cc.

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

◆ findAllCrossingHits()

void findAllCrossingHits ( std::vector< unsigned > &  list,
double  x1,
double  x2,
double  y1,
double  y2,
const cdcMap 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 418 of file CDCTriggerHoughtrafoForETF.cc.

422{
423 double m, a, y1_h, y2_h;
424 for (int iHit = 0; iHit < m_segmentHits.getEntries(); iHit++) {
425 unsigned short iSL = m_segmentHits[iHit]->getISuperLayer();
426 if (iSL % 2) continue;
427 // associate only the hits actually used to form the cluster
428 if (m_suppressClone && inputMap.find(iHit) == inputMap.end()) continue;
429 //TODO: add options: center cell / active priority cell / all priority cells
430 vector<double> phi = {0, 0, 0};
431 phi[0] = m_segmentHits[iHit]->getSegmentID() - TSoffset[iSL];
432 phi[1] = phi[0] + 0.5;
433 phi[2] = phi[0] - 0.5;
434 vector<double> r = {radius[iSL][0], radius[iSL][1], radius[iSL][1]};
435 for (unsigned i = 0; i < 3; ++i) {
436 phi[i] *= 2. * M_PI / (TSoffset[iSL + 1] - TSoffset[iSL]);
437 m = cos(phi[i]) / r[i];
438 a = sin(phi[i]) / r[i];
439 // calculate Hough curve with slightly enlarged limits to avoid errors due to rounding
440 y1_h = m * sin(x1 - 1e-10) - a * cos(x1 - 1e-10);
441 y2_h = m * sin(x2 + 1e-10) - a * cos(x2 + 1e-10);
442 // skip decreasing half of the sine (corresponds to curl back half of the track)
443 if (y1_h > y2_h) continue;
444 if (!((y1_h > y2 && y2_h > y2) || (y1_h < y1 && y2_h < y1))) {
445 list.push_back(iHit);
446 break;
447 }
448 }
449 }
450}

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 133 of file Module.cc.

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

◆ getAllConditionPaths()

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

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

Definition at line 150 of file Module.cc.

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

◆ getAllConditions()

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

Return all set conditions for this module.

Definition at line 324 of file Module.h.

325 {
326 return m_conditions;
327 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

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

Definition at line 314 of file Module.h.

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

◆ getConditionPath()

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

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


Definition at line 113 of file Module.cc.

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

◆ getDescription()

const std::string & getDescription ( ) const
inlineinherited

Returns the description of the module.

Definition at line 202 of file Module.h.

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

◆ getFileNames()

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

Return a list of output filenames for this modules.

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

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

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

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

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

Reimplemented in RootInputModule, StorageRootOutputModule, and RootOutputModule.

Definition at line 134 of file Module.h.

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

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 225 of file Module.h.

225{return m_logConfig;}

◆ getModules()

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

no submodules, return empty list

Implements PathElement.

Definition at line 506 of file Module.h.

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

◆ getName()

const std::string & getName ( ) const
inlineinherited

Returns the name of the module.

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

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

Definition at line 187 of file Module.h.

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

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 197 of file Module.h.

197{return m_package;}

◆ getParamInfoListPython()

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

Returns a python list of all parameters.

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

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

Definition at line 279 of file Module.cc.

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

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 363 of file Module.h.

363{ return m_moduleParamList; }

◆ getPathString()

std::string getPathString ( ) const
overrideprivatevirtualinherited

return the module name.

Implements PathElement.

Definition at line 192 of file Module.cc.

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

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 381 of file Module.h.

381{ return m_returnValue; }

◆ getSector()

int getSector ( int  id,
int  sl 
)

Definition at line 840 of file CDCTriggerHoughtrafoForETF.cc.

841{
842 unsigned int localid = id - TSoffset[sl];
843 unsigned int base = NTS[sl] / NSEC[sl];
844 return localid / base + NSecOffset[sl];
845}
int NSecOffset[9]
Number of sector offset of each super layer.
const int NSEC[9]
Number of sector in each super layer.
const int NTS[9]
Number of track segments in each super layers.

◆ 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 825 of file CDCTriggerHoughtrafoForETF.cc.

826{
827 std::vector<int> ftlists;
828
829 for (long unsigned int iTrack = 0; iTrack < associatedTSHitsList.size(); iTrack++) {
830 for (long unsigned int iHit = 0; iHit < associatedTSHitsList[iTrack].size(); iHit++) {
831 short ft = (!m_usePriorityTiming) ? associatedTSHitsList[iTrack][iHit]->fastestTime()
832 : associatedTSHitsList[iTrack][iHit]->priorityTime();
833 ftlists.push_back(ft * 2);
834 }
835 }
836 return ftlists;
837}

◆ 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://confluence.desy.de/display/BI/Software+ModCondTut 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 157 of file CDCTriggerHoughETFModule.cc.

158{
159 // register DataStore elements
162
163 if (m_storeTracks) {
165 m_clusters.registerInDataStore(m_clusterCollectionName);
166
169 }
170
171 if (m_storePlane > 0) m_houghPlane.registerInDataStore("HoughPlane");
172
174 int layerId = 3;
175 int nTS = 0;
176 for (int iSL = 0; iSL < 9; ++iSL) {
177 TSoffset[iSL] = nTS;
178 nTS += cdc.nWiresInLayer(layerId);
179 TSoffset[iSL + 1] = nTS;
180 for (int priority = 0; priority < 2; ++ priority) {
181 radius[iSL][priority] = cdc.senseWireR(layerId + priority);
182 }
183 layerId += (iSL > 0 ? 6 : 7);
184 }
185
186 for (int sl = 1; sl < 9; sl++) {
187 NSecOffset[sl] = NSEC[sl - 1] + NSecOffset[sl - 1];
188 }
189
190 if (m_testFilename != "") {
192 }
193
194 if (m_suppressClone) {
195 B2INFO("2D finder will exit with the first track candidate in time.");
196 }
197
198 if (m_t0CalcMethod != 0 && m_t0CalcMethod != 1) B2WARNING("t0CalcMethod is invalid. calculate as default.");
199}
The Class for CDC Geometry Parameters.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Definition: StoreArray.h:140

◆ inList()

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

Check if candidate is in list.

Definition at line 336 of file CDCTriggerHoughtrafoForETF.cc.

338{
339 for (unsigned i = 0; i < list.size(); ++i) {
340 if (a == list[i]) return true;
341 }
342 return false;
343}

◆ median()

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

Definition at line 903 of file CDCTriggerHoughtrafoForETF.cc.

904{
905 int size = v.size();
906 std::vector<int> _v;
907 copy(v.begin(), v.end(), back_inserter(_v));
908 std::sort(_v.begin(), _v.end());
909 if (size % 2) {
910 return _v[(size - 1) / 2];
911 } else {
912 return (_v[(size / 2) - 1] + _v[size / 2]) / 2;
913 }
914}

◆ medianInTimeWindow()

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

Definition at line 917 of file CDCTriggerHoughtrafoForETF.cc.

918{
919 int med = median(v);
920 int tbegin = med - abs(m_timeWindowBegin);
921 int tend = med + abs(m_timeWindowEnd);
922
923 std::vector<int> _inWindow;
924
925 for (auto& t : v) if (t > tbegin && t < tend) _inWindow.push_back(t);
926
927 if (_inWindow.size()) {
928 return median(_inWindow);
929 } else {
930 return med;
931 }
932}

◆ 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 384 of file CDCTriggerHoughtrafoForETF.cc.

387{
388 bool found;
389
390 for (auto it = a.begin(); it != a.end(); ++it) {
391 found = false;
392 for (auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
393 if (*it_in == *it) {
394 found = true;
395 break;
396 }
397 }
398 if (!found) {
399 merged.push_back(*it);
400 }
401 }
402
403 for (auto it = b.begin(); it != b.end(); ++it) {
404 found = false;
405 for (auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
406 if (*it_in == *it) {
407 found = true;
408 break;
409 }
410 }
411 if (!found) {
412 merged.push_back(*it);
413 }
414 }
415}

◆ patternClustering()

bool patternClustering ( const cdcMap 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 490 of file CDCTriggerHoughtrafoForETF.cc.

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

849{
850 std::vector<int> ftlists;
851 std::array<std::vector<std::pair<int, int>>, CDC_ETF_SECTOR> arr_sector;
852
853 // distribute into each sector
854 for (long unsigned int iTrack = 0; iTrack < associatedTSHitsList.size(); iTrack++) {
855 for (long unsigned int iHit = 0; iHit < associatedTSHitsList[iTrack].size(); iHit++) {
856 int sl = associatedTSHitsList[iTrack][iHit]->getISuperLayer();
857 int id = associatedTSHitsList[iTrack][iHit]->getSegmentID();
858 int pp = associatedTSHitsList[iTrack][iHit]->getPriorityPosition();
859 int ft = associatedTSHitsList[iTrack][iHit]->fastestTime() * 2; // 2ns -> 1ns
860
861 arr_sector [getSector(id, sl)].push_back(make_pair(ft, pp));
862 }
863 }
864
865 //fastest && 1st pp in each sector
866 for (int sec = 0; sec < CDC_ETF_SECTOR; sec++) {
867 if (!arr_sector[sec].size()) continue;
868 int minft = 1e9;
869 int pp = 0;
870 for (auto& ift : arr_sector[sec]) {
871 if ((minft > ift.first) && (pp <= ift.second)) {
872 minft = ift.first;
873 pp = ift.second;
874 }
875 }
876 ftlists.push_back(minft);
877 }
878
879 return ftlists;
880}

◆ 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 456 of file CDCTriggerHoughtrafoForETF.cc.

459{
460 std::vector<int> bestPerSL(5, -1);
461 for (unsigned i = 0; i < list.size(); ++i) {
462 unsigned iax = m_segmentHits[list[i]]->getISuperLayer() / 2;
463 bool firstPriority = (m_segmentHits[list[i]]->getPriorityPosition() == 3);
464 if (bestPerSL[iax] < 0) {
465 bestPerSL[iax] = i;
466 } else {
467 unsigned itsBest = list[bestPerSL[iax]];
468 bool firstBest = (m_segmentHits[itsBest]->getPriorityPosition() == 3);
469 // selection rules:
470 // first priority, higher ID
471 if ((firstPriority && !firstBest) ||
472 (firstPriority == firstBest &&
473 m_segmentHits[list[i]]->getSegmentID() > m_segmentHits[itsBest]->getSegmentID())) {
474 bestPerSL[iax] = i;
475 }
476 }
477 }
478
479 for (unsigned i = 0; i < list.size(); ++i) {
480 unsigned iax = m_segmentHits[list[i]]->getISuperLayer() / 2;
481 if (int(i) == bestPerSL[iax]) selected.push_back(list[i]);
482 else unselected.push_back(list[i]);
483 }
484}

◆ setAbortLevel()

void setAbortLevel ( int  abortLevel)
inherited

Configure the abort log level.

Definition at line 67 of file Module.cc.

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

◆ setDebugLevel()

void setDebugLevel ( int  debugLevel)
inherited

Configure the debug messaging level.

Definition at line 61 of file Module.cc.

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

◆ setDescription()

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

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 214 of file Module.cc.

215{
216 m_description = description;
217}

◆ setLogConfig()

void setLogConfig ( const LogConfig logConfig)
inlineinherited

Set the log system configuration.

Definition at line 230 of file Module.h.

230{m_logConfig = logConfig;}

◆ setLogInfo()

void setLogInfo ( int  logLevel,
unsigned int  logInfo 
)
inherited

Configure the printed log information for the given level.

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

Definition at line 73 of file Module.cc.

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

◆ setLogLevel()

void setLogLevel ( int  logLevel)
inherited

Configure the log level.

Definition at line 55 of file Module.cc.

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

◆ setName()

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

Set the name of the module.

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

Definition at line 214 of file Module.h.

214{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 501 of file Module.h.

501{ m_moduleParamList = params; }

◆ setParamPython()

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

Implements a method for setting boost::python objects.

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

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

Definition at line 234 of file Module.cc.

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

◆ setParamPythonDict()

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

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

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

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

Definition at line 249 of file Module.cc.

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

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int  propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 208 of file Module.cc.

209{
210 m_propertyFlags = propertyFlags;
211}

◆ setReturnValue() [1/2]

void setReturnValue ( bool  value)
protectedinherited

Sets the return value for this module as bool.

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

Parameters
valueThe value of the return value.

Definition at line 227 of file Module.cc.

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

◆ setReturnValue() [2/2]

void setReturnValue ( int  value)
protectedinherited

Sets the return value for this module as integer.

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

Parameters
valueThe value of the return value.

Definition at line 220 of file Module.cc.

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

◆ setType()

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

Set the module type.

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

Definition at line 48 of file Module.cc.

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

◆ shortTrack()

bool shortTrack ( bool *  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 42 of file CDCTriggerHoughtrafoForETF.cc.

43{
44 unsigned short lcnt = 0;
45 // check axial super layers (even layer number),
46 // break at first layer without hit
47 for (int i = 0; i < CDC_SUPER_LAYERS; i += 2) {
48 if (layer[i] == true) ++lcnt;
49 else break;
50 }
51 return (lcnt >= m_minHitsShort);
52}

◆ terminate()

void terminate ( void  )
overridevirtual

Clean up.

Reimplemented from Module.

Definition at line 359 of file CDCTriggerHoughETFModule.cc.

360{
361 if (m_testFilename != "") 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 790 of file CDCTriggerHoughtrafoForETF.cc.

791{
792 // scan pattern from right to left:
793 // 2 3
794 // 0 1
795 if ((pattern >> 3) & 1) return 3;
796 if ((pattern >> 1) & 1) {
797 if ((pattern >> 2) & 1) {
798 setReturnValue(false);
799 B2DEBUG(100, "topRightCorner not unique");
800 }
801 return 1;
802 }
803 if ((pattern >> 2) & 1) return 2;
804 return 0;
805}

◆ 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 760 of file CDCTriggerHoughtrafoForETF.cc.

761{
762 // scan from top right corner until an active square is found
763 for (unsigned index = pattern.size() - 1; index > 0; --index) {
764 if (!pattern[index]) continue;
765 // check for ambiguity
766 unsigned ix = index % m_clusterSizeX;
767 unsigned iy = index / m_clusterSizeX;
768 if (ix < m_clusterSizeX - 1 && iy > 0) {
769 bool unique = true;
770 for (unsigned index2 = index - 1; index2 > 0; --index2) {
771 if (!pattern[index2]) continue;
772 unsigned ix2 = index2 % m_clusterSizeX;
773 unsigned iy2 = index2 / m_clusterSizeX;
774 if (iy2 < iy && ix2 > ix) {
775 unique = false;
776 break;
777 }
778 }
779 if (!unique) {
780 setReturnValue(false);
781 B2DEBUG(100, "topRightSquare not unique");
782 }
783 }
784 return index;
785 }
786 return 0;
787}

Member Data Documentation

◆ associatedTSHitsList

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

list of fastest timing of TS associated with Track

Definition at line 199 of file CDCTriggerHoughETFModule.h.

◆ hitMap

cdcMap 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 298 of file CDCTriggerHoughETFModule.h.

◆ houghCand

std::vector<CDCTriggerHoughCand> houghCand
protected

Hough Candidates.

Definition at line 300 of file CDCTriggerHoughETFModule.h.

◆ m_arrivalOrder

unsigned m_arrivalOrder
protected

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

Definition at line 208 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 222 of file CDCTriggerHoughETFModule.h.

◆ m_clusterPattern

bool m_clusterPattern
protected

switch for clustering algorithm (if true use nested patterns)

Definition at line 272 of file CDCTriggerHoughETFModule.h.

◆ m_clusters

StoreArray<CDCTriggerHoughCluster> m_clusters
protected

list of clusters in the Hough map

Definition at line 318 of file CDCTriggerHoughETFModule.h.

◆ m_clusterSizeX

unsigned m_clusterSizeX
protected

maximum cluster size for pattern algorithm

Definition at line 274 of file CDCTriggerHoughETFModule.h.

◆ m_clusterSizeY

unsigned m_clusterSizeY
protected

maximum cluster size for pattern algorithm

Definition at line 276 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 257 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 191 of file CDCTriggerHoughETFModule.h.

◆ m_EventTimeName

std::string m_EventTimeName
protected

Name of the StoreObject containing the trigger event time.

Definition at line 193 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 218 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 283 of file CDCTriggerHoughETFModule.h.

◆ m_hits

StoreArray<CDCTriggerSegmentHit> m_hits
protected

list of input track segment hits

Definition at line 197 of file CDCTriggerHoughETFModule.h.

◆ m_houghPlane

StoreObjPtr<TMatrix> m_houghPlane
protected

matrix containing the Hough plane

Definition at line 320 of file CDCTriggerHoughETFModule.h.

◆ m_ignore2nd

bool m_ignore2nd
protected

switch to skip second priority hits

Definition at line 259 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_minCells

unsigned m_minCells
protected

minimum number of cells in a cluster to form a track

Definition at line 251 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 246 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 249 of file CDCTriggerHoughETFModule.h.

◆ m_minPt

double m_minPt
protected

Hough plane limit in Pt [GeV].

Definition at line 228 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_nCellsPhi

unsigned m_nCellsPhi
protected

number of Hough cells in phi

Definition at line 224 of file CDCTriggerHoughETFModule.h.

◆ m_nCellsR

unsigned m_nCellsR
protected

number of Hough cells in 1/r

Definition at line 226 of file CDCTriggerHoughETFModule.h.

◆ m_offset

int m_offset = 0
protected

offset for ETF simulation

Definition at line 286 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 253 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 220 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_requireSL0

bool m_requireSL0
protected

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

Definition at line 263 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 314 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 233 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 270 of file CDCTriggerHoughETFModule.h.

◆ m_storeTracks

bool m_storeTracks
protected

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

Definition at line 195 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 266 of file CDCTriggerHoughETFModule.h.

◆ m_t0CalcMethod

unsigned m_t0CalcMethod
protected

Switch method to determine the event timing.

Definition at line 205 of file CDCTriggerHoughETFModule.h.

◆ m_testFilename

std::string m_testFilename
protected

filename for test output for firmware debugging

Definition at line 289 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 211 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 214 of file CDCTriggerHoughETFModule.h.

◆ m_tracks

StoreArray<CDCTriggerTrack> m_tracks
protected

list of found tracks

Definition at line 316 of file CDCTriggerHoughETFModule.h.

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 509 of file Module.h.

◆ m_useHighPassTimingList

bool m_useHighPassTimingList
protected

Use associated fastest timings track-by-track.

Definition at line 203 of file CDCTriggerHoughETFModule.h.

◆ m_usePriority

bool m_usePriority
protected

switch between priority position and center position of track segment

Definition at line 261 of file CDCTriggerHoughETFModule.h.

◆ m_usePriorityTiming

bool m_usePriorityTiming
protected

Switch to use priority timing instead of fastest timing.

Definition at line 201 of file CDCTriggerHoughETFModule.h.

◆ maxIterations

unsigned 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 240 of file CDCTriggerHoughETFModule.h.

◆ maxR

double maxR = 0.
protected

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

Initialized at 0 by the SW shifter

Definition at line 235 of file CDCTriggerHoughETFModule.h.

◆ nCells

unsigned nCells = 0
protected

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

Initialized at 0 by the SW shifter

Definition at line 242 of file CDCTriggerHoughETFModule.h.

◆ NSEC

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

Number of sector in each super layer.

Definition at line 309 of file CDCTriggerHoughETFModule.h.

◆ NSecOffset

int NSecOffset[9] = {0}
protected

Number of sector offset of each super layer.

Definition at line 311 of file CDCTriggerHoughETFModule.h.

◆ NTS

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

Number of track segments in each super layers.

Definition at line 307 of file CDCTriggerHoughETFModule.h.

◆ radius

double 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 303 of file CDCTriggerHoughETFModule.h.

◆ shiftR

double shiftR = 0.
protected

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

Initialized at 0 by the SW shifter

Definition at line 237 of file CDCTriggerHoughETFModule.h.

◆ testFile

std::ofstream testFile
protected

filestream for test output for firmware debugging

Definition at line 291 of file CDCTriggerHoughETFModule.h.

◆ TSoffset

unsigned TSoffset[10] = {0}
protected

Number of track segments up to super layer.

Initialized at 0 by the SW shifter

Definition at line 305 of file CDCTriggerHoughETFModule.h.


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