StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmcMCData.h
1 // Hey Emacs this is really -*-c++-*- !
2 // \class EEmcMCData
3 // \author Piotr A. Zolnierczuk
4 // \date Aug 26, 2002
5 #ifndef EEmcMCData_h
6 #define EEmcMCData_h
7 /*********************************************************************
8  * Description:
9  * STAR Endcap Electromagnetic Calorimeter Monte Carlo Data
10  *********************************************************************/
11 #include "TObject.h"
12 
13 
14 class StMaker;
15 
16 class St_g2t_emc_hit;
17 class St_g2t_event;
18 
19 class EEeventDst;
20 class StMcEventMaker;
21 
22 const Float_t kEEmcDefaultEnergyThreshold = 0.0005; // 0.5 MeV
23 const Int_t kEEmcDefaultMCHitSize = 0x1000; // 4k hitow
24 
25 
26 enum EEmcVolId {
27  // for Tower
28  kEEmcTowerHalfId = 100000,
29  kEEmcTowerPhiId = 1000,
30  kEEmcTowerEtaId = 10,
31  kEEmcTowerDepId = 1,
32 
33  // for SMDs
34  kEEmcSmdHalfId = 1000000,
35  kEEmcSmdPhiId = 10000,
36  kEEmcSmdPlaneId = 1000,
37  kEEmcSmdStripId = 1
38 };
39 
40 
41 struct EEmcMCHitTower {
42  UChar_t ssec; // endcap subsector 1:5 (A-E)
43  UChar_t eta; // endcap eta 1:12
44 };
45 
46 
47 struct EEmcMCHit {
48  UChar_t detector; // endcap detector part (prs,tower,post,smdu,smdv)
49  UChar_t sector; // endcap phi sector 1:12
50  union {
51  EEmcMCHitTower tower;
52  UShort_t strip; // smd's strip numbers
53  };
54  Float_t de; // energy loss in the element (GeV)
55  int track_p; // parent track for this hit- if aplicable
56 };
57 
58 
59 
60 class EEmcMCData : public TObject {
61 public:
62  enum MCDepth { // FIXME LATER: depths encoded in g2t data
63  kUnknownDepth = 0,
64  kPreShower1Depth = 1,
65  kPreShower2Depth = 2,
66  kTower1Depth = 3,
67  kTower2Depth = 4,
68  kPostShowerDepth = 5
69  };
70 
71 
72  enum MCDetectorId {
73  kEEmcMCUnknownId = 0,
74  kEEmcMCTowerId = 1,
75  kEEmcMCPreShower1Id = 2,
76  kEEmcMCPreShower2Id = 3,
77  kEEmcMCSmdUStripId = 4,
78  kEEmcMCSmdVStripId = 5,
79  kEEmcMCPostShowerId = 6
80  };
81 
82 
83  EEmcMCData(); // default constructor
84  EEmcMCData(const EEmcMCData& ); // copy constructor
85  virtual ~EEmcMCData(); // the destructor
86 
87  Int_t readEventFromChain(const StMaker *mk); // reads g2t event from chain
88 
89  Int_t getSize() const { return mSize; };
90  Int_t getLastHit() const { return mLastHit; };
91  Int_t getEventID() const { return mEventID; };
92 
93  Float_t getEnergyThreshold() const { return mEthr; };
94  void setEnergyThreshold(Float_t e) { mEthr = e; };
95 
96  Int_t getHitArray(EEmcMCHit *h, Int_t size) const;
97  Int_t setHitArray(EEmcMCHit *h, Int_t size);
98 
99  void print() const; // diagnostic print
100  void unpackGeantHits(St_g2t_emc_hit* g2t_tile, St_g2t_emc_hit* g2t_smd);
101  const struct EEmcMCHit * getGeantHits(int &nHit) const { nHit=mLastHit; return mHit;}
102 
103  // obsolete functions
104  Int_t read (void *d, int s); // reads in s bytes of hits
105  Int_t write (void *d, int s); // writes out s bytes of hits
106  Int_t write (EEeventDst *); // export hits to TTree
107 
108 protected:
109  Int_t mEventID; // WARN: not added in to binary I/O, JB
110  struct EEmcMCHit *mHit ; // array to hold hit data
111  Int_t mSize; // size of the above array
112  Int_t mLastHit; // last hit index
113  Float_t mEthr; // energy threshold
114 
115 private:
116  //Float_t *mDE; // temporary array
117  Int_t expandMemory();
118 
119  ClassDef(EEmcMCData,2) // Endcap Emc event
120 };
121 
122 #endif
123 
124 /*
125  * $Log: EEmcMCData.h,v $
126  * Revision 1.7 2010/08/26 22:48:54 ogrebeny
127  * Improved constness
128  *
129  * Revision 1.5 2005/06/03 19:19:48 balewski
130  * for embedding, GEANT unpcker was split on 2 parts
131  *
132  * Revision 1.4 2003/09/02 17:57:56 perev
133  * gcc 3.2 updates + WarnOff
134  *
135  * Revision 1.3 2003/02/20 21:27:06 zolnie
136  * added simple geometry class
137  *
138  * Revision 1.2 2003/02/20 20:13:20 balewski
139  * fixxy
140  * xy
141  *
142  * Revision 1.1 2003/02/20 05:14:07 balewski
143  * reorganization
144  *
145  * Revision 1.1 2003/01/28 23:16:07 balewski
146  * start
147  *
148  * Revision 1.9 2002/11/13 21:53:52 zolnie
149  * restored "private" DetectorID in EEmcMCData
150  *
151  * Revision 1.8 2002/11/11 21:22:48 balewski
152  * EEMC added to StEvent
153  *
154  * Revision 1.7 2002/10/03 15:52:25 zolnie
155  * updates reflecting changes in *.g files
156  *
157  * Revision 1.6 2002/10/01 06:03:15 balewski
158  * added smd & pre2 to TTree, tof removed
159  *
160  * Revision 1.5 2002/09/30 21:58:27 zolnie
161  * do we understand Oleg? (the depth problem)
162  *
163  * Revision 1.4 2002/09/30 20:15:55 zolnie
164  * Oleg's geometry updates
165  *
166  * Revision 1.3 2002/09/24 22:47:35 zolnie
167  * major rewrite: SMD incorporated, use constants rather hard coded numbers
168  * introducing exceptions (rather assert)
169  *
170  * Revision 1.2 2002/09/20 15:49:05 balewski
171  * add event ID
172  *
173  * Revision 1.1.1.1 2002/09/19 18:58:54 zolnie
174  * Imported sources
175  *
176  *********************************************************************/
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...