Belle II Software development
AutomatonCell Class Reference

Cell used by the cellular automata. More...

#include <AutomatonCell.h>

Public Types

enum  ECellFlag : unsigned int {
  c_Assigned = 1 ,
  c_Start = 2 ,
  c_PriorityPath = 4 ,
  c_Cycle = 8 ,
  c_Masked = 16 ,
  c_Taken = 32 ,
  c_Background = 64 ,
  c_Priority = 128 ,
  c_Reverse = 256 ,
  c_Alias = 512 ,
  c_BadADCOrTOT = 1024
}
 Type for the status flags of cells in the cellular automata. More...
 
using ECellFlags = ECellFlag
 Type for an ored combination of the status flags of cells in the cellular automata.
 

Public Member Functions

 AutomatonCell ()
 Default constructor for ROOT compatibility. Cell weight defaults to 0.
 
 AutomatonCell (const Weight &cellWeight)
 Constructor with a certain cell weight.
 
 AutomatonCell (const Weight &cellWeight, const ECellFlags &initialFlags)
 Constructor with a certain cell weight and initial flags to be set.
 
Weight getCellState () const
 Getter for the cell state.
 
void setCellState (Weight state)
 Setter for the cell state.
 
Weight getCellWeight () const
 Getter for the cell weight.
 
void setCellWeight (Weight weight)
 Setter for the cell weight.
 
void setAssignedFlag (bool setTo=true)
 Sets the already assigned marker flag to the given value. Default value true.
 
void unsetAssignedFlag ()
 Resets the already assigned marker flag to false.
 
bool hasAssignedFlag () const
 Gets the current state of the already assigned marker flag.
 
void setStartFlag (bool setTo=true)
 Sets the start marker flag to the given value. Default value true.
 
void unsetStartFlag ()
 Resets the start marker flag to false.
 
bool hasStartFlag () const
 Gets the current state of the start marker flag.
 
void setPriorityPathFlag (bool setTo=true)
 Sets the priority path marker flag to the given value. Default value true.
 
void unsetPriorityPathFlag ()
 Resets the priority path marker flag to false.
 
bool hasPriorityPathFlag () const
 Gets the current state of the priority path marker flag.
 
void setCycleFlag (bool setTo=true)
 Sets the cycle marker flag to the given value. Default value true.
 
void unsetCycleFlag ()
 Resets the cycle marker flag to false.
 
bool hasCycleFlag () const
 Gets the current state of the cycle marker flag.
 
void unsetTemporaryFlags ()
 Resets the assigned, start and cycle marker flag.
 
void setMaskedFlag (bool setTo=true)
 Sets the masked flag to the given value. Default value true.
 
void unsetMaskedFlag ()
 Resets the masked flag to false.
 
bool hasMaskedFlag () const
 Gets the current state of the masked marker flag.
 
void setTakenFlag (bool setTo=true)
 Sets the taken flag to the given value. Default value true.
 
void unsetTakenFlag ()
 Resets the taken flag to false.
 
bool hasTakenFlag () const
 Gets the current state of the taken marker flag.
 
void setBackgroundFlag (bool setTo=true)
 Sets the background flag to the given value. Default value true.
 
void unsetBackgroundFlag ()
 Resets the background flag to false.
 
bool hasBackgroundFlag () const
 Gets the current state of the do not use flag marker flag.
 
void setBadADCOrTOTFlag (bool setTo=true)
 Sets the bad ADC or TOT flag to the given value.
 
void unsetBadADCOrTOTFlag ()
 Resets the bad ADC or TOT flag to false.
 
bool hasBadADCOrTOTFlag () const
 Gets the current state of the bad ADC or TOT flag.
 
void setPriorityFlag (bool setTo=true)
 Sets the priority flag to the given value. Default value true.
 
void unsetPriorityFlag ()
 Resets the priority flag to false.
 
bool hasPriorityFlag () const
 Gets the current state of the do not use flag marker flag.
 
void setReverseFlag (bool setTo=true)
 Sets the reverse flag to the given value. Default value true.
 
void unsetReverseFlag ()
 Resets the reverse flag to false.
 
bool hasReverseFlag () const
 Gets the current state of the do not use flag marker flag.
 
void setAliasFlag (bool setTo=true)
 Sets the alias flag to the given value. Default value true.
 
void unsetAliasFlag ()
 Resets the alias flag to false.
 
