StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcSimpleSimulator.h
1 #ifndef STAR_StEmcSimpleSimulator
2 #define STAR_StEmcSimpleSimulator
3 
4 // $Id: StEmcSimpleSimulator.h,v 1.8 2007/10/08 15:28:37 kocolosk Exp $
5 
6 #include "TRandom3.h"
7 
8 #include "StEmcVirtualSimulator.h"
10 
11 class StBemcTables;
12 class StEmcGeom;
13 
14 /*****************************************************************************
15  * @class StEmcSimpleSimulator
16  * @author A.Pavlinov -> A.Suaide -> A.Kocoloski
17  *
18  * This class provides simple transition from deposit energy to ADC using
19  * ADC's scale, energy scale and sampling fraction function. It is correct for
20  * case when the main fluctuations come from shower fluctuations. Possible
21  * modes of operation include
22  *
23  * kTestMode: ADC = 0 and energy = dE * sampling fraction
24  * kSimpleMode: Simple transition using DB tables and sampling fraction
25  *****************************************************************************/
27 {
28 protected:
29  StDetectorId mDetectorId;
30  StEmcSimulatorMode mMode;
31 
32  const StBemcTables* mTables;
33  const StEmcGeom* mGeom;
34 
35  double mSF[3];
36  double mMaxADC;
37  double mMaxADCSpread;
38 
39  bool mEmbeddingMode;
40  double mCalibScale;
41  double mCalibSpread;
42 
43  TRandom3 mRandom;
44 
45  double samplingFraction(double eta);
46 
47 public:
48  StEmcSimpleSimulator(StDetectorId det, StEmcSimulatorMode mode);
49  virtual ~StEmcSimpleSimulator() { /* nothing */ }
50 
52  void setTables(const StBemcTables *tables) { mTables = tables; }
53 
55  void setCalibScale(float scale) { mCalibScale = scale; }
56 
58  void setCalibSpread(float spread) { mCalibSpread = spread; }
59 
61  void setEmbeddingMode(bool flag) { mEmbeddingMode = flag; }
62 
64  void setMaximumAdc(double adc) { mMaxADC = adc; }
65 
67  void setMaximumAdcSpread(double spread) { mMaxADCSpread = spread; }
68 
70  virtual StEmcRawHit* makeRawHit(const StMcCalorimeterHit *mcHit);
71 
72  ClassDef(StEmcSimpleSimulator, 2)
73 };
74 #endif
75 
76 /*****************************************************************************
77  * $Log: StEmcSimpleSimulator.h,v $
78  * Revision 1.8 2007/10/08 15:28:37 kocolosk
79  * setMaximumAdc(Spread) methods allow for better simulation of BSMD ADC response
80  * http://www.star.bnl.gov/HyperNews-star/get/emc2/2507.html
81  *
82  * Revision 1.7 2007/09/11 21:56:07 kocolosk
83  * remove a couple of unused variables
84  *
85  * Revision 1.6 2007/09/11 21:49:14 kocolosk
86  * complete overhaul of the BEMC simulator
87  * http://www.star.bnl.gov/HyperNews-star/get/emc2/2486.html
88  *
89  * Revision 1.5 2005/03/21 21:36:39 suaide
90  * fixed problem with chain
91  *
92  * Revision 1.4 2004/08/06 13:24:48 suaide
93  * New features added and fixed some bugs in the database
94  *
95  * Revision 1.3 2003/09/23 15:19:51 suaide
96  * fixed bugs and modifications for embedding
97  *
98  * Revision 1.2 2002/06/04 16:09:36 pavlinov
99  * added option with DB(pedestal ans calibration coefficients
100  *
101  * Revision 1.1 2000/10/23 22:53:14 pavlinov
102  * First working C++ version
103  *****************************************************************************/
void setMaximumAdc(double adc)
mean value for maximum possible ADC
void setCalibSpread(float spread)
scale the hit energy using a Gaussian distribution with this width
virtual StEmcRawHit * makeRawHit(const StMcCalorimeterHit *mcHit)
workhorse function
void setCalibScale(float scale)
scale the hit energy using a Gaussian distribution with this mean
void setMaximumAdcSpread(double spread)
max ADC will be calculated by sampling a Gaussian with this width
void setTables(const StBemcTables *tables)
DB access for peds, calib coeffs, etc.
void setEmbeddingMode(bool flag)
if true, don't add pedestal noise to the hit