9#include <alignment/GlobalLabel.h>
20 gid(0), eid(0), pid(0), tid(0), tif(0)
36 auto it = dict.find(teidpid);
54 auto it = ints.find(eidpid);
55 if (it == ints.end()) {
58 dict.insert(make_pair(teidpid, eidpid));
59 ints.insert(make_pair(eidpid,
TimeInterval(teidpid, start, end)));
62 it->second.set(start, end);
92 auto it = ints.find(eidpid);
94 teidpid = it->second.teidpid();
130 cout <<
"GlobalLabel: gid=" <<
gid << endl;
131 cout <<
" eid=" <<
eid << endl;
132 cout <<
" pid=" <<
pid << endl;
133 cout <<
" tid=" <<
tid << endl;
134 cout <<
" tif=" <<
tif << endl;
137 cout <<
" Time-dependent map:" << endl;
138 cout <<
" [EIDPID : TEIDPID] (registered time intervals)" << endl;
140 cout <<
" " << it.first <<
" : " << it.second.teidpid() << endl;
144 cout << it.second.get(i) <<
" ";
145 if ((i + 1) % 40 == 0)
static const gidTYPE tidOffset
Offset of time slice id = 1.000.000.
int label()
Returns encoded Pede label.
static void clearTimeDependentParamaters()
Forget all previously registered time dependent parameters.
static const gidTYPE maxEID
max 9.999.999 detector elements 1..9999999 (NOT time-dep-)
gidTYPE setParameterId(gidTYPE paramId)
Usefull setter to quickly change only the parameter id and return back the encoded label (for use in ...
static const gidTYPE eidOffest
Offset of detector element id = 100.
gidTYPE getUniqueId() const
Returns the global id identifing DB object for constantwith this label.
static std::map< gidTYPE, gidTYPE > & getDictionary()
Reference to dictionary/map TEIDPID -> EIDPID.
void dump(int level=0) const
Dumps the label to std::cout.
static const gidTYPE teidOffset
Offset of time dependent element(detector+parameter) = 100.
GlobalLabel()
Default constuctor. Members initialized in declaration.
static const gidTYPE maxPID
max 99 parameter types 1..99
unsigned int gidTYPE
shortcut for main data type (unsigned int)
gidTYPE getElementId() const
Returns the element id (like VxdID for silicon sensors) to identify sets of parameters in DB objects.
static const gidTYPE maxTID
max time slices for a parameter 1..999
static GlobalLabel construct(gidTYPE element, gidTYPE param)
Construct label for given DB object (template argument) and its element and parameter.
void registerTimeDependent(gidTYPE start, gidTYPE end=maxTID)
Register this Detector element and parameter as time dependent with instance starting at "start" time...
gidTYPE makeEIDPID(gidTYPE eid_, gidTYPE pid_)
Helper to compose elemnt id & param id.
static const gidTYPE pidOffset
parameter number are the last 2 decimal digits
gidTYPE makeTEIDPID(gidTYPE teid_, gidTYPE pid_)
Helper to compose time elemnt id & param id.
gidTYPE tif
time identification flag
static const gidTYPE tifOffset
Offset of time flag = 1.000.000.000.
static const gidTYPE maxLabel
Label and internal id ("gid") are the same numbers (label is signed but 0 and <0 values are invalid t...
static unsigned int & getCurrentTimeIntervalRef()
Returns reference to current time id.
static std::map< gidTYPE, TimeInterval > & getTimeIntervals()
Reference to map EIDPID -> (TEIDPID, time intervals)
static std::set< unsigned short > m_components
Set of global ids of components for which to return non-zero labels.
Abstract base class for different kinds of events.
Struct to hold intervals of validity.