9#include "tracking/dataobjects/FullSecID.h"
10#include <framework/logging/Logger.h>
13#include <boost/format.hpp>
16#include <boost/algorithm/string.hpp>
28const int FullSecID::Bits = LayerBits + SubLayerBits + VxdIDBits + SectorBits;
45 std::vector<std::string> stringSegments;
46 boost::split(stringSegments, sid, boost::is_any_of(
"_"));
48 unsigned int LayerID = stringSegments[0][0] -
50 unsigned int SubLayerID = 0;
51 if (stringSegments[0].size() > 1) {
52 SubLayerID = stringSegments[0][1] -
'0';
55 unsigned int UniID = std::stoi(stringSegments[1]);
56 unsigned int sectorNumber = std::stoi(stringSegments[2]);
57 B2DEBUG(29,
"FullSecID-constructor: Value before converting: " << sid <<
", after converting: layerID " << LayerID <<
58 ", subLayerID " << SubLayerID <<
", UniID " << UniID <<
", secID " << sectorNumber);
67 m_fullSecID = LayerID | SubLayerID | UniID | sectorNumber;
76 unsigned int SubLayerID = subLayerID;
77 unsigned int UniID = vxdID;
79 B2DEBUG(28,
"FullSecID-constructor: LayerID " << LayerID <<
", MaxLayer " <<
MaxLayer <<
", SubLayerID " << SubLayerID <<
80 ", MaxSubLayer " <<
MaxSubLayer <<
", UniID " << UniID <<
", MaxVxdID " <<
MaxVxdID <<
", sectorNumber " << sectorNumber <<
90 m_fullSecID = LayerID | SubLayerID | UniID | sectorNumber;
96FullSecID::FullSecID(
unsigned int layerID,
bool subLayerID,
unsigned int sensorID,
unsigned int sectorNumber)
98 unsigned int SubLayerID = subLayerID;
99 B2DEBUG(28,
"FullSecID-constructor: LayerID " << layerID <<
", MaxLayer " <<
MaxLayer <<
", SubLayerID " << subLayerID <<
100 ", MaxSubLayer " <<
MaxSubLayer <<
", UniID " << sensorID <<
", MaxVxdID " <<
MaxVxdID <<
", sectorNumber " << sectorNumber <<
110 m_fullSecID = layerID | SubLayerID | sensorID | sectorNumber;
111 B2DEBUG(28,
" m_fullSecID/binary: " <<
m_fullSecID <<
"/" << std::bitset<32>(
m_fullSecID) <<
"\n, secID/binary: " << sectorNumber
112 <<
"/" << std::bitset<32>(sectorNumber) <<
", layerID-binary: " << std::bitset<32>(layerID) <<
"\n, SubLayerID-binary: " <<
113 std::bitset<32>(SubLayerID) <<
", sensorID-binary: " << std::bitset<32>(sensorID));
static const int VxdIDBits
Number of bits available to store a full vxdID.
static const int SectorBits
Number of bits available to represent a sector.
std::string getFullSecString() const
returns the FullSecID coded as string compatible to secIDs stored in the xml-sectormaps
static const int Bits
Total bit size of the VxdID.
static const int MaxVxdID
Maximum valid Sensor ID.
static const int MaxSubLayer
Maximum valid Ladder ID.
static const int SubLayerMask
mask to get subLayerID from fullSecID
unsigned short int getUniID() const
returns uniID of sensor (basically the same as VxdID (can simply converted to vxdID(uniID)) but a tri...
static const int LayerBits
Number of bits available to represent a layer.
static const int SectorMask
mask to get SectorID from fullSecID
static const int MaxSector
Maximum valid Segment ID.
static const int LayerBitShift
Number of bits to shift for storing a LayerID.
static const int SubLayerBitShift
Number of bits to shift for storing a SubLayerID.
static const int MaxID
Maximum value for ID.
short int getLayerID() const
returns LayerID compatible with basf2 standards.
BaseType m_fullSecID
contains full info of current SecID.
bool getSubLayerID() const
returns SubLayerID which tells you whether it is useful to search for compatible sectors in the same ...
static const int VxdIDMask
mask to get VxdID from fullSecID
static const int MaxLayer
Maximum valid Layer ID.
static const int SubLayerBits
Number of bits available to represent a subLayer (a sublayer is 1 if current sector on sensor is in a...
FullSecID(const FullSecID &secID)
Copy constructor.
static const int VxdIDBitShift
Number of bits shift for storing a full vxdID.
short int getSecID() const
returns SecID of current FullSecID (only unique for each sensor).
Class to uniquely identify a any structure of the PXD and SVD.
baseType getLayerNumber() const
Get the layer id.
Abstract base class for different kinds of events.