Belle II Software development
|
Hit pattern of CDC hits within a track. More...
#include <HitPatternCDC.h>
Public Member Functions | |
HitPatternCDC () | |
Create empty pattern. | |
HitPatternCDC (ULong64_t initValue) | |
Initialize the pattern with an integer. | |
ULong64_t | getInteger () const |
Getter for underlying integer type. | |
unsigned short | getNHits () const |
Get the total Number of CDC hits in the fit. | |
void | setNHits (unsigned short nHits) |
Sets the 8 MSBs to the total number of hits in the CDC. | |
void | setLayer (const unsigned short layer) |
Set bit corresponding to layer to true. | |
void | resetLayer (const unsigned short layer) |
Set bit corresponding to layer to false. | |
bool | hasLayer (const unsigned short layer) const |
Getter for single layer. | |
short | getFirstLayer () const |
Returns the index of the first layer with a hit. | |
short | getLastLayer () const |
Returns the index of the last layer with a hit. | |
bool | hasSLayer (const unsigned short sLayer) const |
Getter for super-layer match. | |
void | resetSLayer (const unsigned short sLayer) |
Reset complete superLayer, e.g. | |
std::bitset< 64 > | getSLayerPattern (const unsigned short sLayer) |
Get the bit pattern in a specific super layer. | |
unsigned short | getSLayerNHits (const unsigned short sLayer) const |
Getter for the number of hits in one super-layer. | |
unsigned short | getLongestContRunInSL (const unsigned short sLayer) const |
Getter for longest run of consecutive layers with hits within the given Super-layer. | |
bool | hasAxialLayer () const |
True, if at least one axial layer is true. | |
bool | hasStereoLayer () const |
True, if at least one axial layer is true. | |
std::string | __str__ () const |
String for printing in python. | |
Private Member Functions | |
std::bitset< 64 > | getBitSet () const |
Getter for underlying bit set. | |
void | resetPattern () |
Reset the complete hit pattern. | |
Private Attributes | |
std::bitset< 64 > | m_pattern |
Saves the actual pattern. | |
Static Private Attributes | |
static const std::bitset< 64 > | s_sLayerMasks [9] |
Masks to zero out all bits from other layers. | |
static const std::bitset< 64 > | s_infoLayerMask = infoLayerCDC |
Mask to zero out all bits from other layers. | |
static const std::map< unsigned short, std::pair< unsigned short, unsigned short > > | s_superLayerIndices |
Holds the indices for super layer access. | |
Friends | |
class | HitPatternCDCTest_settersNGetters_Test |
class | HitPatternCDCTest_getFirstLastLayer_Test |
Hit pattern of CDC hits within a track.
The pattern is stored using a std::bitset. This allows to use the STL, which is very efficiently programmed.
For each layer there is one bit. The layer counting is from 0 to 55. Super-layer information is generated on demand. The super-layer counting goes from 0 to 8.
The numbering scheme just in this class is equivalent to the one defined in the note BELLE2-NOTE-TE-2015-022: https://docs.belle2.org/record/256
Definition at line 35 of file HitPatternCDC.h.
|
inline |
Create empty pattern.
Definition at line 41 of file HitPatternCDC.h.
|
inlineexplicit |
Initialize the pattern with an integer.
Definition at line 44 of file HitPatternCDC.h.
std::string __str__ | ( | ) | const |
String for printing in python.
Definition at line 169 of file HitPatternCDC.cc.
|
inlineprivate |
short getFirstLayer | ( | ) | const |
Returns the index of the first layer with a hit.
If there is no hit in the whole pattern, -1 is returned.
Definition at line 96 of file HitPatternCDC.cc.
ULong64_t getInteger | ( | ) | const |
Getter for underlying integer type.
Definition at line 69 of file HitPatternCDC.cc.
short getLastLayer | ( | ) | const |
Returns the index of the last layer with a hit.
If there is no hit in the whole pattern, -1 is returned.
Definition at line 104 of file HitPatternCDC.cc.
unsigned short getLongestContRunInSL | ( | const unsigned short | sLayer | ) | const |
Getter for longest run of consecutive layers with hits within the given Super-layer.
sLayer | Super-layer index. |
Definition at line 139 of file HitPatternCDC.cc.
unsigned short getNHits | ( | ) | const |
Get the total Number of CDC hits in the fit.
Nota Bene: The maximum value returned here is 255. This is because only 8 bits are available to store the information. If the track had more than 255 hits, e.g. because it was a curler, the returned value may be to small.
Definition at line 47 of file HitPatternCDC.cc.
unsigned short getSLayerNHits | ( | const unsigned short | sLayer | ) | const |
Getter for the number of hits in one super-layer.
Nota Bene: As only a bitwise information is available if a layer is hit, under-counting is possible if in at least one layer more than one wire is hit.
sLayer | Super-layer index. |
Definition at line 133 of file HitPatternCDC.cc.
std::bitset< 64 > getSLayerPattern | ( | const unsigned short | sLayer | ) |
Get the bit pattern in a specific super layer.
sLayer | Super-layer index. |
Definition at line 128 of file HitPatternCDC.cc.
bool hasAxialLayer | ( | ) | const |
True, if at least one axial layer is true.
Definition at line 157 of file HitPatternCDC.cc.
bool hasLayer | ( | const unsigned short | layer | ) | const |
Getter for single layer.
layer | Layer index. |
Definition at line 90 of file HitPatternCDC.cc.
bool hasSLayer | ( | const unsigned short | sLayer | ) | const |
Getter for super-layer match.
sLayer | super-layer index. |
Definition at line 114 of file HitPatternCDC.cc.
bool hasStereoLayer | ( | ) | const |
True, if at least one axial layer is true.
Definition at line 163 of file HitPatternCDC.cc.
void resetLayer | ( | const unsigned short | layer | ) |
Set bit corresponding to layer to false.
This function may throw an out-of-range exception.
layer | Layer index. |
Definition at line 84 of file HitPatternCDC.cc.
|
inlineprivate |
Reset the complete hit pattern.
Just for testing.
Definition at line 169 of file HitPatternCDC.h.
void resetSLayer | ( | const unsigned short | sLayer | ) |
Reset complete superLayer, e.g.
because segment shouldn't belong to that track.
sLayer | Super-layer index. |
Definition at line 120 of file HitPatternCDC.cc.
void setLayer | ( | const unsigned short | layer | ) |
Set bit corresponding to layer to true.
This function may throw an out-of-range exception.
layer | Layer index. |
Definition at line 78 of file HitPatternCDC.cc.
void setNHits | ( | unsigned short | nHits | ) |
Sets the 8 MSBs to the total number of hits in the CDC.
Nota Bene: If the whole track has more than 255 hits, e.g. because it is a curler, the value is set to 255.
nHits | Number of hits in the CDC. |
Definition at line 53 of file HitPatternCDC.cc.
|
friend |
Definition at line 37 of file HitPatternCDC.h.
|
friend |
Definition at line 36 of file HitPatternCDC.h.
|
private |
Saves the actual pattern.
Definition at line 158 of file HitPatternCDC.h.
|
staticprivate |
Mask to zero out all bits from other layers.
Definition at line 160 of file HitPatternCDC.h.
|
staticprivate |
Masks to zero out all bits from other layers.
Definition at line 159 of file HitPatternCDC.h.
|
staticprivate |
Holds the indices for super layer access.
Definition at line 163 of file HitPatternCDC.h.