bool hasAliasFlag () const
 Gets the current state of the do not use flag marker flag.
 
template<ECellFlags cellFlag>
void setFlags (bool setTo)
 Setting accessing the flag by tag.
 
const ECellFlagsgetFlags () const
 Getter for the ored combination of the cell flags to mark some status of the cell.
 
void setFlags (ECellFlags flags)
 Setter for the cell flags.
 
void clearFlags (ECellFlags flags=c_AllFlags)
 Clear all flags.
 
bool hasAnyFlags (ECellFlags flags) const
 Checks if a cell has any of a sum of given flags.
 

Static Public Attributes

static const ECellFlags c_AllFlags
 Constant summing all possible cell flags.
 
static const ECellFlags c_TemporaryFlags
 Flage that are reset at the start of each run of the cellular automaton.
 

Private Attributes

Weight m_weight = 1
 Storage for the cell weight.
 
ECellFlags m_flags = ECellFlag(0)
 Storage for the cell status flags.
 
Weight m_state = 0
 Storage for the cell state set by the cellular automata.
 

Detailed Description

Cell used by the cellular automata.

This class represents a cell in the cellular automata algorithm the local tracking is build on. Different to the ordinary cellular automaton algorihms this class stores the state not as a interger number but
as a float value. This enables to have fractional measures of quality attached to the cell if say one new item
is not worth a full point, but a probability measure which is additiv. The points that can be gained by picking
this cell are stored in the cell weight property. Moreover the class defines status flags to be set and/or read by
the cellular automaton.

Definition at line 29 of file AutomatonCell.h.

Member Typedef Documentation

◆ ECellFlags

Type for an ored combination of the status flags of cells in the cellular automata.

Definition at line 50 of file AutomatonCell.h.

Member Enumeration Documentation

◆ ECellFlag

enum ECellFlag : unsigned int

Type for the status flags of cells in the cellular automata.

Definition at line 33 of file AutomatonCell.h.

33 : unsigned int {
34 c_Assigned = 1,
35 c_Start = 2,
36 c_PriorityPath = 4,
37 c_Cycle = 8,
38
39 c_Masked = 16,
40
41 c_Taken = 32,
42 c_Background = 64,
43 c_Priority = 128,
44 c_Reverse = 256,
45 c_Alias = 512,
46 c_BadADCOrTOT = 1024, // A CDCWireHit with bad ADC or TOT should not be used in pattern recognition.
47 };

Constructor & Destructor Documentation

◆ AutomatonCell() [1/3]

AutomatonCell ( )
inline

Default constructor for ROOT compatibility. Cell weight defaults to 0.

Definition at line 72 of file AutomatonCell.h.

73 : m_weight(0)
74 , m_flags(ECellFlag(0))
75 , m_state(0)
76 {
77 }
ECellFlag
Type for the status flags of cells in the cellular automata.
Definition: AutomatonCell.h:33
ECellFlags m_flags
Storage for the cell status flags.
Weight m_weight
Storage for the cell weight.
Weight m_state
Storage for the cell state set by the cellular automata.

◆ AutomatonCell() [2/3]

AutomatonCell ( const Weight &  cellWeight)
inlineexplicit

Constructor with a certain cell weight.

Definition at line 80 of file AutomatonCell.h.

81 : m_weight(cellWeight)
82 , m_flags(ECellFlag(0))
83 , m_state(0)
84 {
85 }

◆ AutomatonCell() [3/3]

AutomatonCell ( const Weight &  cellWeight,
const ECellFlags initialFlags 
)
inline

Constructor with a certain cell weight and initial flags to be set.

Definition at line 88 of file AutomatonCell.h.

89 : m_weight(cellWeight)
90 , m_flags(initialFlags)
91 , m_state(0)
92 {
93 }

Member Function Documentation

◆ clearFlags()

void clearFlags ( ECellFlags  flags = c_AllFlags)
inline

Clear all flags.

Definition at line 360 of file AutomatonCell.h.

361 { m_flags = ECellFlags(m_flags bitand ~flags); }
ECellFlag ECellFlags
Type for an ored combination of the status flags of cells in the cellular automata.
Definition: AutomatonCell.h:50

◆ getCellState()

Weight getCellState ( ) const
inline

Getter for the cell state.

Definition at line 96 of file AutomatonCell.h.

97 {
98 return m_state;
99 }

◆ getCellWeight()

