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 ,
  c_BoardWithBadADC = 2048 ,
  c_BoardWithBadTOT = 4096
}
 Type for the status flags of cells in the cellular automata. More...
 
using ECellFlags = ECellFlag
 Type for an ordered 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 setBoardWithBadADCFlag (bool setTo=true)
 Set board with bad ADC flag.
 
void unsetBoardWithBadADCFlag ()
 Resets the bad ADC flag to false.
 
bool hasBoardWithBadADCFlag () const
 Gets the current state of the bad ADC flag.
 
void setBoardWithBadTOTFlag (bool setTo=true)
 Set board with bad TOT flag.
 
void unsetBoardWithBadTOTFlag ()
 Resets the bad TOT flag to false.
 
bool hasBoardWithBadTOTFlag () const
 Gets the current state of the bad 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 ordered 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
 Flags that are reset at the start of each run of the cellular automaton.
 

Private Attributes

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

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 algorithms this class stores the state not as a integer 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 additive. 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 ordered combination of the status flags of cells in the cellular automata.

Definition at line 52 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 c_BoardWithBadADC = 2048, // Ignore ADC info in filters (detected in each event)
48 c_BoardWithBadTOT = 4096 // Ignore TOT info in filters (detected in each event)
49 };

Constructor & Destructor Documentation

◆ AutomatonCell() [1/3]

AutomatonCell ( )
inline

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

Definition at line 77 of file AutomatonCell.h.

78 : m_weight(0)
79 , m_state(0)
80 , m_flags(ECellFlag(0))
81 {
82 }

◆ AutomatonCell() [2/3]

AutomatonCell ( const Weight & cellWeight)
inlineexplicit

Constructor with a certain cell weight.

Definition at line 85 of file AutomatonCell.h.

86 : m_weight(cellWeight)
87 , m_state(0)
88 , m_flags(ECellFlag(0))
89 {
90 }

◆ 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 93 of file AutomatonCell.h.

94 : m_weight(cellWeight)
95 , m_state(0)
96 , m_flags(initialFlags)
97 {
98 }

Member Function Documentation

◆ clearFlags()

void clearFlags ( ECellFlags flags = c_AllFlags)
inline

Clear all flags.

Definition at line 402 of file AutomatonCell.h.

403 { m_flags = ECellFlags(m_flags bitand ~flags); }

◆ getCellState()

Weight getCellState ( ) const
inline

Getter for the cell state.

Definition at line 101 of file AutomatonCell.h.

102 {
103 return m_state;
104 }

◆ 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 describes an additive 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 diminished by the quality of a fit to the segment.
For on the other side wire hits this should be one.

Definition at line 121 of file AutomatonCell.h.

122 {
123 return m_weight;
124 }

◆ getFlags()

const ECellFlags & getFlags ( ) const
inline

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

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

Definition at line 394 of file AutomatonCell.h.

395 { return m_flags; }

◆ hasAliasFlag()

bool hasAliasFlag ( ) const
inline

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

Definition at line 373 of file AutomatonCell.h.

374 {
375 return hasAnyFlags(ECellFlag::c_Alias);
376 }

◆ hasAnyFlags()

bool hasAnyFlags ( ECellFlags flags) const
inline

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

Definition at line 406 of file AutomatonCell.h.

407 { return m_flags bitand flags; }

◆ hasAssignedFlag()

bool hasAssignedFlag ( ) const
inline

Gets the current state of the already assigned marker flag.

Definition at line 145 of file AutomatonCell.h.

146 {
147 return hasAnyFlags(ECellFlag::c_Assigned);
148 }

◆ hasBackgroundFlag()

bool hasBackgroundFlag ( ) const
inline

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

Definition at line 262 of file AutomatonCell.h.

263 {
264 return hasAnyFlags(ECellFlag::c_Background);
265 }

◆ hasBadADCOrTOTFlag()

bool hasBadADCOrTOTFlag ( ) const
inline

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

Definition at line 282 of file AutomatonCell.h.

283 {
284 return hasAnyFlags(ECellFlag::c_BadADCOrTOT);
285 }

◆ hasBoardWithBadADCFlag()

bool hasBoardWithBadADCFlag ( ) const
inline

Gets the current state of the bad ADC flag.

Definition at line 301 of file AutomatonCell.h.

302 {
303 return hasAnyFlags(ECellFlag::c_BoardWithBadADC);
304 }

◆ hasBoardWithBadTOTFlag()

bool hasBoardWithBadTOTFlag ( ) const
inline

Gets the current state of the bad TOT flag.

Definition at line 319 of file AutomatonCell.h.

320 {
321 return hasAnyFlags(ECellFlag::c_BoardWithBadTOT);
322 }

◆ hasCycleFlag()

bool hasCycleFlag ( ) const
inline

Gets the current state of the cycle marker flag.

Definition at line 199 of file AutomatonCell.h.

