StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StChargedPionEvent.h
1 #ifndef ST_CHARGED_PION_EVENT_HH
2 #define ST_CHARGED_PION_EVENT_HH
3 
4 // $Id: StChargedPionEvent.h,v 1.7 2012/11/09 03:31:34 perev Exp $
5 
6 #include <string>
7 using std::string;
8 
9 #include <vector>
10 using std::vector;
11 
12 #include "TClonesArray.h"
13 #include "StEvent/StRunInfo.h"
14 #include "StChargedPionBaseEv.h"
15 
17 class StChargedPionTrack;
18 class StChargedPionJet;
19 
21 {
22 public:
25  virtual ~StChargedPionEvent();
26 
27  StChargedPionEvent& operator=(const StChargedPionEvent&);
28  void copy(const StChargedPionEvent&);
29 
30  virtual void Clear(Option_t* = "");
31 
32  unsigned int runId() const;
33  unsigned int eventId() const;
34  unsigned int bx7() const;
35  unsigned int bbcTimeBin() const;
36  const string& muDstName() const;
37  const StRunInfo& runInfo() const;
38 
39  unsigned int spinBit() const;
40  bool isSpinValid() const;
41  bool isPolValid() const;
42  bool isPolLong() const;
43  bool isPolTrans() const;
44  bool isBxingMasked() const;
45  bool isNullOffset() const;
46 
47  bool isTrigger(unsigned int trigId) const;
48  bool isSimuTrigger(unsigned int trigId) const;
49  float prescale(unsigned int trigId) const;
50 
51  int highTowerAdc(short towerId) const;
52  int triggerPatchAdc(short patchId) const;
53  int jetPatchAdc(short patchId) const;
54 
55  unsigned int nVertices() const;
56  TClonesArray* vertices();
57  const TClonesArray* vertices() const;
58 
59  unsigned int nTracks() const;
60  TClonesArray* tracks();
61  const TClonesArray* tracks() const;
62 
63  unsigned int nJets() const;
64  TClonesArray* jets();
65  const TClonesArray* jets() const;
66 
68  const StChargedPionVertex* vertex(int i) const;
69 
70  StChargedPionTrack* track(int i);
71  const StChargedPionTrack* track(int i) const;
72 
73  StChargedPionJet* jet(int i);
74  const StChargedPionJet* jet(int i) const;
75 
76  void setRunId(unsigned int);
77  void setEventId(unsigned int);
78  void setBx7(unsigned char);
79  void setBbcTimeBin(unsigned short);
80  void setMuDstName(const char*);
81  void setRunInfo(const StRunInfo&);
82 
83  void setSpinBit(unsigned char);
84  void setPolValid(bool);
85  void setPolLong(bool);
86  void setPolTrans(bool);
87  void setBxingMasked(bool);
88  void setBxingOffset(int);
89 
90  void addTrigger(unsigned int);
91  void addSimuTrigger(unsigned int);
92  void setPrescale(unsigned int trigId, float prescale);
93 
94  void addHighTower(short towerId, int ADC);
95  void addTriggerPatch(short patchId, int ADC);
96  void addJetPatch(short patchId, int ADC);
97 
99  void setL2Result(const void *address, bool emulated=false);
100 
101  void addVertex(const StChargedPionVertex*);
102  void addTrack(const StChargedPionTrack*);
103  void addJet(const StChargedPionJet*);
104 
105 private:
106  UInt_t mRunId;
107  UInt_t mEventId;
108  UChar_t mBx7;
109  UShort_t mBbcTimeBin;
110  UChar_t mSpinBit;
111  UChar_t mSpinQA;
112 
113  StRunInfo mRunInfo;
114 
115  string mMuDstName;
116 
117  map<unsigned int, float> mTriggerPrescales;
118  UInt_t mTriggerBits;
119  UInt_t mSimuTriggerBits;
120 
121  map<short, int> mHighTowers;
122  map<short, int> mTriggerPatches;
123  map<short, int> mJetPatches;
124 
125  // this is enough to store L2Jet, L2Ped, L2GammaBemc, L2GammaEemc for 2006
126  UInt_t mL2Result[9];
127  UInt_t mL2ResultEmulated[9];
128 
129  TClonesArray *mVertices;
130  TClonesArray *mTracks;
131  TClonesArray *mJets;
132 
133  enum {kIsPolValid=0x01,
134  kIsPolLong=0x02,
135  kIsPolTrans=0x04,
136  kIsBxingMasked=0x8,
137  kNullOffset=0x10};
138 
139  ClassDef(StChargedPionEvent,4)
140 };
141 
142 inline unsigned int StChargedPionEvent::runId() const { return mRunId; }
143 inline unsigned int StChargedPionEvent::eventId() const { return mEventId; }
144 inline unsigned int StChargedPionEvent::bx7() const { return mBx7; }
145 inline unsigned int StChargedPionEvent::bbcTimeBin() const { return mBbcTimeBin; }
146 inline const string& StChargedPionEvent::muDstName() const { return mMuDstName; }
147 inline const StRunInfo& StChargedPionEvent::runInfo() const { return mRunInfo; }
148 
149 inline unsigned int StChargedPionEvent::spinBit() const { return mSpinBit; }
150 inline bool StChargedPionEvent::isPolValid() const { return mSpinQA & kIsPolValid; }
151 inline bool StChargedPionEvent::isPolLong() const { return mSpinQA & kIsPolLong; }
152 inline bool StChargedPionEvent::isPolTrans() const { return mSpinQA & kIsPolTrans; }
153 inline bool StChargedPionEvent::isBxingMasked() const { return mSpinQA & kIsBxingMasked; }
154 inline bool StChargedPionEvent::isNullOffset() const { return mSpinQA & kNullOffset; }
155 
156 inline unsigned int StChargedPionEvent::
157 nVertices() const { return mVertices->GetEntriesFast(); }
158 
159 inline TClonesArray* StChargedPionEvent::
160 vertices() { return mVertices; }
161 
162 inline const TClonesArray* StChargedPionEvent::
163 vertices() const { return mVertices; }
164 
165 inline unsigned int StChargedPionEvent::
166 nTracks() const { return mTracks->GetEntriesFast(); }
167 
168 inline TClonesArray* StChargedPionEvent::
169 tracks() { return mTracks; }
170 
171 inline const TClonesArray* StChargedPionEvent::
172 tracks() const { return mTracks; }
173 
174 inline unsigned int StChargedPionEvent::
175 nJets() const { return mJets->GetEntriesFast(); }
176 
177 inline TClonesArray* StChargedPionEvent::
178 jets() { return mJets; }
179 
180 inline const TClonesArray* StChargedPionEvent::
181 jets() const { return mJets; }
182 
183 inline void StChargedPionEvent::setRunId(unsigned int a) { mRunId = a; }
184 inline void StChargedPionEvent::setEventId(unsigned int a) { mEventId = a; }
185 inline void StChargedPionEvent::setBx7(unsigned char a) { mBx7 = a; }
186 inline void StChargedPionEvent::setBbcTimeBin(unsigned short a) { mBbcTimeBin = a; }
187 inline void StChargedPionEvent::setMuDstName(const char* a) { mMuDstName = a; }
188 inline void StChargedPionEvent::setRunInfo(const StRunInfo& a) { mRunInfo = a; }
189 
190 inline void StChargedPionEvent::
191 setSpinBit(unsigned char a) { mSpinBit = a; }
192 
193 inline void StChargedPionEvent::
194 setPolValid(bool a) { a ? mSpinQA |= kIsPolValid : mSpinQA &= ~kIsPolValid; }
195 
196 inline void StChargedPionEvent::
197 setPolLong(bool a) { a ? mSpinQA |= kIsPolLong : mSpinQA &= ~kIsPolLong; }
198 
199 inline void StChargedPionEvent::
200 setPolTrans(bool a) { a ? mSpinQA |= kIsPolTrans : mSpinQA &= ~kIsPolTrans; }
201 
202 inline void StChargedPionEvent::
203 setBxingMasked(bool a) { a ? mSpinQA |= kIsBxingMasked : mSpinQA &= ~kIsBxingMasked; }
204 
205 inline void StChargedPionEvent::
206 setBxingOffset(int a) { (a==0) ? mSpinQA |= kNullOffset : mSpinQA &= ~kNullOffset; }
207 
208 inline void StChargedPionEvent::
209 setPrescale(unsigned int trigId, float prescale) { mTriggerPrescales[trigId] = prescale; }
210 
211 inline void StChargedPionEvent::
212 addHighTower(short towerId, int ADC) { mHighTowers[towerId] = ADC; }
213 
214 inline void StChargedPionEvent::
215 addTriggerPatch(short patchId, int ADC) { mTriggerPatches[patchId] = ADC; }
216 
217 inline void StChargedPionEvent::
218 addJetPatch(short patchId, int ADC) { mJetPatches[patchId] = ADC; }
219 
220 #endif
221 
222 /*****************************************************************************
223  * $Log: StChargedPionEvent.h,v $
224  * Revision 1.7 2012/11/09 03:31:34 perev
225  * Cleanup
226  *
227  * Revision 1.6 2008/12/29 15:58:28 kocolosk
228  * removed commented code and added $Id: StChargedPionEvent.h,v 1.7 2012/11/09 03:31:34 perev Exp $/$Log: StChargedPionEvent.h,v $
229  * removed commented code and added $Id$/Revision 1.7 2012/11/09 03:31:34 perev
230  * removed commented code and added $Id$/Cleanup
231  * removed commented code and added $Id$/ as needed
232  *
233  *****************************************************************************/
void setL2Result(const void *address, bool emulated=false)
address to dijet result