29 #include "StTriggerId.h"
30 #include "StMessMgr.h"
37 for(
int i=0 ; i < mMaxTriggerIds ; ++i) {
41 mThresholdVersion[i] = 0;
42 mPrescaleVersion[i] = 0;
46 StTriggerId::~StTriggerId() {}
51 for(
int i=0 ; i < mMaxTriggerIds ; ++i){
53 mVersion[i] =
id.mVersion[i];
54 mNameVersion[i] =
id.mNameVersion[i];
55 mThresholdVersion[i] =
id.mThresholdVersion[i];
56 mPrescaleVersion[i] =
id.mPrescaleVersion[i];
61 if (&
id==
this)
return id;
66 for(
int i=0 ; i < mMaxTriggerIds ; ++i) {
68 mVersion[i] =
id.mVersion[i];
69 mNameVersion[i] =
id.mNameVersion[i];
70 mThresholdVersion[i] =
id.mThresholdVersion[i];
71 mPrescaleVersion[i] =
id.mPrescaleVersion[i];
77 StTriggerId::index(
unsigned int id)
const
79 for (
unsigned int i=0; i<mMaxTriggerIds; i++)
80 if (
id == mId[i])
return i;
81 return mMaxTriggerIds;
85 StTriggerId::mask()
const {
return mMask;}
88 StTriggerId::isTrigger(
unsigned int id)
const
90 return index(
id) < mMaxTriggerIds;
94 StTriggerId::version(
unsigned int id)
const
96 unsigned int i = index(
id);
97 if (i < mMaxTriggerIds)
104 StTriggerId::nameVersion(
unsigned int id)
const
106 unsigned int i = index(
id);
107 if (i < mMaxTriggerIds)
108 return mNameVersion[i];
114 StTriggerId::thresholdVersion(
unsigned int id)
const
116 unsigned int i = index(
id);
117 if (i < mMaxTriggerIds)
118 return mThresholdVersion[i];
124 StTriggerId::prescaleVersion(
unsigned int id)
const
126 unsigned int i = index(
id);
127 if (i < mMaxTriggerIds)
128 return mPrescaleVersion[i];
134 StTriggerId::triggerIds()
const {
135 vector<unsigned int> retVec;
136 for (
unsigned int i=0; i< mMaxTriggerIds; ++i) {
137 if (mId[i]) retVec.push_back(mId[i]);
144 StTriggerId::setMask(uint64_t val) {mMask = val;}
147 StTriggerId::addTrigger(
unsigned int id,
unsigned int v,
148 unsigned int nv,
unsigned int tv,
151 if( mIdx >= mMaxTriggerIds){
152 gMessMgr->Warning() <<
"StTriggerId::addTrigger : MAX Dimension reached. Cannot add !!" << endm;
157 mNameVersion[mIdx] = nv;
158 mThresholdVersion[mIdx] = tv;
159 mPrescaleVersion[mIdx] = pv;
164 ostream& operator<<(ostream& os,
const StTriggerId&
id)
166 for (
unsigned int i=0; i<
id.maxTriggerIds(); i++) {
169 <<
id.mVersion[i] <<
'\t'
170 <<
id.mNameVersion[i] <<
'\t'
171 <<
id.mThresholdVersion[i] <<
'\t'
172 <<
id.mPrescaleVersion[i] << endl;