200 {
201 return hasAnyFlags(ECellFlag::c_Cycle);
202 }

◆ hasMaskedFlag()

bool hasMaskedFlag ( ) const
inline

Gets the current state of the masked marker flag.

Definition at line 223 of file AutomatonCell.h.

224 {
225 return hasAnyFlags(ECellFlag::c_Masked);
226 }

◆ hasPriorityFlag()

bool hasPriorityFlag ( ) const
inline

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

Definition at line 337 of file AutomatonCell.h.

338 {
339 return hasAnyFlags(ECellFlag::c_Priority);
340 }

◆ hasPriorityPathFlag()

bool hasPriorityPathFlag ( ) const
inline

Gets the current state of the priority path marker flag.

Definition at line 181 of file AutomatonCell.h.

182 {
183 return hasAnyFlags(ECellFlag::c_PriorityPath);
184 }

◆ hasReverseFlag()

bool hasReverseFlag ( ) const
inline

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

Definition at line 355 of file AutomatonCell.h.

356 {
357 return hasAnyFlags(ECellFlag::c_Reverse);
358 }

◆ hasStartFlag()

bool hasStartFlag ( ) const
inline

Gets the current state of the start marker flag.

Definition at line 163 of file AutomatonCell.h.

164 {
165 return hasAnyFlags(ECellFlag::c_Start);
166 }

◆ 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 244 of file AutomatonCell.h.

245 {
246 return hasAnyFlags(ECellFlag::c_Taken);
247 }

◆ setAliasFlag()

void setAliasFlag ( bool setTo = true)
inline

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

Definition at line 361 of file AutomatonCell.h.

362 {
363 setFlags<ECellFlag::c_Alias>(setTo);
364 }

◆ setAssignedFlag()

void setAssignedFlag ( bool setTo = true)
inline

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

Definition at line 133 of file AutomatonCell.h.

134 {
135 setFlags<ECellFlag::c_Assigned>(setTo);
136 }

◆ setBackgroundFlag()

void setBackgroundFlag ( bool setTo = true)
inline

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

Definition at line 250 of file AutomatonCell.h.

251 {
252 setFlags<ECellFlag::c_Background>(setTo);
253 }

◆ 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 270 of file AutomatonCell.h.

271 {
272 setFlags<ECellFlag::c_BadADCOrTOT>(setTo);
273 }

◆ setBoardWithBadADCFlag()

void setBoardWithBadADCFlag ( bool setTo = true)
inline

Set board with bad ADC flag.

Definition at line 289 of file AutomatonCell.h.

290 {
291 setFlags<ECellFlag::c_BoardWithBadADC>(setTo);
292 }

◆ setBoardWithBadTOTFlag()

void setBoardWithBadTOTFlag ( bool setTo = true)
inline

Set board with bad TOT flag.

Definition at line 307 of file AutomatonCell.h.

308 {
309 setFlags<ECellFlag::c_BoardWithBadTOT>(setTo);
310 }

◆ setCellState()

void setCellState ( Weight state)
inline

Setter for the cell state.

Definition at line 107 of file AutomatonCell.h.

108 {
109 m_state = state;
110 }

◆ setCellWeight()

void setCellWeight ( Weight weight)
inline

Setter for the cell weight.

Definition at line 127 of file AutomatonCell.h.

128 {
129 m_weight = weight;
130 }

◆ setCycleFlag()

void setCycleFlag ( bool setTo = true)
inline

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

Definition at line 187 of file AutomatonCell.h.

188 {
189 setFlags<ECellFlag::c_Cycle>(setTo);
190 }

◆ setFlags() [1/2]

template<ECellFlags cellFlag>
void setFlags ( bool setTo)
inline

Setting accessing the flag by tag.

Definition at line 380 of file AutomatonCell.h.

381 {
382 if (setTo) {
383 setFlags(cellFlag);
384 } else {
385 clearFlags(cellFlag);
386 }
387 }

◆ setFlags() [2/2]

void setFlags ( ECellFlags flags)
inline

Setter for the cell flags.

Definition at line 398 of file AutomatonCell.h.

