StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcEvent.hh
1 /***************************************************************************
2  *
3  * $Id: StMcEvent.hh,v 2.35 2018/03/15 22:00:35 smirnovd Exp $
4  * $Log: StMcEvent.hh,v $
5  * Revision 2.35 2018/03/15 22:00:35 smirnovd
6  * Fix linker error by removing declared but undefined functions
7  *
8  * Revision 2.34 2013/03/25 23:27:13 perev
9  * Mustafa.Pxl corrs
10  *
11  * Revision 2.33 2012/03/22 00:37:28 perev
12  * Etr added
13  *
14  * Revision 2.32 2012/03/01 16:48:29 perev
15  * method Browse() added
16  *
17  * Revision 2.31 2011/10/11 01:12:18 perev
18  * Mtd added
19  *
20  * Revision 2.30 2011/07/20 17:35:35 perev
21  * Fsc added
22  *
23  * Revision 2.29 2011/04/01 19:56:32 perev
24  * Redundant Browse removed
25  *
26  * Revision 2.28 2011/01/26 19:46:24 perev
27  * FPD ==> STAR Soft
28  *
29  * Revision 2.27 2010/06/23 20:18:30 jwebb
30  * Fixed typo. Bug had eprsCollection returning btow hits if called using
31  * the const version.
32  *
33  * Revision 2.26 2009/07/27 18:22:40 perev
34  * Supress I/O for serice words
35  *
36  * Revision 2.25 2009/07/24 20:26:20 perev
37  * Increase version in ClassDef
38  *
39  * Revision 2.24 2009/07/24 19:08:06 perev
40  * Cleanup + Btof added (Geurts)
41  *
42  * Revision 2.23 2007/10/16 19:49:13 fisyak
43  * rename Hft => Pxl, remove Hpd, Igt and Fst
44  *
45  * Revision 2.22 2006/09/25 14:20:43 fisyak
46  * Add Hpd Hits
47  *
48  * Revision 2.21 2005/10/03 14:08:02 fisyak
49  * fix memory leak with EmcHitCollections
50  *
51  * Revision 2.20 2005/09/28 21:30:14 fisyak
52  * Persistent StMcEvent
53  *
54  * Revision 2.19 2005/07/07 18:20:49 calderon
55  * Added support for IGT detector.
56  *
57  * Revision 2.18 2005/05/27 23:37:25 calderon
58  * Update for EEMC, add eprs, esmdu esdmv hits to StMcEvent.
59  *
60  * Revision 2.17 2005/04/18 20:11:32 calderon
61  * Addition of Fgt and Fst files. Modified other files to accomodate changes.
62  *
63  * Revision 2.16 2005/01/27 23:40:47 calderon
64  * Adding persistency to StMcEvent as a step for Virtual MonteCarlo.
65  *
66  * Revision 2.15 2004/09/14 05:00:29 calderon
67  * Added support for Ist, Ssd and changes to Pixel, from "El Kai".
68  *
69  * Revision 2.14 2004/01/13 21:03:34 fisyak
70  * Replace iostream by Stiostream.h (for icc)
71  *
72  * Revision 2.13 2003/12/04 05:56:47 calderon
73  * Inclusion of Endcap EMC hit collection in StMcEvent and
74  * of the Endcap hit vector in StMcTrack.
75  * fix const of StMcVertex::parent() to avoid warnings in user code
76  *
77  * Revision 2.12 2003/10/08 20:17:55 calderon
78  * -using <iostream>, std::cout, std::ostream.
79  * -changes in FTPC volume Id.
80  * o Causes changes in decoding of plane().
81  * o sector() is added.
82  * o print volumeId and sector() in the operator<<.
83  *
84  * Revision 2.11 2003/09/02 17:58:41 perev
85  * gcc 3.2 updates + WarnOff
86  *
87  * Revision 2.10 2003/08/20 18:50:21 calderon
88  * Addition of Tof classes and Pixel classes. Modified track, event, and
89  * container code to reflect this.
90  * Fix bug in StMcVertex and in clearing of some hit collections.
91  *
92  * Revision 2.9 2003/05/15 18:28:47 calderon
93  * Added data members from modified g2t_event table:
94  * Event Generator Final State Tracks, N Binary Collisions,
95  * N Wounded Nucleons East and West, N Jets.
96  *
97  * Revision 2.8 2003/03/18 22:37:43 calderon
98  * Added member mSubProcessId which is used for Pythia events.
99  * Only is set from constructor from g2t_event table.
100  *
101  * Revision 2.7 2003/02/19 03:16:05 calderon
102  * Introduction of Ctb Hit Class and Ctb Hit Collection class, modified
103  * StMcTrack, and StMcEvent accordingly. Clearing of hits in StMcSvtWaferHitCollection.
104  *
105  * Revision 2.6 2000/06/06 02:58:40 calderon
106  * Introduction of Calorimeter classes. Modified several classes
107  * accordingly.
108  *
109  * Revision 2.5 2000/04/17 23:01:15 calderon
110  * Added local momentum to hits as per Lee's request
111  *
112  * Revision 2.4 2000/03/06 18:05:21 calderon
113  * 1) Modified SVT Hits storage scheme from layer-ladder-wafer to
114  * barrel-ladder-wafer.
115  * 2) Added Rich Hit class and collection, and links to them in other
116  * classes.
117  *
118  * Revision 2.3 2000/01/18 20:52:31 calderon
119  * Works with CC5
120  *
121  * Revision 2.2 1999/12/03 00:51:52 calderon
122  * Tested with new StMcEventMaker. Added messages for
123  * diagnostics.
124  *
125  * Revision 2.1 1999/11/19 19:06:31 calderon
126  * Recommit after redoing the files.
127  *
128  * Revision 2.0 1999/11/17 02:12:15 calderon
129  * Completely revised for new StEvent
130  *
131  * Revision 1.4 1999/09/24 01:23:15 fisyak
132  * Reduced Include Path
133  *
134  * Revision 1.3 1999/09/23 21:25:50 calderon
135  * Added Log & Id
136  * Modified includes according to Yuri
137  *
138  * Revision 1.2 1999/07/28 20:27:32 calderon
139  * Version with SL99f libraries
140  *
141  *
142  **************************************************************************/
143 #ifndef StMcEvent_hh
144 #define StMcEvent_hh
145 
146 #include "Stiostream.h"
147 #include "StMcContainers.hh"
148 #include "TString.h"
149 #include "TDataSet.h"
150 #include "TBrowser.h"
151 class StObject;
158 #include "StMcEmcHitCollection.hh"
166 class StMcVertex;
167 class g2t_event_st;
168 
169 class StMcEvent : public TDataSet {
170 
171 public:
172  StMcEvent();
173  StMcEvent(g2t_event_st*);
174  virtual ~StMcEvent();
175  virtual void Browse(TBrowser *b);
176  virtual bool IsFolder() const {return true;};
177  int operator==(const StMcEvent&) const;
178  int operator!=(const StMcEvent&) const;
179 protected:
180  void initToZero();
181  void makeColls();
182 public:
183 
184 
185  //"Get" Methods
186 
187  // The following stuff will be read directly from g2t_event table
188  static const TString& cvsTag() {return mCvsTag; }
189  unsigned long eventGeneratorEventLabel() const {return mEventGeneratorEventLabel; }
190  unsigned long eventNumber() const {return mEventNumber; }
191  unsigned long runNumber() const {return mRunNumber;}
192  unsigned long type() const {return mType;}
193  unsigned long zWest() const {return mZWest;}
194  unsigned long nWest() const {return mNWest;}
195  unsigned long zEast() const {return mZEast;}
196  unsigned long nEast() const {return mNEast;}
197  unsigned long eventGeneratorFinalStateTracks() const {return mEvGenFSTracks;}
198  unsigned long numberOfPrimaryTracks() const {return mPrimaryTracks;}
199  unsigned long subProcessId() const {return mSubProcessId;}
200  float impactParameter() const {return mImpactParameter; }
201  float phiReactionPlane() const {return mPhiReactionPlane; }
202  float triggerTimeOffset() const {return mTriggerTimeOffset;}
203  unsigned long nBinary() const {return mNBinary;}
204  unsigned long nWoundedEast() const {return mNWoundedEast;}
205  unsigned long nWoundedWest() const {return mNWoundedWest;}
206  unsigned long nJets() const {return mNJets;}
207  StMcVertex* primaryVertex() {return mPrimaryVertex;}
208  const StMcVertex* primaryVertex() const {return mPrimaryVertex;}
209  StSPtrVecMcVertex& vertices() {return mVertices;}
210  const StSPtrVecMcVertex& vertices() const {return mVertices;}
211  StSPtrVecMcTrack& tracks() {return mTracks;}
212  const StSPtrVecMcTrack& tracks() const {return mTracks;}
213  StMcTpcHitCollection* tpcHitCollection() {return mTpcHits;}
214  const StMcTpcHitCollection* tpcHitCollection() const {return mTpcHits;}
215  StMcSvtHitCollection* svtHitCollection() {return mSvtHits;}
216  const StMcSvtHitCollection* svtHitCollection() const {return mSvtHits;}
217  StMcSsdHitCollection* ssdHitCollection() {return mSsdHits;}
218  const StMcSsdHitCollection* ssdHitCollection() const {return mSsdHits;}
219  StMcFtpcHitCollection* ftpcHitCollection() {return mFtpcHits;}
220  const StMcFtpcHitCollection* ftpcHitCollection() const {return mFtpcHits;}
221  StMcRichHitCollection* richHitCollection() {return mRichHits;}
222  const StMcRichHitCollection* richHitCollection() const {return mRichHits;}
223  StMcCtbHitCollection* ctbHitCollection() {return mCtbHits;}
224  const StMcCtbHitCollection* ctbHitCollection() const {return mCtbHits;}
225 
226  StMcEmcHitCollection* emcHitCollection(const Char_t *name) {
227  StMcEmcHitCollection *emcHitColl = (StMcEmcHitCollection*) Find(name);
228  if (! emcHitColl) {emcHitColl = new StMcEmcHitCollection(); emcHitColl->SetName(name); Add(emcHitColl);}
229  return emcHitColl;
230  }
231  const StMcEmcHitCollection* emcHitCollection(const Char_t *name) const {
232  return (const StMcEmcHitCollection*) this->Find(name);
233  }
234  StMcEmcHitCollection* bemcHitCollection() {return emcHitCollection("BemcHits");}
235  const StMcEmcHitCollection* bemcHitCollection() const {return emcHitCollection("BemcHits");}
236  StMcEmcHitCollection* bprsHitCollection() {return emcHitCollection("BprsHits");}
237  const StMcEmcHitCollection* bprsHitCollection() const {return emcHitCollection("BprsHits");}
238  StMcEmcHitCollection* bsmdeHitCollection() {return emcHitCollection("BsmdeHits");}
239  const StMcEmcHitCollection* bsmdeHitCollection() const {return emcHitCollection("BsmdeHits");}
240  StMcEmcHitCollection* bsmdpHitCollection() {return emcHitCollection("BsmdpHits");}
241  const StMcEmcHitCollection* bsmdpHitCollection() const {return emcHitCollection("BsmdpHits");}
242 
243  StMcTofHitCollection* tofHitCollection() {return mTofHits;}
244  const StMcTofHitCollection* tofHitCollection() const {return mTofHits;}
245  StMcBTofHitCollection* btofHitCollection() {return mBTofHits;}
246  const StMcBTofHitCollection* btofHitCollection() const {return mBTofHits;}
247  StMcMtdHitCollection* mtdHitCollection() {return mMtdHits;}
248  const StMcMtdHitCollection* mtdHitCollection() const {return mMtdHits;}
249 
250  StMcEmcHitCollection* eemcHitCollection() {return emcHitCollection("EemcHits");}
251  const StMcEmcHitCollection* eemcHitCollection() const {return emcHitCollection("EemcHits");}
252  StMcEmcHitCollection* eprsHitCollection() {return emcHitCollection("EprsHits");}
253  const StMcEmcHitCollection* eprsHitCollection() const {return emcHitCollection("EprsHits");}
254  StMcEmcHitCollection* esmduHitCollection() {return emcHitCollection("EsmduHits");}
255  const StMcEmcHitCollection* esmduHitCollection() const {return emcHitCollection("EsmduHits");}
256  StMcEmcHitCollection* esmdvHitCollection() {return emcHitCollection("EsmdvHits");}
257  const StMcEmcHitCollection* esmdvHitCollection() const {return emcHitCollection("EsmdvHits");}
258 
259  StMcEtrHitCollection* etrHitCollection() { return mEtrHits; }
260  const StMcEtrHitCollection* etrHitCollection() const { return mEtrHits; }
261 
262  StMcEmcHitCollection* fpdHitCollection() { return emcHitCollection("FpdHits"); }
263  const StMcEmcHitCollection* fpdHitCollection() const { return emcHitCollection("FpdHits"); }
264 
265  StMcEmcHitCollection* fscHitCollection() { return emcHitCollection("FscHits"); }
266  const StMcEmcHitCollection* fscHitCollection() const { return emcHitCollection("FscHits"); }
267 
268  StMcPxlHitCollection* pxlHitCollection() {return mPxlHits;}
269  const StMcPxlHitCollection*pxlHitCollection() const {return mPxlHits;}
270  StMcIstHitCollection* istHitCollection() {return mIstHits;}
271  const StMcIstHitCollection* istHitCollection() const {return mIstHits;}
272  StMcFgtHitCollection* fgtHitCollection() {return mFgtHits;}
273  const StMcFgtHitCollection* fgtHitCollection() const {return mFgtHits;}
274 
275  // "Set" Methods
276 
277  void setEventGeneratorEventLabel(unsigned long);
278  void setEventNumber(unsigned long);
279  void setRunNumber(unsigned long);
280  void setType(unsigned long);
281  void setZWest(unsigned long);
282  void setNWest(unsigned long);
283  void setZEast(unsigned long);
284  void setNEast(unsigned long);
285  void setEventGeneratorFinalStateTracks(unsigned long);
286  void setNumberOfPrimaryTracks(unsigned long);
287  void setImpactParameter(float);
288  void setPhiReactionPlane(float);
289  void setTriggerTimeOffset(float);
290  void setNBinary(unsigned long);
291  void setNWoundedEast(unsigned long);
292  void setNWoundedWest(unsigned long);
293  void setNJets(unsigned long);
294  void setPrimaryVertex(StMcVertex*);
295  void setTpcHitCollection(StMcTpcHitCollection*);
296  void setSvtHitCollection(StMcSvtHitCollection*);
297  void setSsdHitCollection(StMcSsdHitCollection*);
298  void setFtpcHitCollection(StMcFtpcHitCollection*);
299  void setRichHitCollection(StMcRichHitCollection*);
300  void setTofHitCollection(StMcTofHitCollection*);
301  void setBTofHitCollection(StMcBTofHitCollection*);
302  void setMtdHitCollection(StMcMtdHitCollection*);
303  void setPxlHitCollection(StMcPxlHitCollection*);
304  void setIstHitCollection(StMcIstHitCollection*);
305  void setFgtHitCollection(StMcFgtHitCollection*);
306  virtual void Print(Option_t *option="") const; // *MENU*
307  protected:
308  char mBeg[1];
309  unsigned long mEventGeneratorEventLabel;
310  unsigned long mEventNumber;
311  unsigned long mRunNumber;
312  unsigned long mType;
313  unsigned long mZWest;
314  unsigned long mNWest;
315  unsigned long mZEast;
316  unsigned long mNEast;
317  unsigned long mEvGenFSTracks; // Number of final state event generator tracks
318  unsigned long mPrimaryTracks;
319  unsigned long mSubProcessId; // Pythia subprocess Id
320  float mImpactParameter;
321  float mPhiReactionPlane;
322  float mTriggerTimeOffset; // time offset wrt trigger event
323  unsigned long mNBinary; // Number of Binary Collisions
324  unsigned long mNWoundedEast; // Number of Wounded Nucleons East
325  unsigned long mNWoundedWest; // Number of Wounded Nucleons West
326  unsigned long mNJets; // Number of Jets
327  StMcVertex* mPrimaryVertex;
328  StObject* mBegColl[1];
329  StMcTpcHitCollection* mTpcHits;
330  StMcSvtHitCollection* mSvtHits;
331  StMcSsdHitCollection* mSsdHits;
332  StMcFtpcHitCollection* mFtpcHits;
333  StMcRichHitCollection* mRichHits;
334  StMcCtbHitCollection* mCtbHits;
335  StMcTofHitCollection* mTofHits;
336  StMcBTofHitCollection* mBTofHits;
337  StMcMtdHitCollection* mMtdHits;
338  StMcPxlHitCollection* mPxlHits;
339  StMcIstHitCollection* mIstHits;
340  StMcFgtHitCollection* mFgtHits;
341  StMcEtrHitCollection* mEtrHits;
342  StObject* mEndColl[1];
343  char mEnd[1];
344  StSPtrVecMcVertex mVertices;
345  StSPtrVecMcTrack mTracks;
346  static TString mCvsTag;
347  protected:
348  const StMcEvent& operator=(const StMcEvent&);
349  StMcEvent(const StMcEvent&);
350  ClassDef(StMcEvent,3)
351 };
352 
353 ostream& operator<<(ostream& os, const StMcEvent&);
354 
355 // Definition of "Get" methods
356 
357 #endif
358 
virtual void Browse(TBrowser *b)
Browse this dataset (called by TBrowser).
Definition: StMcEvent.cc:665
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169
virtual TDataSet * Find(const char *path) const
Definition: TDataSet.cxx:362