StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcSimulatorMaker.h
1 #ifndef STAR_StEmcSimulatorMaker
2 #define STAR_StEmcSimulatorMaker
3 
4 // $Id: StEmcSimulatorMaker.h,v 1.28 2014/08/06 11:43:07 jeromel Exp $
5 
6 #include "StMaker.h"
7 #include "StEmcRawMaker/defines.h"
9 #include "StEmcVirtualSimulator.h"
10 
11 class StBemcTables;
12 class StEmcPosition;
13 class StEmcGeom;
15 class StMcEvent;
16 class StMcTrack;
17 class StEmcCollection;
18 
19 /*****************************************************************************
20  * @class StEmcSimulatorMaker
21  * @author A.Pavlinov -> A.Suaide -> A.Kocoloski
22  *
23  * This is the slow simulator for the BEMC. It translates energy depositions
24  * from GEANT into ADCs, which means it needs to run with StIOMaker in the
25  * chain. The BSMD planes are simulated using instances of StEmcSimpleSimulator,
26  * while the BTOW and BPRS use the StEmcPmtSimulator class which offers better
27  * accounting for primary and secondary photostatistics.
28  *****************************************************************************/
30 {
31 private:
32  StBemcTables* mTables;
33  StEmcPosition* mPosition;
34  StEmcGeom* mGeom[MAXDETBARREL];
35 
36  StEmcVirtualSimulator* mSimulator[MAXDETBARREL];
37  StEmcVirtualSimulator::StEmcSimulatorMode mSimulatorMode[MAXDETBARREL];
38 
40  StMcEmcHitCollection* mEmcMcHits[MAXDETBARREL];
41 
42  StMcEvent* mMcEvent;
43  StEmcCollection* mEmcCollection;
44 
45  bool mMakeFullDetector[MAXDETBARREL];
46  bool mCheckStatus[MAXDETBARREL];
47  bool mDoZeroSuppression[MAXDETBARREL];
48  float mPedestalCut[MAXDETBARREL];
49  float mCalibOffset[MAXDETBARREL];
50  float mCalibSpread[MAXDETBARREL];
51  float mMaxAdc[MAXDETBARREL];
52  float mMaxAdcSpread[MAXDETBARREL];
53 
54  float mCrossTalk[MAXDETBARREL];
55 
58  bool mEmbeddingMode;
59 
63  bool mIsBFC;
64 
66  void makeRawHits();
67 
69  void makeCrossTalk(StMcTrack *track);
70 
71 public:
75  StEmcSimulatorMaker(const char *name="EmcSimulator");
76 
77  virtual ~StEmcSimulatorMaker();
78 
80  virtual Int_t Init();
81 
83  virtual void Clear(const char*);
84 
88  virtual Int_t Make();
89 
92  void setCheckStatus(StDetectorId det, bool flag) { mCheckStatus[det-kBarrelEmcTowerId] = flag; }
93 
95  void setMakeFullDetector(StDetectorId det, bool flag) { mMakeFullDetector[det-kBarrelEmcTowerId] = flag; }
96 
99  void setDoZeroSuppression(StDetectorId det, bool flag) { mDoZeroSuppression[det-kBarrelEmcTowerId] = flag; }
100 
102  void setPedestalCut(StDetectorId det, float nRMS) { mPedestalCut[det-kBarrelEmcTowerId] = nRMS; }
103 
105  void setCalibOffset(StDetectorId det, float offset) { mCalibOffset[det-kBarrelEmcTowerId] = offset; }
106 
108  void setCalibSpread(StDetectorId det, float spread) { mCalibSpread[det-kBarrelEmcTowerId] = spread; }
109 
111  void setSimulatorMode(StDetectorId det, StEmcVirtualSimulator::StEmcSimulatorMode mode) { mSimulatorMode[det-kBarrelEmcTowerId] = mode; }
112 
114  void setMaximumAdc(StDetectorId det, float adc) { mMaxAdc[det-kBarrelEmcTowerId] = adc; }
115 
117  void setMaximumAdcSpread(StDetectorId det, float spread) { mMaxAdcSpread[det-kBarrelEmcTowerId] = spread; }
118 
120  void setMaxCrossTalkPercentage(StDetectorId det, float percentage) { mCrossTalk[det - kBarrelEmcTowerId] = percentage / 100.0; }
121 
122  StMcEmcHitCollection* getEmcMcHits(Int_t det) { return mEmcMcHits[det-1]; }
123  StMcEmcHitCollection* getBemcMcHits() { return getEmcMcHits(BTOW); }
124  StMcEmcHitCollection* getBprsMcHits() { return getEmcMcHits(BPRS); }
125  StMcEmcHitCollection* getBsmdeMcHits() { return getEmcMcHits(BSMDE); }
126  StMcEmcHitCollection* getBsmdpMcHits() { return getEmcMcHits(BSMDP); }
127 
131  StEmcCollection* getEmcCollection() { return mEmcCollection; }
132 
134  StBemcTables* getTables() { return mTables; }
135 
136  virtual const char* GetCVS() const {
137  static const char cvs[]="Tag $Name: $ $Id: StEmcSimulatorMaker.h,v 1.28 2014/08/06 11:43:07 jeromel Exp $ built " __DATE__ " " __TIME__ ;
138  return cvs;
139  }
140 
141  ClassDef(StEmcSimulatorMaker, 1)
142 };
143 
144 #endif
145 
146 /*****************************************************************************
147  * $Log: StEmcSimulatorMaker.h,v $
148  * Revision 1.28 2014/08/06 11:43:07 jeromel
149  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
150  *
151  * Revision 1.27 2008/11/17 21:35:21 kocolosk
152  * store GEANT dE in MuDST raw hit energy data member
153  *
154  * Revision 1.26 2007/12/12 23:29:48 kocolosk
155  * full pedestal simulation is now default for BTOW
156  *
157  * Revision 1.25 2007/11/28 16:18:58 kocolosk
158  * optical cross-talk simulation by Mike Betancourt
159  * http://www.star.bnl.gov/HyperNews-star/protected/get/phana/144.html
160  *
161  * Revision 1.24 2007/10/08 15:28:38 kocolosk
162  * setMaximumAdc(Spread) methods allow for better simulation of BSMD ADC response
163  * http://www.star.bnl.gov/HyperNews-star/get/emc2/2507.html
164  *
165  * Revision 1.23 2007/09/15 18:36:35 kocolosk
166  * changed defaults so makeFullDetector is false and so zero suppression is turned off for BTOW
167  *
168  * Revision 1.22 2007/09/12 03:06:13 kocolosk
169  * embedding mode also set if StEmcADCtoEMaker is in chain (non-bfc embedding)
170  *
171  * Revision 1.21 2007/09/12 02:58:53 kocolosk
172  * look for emcRaw, not emcEmbed, to determine if it's an embedding chain
173  *
174  * Revision 1.20 2007/09/12 02:55:15 kocolosk
175  * don't do zero suppression on embedding hits (they have no pedestal)
176  *
177  * Revision 1.19 2007/09/12 01:29:32 kocolosk
178  * added method to access StBemcTables
179  *
180  * Revision 1.18 2007/09/11 22:40:48 kocolosk
181  * small correction to documentation
182  *
183  * Revision 1.17 2007/09/11 21:49:14 kocolosk
184  * complete overhaul of the BEMC simulator
185  * http://www.star.bnl.gov/HyperNews-star/get/emc2/2486.html
186  *
187  * Revision 1.16 2007/01/22 19:13:40 kocolosk
188  * use STAR logger for all output
189  *
190  * Revision 1.15 2005/03/21 21:36:39 suaide
191  * fixed problem with chain
192  *
193  * Revision 1.14 2004/08/09 19:43:28 suaide
194  * moved global variables to private members and
195  * made small modifications to run in embedding mode
196  *
197  * Revision 1.13 2004/08/06 13:24:48 suaide
198  * New features added and fixed some bugs in the database
199  *
200  * Revision 1.12 2004/04/08 21:35:45 perev
201  * Leak off
202  *
203  * Revision 1.11 2003/09/23 15:19:55 suaide
204  * fixed bugs and modifications for embedding
205  *
206  * Revision 1.10 2003/09/10 19:47:12 perev
207  * ansi corrs
208  *
209  * Revision 1.9 2003/01/23 03:09:02 jeromel
210  * Include modif
211  *
212  * Revision 1.8 2002/09/10 16:51:32 pavlinov
213  * Discard line with mDbMaker->SetDateTime
214  *
215  * Revision 1.7 2002/06/04 16:09:37 pavlinov
216  * added option with DB(pedestal ans calibration coefficients
217  *
218  * Revision 1.6 2002/06/03 23:35:11 pavlinov
219  * Last correction without DB for ped and calib. coeff.
220  *
221  * Revision 1.5 2001/09/22 00:29:47 pavlinov
222  * No public constructor for StEmcGeom
223  *
224  * Revision 1.4 2001/03/22 22:04:45 pavlinov
225  * Clean up for mdc4
226  *
227  * Revision 1.3 2001/02/03 00:00:01 pavlinov
228  * New function Browse() and cleanup for new version of BFC
229  *
230  * Revision 1.2 2000/10/28 00:33:45 pavlinov
231  * added methods getEmcCollectin()
232  *
233  * Revision 1.1 2000/10/23 22:53:14 pavlinov
234  * First working C++ version
235  *****************************************************************************/
void setSimulatorMode(StDetectorId det, StEmcVirtualSimulator::StEmcSimulatorMode mode)
choose the simulator mode for each detector. Defaults are kPrimarySecondaryFullMode (BTOW...
StBemcTables * getTables()
pointer to database tables
void setMaximumAdc(StDetectorId det, float adc)
maximum possible ADC for a channel. Defaults are 4095 (TOW), 1023 (PRS), 1023 (SMDs) ...
void setDoZeroSuppression(StDetectorId det, bool flag)
void setCalibOffset(StDetectorId det, float offset)
scale simulator calibration coefficients by 1.0 + offset. Default is zero
void setCheckStatus(StDetectorId det, bool flag)
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144
StEmcCollection * getEmcCollection()
StEmcSimulatorMaker(const char *name="EmcSimulator")
void setMaximumAdcSpread(StDetectorId det, float spread)
maximum possible ADC will be calculated by sampling Gaussian with this spread. Default is 0 for all d...
virtual void Clear(const char *)
resets the pointer to the current StMcEvent
void setMaxCrossTalkPercentage(StDetectorId det, float percentage)
this setting has no effect if det!=kBarrelSmdEtaStripId. Simulate cross-talk from cross-capacitance...
virtual Int_t Init()
creates the detector simulators and sets their properties
void setPedestalCut(StDetectorId det, float nRMS)
pedestal cut requires (ADC-pedMean) > n*pedRMS.
void setMakeFullDetector(StDetectorId det, bool flag)
simulate pedestal noise where no MC hits are found. Default is true for BTOW, false otherwise...
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169
void setCalibSpread(StDetectorId det, float spread)
smear simulator calibration coefficients using Gaussian with this RMS.