Weight getCellWeight ( ) const
inline

Getter for the cell weight.

The cell might carry more than one unit of information to be added to the path.
The weight discribes an additiv constant to be gained when picking up this cell.
For instance segments may provide their number of hits as weight.
Or they could have a reduced number of hits deminshed by the quality of a fit to the segment.
For on the other side wire hits this should be one.

Definition at line 116 of file AutomatonCell.h.

117 {
118 return m_weight;
119 }

◆ getFlags()

const ECellFlags & getFlags ( ) const
inline

Getter for the ored combination of the cell flags to mark some status of the cell.

Give the ored combination of all cell flags, therefore providing a bit pattern.
Use rather hasAnyFlags() to retrieve stats even for single state values.

Definition at line 352 of file AutomatonCell.h.

353 { return m_flags; }

◆ hasAliasFlag()

bool hasAliasFlag ( ) const
inline

Gets the current state of the do not use flag marker flag.

Definition at line 331 of file AutomatonCell.h.

332 {
333 return hasAnyFlags(ECellFlag::c_Alias);
334 }
bool hasAnyFlags(ECellFlags flags) const
Checks if a cell has any of a sum of given flags.

◆ hasAnyFlags()

bool hasAnyFlags ( ECellFlags  flags) const
inline

Checks if a cell has any of a sum of given flags.

Definition at line 364 of file AutomatonCell.h.

365 { return m_flags bitand flags; }

◆ hasAssignedFlag()

bool hasAssignedFlag ( ) const
inline

Gets the current state of the already assigned marker flag.

Definition at line 140 of file AutomatonCell.h.

141 {
142 return hasAnyFlags(ECellFlag::c_Assigned);
143 }

◆ hasBackgroundFlag()

bool hasBackgroundFlag ( ) const
inline

Gets the current state of the do not use flag marker flag.

Definition at line 257 of file AutomatonCell.h.

258 {
259 return hasAnyFlags(ECellFlag::c_Background);
260 }

◆ hasBadADCOrTOTFlag()

bool hasBadADCOrTOTFlag ( ) const
inline

Gets the current state of the bad ADC or TOT flag.

Definition at line 277 of file AutomatonCell.h.

278 {
279 return hasAnyFlags(ECellFlag::c_BadADCOrTOT);
280 }

◆ hasCycleFlag()

bool hasCycleFlag ( ) const
inline

Gets the current state of the cycle marker flag.

Definition at line 194 of file AutomatonCell.h.

195 {
196 return hasAnyFlags(ECellFlag::c_Cycle);
197 }

◆ hasMaskedFlag()

bool hasMaskedFlag ( ) const
inline

Gets the current state of the masked marker flag.

Definition at line 218 of file AutomatonCell.h.

219 {
220 return hasAnyFlags(ECellFlag::c_Masked);
221 }

◆ hasPriorityFlag()

bool hasPriorityFlag ( ) const
inline

Gets the current state of the do not use flag marker flag.

Definition at line 295 of file AutomatonCell.h.

296 {
297 return hasAnyFlags(ECellFlag::c_Priority);
298 }

◆ hasPriorityPathFlag()

bool hasPriorityPathFlag ( ) const
inline

Gets the current state of the priority path marker flag.

Definition at line 176 of file AutomatonCell.h.

177 {
178 return hasAnyFlags(ECellFlag::c_PriorityPath);
179 }

◆ hasReverseFlag()

bool hasReverseFlag ( ) const
inline

Gets the current state of the do not use flag marker flag.

Definition at line 313 of file AutomatonCell.h.

314 {
315 return hasAnyFlags(ECellFlag::c_Reverse);
316 }

◆ hasStartFlag()

bool hasStartFlag ( ) const
inline

Gets the current state of the start marker flag.

Definition at line 158 of file AutomatonCell.h.

159 {
160 return hasAnyFlags(ECellFlag::c_Start);
161 }

◆ hasTakenFlag()

bool hasTakenFlag ( ) const
inline

Gets the current state of the taken marker flag.

Taken means that the hit has been either assigned to a track or has been classified as background should therefore be not used for any track fitting

Definition at line 239 of file AutomatonCell.h.

240 {
241 return hasAnyFlags(ECellFlag::c_Taken);
242 }

◆ setAliasFlag()

void setAliasFlag ( bool  setTo = true)
inline

Sets the alias flag to the given value. Default value true.

