![]() |
Belle II Software
light-2303-iriomote
|
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. More... | |
| void | setNHits (unsigned short nHits) |
| Sets the 8 MSBs to the total number of hits in the CDC. More... | |
| void | setLayer (const unsigned short layer) |
| Set bit corresponding to layer to true. More... | |
| void | resetLayer (const unsigned short layer) |
| Set bit corresponding to layer to false. More... | |
| bool | hasLayer (const unsigned short layer) const |
| Getter for single layer. More... | |
| short | getFirstLayer () const |
| Returns the index of the first layer with a hit. More... | |
| short | getLastLayer () const |
| Returns the index of the last layer with a hit. More... | |
| bool | hasSLayer (const unsigned short sLayer) const |
| Getter for super-layer match. More... | |
| void | resetSLayer (const unsigned short sLayer) |
| Reset complete superLayer, e.g. More... | |
| std::bitset< 64 > | getSLayerPattern (const unsigned short sLayer) |
| Get the bit pattern in a specific super layer. More... | |
| unsigned short | getSLayerNHits (const unsigned short sLayer) const |
| Getter for the number of hits in one super-layer. More... | |
| unsigned short | getLongestContRunInSL (const unsigned short sLayer) const |
| Getter for longest run of consecutive layers with hits within the given Super-layer. More... | |
| 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. More... | |
| void | resetPattern () |
| Reset the complete hit pattern. More... | |
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. More... | |
| 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. More... | |
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.
|
inlineprivate |
Getter for underlying bit set.
Just for testing.
Definition at line 166 of file HitPatternCDC.h.
| 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.
| 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 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.
| 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 |
| 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.
|
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.