StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcFastMaker.h
1 // $Id: StEEmcFastMaker.h,v 1.15 2014/08/06 11:43:03 jeromel Exp $
2 
3 
4 /* \class StEEmcFastMaker
5 \author Jan Balewski
6 
7  Fast simulator of the E-EMC tower response converts energy loss in the tower tails generated by GEANT directly to ADC using eta-dependent conversion factor. The following assumptions are made:
8 
9  <li> energy deposit in any tail is equal to the sum of contribution from all particles passing its volume. Number of fibers within the tail and type of scintillator is ignored.
10  <li> all fibers transport to PMT 100% of energy deposited, except tails with a total deposit below 100 keV.
11  <li> total Geant energy deposit is recorded as in StEvent
12  <li> ADC=4095 * geantEnergy / samplingFrac / 60GeV / cosh(eta) is recorded as in StEvent
13 
14 <pre>
15  Details of the code
16 -----------------------------
17 
18 Decoding of E-EMC hits in StEvent
19 <hr>
20  __ENDCAP__
21  TOWERS: det = kEndcapEmcTowerId
22  sector 1-12 -->module 0-11
23  subsector A-E -->submodule 0-4
24  jeta 1-12 -->eta 0-11
25 
26  PRE1-, PRE2-, POST-shower: all det = kEndcapEmcPreshowerId
27  sector,subsector,eta : the same
28  add 0, 5, or 10 to submodule for PRE1-, PRE2-, POST-shower
29 
30  SmdU : det=kEndcapSmdUStripId
31  SmdV : det=kEndcapSmdVStripId
32  sector 1-12 -->module 0-11
33  stripID 1-288 -->eta 0-287
34  -->submodule=0 (not used)
35 
36 ---------------------------------------
37 StEEmcFastMaker::Make() {
38 
39  EEmcMCData *evIN->readEventFromChain(this); // acquire E-EMC hit/track list
40 
41  EEevent eeveRaw;
42  evIN->write(&eeveRaw); // copy E-EMC hit/track to local TTree
43 
44  EEevent eeveRaw.sumRawMC(eeve); //convert it to hit/tail list
45 
46  EE2ST(eeve, stevent); // add hit/tail list to StEvent
47 
48 }
49 
50 ----------------------------------
51 usage in bfc.C
52 
53 
54  StEEmcFastMaker *myMk=new StEEmcFastMaker;
55  Char_t *after = "BbcSimulation";
56  StMaker *xMk = chain->GetMaker(after);
57  assert(xMk);
58  chain->AddAfter(after,myMk);
59 
60 </pre>
61 Example how to read back E-EMC data from StEvent:
62 www.star.bnl.gov/STAR/eemc -->How To
63 
64 */
65 
66 #ifndef STAR_StEEmcFastMaker
67 #define STAR_StEEmcFastMaker
68 
69 
70 #ifndef StMaker_H
71 #include "StMaker.h"
72 #endif
73 class EEeventDst;
74 class StEvent;
75 class EEmcMCData;
76 class StEmcCollection;
77 
78 /* Translation of StEmcCollection names: EEMC -->BEMC
79 
80  WARN: preserve sub<16=2^4, eta<512=2^9, mod<128=2^7
81 
82  Jan
83 */
84 
85 
86 class StEEmcFastMaker : public StMaker {
87 
88  public:
89 
90  static Float_t getSamplingFraction();
91  static Float_t *getTowerGains();
92  static Float_t getSmdGain();
93  static Float_t getPreshowerGain();
94 
95  static Int_t getMaxAdc() { return 4095; } // [ADC channels]
96  static Int_t getMaxET() { return 60 ; } // [GeV]
97 
98  private:
99 
100  void mEE2ST(EEeventDst*, StEmcCollection* emcC);
101 
102  protected:
103  public:
104  StEEmcFastMaker(const char *name="EEmcFastSim");
105  virtual ~StEEmcFastMaker();
106  virtual Int_t Init();
107  virtual Int_t Make();
108  virtual void Clear(Option_t *option="");
109 
110  void SetLocalStEvent();
111  void SetEmcCollectionLocal(bool x=true){mEmcCollectionIsLocal=x;}
112  void SetEmbeddingMode(){SetEmcCollectionLocal(true);}
113  void UseFullTower(bool flag = true) { mUseFullTower = flag; } // always create all hits, even if ADC=0
114  void UseFullPreShower(bool flag = true) { mUseFullPreShower = flag; } // includes pre1/pre2/post
115  void UseFullSmdu(bool flag = true) { mUseFullSmdu = flag; }
116  void UseFullSmdv(bool flag = true) { mUseFullSmdv = flag; }
117  StEmcCollection * GetLocalEmcCollection() { return mLocalStEmcCollection;}
118 
119  virtual const char *GetCVS() const {
120  static const char cvs[]="Tag $Name: $ $Id: StEEmcFastMaker.h,v 1.15 2014/08/06 11:43:03 jeromel Exp $ built " __DATE__ " " __TIME__ ;
121  return cvs;
122  }
123  private:
124 
125  EEmcMCData *mevIN;
126  EEeventDst *meeve;
127  float *mfixTgain;
128 
129  StEmcCollection *mLocalStEmcCollection; // for special uses (embedding)
130  bool mEmcCollectionIsLocal;
131  bool mUseFullTower;
132  bool mUseFullPreShower;
133  bool mUseFullSmdu;
134  bool mUseFullSmdv;
135 
136  ClassDef(StEEmcFastMaker,0)
137 };
138 
139 #endif
140 
141 
142 // $Log: StEEmcFastMaker.h,v $
143 // Revision 1.15 2014/08/06 11:43:03 jeromel
144 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
145 //
146 // Revision 1.14 2010/08/05 21:23:45 stevens4
147 // Update sampling fraction to 4.8%
148 //
149 // Revision 1.13 2010/07/29 16:12:03 ogrebeny
150 // Update after the peer review
151 //
152 // Revision 1.12 2009/12/09 20:38:00 ogrebeny
153 // User-switchable function added to always create all hits, even if ADC=0. Requested by Pibero for the trigger simulator.
154 //
155 // Revision 1.11 2007/03/23 03:26:23 balewski
156 // Corretions from Victor
157 //
158 // Revision 1.10 2007/01/24 21:07:02 balewski
159 // 1) no cout or printf, only new Logger
160 // 2) EndcapMixer:
161 // - no assert()
162 // - locks out on first fatal error til the end of the job
163 //
164 // Revision 1.9 2007/01/12 23:57:12 jwebb
165 // Calculation of ideal gains moved into static member function getTowerGains()
166 // to allow slow simulator to access them.
167 //
168 // Revision 1.8 2006/12/12 20:29:13 balewski
169 // added hooks for Endcap embedding
170 //
171 // Revision 1.7 2005/06/09 20:04:23 balewski
172 // upgrade for embedding
173 //
174 // Revision 1.6 2005/06/03 19:20:47 balewski
175 // *** empty log message ***
176 //
177 // Revision 1.5 2004/05/26 21:28:37 jwebb
178 // o Changes to StEEmcFastMaker to provide methods to get sampling fraction,
179 // gains, etc...
180 //
181 // o StMuEEmcSimuMaker is now just a shell of its former self
182 //
183 // o Added StMuEEmcSimuReMaker. This maker takes a muDst as input, and uses
184 // the database maker to "massage" the ADC response, to better simulate
185 // the calorimeter as installed. For now, it simply uses the geant
186 // energy response, combined with a single sampling fraction and the
187 // database gains and pedestals to come up with a new ADC response.
188 //
189 // Revision 1.4 2004/04/08 21:33:49 perev
190 // Leak off
191 //
192 // Revision 1.3 2003/09/10 19:47:08 perev
193 // ansi corrs
194 //
195 // Revision 1.2 2003/02/20 05:15:51 balewski
196 // *** empty log message ***
197 //
198 // Revision 1.1 2003/01/28 23:12:59 balewski
199 // star
200 //
StEEmcFastMaker(const char *name="EEmcFastSim")
static Float_t getPreshowerGain()
(adc=g*de ) fixed gain for pre/post shower
virtual void Clear(Option_t *option="")
User defined functions.
static Float_t getSmdGain()
(adc=g*de ) fixed gain for SMD
virtual Int_t Make()