1 #ifndef LCTrackerConf_h
2 #define LCTrackerConf_h 1
73 if(
_accessed )
throw std::logic_error(
"The encoding string was already accessed! Changing it now will lead to inconsistencies! Fix your code!" );
77 unsigned long long subdetPos = encodingString.
find(
"subdet" );
78 unsigned long long systemPos = encodingString.
find(
"system" );
79 unsigned long long sidePos = encodingString.
find(
"side" ) ;
80 unsigned long long layerPos = encodingString.
find(
"layer" ) ;
81 unsigned long long modulePos = encodingString.
find(
"module" ) ;
82 unsigned long long sensorPos = encodingString.
find(
"sensor" ) ;
84 isValid = ( (subdetPos != std::string::npos || systemPos != std::string::npos) &&
85 sidePos != std::string::npos &&
86 layerPos != std::string::npos &&
87 modulePos != std::string::npos &&
88 sensorPos != std::string::npos &&
90 (( subdetPos < sidePos ) || (systemPos < sidePos ) ) &&
91 ( sidePos < layerPos ) &&
92 ( layerPos < modulePos ) &&
93 ( modulePos < sensorPos)
97 if( ! isValid )
throw std::runtime_error(
" LCTrackerCellID::set_encoding_string(): string needs to contain"
98 " \"subdet:A,side:B,layer:C,module:D,sensor:E\" " ) ;
LCTrackerCellID()
c'tor initialize the encoding string with the 'canonical' encoding
void setAccessed()
set accessed to true
static LCTrackerCellID & instance()
static unsigned layer()
index of layer in cellID
static std::string valueString(unsigned val)
return a string with the details of the given id:
void set_encoding_string(const std::string &encodingString)
set the encoding string. Throws exception if it was already accessed to prevent inconsistencies ...
A bit field of 64bits that allows convenient declaration and manipulation of sub fields of various wi...
std::string valueString() const
Return a string with a comma separated list of the current sub field values.
static unsigned side()
index of side in cellID
static unsigned module()
index of module in cellID
static unsigned sensor()
index of sensor in cellID
static const std::string & encoding_string()
void setValue(lcio::long64 value)
Set a new 64bit value.
static unsigned subdet()
index of subdet in cellID
Singleton helper class defining the cellID encoding used in the LC tracking packages.