StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMtdSimMaker.h
1 /***************************************************************************
2  *
3  * $Id: StMtdSimMaker.h,v 1.11 2015/07/29 01:11:24 smirnovd Exp $
4  *
5  * Author: Frank Geurts
6  ***************************************************************************
7  *
8  * Description: StMtdSimMaker virtual base class for Barrel TOF Simulations
9  *
10  ***************************************************************************
11  *
12  * $Log: StMtdSimMaker.h,v $
13  * Revision 1.11 2015/07/29 01:11:24 smirnovd
14  * Initialize static constants outside of class definition
15  *
16  * C++ forbids initialization of non-integral static const members within the class
17  * definition. The syntax is allowed only for integral type variables.
18  *
19  * Revision 1.10 2015/07/01 17:51:54 marr
20  * Add data member mWriteHisto to control the output of histograms
21  *
22  * Revision 1.9 2014/12/10 17:29:19 marr
23  * 1. Use localz and time-of-flight information from GEANT to determine the
24  * leading times on east and west sides for MC MTD hits. With this change, the
25  * localz of the MC hits can be calcualted exactly the same as the regular
26  * hits.
27  * 2. Cell Id runs from 0 to 11 as in real data
28  * 3. Clean up lines that are commented out.
29  *
30  * Revision 1.8 2014/08/06 11:43:27 jeromel
31  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
32  *
33  * Revision 1.7 2014/07/16 20:09:11 marr
34  * Move the initialization of the GEANT-to-Backleg map using the database to InitRun()
35  *
36  * Revision 1.5 2014/01/20 18:01:05 geurts
37  * bug update: changed default Maker name from TofSim to MtdSim in order to prevent name clashes with StBTofSimMaker [Bill LLope]
38  *
39  * Revision 1.4 2013/11/14 16:17:08 geurts
40  * Correct mapping based on GEANT volume_id [Alex Jentsch]
41  *
42  * Revision 1.3 2013/07/05 21:57:34 geurts
43  * Bug fix and improved mapping [Alex Jentsch]
44  *
45  * Revision 1.2 2012/03/02 02:18:34 perev
46  * New provisional version rewritten by VP
47  *
48  *
49  **************************************************************************/
50 #ifndef STBMTDSIMMAKER_HH
51 #define STBMTDSIMMAKER_HH
52 #include "StMaker.h"
53 
54 class StEvent;
55 struct g2t_mtd_hit_st;
56 class StMtdCollection;
57 class TH2F;
58 class TH2I;
59 
60 // g2t tables
61 #include "tables/St_g2t_mtd_hit_Table.h"
62 #include "tables/St_g2t_track_Table.h"
63 #include "tables/St_g2t_tpc_hit_Table.h"
64 
65 #include <vector>
66 
67 class StMtdSimMaker : public StMaker
68 {
69  private:
70  Int_t mModuleChannel[5][24];
71 
72 
73  protected:
74  St_DataSet *mGeantData;
76  StMtdCollection *mMtdCollection;
77  int mNMtdHits;
78  g2t_mtd_hit_st *mMtdHitsFromGeant;
79 
80  //define some constants
81  enum {
82  kNBackleg = 99,
83  kNModule = 99,
84  kNCell = 12,
85  kAMP = 50000,
86  kADCBINWIDTH = 25,
87  kTDCBINWIDTH = 50
88  };
89 
90  static const float kMtdPadWidth;
91  Bool_t mBookHisto;
92  Bool_t mWriteHisto;
93  Bool_t mWriteStEvent;
94 
95 
96 
97  string mHistFile; //for QA histograms
98  TH1F* mBetaHist;
99  TH1F* mPathLHist;
100  TH1F* mTofHist;
101  TH1F* mRecMass;
102 
103  TH2F* mCellGeant;
104  TH1F* mVpdGeant;
105  TH2F* mNCellGeant;
106  TH2F* mNVpdGeant;
107  TH1F* mDeGeant;
108  TH1F* mTofGeant;
109 
110  TH2F* mCellSeen;
111  TH1F* mVpdSeen;
112  TH2F* mNCellSeen;
113  TH2F* mNVpdSeen;
114  TH1F* mDeSeen;
115  TH1F* mT0Seen;
116  TH1F* mTofSeen;
117  TH1F* mTofResSeen;
118  TH1F* mVpdResSeen;
119 
120  TH2F* mCellReco;
121  TH1F* mVpdReco;
122  TH2F* mNCellReco;
123  TH2F* mNVpdReco;
124  TH1F* mTDCReco;
125  TH1F* mADCReco;
126  TH1F* mT0Reco;
127  TH1F* mTofResReco;
128  TH1F* mVpdResReco;
129  TH2F* mTACorr;
130  TH1F* mModHist;
132 
134  TH1F* mdE;
135  TH1F* mdS;
136  TH1F* mNumberOfPhotoelectrons;
137  TH1F* mT;
138  TH1F* mTime;
139  TH1F* mTime1;
140  TH1F* mPMlength;
141  TH1F* mAdc;
142  TH1F* mTdc;
143 
144  TVolume *starHall;
145 
146  Int_t bookHistograms();
147  Int_t writeHistograms();
148 
149 
150  public:
151  StMtdSimMaker(const char *name="MtdSim");
152  virtual ~StMtdSimMaker();
153 
154  void Reset();
155  virtual Int_t Init();
156  Int_t InitRun(Int_t);
157  Int_t FinishRun(Int_t);
158  virtual Int_t Make();
159  virtual Int_t Finish();
160  Int_t FastCellResponse();
161  Int_t CalcCellId(Int_t volume_id, Float_t ylocal,
162  Int_t &ibackleg,Int_t &imodule,Int_t &icell);
163 
164  virtual const char *GetCVS() const
165  {static const char cvs[]="Tag $Name: $ $Id: StMtdSimMaker.h,v 1.11 2015/07/29 01:11:24 smirnovd Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
166 
167  ClassDef(StMtdSimMaker,2)
168 };
169 #endif
StMtdSimMaker(const char *name="MtdSim")
Pad Width: 38mm padwidth + 6mm innerspacing.
TH1F * mVpdResSeen
time resolution after Detector Response
TH2I * QABacklegChannel
T-A Slewing Correlation.
TH1F * mVpdSeen
cellId after DetectorResponse
TH2F * mNVpdSeen
of cells after DetectorResponse
TH2F * mNCellSeen
Vpd tubeId after DetectorResponse.
TH1F * mRecMass
total time of flight of partilce
string mHistFile
switch to enable Maker to write out simulated hits to StEvent
Definition: StMtdSimMaker.h:97
TH1F * mPathLHist
speed of particles hitting tof
Definition: StMtdSimMaker.h:99
TH1F * mDeGeant
of vpd tubes of geant hit
TH1F * mDeSeen
of vpd tubes after DetectorResponse
TH1F * mVpdResReco
time resolution after recon
12 cells per box
Definition: StMtdSimMaker.h:85
TH1F * mdE
MTD hit distribution.
TH1F * mT0Seen
deposited-energy after DetectorResponse
TH1F * mTofGeant
deposited-energy in geant hit
TH2F * mNVpdGeant
of cells of geant hit
TH2F * mTACorr
vpd time resolution after recon
TH1F * mTDCReco
of vpd tubes after recon
Int_t CalcCellId(Int_t volume_id, Float_t ylocal, Int_t &ibackleg, Int_t &imodule, Int_t &icell)
This will calculate the cell ID as well as decode the module # and backleg # to store in an MTD Colle...
TH2F * mNCellReco
Vpd tubeId after recon.
TH2F * mCellSeen
tof in geant hit
TH2F * mCellReco
vpd time resolution after DetectorResponse
static const float kMtdPadWidth
Pad Width: 38mm padwidth + 6mm innerspacing.
Definition: StMtdSimMaker.h:90
StEvent * mEvent
geant table
Definition: StMtdSimMaker.h:75
virtual Int_t Finish()
TH1F * mTofResSeen
smeared-tof after DetectorResponse
Int_t bookHistograms()
TH1F * mT0Reco
ADC recon – empty.
TH1F * mVpdGeant
cellId of geant hit
TH1F * mVpdReco
cellId after recon
virtual Int_t Make()
TH1F * mADCReco
TDC recon.
Int_t InitRun(Int_t)
Int_t FastCellResponse()
This will define the maps to store the StMtdHits and will call the necessary functions to obtain the ...
TH1F * mTofHist
speed of particles hitting tof
TH2F * mNCellGeant
Vpd tubeId of geant hit.
TH2F * mCellGeant
reconstructed mass of particle
TH2F * mNVpdReco
of cells after recon
TH1F * mModHist
T-A Slewing Correlation.