 |
Belle II Software
release-05-02-19
|
11 #include <mdst/dataobjects/HitPatternVXD.h>
12 #include <framework/logging/Logger.h>
21 std::bitset<32>(
static_cast<std::string
>(
"00000000000000000000000000001111")),
22 std::bitset<32>(
static_cast<std::string
>(
"00000000000000000000000011110000")),
23 std::bitset<32>(
static_cast<std::string
>(
"00000000000000000000111100000000")),
24 std::bitset<32>(
static_cast<std::string
>(
"00000000000000001111000000000000")),
25 std::bitset<32>(
static_cast<std::string
>(
"00000000000011110000000000000000")),
26 std::bitset<32>(
static_cast<std::string
>(
"00000000111100000000000000000000"))
30 std::bitset<32>(
static_cast<std::string
>(
"00000000000000000000000000110011")),
31 std::bitset<32>(
static_cast<std::string
>(
"00000000000000000000000011001100"))
35 std::bitset<32>(
static_cast<std::string
>(
"00000000001100110011001100000000")),
36 std::bitset<32>(
static_cast<std::string
>(
"00000000110011001100110000000000"))
53 B2ASSERT(
"SVD layer is out of range.", 3 <= layerId and layerId <= 6);
55 if (uHits > 3) uHits = 3;
56 if (vHits > 3) vHits = 3;
57 const unsigned short arrayId = layerId - 3;
58 std::bitset<32> uHitPattern(uHits);
60 std::bitset<32> vHitPattern(vHits);
67 B2ASSERT(
"SVD layer is out of range.", 3 <= layerId and layerId <= 6);
70 const unsigned short arrayId = layerId - 3;
71 const unsigned short uHits = (uHitsPattern >> (
s_svdUshift + 4 * arrayId)).to_ulong();
72 const unsigned short vHits = (vHitsPattern >> (
s_svdVshift + 4 * arrayId)).to_ulong();
73 return std::make_pair(uHits, vHits);
78 B2ASSERT(
"SVD layer is out of range.", 3 <= layerId and layerId <= 6);
85 unsigned short svdHits = 0;
95 unsigned short nSVD = 0;
97 std::pair<const unsigned short, const unsigned short> hits(
getSVDLayer(layerId));
98 if ((hits.first + hits.second) > 0) ++nSVD;
106 std::pair<const unsigned short, const unsigned short> hits(
getSVDLayer(layerId));
107 if ((hits.first + hits.second) > 0)
return layerId;
115 const auto layerId = *rit;
116 std::pair<const unsigned short, const unsigned short> hits(
getSVDLayer(layerId));
117 if ((hits.first + hits.second) > 0)
return layerId;
124 B2ASSERT(
"PXD layer is out of range.", layerId == 1 or layerId == 2);
126 if (nHits > 3) nHits = 3;
127 std::bitset<32> hits(nHits);
128 const unsigned short arrayId = layerId - 1;
129 hits <<= 4 * arrayId + 2 * static_cast<unsigned short>(mode);
135 B2ASSERT(
"PXD layer is out of range.", layerId == 1 or layerId == 2);
136 const unsigned short arrayId = layerId - 1;
138 return (hits >> (4 * arrayId + 2 *
static_cast<unsigned short>(mode))).to_ulong();
143 B2ASSERT(
"PXD layer is out of range.", layerId == 1 or layerId == 2);
149 unsigned short pxdHits = 0;
159 unsigned short nPXD = 0;
169 if (
getPXDLayer(layerId, mode) > 0)
return layerId;
177 const auto layerId = *rit;
178 if (
getPXDLayer(layerId, mode) > 0)
return layerId;
static const std::list< unsigned short > s_SVDLayerNumbers
For iterating through layers.
static const std::bitset< 32 > s_SVDuvMasks[2]
Mask to zero out all bits from other layers.
unsigned short getNdf() const
Get degrees of freedom in PXD and SVD.
short getFirstSVDLayer() const
Get the first activated SVD layer index.
unsigned short getNPXDHits() const
Get total number of hits in the PXD.
static const std::bitset< 32 > s_LayerMasks[6]
Masks to zero out all bits from other layers.
unsigned short getNVXDLayers(const PXDMode &pxdmode=PXDMode::normal) const
Return the total number of activated layers in the VXD depending on the mode of the PXD.
short getFirstPXDLayer(const PXDMode &mode=PXDMode::normal) const
Returns the first activated layer of the PXD depending on the mode.
void resetPXDLayer(const unsigned short layerId, const PXDMode &mode=PXDMode::normal)
Reset the number of hits in a specific layer of the PXD.
std::pair< const unsigned short, const unsigned short > getSVDLayer(const unsigned short layerId) const
Get the number of hits in a specific layer of the SVD.
short getLastPXDLayer(const PXDMode &mode=PXDMode::normal) const
Returns the last activated layer of the PXD depending on the mode.
unsigned short getNPXDLayers(const PXDMode &mode=PXDMode::normal) const
Returns the total number of activated layers of the PXD.
Abstract base class for different kinds of events.
static const unsigned int s_svdVshift
for internal shifting to the SVD bits.
void setPXDLayer(const unsigned short layerId, unsigned short nHits, const PXDMode &mode=PXDMode::normal)
Set the number of hits in a specific layer of the PXD.
void resetSVDLayer(const unsigned short layerId)
Reset the number of hits in a specific layer of the SVD.
void setSVDLayer(const unsigned short layerId, unsigned short uHits, unsigned short vHits)
Set the number of hits in a specific layer of the SVD.
unsigned short getNSVDLayers() const
Returns the total number of activated layers of the SVD.
std::bitset< 32 > getLayerMask(const unsigned short layerId) const
Getter for the proper layer masks.
static const std::bitset< 32 > s_infoLayerMask
Mask to zero out all bits from other layers.
unsigned short getPXDLayer(const unsigned short layerId, const PXDMode &mode=PXDMode::normal) const
Get the number of hits in a specific layer of the PXD.
std::pair< VxdID, TVector3 > svdHitPair
The DATCON Tracking Module performs track finding / pattern recognition based on SVD hit information.
std::bitset< 32 > m_pattern
Storing of actual hit pattern.
static const std::bitset< 32 > s_PXDModeMasks[2]
Mask to zero out all bits from other layers.
std::string __repr__() const
String for printing in python.
unsigned short getNSVDHits() const
Get total number of hits in the SVD.
static const unsigned int s_svdUshift
for internal shifting to the SVD bits.
static const std::list< unsigned short > s_PXDLayerNumbers
For iterating through layers.
short getLastSVDLayer() const
Get the last activated SVD layer index.