1 #ifndef CellIDDecoder_h
2 #define CellIDDecoder_h 1
6 #include "EVENT/LCCollection.h"
8 #include "UTIL/BitField64.h"
13 #include "EVENT/LCParameters.h"
18 using namespace lcio ;
38 if( encoder_str.length() == 0 ){
39 throw(
lcio::Exception(
"CellIDDecoder : string of length zero provided as encoder string" ) ) ;
49 std::string initString(
"") ;
54 if( initString.size() == 0 ) {
56 initString = *_defaultEncoding ;
58 std::cout <<
" ----------------------------------------- " << std::endl
59 <<
" WARNING: CellIDDecoder - no CellIDEncoding parameter in collection ! "
61 <<
" -> using default : \"" << initString <<
"\""
63 <<
" ------------------------------------------ "
82 if( hit != _oldHit && hit ) {
102 delete _defaultEncoding ;
104 _defaultEncoding =
new std::string( defaultEncoding ) ;
111 static std::string* _defaultEncoding ;
116 =
new std::string(
"byte0:8,byte1:8,byte2:8,byte3:8,byte4:8,byte5:8,byte6:8,byte7:8") ;
Base exception class for LCIO - all other exceptions extend this.
Definition: Exceptions.h:21
CellIDDecoder(const std::string &encoder_str)
Constructor takes encoding string as argument.
Definition: CellIDDecoder.h:36
A bit field of 64bits that allows convenient declaration and manipulation of sub fields of various wi...
Definition: BitField64.h:132
const BitField64 & operator()(const T *hit)
Provides access to the bit fields, e.g.
Definition: CellIDDecoder.h:80
long long long64
64 bit signed integer,e.g.to be used for timestamps
Definition: LCIOTypes.h:14
Convenient class for decoding cellIDs from collection parameter LCIO::CellIDEncoding.
Definition: CellIDDecoder.h:30
static void setDefaultEncoding(const std::string &defaultEncoding)
This can be used to set the default encoding that is used if no CellIDEncoding parameter is set in th...
Definition: CellIDDecoder.h:100
The generic collection used in LCIO.
Definition: LCCollection.h:29
CellIDDecoder(const EVENT::LCCollection *col)
Constructor reads encoding string from collection parameter LCIO::CellIDEncoding. ...
Definition: CellIDDecoder.h:47
virtual const std::string & getStringVal(const std::string &key) const =0
Returns the first string value for the given key.
virtual const LCParameters & getParameters() const =0
Parameters defined for this collection.