9#include <mdst/dataobjects/HitPatternCDC.h>
11#include<framework/logging/Logger.h>
17std::bitset<64> sLayerZer(
static_cast<std::string
>(
"0000000000000000000000000000000000000000000000000000000011111111"));
18std::bitset<64> sLayerOne(
static_cast<std::string
>(
"0000000000000000000000000000000000000000000000000011111100000000"));
19std::bitset<64> sLayerTwo(
static_cast<std::string
>(
"0000000000000000000000000000000000000000000011111100000000000000"));
20std::bitset<64> sLayerThr(
static_cast<std::string
>(
"0000000000000000000000000000000000000011111100000000000000000000"));
21std::bitset<64> sLayerFou(
static_cast<std::string
>(
"0000000000000000000000000000000011111100000000000000000000000000"));
22std::bitset<64> sLayerFiv(
static_cast<std::string
>(
"0000000000000000000000000011111100000000000000000000000000000000"));
23std::bitset<64> sLayerSix(
static_cast<std::string
>(
"0000000000000000000011111100000000000000000000000000000000000000"));
24std::bitset<64> sLayerSev(
static_cast<std::string
>(
"0000000000000011111100000000000000000000000000000000000000000000"));
25std::bitset<64> sLayerEig(
static_cast<std::string
>(
"0000000011111100000000000000000000000000000000000000000000000000"));
28 sLayerFiv, sLayerSix, sLayerSev, sLayerEig
31std::bitset<64> infoLayerCDC(
static_cast<std::string
>(
"1111111100000000000000000000000000000000000000000000000000000000"));
36 {0, std::make_pair(0, 7)},
37 {1, std::make_pair(8, 13)},
38 {2, std::make_pair(14, 19)},
39 {3, std::make_pair(20, 25)},
40 {4, std::make_pair(26, 31)},
41 {5, std::make_pair(32, 37)},
42 {6, std::make_pair(38, 43)},
43 {7, std::make_pair(44, 49)},
44 {8, std::make_pair(50, 55)}
50 return static_cast<unsigned short int>((
m_pattern >> 56).to_ulong());
62 std::bitset<64> numberOfHits(nHits);
71 if constexpr(
sizeof(
unsigned long) >= 8) {
80 B2ASSERT(
"Layer is out of range.", layer <= 55);
86 B2ASSERT(
"Layer is out of range.", layer <= 55);
92 B2ASSERT(
"Layer is out of range.", layer <= 55);
98 for (
unsigned int i = 0; i <
m_pattern.size(); ++i) {
107 for (
unsigned int i =
m_pattern.size() - 8; i > 0; --i) {
116 B2ASSERT(
"Super layer outof range.", sLayer <= 8);
122 B2ASSERT(
"Super layer outof range.", sLayer <= 8);
123 for (
unsigned short int ii = 0; ii <
m_pattern.size(); ++ii) {
135 B2ASSERT(
"Super layer outof range.", sLayer <= 8);
141 B2ASSERT(
"Super layer outof range.", sLayer <= 8);
142 unsigned short max = 0;
143 unsigned short counter = 0;
145 for (
unsigned short i = indices.first; i <= indices.second; ++i) {
154 return std::max(max, counter);
std::string __str__() const
String for printing in python.
unsigned short getSLayerNHits(const unsigned short sLayer) const
Getter for the number of hits in one super-layer.
short getLastLayer() const
Returns the index of the last layer with a hit.
std::bitset< 64 > getSLayerPattern(const unsigned short sLayer)
Get the bit pattern in a specific super layer.
std::bitset< 64 > m_pattern
Saves the actual pattern.
static const std::map< unsigned short, std::pair< unsigned short, unsigned short > > s_superLayerIndices
Holds the indices for super layer access.
bool hasSLayer(const unsigned short sLayer) const
Getter for super-layer match.
bool hasAxialLayer() const
True, if at least one axial layer is true.
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.
ULong64_t getInteger() const
Getter for underlying integer type.
bool hasLayer(const unsigned short layer) const
Getter for single layer.
unsigned short getNHits() const
Get the total Number of CDC hits in the fit.
static const std::bitset< 64 > s_sLayerMasks[9]
Masks to zero out all bits from other layers.
short getFirstLayer() const
Returns the index of the first layer with a hit.
void resetLayer(const unsigned short layer)
Set bit corresponding to layer to false.
void resetSLayer(const unsigned short sLayer)
Reset complete superLayer, e.g.
unsigned short getLongestContRunInSL(const unsigned short sLayer) const
Getter for longest run of consecutive layers with hits within the given Super-layer.
bool hasStereoLayer() const
True, if at least one axial layer is true.
static const std::bitset< 64 > s_infoLayerMask
Mask to zero out all bits from other layers.
Abstract base class for different kinds of events.