Definition at line 319 of file AutomatonCell.h.

320 {
321 setFlags<ECellFlag::c_Alias>(setTo);
322 }

◆ setAssignedFlag()

void setAssignedFlag ( bool  setTo = true)
inline

Sets the already assigned marker flag to the given value. Default value true.

Definition at line 128 of file AutomatonCell.h.

129 {
130 setFlags<ECellFlag::c_Assigned>(setTo);
131 }

◆ setBackgroundFlag()

void setBackgroundFlag ( bool  setTo = true)
inline

Sets the background flag to the given value. Default value true.

Definition at line 245 of file AutomatonCell.h.

246 {
247 setFlags<ECellFlag::c_Background>(setTo);
248 }

◆ setBadADCOrTOTFlag()

void setBadADCOrTOTFlag ( bool  setTo = true)
inline

Sets the bad ADC or TOT flag to the given value.

Default value true. The CDCWireHit with bad ADC or TOT should not be used in pattern recognition, but may be added to the track after the track finding if it is very close to the found track.

Definition at line 265 of file AutomatonCell.h.

266 {
267 setFlags<ECellFlag::c_BadADCOrTOT>(setTo);
268 }

◆ setCellState()

void setCellState ( Weight  state)
inline

Setter for the cell state.

Definition at line 102 of file AutomatonCell.h.

103 {
104 m_state = state;
105 }

◆ setCellWeight()

void setCellWeight ( Weight  weight)
inline

Setter for the cell weight.

Definition at line 122 of file AutomatonCell.h.

123 {
124 m_weight = weight;
125 }

◆ setCycleFlag()

void setCycleFlag ( bool  setTo = true)
inline

Sets the cycle marker flag to the given value. Default value true.

Definition at line 182 of file AutomatonCell.h.

183 {
184 setFlags<ECellFlag::c_Cycle>(setTo);
185 }

◆ setFlags() [1/2]

void setFlags ( bool  setTo)
inline

Setting accessing the flag by tag.

Definition at line 338 of file AutomatonCell.h.

339 {
340 if (setTo) {
341 setFlags(cellFlag);
342 } else {
343 clearFlags(cellFlag);
344 }
345 }
void setFlags(bool setTo)
Setting accessing the flag by tag.
void clearFlags(ECellFlags flags=c_AllFlags)
Clear all flags.

◆ setFlags() [2/2]

void setFlags ( ECellFlags  flags)
inline

Setter for the cell flags.

Definition at line 356 of file AutomatonCell.h.

357 { m_flags = ECellFlags(m_flags bitor flags); }

◆ setMaskedFlag()

void setMaskedFlag ( bool  setTo = true)
inline

Sets the masked flag to the given value. Default value true.

Definition at line 206 of file AutomatonCell.h.

207 {
208 setFlags<ECellFlag::c_Masked>(setTo);
209 }

◆ setPriorityFlag()

void setPriorityFlag ( bool  setTo = true)
inline

Sets the priority flag to the given value. Default value true.

Definition at line 283 of file AutomatonCell.h.

284 {
285 setFlags<ECellFlag::c_Priority>(setTo);
286 }

◆ setPriorityPathFlag()

void setPriorityPathFlag ( bool  setTo = true)
inline

Sets the priority path marker flag to the given value. Default value true.

Definition at line 164 of file AutomatonCell.h.

165 {
166 setFlags<ECellFlag::c_PriorityPath>(setTo);
167 }

◆ setReverseFlag()

void setReverseFlag ( bool  setTo = true)
inline

Sets the reverse flag to the given value. Default value true.

Definition at line 301 of file AutomatonCell.h.

302 {
303 setFlags<ECellFlag::c_Reverse>(setTo);
304 }

◆ setStartFlag()

void setStartFlag ( bool  setTo = true)
inline

Sets the start marker flag to the given value. Default value true.

Definition at line 146 of file AutomatonCell.h.

147 {
148 setFlags<ECellFlag::c_Start>(setTo);
149 }

◆ setTakenFlag()

void setTakenFlag ( bool  setTo = true)
inline

Sets the taken flag to the given value. Default value true.

Definition at line 224 of file AutomatonCell.h.

225 {
226 setFlags<ECellFlag::c_Taken>(setTo);
227 }

◆ unsetAliasFlag()

void unsetAliasFlag ( )
inline

Resets the alias flag to false.