399 { 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 211 of file AutomatonCell.h.

212 {
213 setFlags<ECellFlag::c_Masked>(setTo);
214 }

◆ setPriorityFlag()

void setPriorityFlag ( bool setTo = true)
inline

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

Definition at line 325 of file AutomatonCell.h.

326 {
327 setFlags<ECellFlag::c_Priority>(setTo);
328 }

◆ setPriorityPathFlag()

void setPriorityPathFlag ( bool setTo = true)
inline

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

Definition at line 169 of file AutomatonCell.h.

170 {
171 setFlags<ECellFlag::c_PriorityPath>(setTo);
172 }

◆ setReverseFlag()

void setReverseFlag ( bool setTo = true)
inline

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

Definition at line 343 of file AutomatonCell.h.

344 {
345 setFlags<ECellFlag::c_Reverse>(setTo);
346 }

◆ setStartFlag()

void setStartFlag ( bool setTo = true)
inline

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

Definition at line 151 of file AutomatonCell.h.

152 {
153 setFlags<ECellFlag::c_Start>(setTo);
154 }

◆ setTakenFlag()

void setTakenFlag ( bool setTo = true)
inline

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

Definition at line 229 of file AutomatonCell.h.

230 {
231 setFlags<ECellFlag::c_Taken>(setTo);
232 }

◆ unsetAliasFlag()

void unsetAliasFlag ( )
inline

Resets the alias flag to false.

Definition at line 367 of file AutomatonCell.h.

368 {
369 setFlags<ECellFlag::c_Alias>(false);
370 }

◆ unsetAssignedFlag()

void unsetAssignedFlag ( )
inline

Resets the already assigned marker flag to false.

Definition at line 139 of file AutomatonCell.h.

140 {
141 setFlags<ECellFlag::c_Assigned>(false);
142 }

◆ unsetBackgroundFlag()

void unsetBackgroundFlag ( )
inline

Resets the background flag to false.

Definition at line 256 of file AutomatonCell.h.

257 {
258 setFlags<ECellFlag::c_Background>(false);
259 }

◆ unsetBadADCOrTOTFlag()

void unsetBadADCOrTOTFlag ( )
inline

Resets the bad ADC or TOT flag to false.

Definition at line 276 of file AutomatonCell.h.

277 {
278 setFlags<ECellFlag::c_BadADCOrTOT>(false);
279 }

◆ unsetBoardWithBadADCFlag()

void unsetBoardWithBadADCFlag ( )
inline

Resets the bad ADC flag to false.

Definition at line 295 of file AutomatonCell.h.

296 {
297 setFlags<ECellFlag::c_BoardWithBadADC>(false);
298 }

◆ unsetBoardWithBadTOTFlag()

void unsetBoardWithBadTOTFlag ( )
inline

Resets the bad TOT flag to false.

Definition at line 313 of file AutomatonCell.h.

314 {
315 setFlags<ECellFlag::c_BoardWithBadTOT>(false);
316 }

◆ unsetCycleFlag()

void unsetCycleFlag ( )
inline

Resets the cycle marker flag to false.

Definition at line 193 of file AutomatonCell.h.

194 {
195 setFlags<ECellFlag::c_Cycle>(false);
196 }

◆ unsetMaskedFlag()

void unsetMaskedFlag ( )
inline

Resets the masked flag to false.

Definition at line 217 of file AutomatonCell.h.

218 {
219 setFlags<ECellFlag::c_Masked>(false);
220 }

◆ unsetPriorityFlag()

void unsetPriorityFlag ( )
inline

Resets the priority flag to false.

Definition at line 331 of file AutomatonCell.h.

332 {
333 setFlags<ECellFlag::c_Priority>(false);
334 }

◆ unsetPriorityPathFlag()

void unsetPriorityPathFlag ( )
inline

Resets the priority path marker flag to false.

Definition at line 175 of file AutomatonCell.h.

176 {
177 setFlags<ECellFlag::c_PriorityPath>(false);
178 }

◆ unsetReverseFlag()

void unsetReverseFlag ( )
inline

Resets the reverse flag to false.

Definition at line 349 of file AutomatonCell.h.

350 {
351 setFlags<ECellFlag::c_Reverse>(false);
352 }

◆ unsetStartFlag()

void unsetStartFlag ( )
inline

Resets the start marker flag to false.

Definition at line 157 of file AutomatonCell.h.

158 {
159 setFlags<ECellFlag::c_Start>(false);
160 }

◆ unsetTakenFlag()

void unsetTakenFlag ( )
inline

Resets the taken flag to false.

Definition at line 235 of file AutomatonCell.h.

236 {
237 setFlags<ECellFlag::c_Taken>(false);
238 }

◆ unsetTemporaryFlags()

void unsetTemporaryFlags ( )
inline

Resets the assigned, start and cycle marker flag.

Definition at line 205 of file AutomatonCell.h.

206 {
207 setFlags<c_TemporaryFlags>(false);
208 }

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 +
ECellFlag::c_BoardWithBadADC +
ECellFlag::c_BoardWithBadTOT
)
ECellFlag ECellFlags
Type for an ordered combination of the status flags of cells in the cellular automata.

Constant summing all possible cell flags.

Definition at line 55 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)

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

Definition at line 70 of file AutomatonCell.h.

◆ m_flags

ECellFlags m_flags = ECellFlag(0)
private

Storage for the cell status flags.

Definition at line 417 of file AutomatonCell.h.

◆ m_state

Weight m_state = 0
private

Storage for the cell state set by the cellular automata.

Definition at line 414 of file AutomatonCell.h.

◆ m_weight

Weight m_weight = 1
private

Storage for the cell weight.

Definition at line 411 of file AutomatonCell.h.


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