StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StChargedPionMcEvent.h
1 #ifndef STAR_StChargedPionMcEvent
2 #define STAR_StChargedPionMcEvent
3 
4 // $Id: StChargedPionMcEvent.h,v 1.3 2009/01/04 16:47:25 kocolosk Exp $
5 
6 /*****************************************************************************
7  * @class StChargedPionMcEvent
8  * @author Adam Kocoloski
9  *
10  * Description of class.
11  *****************************************************************************/
12 
13 #include <string>
14 using std::string;
15 
16 #include <vector>
17 using std::vector;
18 
19 #include <map>
20 using std::map;
21 
22 #include "TObject.h"
23 #include "TClonesArray.h"
24 #include "TVector3.h"
25 
26 #include "StChargedPionTypes.h"
27 #include "StChargedPionBaseEv.h"
28 
29 class StChargedPionJet;
30 class StChargedPionTrack;
32 
34 {
35 public:
37  virtual ~StChargedPionMcEvent();
38 
39  virtual void Clear(Option_t* = "");
40 
41  // methods shared with StChargedPionEvent
42  unsigned int runId() const;
43  unsigned int eventId() const;
44  unsigned int bbcTimeBin() const;
45  const string& muDstName() const;
46 
47  bool isSimuTrigger(unsigned int trigId) const;
48 
49  int highTowerAdc(short towerId) const;
50  int triggerPatchAdc(short patchId) const;
51  int jetPatchAdc(short patchId) const;
52 
53  unsigned int nVertices() const;
54  TClonesArray* vertices();
55  const TClonesArray* vertices() const;
56 
57  unsigned int nTracks() const;
58  TClonesArray* tracks();
59  const TClonesArray* tracks() const;
60 
61  unsigned int nJets() const;
62  TClonesArray* jets();
63  const TClonesArray* jets() const;
64 
66  const StChargedPionVertex* vertex(int i) const;
67 
68  StChargedPionTrack* track(int i);
69  const StChargedPionTrack* track(int i) const;
70 
71  StChargedPionJet* jet(int i);
72  const StChargedPionJet* jet(int i) const;
73 
74  // methods unique to simulations
75  double s() const;
76  double t() const;
77  double u() const;
78  double cosTheta() const;
79  double pt() const;
80  double hardP() const;
81  double Q2() const;
82  double x1() const;
83  double x2() const;
84 
85  double t_alternative() const;
86  double u_alternative() const;
87  double Q2_alternative() const;
88  double Q2_alternative2() const;
89 
90  double tau() const;
91  double y() const;
92  double xF() const;
93  double beta34() const;
94 
95  int processId() const;
96 
97  enum Frame {LAB, CM};
98  StChargedPionLorentzVector parton(int id, Frame = LAB) const;
99 
100  // the incoming partons before initial-state radiation
101  StChargedPionLorentzVector& isr1();
102  StChargedPionLorentzVector& isr2();
103 
104  // maybe I should be saving parton flavors here
105  StChargedPionLorentzVector& parton1();
106  StChargedPionLorentzVector& parton2();
107  StChargedPionLorentzVector& parton3();
108  StChargedPionLorentzVector& parton4();
109 
110  short flavor(int i) const;
111  void setFlavor(int i, short f);
112 
113  static TLorentzVector lv(const StChargedPionLorentzVector&);
114 
115  StChargedPion3Vector& mcVertex();
116  const StChargedPion3Vector& mcVertex() const;
117 
118  vector<StChargedPionMcTrack>& mcTracks();
119  const vector<StChargedPionMcTrack>& mcTracks() const;
120 
121  vector<StChargedPionJet>& mcJets();
122  const vector<StChargedPionJet>& mcJets() const;
123 
124  // matched pairs, etc. containers
125  vector<StChargedPionTrackPair>& matchedPairs();
126  const vector<StChargedPionTrackPair>& matchedPairs() const;
127 
128  vector<StChargedPionTrackPair>& mergedPairs();
129  const vector<StChargedPionTrackPair>& mergedPairs() const;
130 
131  vector<StChargedPionTrackPair>& splitPairs();
132  const vector<StChargedPionTrackPair>& splitPairs() const;
133 
134  vector<StChargedPionTrackPair>& contamPairs();
135  const vector<StChargedPionTrackPair>& contamPairs() const;
136 
137  vector<StChargedPionTrackPair>& ghostPairs();
138  const vector<StChargedPionTrackPair>& ghostPairs() const;
139 
140  vector<StChargedPionPythiaRow>& pythiaRecord();
141  const vector<StChargedPionPythiaRow>& pythiaRecord() const;
142 
143  // setters
144  void setRunId(unsigned int);
145  void setEventId(unsigned int);
146  void setBbcTimeBin(unsigned short);
147  void setMuDstName(const char*);
148  void addSimuTrigger(unsigned int);
149  void addHighTower(short towerId, int ADC);
150  void addTriggerPatch(short patchId, int ADC);
151  void addJetPatch(short patchId, int ADC);
152  void addVertex(const StChargedPionVertex*);
153  void addTrack(const StChargedPionTrack*);
154  void addJet(const StChargedPionJet*);
155  void setProcessId(int);
156  void setX1(float);
157  void setHardP(float);
158 
159  void setL2Result(const void *address, bool emulated=false);
160 
161 private:
162  UInt_t mRunId;
163  UInt_t mEventId;
164  UShort_t mBbcTimeBin;
165  string mMuDstName;
166 
167  UInt_t mSimuTriggerBits;
168  map<short, int> mHighTowers;
169  map<short, int> mTriggerPatches;
170  map<short, int> mJetPatches;
171  UInt_t mL2ResultEmulated[9];
172 
173  TClonesArray *mVertices;
174  TClonesArray *mTracks;
175  TClonesArray *mJets;
176 
177  StChargedPionLorentzVector mISR1;
178  StChargedPionLorentzVector mISR2;
179  StChargedPionLorentzVector mParton1;
180  StChargedPionLorentzVector mParton2;
181  StChargedPionLorentzVector mParton3;
182  StChargedPionLorentzVector mParton4;
183  Int_t mProcessId;
184  Float_t mX1;
185  Float_t mHardP;
186  Short_t mFlavor[4];
187 
188  StChargedPion3Vector mMcVertex;
189  vector<StChargedPionMcTrack> mMcTracks;
190  vector<StChargedPionJet> mMcJets;
191 
192  vector<StChargedPionTrackPair> mMatchedPairs;
193  vector<StChargedPionTrackPair> mMergedPairs;
194  vector<StChargedPionTrackPair> mSplitPairs;
195  vector<StChargedPionTrackPair> mContamPairs;
196  vector<StChargedPionTrackPair> mGhostPairs;
197  //vector<StChargedPionTrackPair> mMatchedGlobals;
198 
199  vector<StChargedPionPythiaRow> mPythiaRecord;
200 
201  ClassDef(StChargedPionMcEvent, 2)
202 };
203 
204 inline unsigned int
205 StChargedPionMcEvent::runId() const { return mRunId; }
206 
207 inline unsigned int
208 StChargedPionMcEvent::eventId() const { return mEventId; }
209 
210 inline unsigned int
211 StChargedPionMcEvent::bbcTimeBin() const { return mBbcTimeBin; }
212 
213 inline const string&
214 StChargedPionMcEvent::muDstName() const { return mMuDstName; }
215 
216 inline unsigned int
217 StChargedPionMcEvent::nVertices() const { return mVertices->GetEntriesFast(); }
218 
219 inline TClonesArray*
220 StChargedPionMcEvent::vertices() { return mVertices; }
221 
222 inline const TClonesArray*
223 StChargedPionMcEvent::vertices() const { return mVertices; }
224 
225 inline unsigned int
226 StChargedPionMcEvent::nTracks() const { return mTracks->GetEntriesFast(); }
227 
228 inline TClonesArray*
229 StChargedPionMcEvent::tracks() { return mTracks; }
230 
231 inline const TClonesArray*
232 StChargedPionMcEvent::tracks() const { return mTracks; }
233 
234 inline unsigned int
235 StChargedPionMcEvent::nJets() const { return mJets->GetEntriesFast(); }
236 
237 inline TClonesArray*
238 StChargedPionMcEvent::jets() { return mJets; }
239 
240 inline const TClonesArray*
241 StChargedPionMcEvent::jets() const { return mJets; }
242 
243 inline int
244 StChargedPionMcEvent::processId() const { return mProcessId; }
245 
246 inline double
247 StChargedPionMcEvent::hardP() const { return mHardP; }
248 
249 inline StChargedPionLorentzVector&
250 StChargedPionMcEvent::isr1() { return mISR1; }
251 
252 inline StChargedPionLorentzVector&
253 StChargedPionMcEvent::isr2() { return mISR2; }
254 
255 inline StChargedPionLorentzVector&
256 StChargedPionMcEvent::parton1() { return mParton1; }
257 
258 inline StChargedPionLorentzVector&
259 StChargedPionMcEvent::parton2() { return mParton2; }
260 
261 inline StChargedPionLorentzVector&
262 StChargedPionMcEvent::parton3() { return mParton3; }
263 
264 inline StChargedPionLorentzVector&
265 StChargedPionMcEvent::parton4() { return mParton4; }
266 
267 inline short
268 StChargedPionMcEvent::flavor(int i) const { return mFlavor[i-1]; }
269 
270 inline void
271 StChargedPionMcEvent::setFlavor(int i, short f) { mFlavor[i-1] = f; }
272 
273 inline StChargedPion3Vector&
274 StChargedPionMcEvent::mcVertex() { return mMcVertex; }
275 
276 inline const StChargedPion3Vector&
277 StChargedPionMcEvent::mcVertex() const { return mMcVertex; }
278 
279 inline vector<StChargedPionMcTrack>&
280 StChargedPionMcEvent::mcTracks() { return mMcTracks; }
281 
282 inline const vector<StChargedPionMcTrack>&
283 StChargedPionMcEvent::mcTracks() const { return mMcTracks; }
284 
285 inline vector<StChargedPionJet>&
286 StChargedPionMcEvent::mcJets() { return mMcJets; }
287 
288 inline const vector<StChargedPionJet>&
289 StChargedPionMcEvent::mcJets() const { return mMcJets; }
290 
291 inline vector<StChargedPionTrackPair>&
292 StChargedPionMcEvent::matchedPairs() { return mMatchedPairs; }
293 
294 inline const vector<StChargedPionTrackPair>&
295 StChargedPionMcEvent::matchedPairs() const { return mMatchedPairs; }
296 
297 inline vector<StChargedPionTrackPair>&
298 StChargedPionMcEvent::mergedPairs() { return mMergedPairs; }
299 
300 inline const vector<StChargedPionTrackPair>&
301 StChargedPionMcEvent::mergedPairs() const { return mMergedPairs; }
302 
303 inline vector<StChargedPionTrackPair>&
304 StChargedPionMcEvent::splitPairs() { return mSplitPairs; }
305 
306 inline const vector<StChargedPionTrackPair>&
307 StChargedPionMcEvent::splitPairs() const { return mSplitPairs; }
308 
309 inline vector<StChargedPionTrackPair>&
310 StChargedPionMcEvent::contamPairs() { return mContamPairs; }
311 
312 inline const vector<StChargedPionTrackPair>&
313 StChargedPionMcEvent::contamPairs() const { return mContamPairs; }
314 
315 inline vector<StChargedPionTrackPair>&
316 StChargedPionMcEvent::ghostPairs() { return mGhostPairs; }
317 
318 inline const vector<StChargedPionTrackPair>&
319 StChargedPionMcEvent::ghostPairs() const { return mGhostPairs; }
320 
321 inline vector<StChargedPionPythiaRow>&
322 StChargedPionMcEvent::pythiaRecord() { return mPythiaRecord; }
323 
324 inline const vector<StChargedPionPythiaRow>&
325 StChargedPionMcEvent::pythiaRecord() const { return mPythiaRecord; }
326 
327 inline void
328 StChargedPionMcEvent::setRunId(unsigned int a) { mRunId = a; }
329 
330 inline void
331 StChargedPionMcEvent::setEventId(unsigned int a) { mEventId = a; }
332 
333 inline void
334 StChargedPionMcEvent::setBbcTimeBin(unsigned short a) { mBbcTimeBin = a; }
335 
336 inline void
337 StChargedPionMcEvent::setMuDstName(const char* a) { mMuDstName = a; }
338 
339 inline void
340 StChargedPionMcEvent::setProcessId(int i) { mProcessId = i; }
341 
342 inline void
343 StChargedPionMcEvent::setX1(float a) { mX1 = a; }
344 
345 inline void
346 StChargedPionMcEvent::setHardP(float a) { mHardP = a; }
347 
348 inline void
349 StChargedPionMcEvent::addHighTower(short towerId, int ADC) {
350  mHighTowers[towerId] = ADC;
351 }
352 
353 inline void
354 StChargedPionMcEvent::addTriggerPatch(short patchId, int ADC) {
355  mTriggerPatches[patchId] = ADC;
356 }
357 
358 inline void
359 StChargedPionMcEvent::addJetPatch(short patchId, int ADC) {
360  mJetPatches[patchId] = ADC;
361 }
362 
363 #endif
364 
365 /*****************************************************************************
366  * $Log: StChargedPionMcEvent.h,v $
367  * Revision 1.3 2009/01/04 16:47:25 kocolosk
368  * increment ClassDef, not even sure why
369  *
370  * Revision 1.2 2008/12/29 15:58:31 kocolosk
371  * removed commented code and added $Id: StChargedPionMcEvent.h,v 1.3 2009/01/04 16:47:25 kocolosk Exp $/$Log: StChargedPionMcEvent.h,v $
372  * removed commented code and added $Id$/Revision 1.3 2009/01/04 16:47:25 kocolosk
373  * removed commented code and added $Id$/increment ClassDef, not even sure why
374  * removed commented code and added $Id$/ as needed
375  *
376  * Revision 1.1 2008/07/17 17:06:31 kocolosk
377  * big-bang integration StChargedPionMcEvent framework
378  *
379  *****************************************************************************/
double pt() const
doesn&#39;t quite match hard_p in the case of b quark stuff
double Q2_alternative() const
eqn 83, Chapter 7 of PYTHIA 6.400 manual
double Q2() const
this one neglects outgoing parton masses, and matches g2t_pythia-&gt;hard_p**2
double u() const
this version neglects outgoing parton masses, and matches g2t_pythia-&gt;mand_u
double t() const
this version neglects outgoing parton masses, and matches g2t_pythia-&gt;mand_t