Definition at line 325 of file AutomatonCell.h.

326 {
327 setFlags<ECellFlag::c_Alias>(false);
328 }

◆ unsetAssignedFlag()

void unsetAssignedFlag ( )
inline

Resets the already assigned marker flag to false.

Definition at line 134 of file AutomatonCell.h.

135 {
136 setFlags<ECellFlag::c_Assigned>(false);
137 }

◆ unsetBackgroundFlag()

void unsetBackgroundFlag ( )
inline

Resets the background flag to false.

Definition at line 251 of file AutomatonCell.h.

252 {
253 setFlags<ECellFlag::c_Background>(false);
254 }

◆ unsetBadADCOrTOTFlag()

void unsetBadADCOrTOTFlag ( )
inline

Resets the bad ADC or TOT flag to false.

Definition at line 271 of file AutomatonCell.h.

272 {
273 setFlags<ECellFlag::c_BadADCOrTOT>(false);
274 }

◆ unsetCycleFlag()

void unsetCycleFlag ( )
inline

Resets the cycle marker flag to false.

Definition at line 188 of file AutomatonCell.h.

189 {
190 setFlags<ECellFlag::c_Cycle>(false);
191 }

◆ unsetMaskedFlag()

void unsetMaskedFlag ( )
inline

Resets the masked flag to false.

Definition at line 212 of file AutomatonCell.h.

213 {
214 setFlags<ECellFlag::c_Masked>(false);
215 }

◆ unsetPriorityFlag()

void unsetPriorityFlag ( )
inline

Resets the priority flag to false.

Definition at line 289 of file AutomatonCell.h.

290 {
291 setFlags<ECellFlag::c_Priority>(false);
292 }

◆ unsetPriorityPathFlag()

void unsetPriorityPathFlag ( )
inline

Resets the priority path marker flag to false.

Definition at line 170 of file AutomatonCell.h.

171 {
172 setFlags<ECellFlag::c_PriorityPath>(false);
173 }

◆ unsetReverseFlag()

void unsetReverseFlag ( )
inline

Resets the reverse flag to false.

Definition at line 307 of file AutomatonCell.h.

308 {
309 setFlags<ECellFlag::c_Reverse>(false);
310 }

◆ unsetStartFlag()

void unsetStartFlag ( )
inline

Resets the start marker flag to false.

Definition at line 152 of file AutomatonCell.h.

153 {
154 setFlags<ECellFlag::c_Start>(false);
155 }

◆ unsetTakenFlag()

void unsetTakenFlag ( )
inline

Resets the taken flag to false.

Definition at line 230 of file AutomatonCell.h.

231 {
232 setFlags<ECellFlag::c_Taken>(false);
233 }

◆ unsetTemporaryFlags()

void unsetTemporaryFlags ( )
inline

Resets the assigned, start and cycle marker flag.

Definition at line 200 of file AutomatonCell.h.

201 {
202 setFlags<c_TemporaryFlags>(false);
203 }

Member Data Documentation

◆ c_AllFlags

const ECellFlags c_AllFlags
static
Initial value:
= ECellFlags(ECellFlag::c_Assigned +
ECellFlag::c_Start +
ECellFlag::c_PriorityPath +
ECellFlag::c_Cycle +
ECellFlag::c_Masked +
ECellFlag::c_Taken +
ECellFlag::c_Background +
ECellFlag::c_Reverse +
ECellFlag::c_Alias +
ECellFlag::c_BadADCOrTOT)

Constant summing all possible cell flags.

Definition at line 53 of file AutomatonCell.h.

◆ c_TemporaryFlags

const ECellFlags c_TemporaryFlags
static
Initial value:
= ECellFlags(ECellFlag::c_Assigned +
ECellFlag::c_Start +
ECellFlag::c_PriorityPath +
ECellFlag::c_Cycle)

Flage that are reset at the start of each run of the cellular automaton.

Definition at line 65 of file AutomatonCell.h.

◆ m_flags

ECellFlags m_flags = ECellFlag(0)
private

Storage for the cell status flags.

Definition at line 372 of file AutomatonCell.h.

◆ m_state

Weight m_state = 0
private

Storage for the cell state set by the cellular automata.

Definition at line 375 of file AutomatonCell.h.

◆ m_weight

Weight m_weight = 1
private

Storage for the cell weight.

Definition at line 369 of file AutomatonCell.h.


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