3 #include "StChargedPionEvent.h"
9 #include "StChargedPionVertex.h"
10 #include "StChargedPionTrack.h"
11 #include "StChargedPionJet.h"
16 mVertices =
new TClonesArray(
"StChargedPionVertex", 20);
17 mTracks =
new TClonesArray(
"StChargedPionTrack", 50);
18 mJets =
new TClonesArray(
"StChargedPionJet", 50);
20 memset(mL2Result, 0, 36);
21 memset(mL2ResultEmulated, 0, 36);
23 StChargedPionEvent::Class()->IgnoreTObjectStreamer();
24 StChargedPionVertex::Class()->IgnoreTObjectStreamer();
25 StChargedPionTrack::Class()->IgnoreTObjectStreamer();
26 StChargedPionJet::Class()->IgnoreTObjectStreamer();
29 StChargedPionEvent::~StChargedPionEvent() {
30 if(mVertices)
delete mVertices;
31 if(mTracks)
delete mTracks;
32 if(mJets)
delete mJets;
36 mRunId(e.mRunId), mEventId(e.mEventId), mBx7(e.mBx7), mBbcTimeBin(e.mBbcTimeBin),
37 mSpinBit(e.mSpinBit), mSpinQA(e.mSpinQA),
38 mTriggerBits(e.mTriggerBits), mSimuTriggerBits(e.mSimuTriggerBits) {
40 memcpy(mL2Result, e.mL2Result, 36);
41 memcpy(mL2ResultEmulated, e.mL2ResultEmulated, 36);
43 for(
unsigned i=0; i<e.nVertices(); ++i) {
44 addVertex(e.vertex(i));
47 for(
unsigned i=0; i<e.nTracks(); ++i) {
51 for(
unsigned i=0; i<e.nJets(); ++i) {
57 if (
this == &e)
return *
this;
61 mEventId = e.mEventId;
63 mBbcTimeBin = e.mBbcTimeBin;
64 mSpinBit = e.mSpinBit;
66 mTriggerPrescales = e.mTriggerPrescales;
67 mTriggerBits = e.mTriggerBits;
68 mSimuTriggerBits = e.mSimuTriggerBits;
70 memcpy(mL2Result, e.mL2Result, 36);
71 memcpy(mL2ResultEmulated, e.mL2ResultEmulated, 36);
73 for(
unsigned i=0; i<e.nVertices(); ++i) {
74 addVertex(e.vertex(i));
77 for(
unsigned i=0; i<e.nTracks(); ++i) {
81 for(
unsigned i=0; i<e.nJets(); ++i) {
92 void StChargedPionEvent::Clear(Option_t* o) {
102 mTriggerPrescales.clear();
104 mTriggerPatches.clear();
108 bool StChargedPionEvent::isSpinValid()
const {
109 return (isPolValid() && !isBxingMasked() && isNullOffset());
112 bool StChargedPionEvent::isTrigger(
unsigned int trigId)
const {
113 map<unsigned int, unsigned int>::const_iterator it = mTriggerLookup.find(trigId);
114 if(it==mTriggerLookup.end())
return false;
115 return mTriggerBits & it->second;
118 bool StChargedPionEvent::isSimuTrigger(
unsigned int trigId)
const {
119 map<unsigned int, unsigned int>::const_iterator it = mTriggerLookup.find(trigId);
120 if(it==mTriggerLookup.end())
return false;
121 return mSimuTriggerBits & it->second;
124 float StChargedPionEvent::prescale(
unsigned int trigId)
const {
125 map<unsigned int, float>::const_iterator it = mTriggerPrescales.find(trigId);
126 if(it==mTriggerPrescales.end())
return -1.0;
130 int StChargedPionEvent::highTowerAdc(
short towerId)
const {
131 map<short, int>::const_iterator it = mHighTowers.find(towerId);
132 if(it==mHighTowers.end())
return -1;
136 int StChargedPionEvent::triggerPatchAdc(
short patchId)
const {
137 map<short, int>::const_iterator it = mTriggerPatches.find(patchId);
138 if(it==mTriggerPatches.end())
return -1;
142 int StChargedPionEvent::jetPatchAdc(
short patchId)
const {
143 map<short, int>::const_iterator it = mJetPatches.find(patchId);
144 if(it==mJetPatches.end())
return -1;
172 void StChargedPionEvent::addTrigger(
unsigned int trigId) {
173 map<unsigned int, unsigned int>::const_iterator it = mTriggerLookup.find(trigId);
174 if(it!=mTriggerLookup.end()) {
175 mTriggerBits |= it->second;
179 void StChargedPionEvent::addSimuTrigger(
unsigned int trigId) {
180 map<unsigned int, unsigned int>::const_iterator it = mTriggerLookup.find(trigId);
181 if(it!=mTriggerLookup.end()) {
182 mSimuTriggerBits |= it->second;
188 memcpy(mL2ResultEmulated, address, 20);
189 memcpy(mL2ResultEmulated+5, (
int*)address+6, 16);
192 memcpy(mL2Result, address, 20);
193 memcpy(mL2Result+5, (
int*)address+6, 16);
void setL2Result(const void *address, bool emulated=false)
address to dijet result