StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtSlowSimuMaker.h
1 // $Id: StFgtSlowSimuMaker.h,v 1.3 2014/08/06 11:43:13 jeromel Exp $
2 
3 
81 #ifndef STAR_StFgtSlowSimuMaker
82 #define STAR_StFgtSlowSimuMaker
83 
84 #ifndef StMaker_H
85 #include "StMaker.h"
86 #endif
87 
88 #include "StFgtUtil/StFgtConsts.h"
89 #include <TVector3.h>
90 
91 class St_g2t_fgt_hit;
92 class g2t_fgt_hit_st;
93 class TH2F;
94 class TH1F;
95 
96 #include <TRandom3.h>
97 class StFgtDisc;
98 class StFgtDb;
99 
101 
102 
103 //#define __FGT_QA_HISTO__
104 /* enable this switch to generate many QA histos.
105 Note, you need to pass pointer to the valid TObjArray top get them out of this maker.
106 In bfc.C you should have:
107  StFgtSlowSimuMaker *myMkSM = get valid pointer....
108  HList=new TObjArray;
109  myMkSM->setHList(HList);
110 .....
111 after event loop save them:
112  TString &fnameOut1=chain->GetFileOut(); TString fnameOut2=fnameOut1;
113  fnameOut2.ReplaceAll(".root",".fgt");
114  myMkSM->saveHisto(fnameOut2);// jan , save one maker is enough, all histos are merged
115 */
116 
117 
119 struct fgt_g2t_auxil {
120  TVector3 Rlab;
121  TVector3 Rloc, Dloc;
122  g2t_fgt_hit_st *hitPtr;
123  Int_t iQuad;
124 };
125 
126 
127 class StFgtSlowSimuMaker : public StMaker {
128  protected:
129 
130  static const Float_t pulseShape[20];
131 
132  private:
133 
134 
135  enum {mxH=32};
136  TH1 *hA[mxH];
137  TObjArray *HList;
138 
139 
140  StFgtDb *fgtDb;
141 
143  TH2F *quadDigitizationXY;
144  TH1F *quadDigitizationPhi;
145  TH1F *quadDigitizationRad;
146 
148  TH2F *digXYAll;
149  TH2F *digPadcAll, *digRadcAll;
150  TH1F *digPAll, *digRAll;
151 
152  Int_t mInpEve;
153  Int_t mEventId;
154 
156 
157  Double_t par_stripThreshAdc;
158  Double_t par_XYamplSigma;
159 
160  Int_t par_cutoffOfBichel;
161  Double_t par_pairsPerCm ;
162  Double_t par_trackTOFcutoff;
163  Double_t par_trackPcutoff;
164 
165  Double_t par_transDiffusionPerPath;
166  Int_t par_binStep;
167 
168 
169  Double_t par_2DampCutoffScale;
170  Double_t par_overalGain;
171  Double_t par_PplaneChargeFraction;
172 
173  Int_t par_badSetup;
174  Int_t switch_addPeds;
175 
176  TRandom3* mRnd;
177 
179  void addHit(TVector3 rLocal, Double_t ampl=1.) ;
181  void responseMipModel(TVector3 Rloc, TVector3 Dloc);// detailed, w/ fluct
183  vector<fgt_g2t_auxil> mG2tHitList[kFgtNumDiscs][kFgtNumQuads];
184 
185  void InitHisto1();
186  void InitHisto2();
187  void CloseHisto();
188 
190  void unpack_g2t_hits(St_g2t_fgt_hit *);
192  void projectQuad2strips( Int_t idisc, Int_t iquad);
194  void exportStripPlane2StEvent(TH1F *hInp, Int_t stripIdOffset, StFgtStripCollection *out);
195 
196 
197  /* model transverse response in 1D
198  Frank: However, from test beam data I calculate the RMS of each cluster,
199  and there I get something like 0.5 - 0.6 strips, which is around 350 um.
200  all clusters (both in my diploma thesis and in my email) are 1D. A
201  cluster is defined as something on ONE projection of the detector. So
202  the FWHM and the sigma is all 1D. So you should not divide by Sqrt(2) to
203  get the 1 D value.
204  */
205 
206  Double_t amplFunc(Double_t del_cm) {
207  Double_t relD=del_cm/par_XYamplSigma;
208  return exp(-relD*relD/2.);
209  }
210 
211 
212  public:
213  StFgtSlowSimuMaker(const char *name="FgtSlowSimu");
214  virtual ~StFgtSlowSimuMaker();
215  virtual Int_t Init();
216  virtual Int_t InitRun(Int_t runNumber);
217  virtual Int_t Finish();
218  virtual Int_t Make();
219  virtual void Clear(Option_t *option="");
221  void setHList(TObjArray * x){HList=x;}
223  void setFgtDb(StFgtDb *x) { fgtDb=x;}
225  void enableAddPeds(){switch_addPeds=1;}
227  void setRndSeed(int x) { mRnd->SetSeed(x); } // force reproducible rnd sequence
228  void saveHisto(TString fname);
229 
230 
231  virtual const char *GetCVS() const {
232  static const char cvs[]="Tag $Name: $ $Id: StFgtSlowSimuMaker.h,v 1.3 2014/08/06 11:43:13 jeromel Exp $ built " __DATE__ " " __TIME__ ;
233  return cvs;
234  }
235  private:
236 
237  ClassDef(StFgtSlowSimuMaker,0)
238 };
239 
240 #endif
241 
242 
243 
244 // $Log: StFgtSlowSimuMaker.h,v $
245 // Revision 1.3 2014/08/06 11:43:13 jeromel
246 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
247 //
248 // Revision 1.2 2012/06/20 18:32:40 avossen
249 // setting elec ids for strips now, implemented pulse shape over 7 timebins
250 //
251 // Revision 1.1 2012/06/06 20:35:09 jeromel
252 // Code review closed (requested Anselm/Jan; reviewed Jonathan/Jason)
253 //
254 
255 
virtual Int_t Finish()
virtual void Clear(Option_t *option="")
User defined functions.
vector< fgt_g2t_auxil > mG2tHitList[kFgtMxDisk+1][kFgtMxQuad]
accepted track segements
void setFgtDb(StFgtDb *x)
needed to access DB tables
void setHList(TObjArray *x)
needed for exporting histograms
Int_t iQuad
the oryginal g2t hit
void enableAddPeds()
optional, allows adding of real pedestals to simulated data
.... utility c-struct for g2t hits
void setRndSeed(int x)
optional, enforces use of specific seed for repetetive test simu
TVector3 Rloc
hit entrance in LAB
g2t_fgt_hit_st * hitPtr
entrance &amp; path in local ref frame
StFgtSlowSimuMaker(const char *name="FgtSlowSimu")