6 #ifndef StJetSkimEvent_HH
7 #define StJetSkimEvent_HH
10 #include "TClonesArray.h"
12 #include "TObjString.h"
14 #include "TLorentzVector.h"
16 #include "TTimeStamp.h"
32 void Clear(
const char *option=
"");
39 Int_t eastBarrelTowerThreshold;
40 Int_t eastBarrelTriggerPatchThreshold;
41 Int_t eastBarrelJetPatchThreshold;
43 Int_t westBarrelTowerThreshold;
44 Int_t westBarrelTriggerPatchThreshold;
45 Int_t westBarrelJetPatchThreshold;
47 Int_t endcapTowerThreshold;
48 Int_t endcapTriggerPatchThreshold;
49 Int_t endcapJetPatchThreshold;
51 Int_t totalEnergyThreshold;
68 void Clear(
const char *option=
"");
72 int shouldFire()
const;
73 int shouldFireBBC()
const;
74 int shouldFireBemc()
const;
75 int shouldFireEemc()
const;
76 int shouldFireL2()
const;
79 map<int,int>& towersAboveThreshold(
int detector)
const;
80 map<int,int>& triggerPatchesAboveThreshold(
int detector)
const;
81 map<int,int>& jetPatchesAboveThreshold(
int detector)
const;
83 int totalEnergy()
const;
85 const int* L2ResultEmulated()
const;
88 void setTrigId(
int aTrigId);
89 void setDidFire(
bool aFire);
90 void setShouldFire(
int aFire);
91 void setShouldFireBBC(
int aFireBBC);
92 void setShouldFireBemc(
int aFireBemc);
93 void setShouldFireEemc(
int aFireEemc);
94 void setShouldFireL2(
int aFireL2);
97 void addTowerAboveThreshold(
int detector,
int aID,
int aADC);
98 void addTriggerPatchAboveThreshold(
int detector,
int aID,
int aADC);
99 void addJetPatchAboveThreshold(
int detector,
int aID,
int aADC);
101 void setTotalEnergy(
int aEnergy);
103 void setL2ResultEmulated(
const int* rhs);
111 Int_t mShouldFireBBC;
112 Int_t mShouldFireBemc;
113 Int_t mShouldFireEemc;
116 map<int,int> mTowers;
117 map<int,int> mTriggerPatches;
118 map<int,int> mJetPatches;
122 int mL2ResultEmulated[64];
127 inline int StJetSkimTrig::trigId()
const {
return mTrigId;}
128 inline bool StJetSkimTrig::didFire()
const {
return mDidFire > 0;}
129 inline int StJetSkimTrig::shouldFire()
const {
return mShouldFire;}
130 inline int StJetSkimTrig::shouldFireBBC()
const {
return mShouldFireBBC;}
131 inline int StJetSkimTrig::shouldFireBemc()
const {
return mShouldFireBemc;}
132 inline int StJetSkimTrig::shouldFireEemc()
const {
return mShouldFireEemc;}
133 inline int StJetSkimTrig::shouldFireL2()
const {
return mShouldFireL2;}
134 inline int StJetSkimTrig::totalEnergy()
const {
return mTotalEnergy;}
135 inline const int* StJetSkimTrig::L2ResultEmulated()
const {
return mL2ResultEmulated;}
137 inline void StJetSkimTrig::setTrigId(
int aTrigId) {mTrigId = aTrigId;}
138 inline void StJetSkimTrig::setDidFire(
bool aFire) {mDidFire = aFire;}
139 inline void StJetSkimTrig::setShouldFire(
int aFire) {mShouldFire = aFire;}
140 inline void StJetSkimTrig::setShouldFireBBC(
int aFireBBC) {mShouldFireBBC = aFireBBC;}
141 inline void StJetSkimTrig::setShouldFireBemc(
int aFireBemc) {mShouldFireBemc = aFireBemc;}
142 inline void StJetSkimTrig::setShouldFireEemc(
int aFireEemc) {mShouldFireEemc = aFireEemc;}
143 inline void StJetSkimTrig::setShouldFireL2(
int aFireL2) {mShouldFireL2 = aFireL2;}
144 inline void StJetSkimTrig::setTotalEnergy(
int aEnergy) {mTotalEnergy = aEnergy;}
154 void Clear(
const char *option=
"");
158 void setPosition(
float* x);
159 void setError(
float* y);
161 void setVertexFinderId(
int i) {mVertexFinderId = i;}
162 void setRanking(Float_t i) { mRanking = i;}
163 void setNTracksUsed(UShort_t i) {mNTracksUsed = i;}
164 void setNBTOFMatch(UShort_t i) { mNBTOFMatch = i;}
165 void setNCTBMatch(UShort_t i) { mNCTBMatch = i;}
166 void setNBEMCMatch(UShort_t i) { mNBEMCMatch = i;}
167 void setNEEMCMatch(UShort_t i) { mNEEMCMatch = i;}
168 void setNCrossingCentralMembrane(UShort_t i) { mNCrossCentralMembrane = i;}
169 void setSumTrackPt(Float_t i) { mSumTrackPt = i;}
170 void setMeanDip(Float_t i) { mMeanDip = i;}
171 void setChiSquared(Float_t i) { mChiSquared = i;}
174 void setRefMultNeg( UShort_t i) { mRefMultNeg = i;}
175 void setRefMultPos(UShort_t i) { mRefMultPos = i;}
176 void setRefMultFtpcWest(UShort_t i) { mRefMultFtpcWest = i;}
177 void setRefMultFtpcEast( UShort_t i) { mRefMultFtpcEast = i;}
180 float x()
const {
return mPosition[0]; }
181 float y()
const {
return mPosition[1]; }
182 float z()
const {
return mPosition[2]; }
183 float dx()
const {
return mPosError[0]; }
184 float dy()
const {
return mPosError[1]; }
185 float dz()
const {
return mPosError[2]; }
186 const float* position()
const {
return mPosition;}
187 const float* posError()
const {
return mPosError;}
188 int vertexFinderId()
const {
return mVertexFinderId;}
189 Float_t ranking()
const {
return mRanking;}
190 UShort_t nTracksUsed()
const {
return mNTracksUsed;}
191 UShort_t nBTOFMatch()
const {
return mNBTOFMatch;}
192 UShort_t nCTBMatch()
const {
return mNCTBMatch;}
193 UShort_t nBEMCMatch()
const {
return mNBEMCMatch;}
194 UShort_t nEEMCMatch()
const {
return mNEEMCMatch;}
195 UShort_t nCrossCentralMembrane()
const {
return mNCrossCentralMembrane;}
196 Float_t sumTrackPt()
const {
return mSumTrackPt; }
197 Float_t meanDip()
const {
return mMeanDip; }
198 Float_t chiSquared()
const {
return mChiSquared; }
200 UShort_t refMultPos()
const {
return mRefMultPos; }
201 UShort_t refMultNeg()
const {
return mRefMultNeg; }
202 UShort_t refMult()
const {
return refMultPos() + refMultNeg(); }
203 UShort_t refMultFtpcEast()
const {
return mRefMultFtpcEast; }
204 UShort_t refMultFtpcWest()
const {
return mRefMultFtpcWest; }
205 UShort_t refMultFtpc()
const {
return refMultFtpcEast() + refMultFtpcWest(); }
214 UShort_t mNTracksUsed;
215 UShort_t mNBTOFMatch;
217 UShort_t mNBEMCMatch;
218 UShort_t mNEEMCMatch;
219 UShort_t mNCrossCentralMembrane;
225 UShort_t mRefMultNeg;
226 UShort_t mRefMultPos;
227 UShort_t mRefMultFtpcWest;
228 UShort_t mRefMultFtpcEast;
242 void Clear(
const char *option=
"");
248 void setTrigHeaderArray(TClonesArray* array) {mTrigHeaderArrayRef = array;}
249 void setTrigHeaderArray(TRef arrayRef) {mTrigHeaderArrayRef = arrayRef;}
253 void setBestVert(
int clonesArrayIndex);
255 void setFill(
float i) {mFill = i;}
256 void setRunId(
int i) {mRunId = i;}
257 void setEventId(
int i) {mEventId = i;}
258 void setMudstFileName(
const TObjString& i) {mMudstFileName = i;}
260 void setBx7(
int i) {mbx7 = i;}
261 void setBx48(
int i) {mbx48 = i;}
262 void setSpinBits(
int i) {mSpinBits = i;}
264 void setEbbc(
int i) {mEbbc = i;}
265 void setWbbc(
int i) {mWbbc = i;}
266 void setBbcTimeBin(
int i) {mBbcTimeBin = i;}
268 void setVpdTdiff (
float x) {mVpdTdiff = x;}
269 void setVpdZvertex(
float x) {mVpdZvertex = x;}
270 void setVpdEastHits(
int i) {mVpdEastHits = i;}
271 void setVpdWestHits(
int i) {mVpdWestHits = i;}
273 void setTstart (
float x) {mTstart = x;}
275 void setZdcWestRate(
float x) { mZdcWestRate = x; }
276 void setZdcEastRate(
float x) { mZdcEastRate = x; }
277 void setZdcCoincidenceRate(
float x) { mZdcCoincidenceRate = x; }
279 void setBbcWestRate(
float x) { mBbcWestRate = x; }
280 void setBbcEastRate(
float x) { mBbcEastRate = x; }
281 void setBbcCoincidenceRate(
float x) { mBbcCoincidenceRate = x; }
283 void setIsValid(
int i) {mIsValid = i;}
284 void setIsPolLong(
int i) {mIsPolLong = i;}
285 void setIsPolTrans(
int i) {mIsPolTrans = i;}
286 void setIsMaskedUsingBx48(
int i) {mIsMaskedUsingBx48 = i;}
287 void setOffsetBx48minusBX7(
int i) {mOffsetBx48minusBX7 = i;}
288 void setSpin4UsingBx48(
int i) {mSpin4usingBx48 = i;}
289 void setL2Result(
const int* rhs);
292 void setNTzero(
short n) { mNTzero = n; }
293 void setNTzeroCan(
short nCan) { mNTzeroCan = nCan; }
294 void setTCanFirst(
double tFirst) { mTCanFirst = tFirst; }
295 void setTCanLast(
double tLast) { mTCanLast = tLast; }
296 void setNVpdEGoodHits(
int vpdEGoodHits) { mNVpdEGoodHits = vpdEGoodHits; }
297 void setNVpdWGoodHits(
int vpdWGoodHits) { mNVpdWGoodHits = vpdWGoodHits; }
298 void setEarliestVpdEHit(
int earliestVpdEHit) { mEarliestVpdEHit = earliestVpdEHit; }
299 void setEarliestVpdWHit(
double earliestVpdWHit) { mEarliestVpdWHit = earliestVpdWHit; }
300 void setClosestVpdEHit(
double closestVpdEHit) { mClosestVpdEHit = closestVpdEHit; }
301 void setClosestVpdWHit(
double closestVpdWHit) { mClosestVpdWHit = closestVpdWHit; }
302 void setLatestVpdEHit(
double latestVpdEHit) { mLatestVpdEHit = latestVpdEHit; }
303 void setLatestVpdWHit(
double latestVpdWHit) { mLatestVpdWHit = latestVpdWHit; }
306 float fill()
const {
return mFill;}
307 int runId()
const {
return mRunId;}
308 int eventId()
const {
return mEventId;}
309 TObjString mudstFileName()
const {
return mMudstFileName;}
311 int bx7()
const {
return mbx7;}
312 int bx48()
const {
return mbx48;}
313 int spinBits()
const {
return mSpinBits;}
315 int eBbc()
const {
return mEbbc;}
316 int wBbc()
const {
return mWbbc;}
317 int bbcTimeBin()
const {
return mBbcTimeBin;}
319 float vpdTdiff()
const {
return mVpdTdiff;}
320 float vpdZvertex()
const {
return mVpdZvertex;}
321 int vpdEastHits()
const {
return mVpdEastHits;}
322 int vpdWestHits()
const {
return mVpdWestHits;}
324 float zdcWestRate()
const {
return mZdcWestRate; }
325 float zdcEastRate()
const {
return mZdcEastRate; }
326 float zdcCoincidenceRate()
const {
return mZdcCoincidenceRate; }
327 float bbcWestRate()
const {
return mBbcWestRate; }
328 float bbcEastRate()
const {
return mBbcEastRate; }
329 float bbcCoincidenceRate()
const {
return mBbcCoincidenceRate; }
331 int isValid()
const {
return mIsValid;}
332 int isPolLong()
const {
return mIsPolLong;}
333 int isPolTrans()
const {
return mIsPolTrans;}
334 int isMaskedUsingBx48()
const {
return mIsMaskedUsingBx48;}
335 int offsetBx48minusBX7()
const {
return mOffsetBx48minusBX7;}
336 int spin4usingBx48()
const {
return mSpin4usingBx48;}
338 const TClonesArray* triggers()
const {
return mTriggers;}
339 TClonesArray* triggers() {
return mTriggers;}
342 TClonesArray* trigHeaders() {
return (TClonesArray*)mTrigHeaderArrayRef.GetObject();}
345 const TClonesArray* vertices()
const {
return mVertices;}
348 const int* L2Result()
const {
return mL2Result; }
352 float tStart()
const {
return mTstart;}
353 short nTzero()
const {
return mNTzero; }
354 short nTzeroCan()
const {
return mNTzeroCan; }
355 double tCanFirst()
const {
return mTCanFirst; }
356 double tCanLast()
const {
return mTCanLast; }
357 int vpdEGoodHits()
const {
return mNVpdEGoodHits; }
358 int vpdWGoodHits()
const {
return mNVpdWGoodHits; }
359 double earliestVpdEHit()
const {
return mEarliestVpdEHit; }
360 double earliestVpdWHit()
const {
return mEarliestVpdWHit; }
361 double closestVpdEHit()
const {
return mClosestVpdEHit; }
362 double closestVpdWHit()
const {
return mClosestVpdWHit; }
363 double latestVpdEHit()
const {
return mLatestVpdEHit; }
364 double latestVpdWHit()
const {
return mLatestVpdWHit; }
367 int barrelJetPatchTh(
int i)
const;
368 int endcapJetPatchTh(
int i)
const;
369 int overlapJetPatchTh(
int i)
const;
371 int barrelHighTowerTh(
int i)
const;
372 int endcapHighTowerTh(
int i)
const;
374 int barrelJetPatchAdc(
int jp)
const;
375 int endcapJetPatchAdc(
int jp)
const;
376 int overlapJetPatchAdc(
int jp)
const;
378 map<int,int> barrelJetPatchesAboveTh(
int i)
const;
379 map<int,int> endcapJetPatchesAboveTh(
int i)
const;
380 map<int,int> overlapJetPatchesAboveTh(
int i)
const;
382 int emcLayer2()
const;
403 int EEMCdijet()
const;
404 int JP1dijet()
const;
405 int JP0dijet()
const;
417 void setBarrelJetPatchTh(
int i,
int value);
418 void setEndcapJetPatchTh(
int i,
int value);
419 void setOverlapJetPatchTh(
int i,
int value);
421 void setBarrelHighTowerTh(
int i,
int value);
422 void setEndcapHighTowerTh(
int i,
int value);
424 void setBarrelJetPatchAdc(
int jp,
int adc);
425 void setEndcapJetPatchAdc(
int jp,
int adc);
426 void setOverlapJetPatchAdc(
int jp,
int adc);
428 void setEmcLayer2(
int value);
431 const TDatime& dateTime()
const {
return mDatime; }
432 int year ()
const {
return mDatime.GetYear (); }
433 int month ()
const {
return mDatime.GetMonth (); }
434 int day ()
const {
return mDatime.GetDay (); }
435 int hour ()
const {
return mDatime.GetHour (); }
436 int minute()
const {
return mDatime.GetMinute(); }
437 int second()
const {
return mDatime.GetSecond(); }
439 time_t unixTime()
const { TTimeStamp
stamp(mDatime.GetYear(), mDatime.GetMonth(), mDatime.GetDay(), mDatime.GetHour(), mDatime.GetMinute(), mDatime.GetSecond());
return stamp.GetSec(); }
441 void setDateTime(
const TDatime& datime) { mDatime = datime; }
445 int btest(
int x,
int pos)
const {
return x >> pos & 1; }
448 int getbits(
int x,
int pos,
int n)
const {
return x >> pos & ~(~0 << n); }
451 void setbits(
int& x,
int pos,
int value)
const { x |= value << pos; }
456 TObjString mMudstFileName;
459 float mZdcCoincidenceRate;
462 float mBbcCoincidenceRate;
464 TClonesArray* mTriggers;
465 TRef mTrigHeaderArrayRef;
467 TClonesArray* mVertices;
491 double mEarliestVpdEHit;
492 double mEarliestVpdWHit;
493 double mClosestVpdEHit;
494 double mClosestVpdWHit;
495 double mLatestVpdEHit;
496 double mLatestVpdWHit;
508 int mIsMaskedUsingBx48;
509 int mOffsetBx48minusBX7;
524 int mBarrelJetPatchTh[4];
525 int mEndcapJetPatchTh[4];
526 int mOverlapJetPatchTh[3];
528 int mBarrelHighTowerTh[4];
529 int mEndcapHighTowerTh[2];
531 int mBarrelJetPatchAdc[18];
532 int mEndcapJetPatchAdc[6];
533 int mOverlapJetPatchAdc[6];
543 inline int StJetSkimEvent::barrelJetPatchTh(
int i)
const {
return mBarrelJetPatchTh[i]; }
544 inline int StJetSkimEvent::endcapJetPatchTh(
int i)
const {
return mEndcapJetPatchTh[i]; }
545 inline int StJetSkimEvent::overlapJetPatchTh(
int i)
const {
return mOverlapJetPatchTh[i]; }
547 inline int StJetSkimEvent::barrelHighTowerTh(
int i)
const {
return mBarrelHighTowerTh[i]; }
548 inline int StJetSkimEvent::endcapHighTowerTh(
int i)
const {
return mEndcapHighTowerTh[i]; }
550 inline int StJetSkimEvent::barrelJetPatchAdc(
int jp)
const {
return mBarrelJetPatchAdc[jp]; }
551 inline int StJetSkimEvent::endcapJetPatchAdc(
int jp)
const {
return mEndcapJetPatchAdc[jp]; }
552 inline int StJetSkimEvent::overlapJetPatchAdc(
int jp)
const {
return mOverlapJetPatchAdc[jp]; }
554 inline int StJetSkimEvent::emcLayer2()
const {
return mEmcLayer2; }
556 inline int StJetSkimEvent::BHT()
const {
return getbits(mEmcLayer2,0,4); }
557 inline int StJetSkimEvent::EHT()
const {
return getbits(mEmcLayer2,4,2); }
558 inline int StJetSkimEvent::JP1()
const {
return btest(mEmcLayer2,6); }
559 inline int StJetSkimEvent::JP2()
const {
return btest(mEmcLayer2,7); }
560 inline int StJetSkimEvent::BJP1()
const {
return btest(mEmcLayer2,8); }
561 inline int StJetSkimEvent::BJP2()
const {
return btest(mEmcLayer2,9); }
562 inline int StJetSkimEvent::EJP1()
const {
return btest(mEmcLayer2,10); }
563 inline int StJetSkimEvent::EJP2()
const {
return btest(mEmcLayer2,11); }
564 inline int StJetSkimEvent::AJP()
const {
return btest(mEmcLayer2,12); }
565 inline int StJetSkimEvent::BAJP()
const {
return btest(mEmcLayer2,13); }
566 inline int StJetSkimEvent::EAJP()
const {
return btest(mEmcLayer2,14); }
567 inline int StJetSkimEvent::JP0()
const {
return btest(mEmcLayer2,15); }
572 inline int StJetSkimEvent::EEMCdijet()
const {
return btest(mEmcLayer2,9); }
573 inline int StJetSkimEvent::JP1dijet()
const {
return btest(mEmcLayer2,11); }
574 inline int StJetSkimEvent::JP0dijet()
const {
return btest(mEmcLayer2,12); }
575 inline int StJetSkimEvent::DAQ10k()
const {
return btest(mEmcLayer2,14); }
577 inline int StJetSkimEvent::BHT0()
const {
return btest(mEmcLayer2,0); }
578 inline int StJetSkimEvent::BHT1()
const {
return btest(mEmcLayer2,1); }
579 inline int StJetSkimEvent::BHT2()
const {
return btest(mEmcLayer2,2); }
580 inline int StJetSkimEvent::BHT3()
const {
return btest(mEmcLayer2,3); }
582 inline int StJetSkimEvent::EHT0()
const {
return btest(mEmcLayer2,4); }
583 inline int StJetSkimEvent::EHT1()
const {
return btest(mEmcLayer2,5); }
586 inline void StJetSkimEvent::setBarrelJetPatchTh(
int i,
int value) { mBarrelJetPatchTh[i] = value; }
587 inline void StJetSkimEvent::setEndcapJetPatchTh(
int i,
int value) { mEndcapJetPatchTh[i] = value; }
588 inline void StJetSkimEvent::setOverlapJetPatchTh(
int i,
int value) { mOverlapJetPatchTh[i] = value; }
590 inline void StJetSkimEvent::setBarrelHighTowerTh(
int i,
int value) { mBarrelHighTowerTh[i] = value; }
591 inline void StJetSkimEvent::setEndcapHighTowerTh(
int i,
int value) { mEndcapHighTowerTh[i] = value; }
593 inline void StJetSkimEvent::setBarrelJetPatchAdc(
int jp,
int adc) { mBarrelJetPatchAdc[jp] = adc; }
594 inline void StJetSkimEvent::setEndcapJetPatchAdc(
int jp,
int adc) { mEndcapJetPatchAdc[jp] = adc; }
595 inline void StJetSkimEvent::setOverlapJetPatchAdc(
int jp,
int adc) { mOverlapJetPatchAdc[jp] = adc; }
597 inline void StJetSkimEvent::setEmcLayer2(
int value) { mEmcLayer2 = value; }