StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTofSimParam.cxx
1 /*******************************************************************
2  *
3  * $Id: StTofSimParam.cxx,v 1.7 2008/09/02 18:39:43 dongx Exp $
4  *
5  * Author: Frank Geurts
6  *****************************************************************
7  *
8  * Description: Simulation Parameters for TOFp
9  *
10  *****************************************************************
11  *
12  * $Log: StTofSimParam.cxx,v $
13  * Revision 1.7 2008/09/02 18:39:43 dongx
14  * update on MRPC slow parameters
15  *
16  * Revision 1.6 2008/08/28 18:43:19 dongx
17  * Added MRPC-TOF simulation parameters
18  * Added TOF/VPD fast simulation parameters
19  *
20  * Revision 1.5 2007/04/17 23:01:52 dongx
21  * replaced with standard STAR Loggers
22  *
23  * Revision 1.4 2003/09/02 17:59:10 perev
24  * gcc 3.2 updates + WarnOff
25  *
26  * Revision 1.3 2003/04/22 00:03:35 geurts
27  * doubled the m_nphe_to_adc parameter (used in StTofSimMaker).
28  *
29  * Revision 1.2 2002/01/22 07:18:08 geurts
30  * doxygenized
31  *
32  * Revision 1.1 2001/09/28 19:09:40 llope
33  * first version
34  *
35  *******************************************************************/
37 
51 #include "StTofSimParam.h"
52 #include <Stiostream.h>
53 #include "StMessMgr.h"
54 #include "math.h"
55 //#include "St_XDFFile.h"
56 //#include "St_DataSetIter.h"
57 
58 
62  mSimuTofp = false;
63  mSimuVpd = true;
64  mSimuTofFast = true;
65  mSimuTofSlow = false;
66 
68  m_adc_overflow = 1024.0 ;
69  m_attlen = 110.0 ;
70  m_cath_eff = 0.2 ;
71  m_cath_surf = 0.61 ;
72  m_delay = 80.2e-12 ;
73  m_elec_noise = 0. ;
74  m_gate_t0 = 3.e-9 ;
75  m_gate_width = 200.e-9 ;
76  m_geo_from_geant = 1. ;
77  m_GeV_2_n_photons = 1.e+7 ;
78  m_nphe_to_adc = 0.2 ;
79  m_phys_noise = 0. ;
80  m_position_tolerance = 0.3 ;
81  m_slat_para = 0. ; // no slat response table yet.
82  m_start_res = 50.e-12 ;
83  m_surf_loss = 0.42 ;
84  m_time_res = 16.e-12 ;
85  m_tdc_overflow = 2048.0 ;
86 
88  m_n_gap = 6 ;
89  m_nmax_clus = 20 ;
90  m_d_in = 0.54 ;
91  m_d_out = 1.10 ;
92  m_d_gap = 0.22 ;
93  m_alpha_dg = 31.944 ;
94  m_er = 5.0 ;
95  m_clus_par[0] = 10.07 ;
96  m_clus_par[1] = -6.781 ;
97  m_clus_par[2] = 6.396 ;
98  m_clus_par[3] = -0.6407 ;
99  m_vd_mean = 2.28e-4 ;
100  m_nmean_e = 2.42 ;
101  m_nmax_e = 1.6e+7 ;
102  m_dt = 25. ;
103  m_ndt = 600 ;
104  m_toffset = 6000. ;
105  m_adc_thre = 12.8 ;
106  m_xtalk_dy = 1.0 ;
107  m_res_fee = 45.e-12 ;
108 
110  m_res_tof = 85.e-12 ;
111  m_thre_tof = 1.e-7 ;
112  m_res_vpd = 140.e-12 ;
113  m_thre_vpd = 1.e-7 ;
114 
116  for(int i=0;i<120;i++) {
117  for(int j=0;j<192;j++) {
118  m_eff_tof[i][j] = 0.95;
119  }
120  }
124  for(int i=0;i<50;i++) {
125  if(i<38) m_eff_vpd[i] = 0.95;
126  else m_eff_vpd[i] = 0.0;
127  }
128 
129 }
130 
131 
134 
135 
138  // Char_t *InputXdfFile= "cts_pars.xdf";
139  // St_XDFFile xdf(InputXdfFile);
140  // St_DataSet *ctfs = xdf.NextEventGet();
141  //
142  // assert (ctfs);
143  // St_DataSetIter gime(ctfs);
144  // St_cts_mpara *stafSimParam(0);
145  // stafSimParam = (St_cts_mpara *) gime("cts_tof");
146  // cts_mpara_st *sim = stafSimParam->GetTable();
147  //
148  // // convert STAF database of simulation to StRoot database
149  // mSimParam = *sim;
150 }
151 
152 float StTofSimParam::nclus(float beta) const
153 {
154  if (beta>0.999999) beta = 0.999999;
155  if (beta<0.) beta = 0.;
156 
157  float ga = 1./sqrt(1.-beta*beta);
158  float para = 1./sqrt(ga);
159  float clus = m_clus_par[0] + m_clus_par[1]*para + m_clus_par[2]*para*para + m_clus_par[3]*para*para*para;
160 
161  return clus;
162 }
163 
164 void StTofSimParam::print(){
165  LOG_INFO << "------StTofSimParam::print()------" << endm;
166  if(mSimuTofp) {
167  LOG_INFO << " ==>> TOFp parameters <<== " << endm;
168  LOG_INFO << " adc_overflow = " << m_adc_overflow << endm;
169  LOG_INFO << " attlen = " << m_attlen << endm;
170  LOG_INFO << " cath_eff = " << m_cath_eff << endm;
171  LOG_INFO << " cath_surf = " << m_cath_surf << endm;
172  LOG_INFO << " delay = " << m_delay << endm;
173  LOG_INFO << " elec_noise = " << m_elec_noise << endm;
174  LOG_INFO << " gate_t0 = " << m_gate_t0 << endm;
175  LOG_INFO << " gate_width = " << m_gate_width << endm;
176  LOG_INFO << " geo_from_geant = " << m_geo_from_geant << endm;
177  LOG_INFO << " GeV_2_n_photons = " << m_GeV_2_n_photons << endm;
178  LOG_INFO << " nphe_to_adc = " << m_nphe_to_adc << endm;
179  LOG_INFO << " phys_noise = " << m_phys_noise << endm;
180  LOG_INFO << " position_tolerance = " << m_position_tolerance << endm;
181  LOG_INFO << " slat_para = " << m_slat_para << endm;
182  LOG_INFO << " start_res = " << m_start_res << endm;
183  LOG_INFO << " surf_loss = " << m_surf_loss << endm;
184  LOG_INFO << " tdc_overflow = " << m_tdc_overflow << endm;
185  LOG_INFO << " time_res = " << m_time_res << endm;
186  }
187  if(mSimuVpd) {
188  LOG_INFO << " ==>> VPD parameters <<== " << endm;
189  LOG_INFO << " res_vpd = " << m_res_vpd << endm;
190  LOG_INFO << " thre_vpd = " << m_thre_vpd << endm;
191  }
192  if(mSimuTofFast) {
193  LOG_INFO << " ==>> MRPC TOF fast simu parameters <<== " << endm;
194  LOG_INFO << " res_tof = " << m_res_tof << endm;
195  LOG_INFO << " thre_tof = " << m_thre_tof << endm;
196  }
197  if(mSimuTofSlow) {
198  LOG_INFO << " ==>> MRPC TOF slow simu parameters <<== " << endm;
199  LOG_INFO << " n_gap = " << m_n_gap << endm;
200  LOG_INFO << " nmax_clus = " << m_nmax_clus << endm;
201  LOG_INFO << " d_in = " << m_d_in << endm;
202  LOG_INFO << " d_out = " << m_d_out << endm;
203  LOG_INFO << " d_gap = " << m_d_gap << endm;
204  LOG_INFO << " alpha = " << alpha() << endm;
205  LOG_INFO << " er = " << m_er << endm;
206  LOG_INFO << " vd_mean = " << m_vd_mean << endm;
207  LOG_INFO << " nmean_e = " << m_nmean_e << endm;
208  LOG_INFO << " nmax_e = " << m_nmax_e << endm;
209  LOG_INFO << " dt = " << m_dt << endm;
210  LOG_INFO << " ndt = " << m_ndt << endm;
211  LOG_INFO << " toffset = " << m_toffset << endm;
212  LOG_INFO << " adc_thre = " << m_adc_thre << endm;
213  LOG_INFO << " xtalk_dy = " << m_xtalk_dy << endm;
214  LOG_INFO << " res_fee = " << m_res_fee << endm;
215  }
216  LOG_INFO << " ==>> VPD dead channels <<== " << endm;
217  for(int i=0;i<38;i++) {
218  if(m_eff_vpd[i]<1.e-4) {
219  const char *westeast = (i/19) ? "West" : "East";
220  int itube = i%19 + 1;
221  LOG_INFO << " " << westeast << " tube " << itube << endm;
222  }
223  }
224  LOG_INFO << " ==>> TOF dead channels <<== " << endm;
225  for(int i=0;i<120;i++) {
226  for(int j=0;j<192;j++) {
227  int itray = i+1;
228  int imodule = j/6 + 1;
229  int icell = j%6 + 1;
230  if(m_eff_tof[i][j]<1.e-4)
231  LOG_INFO << " tray " << itray << " module " << imodule << " cell " << icell << endm;
232  }
233  }
234  LOG_INFO << "----------------------------------" << endm;
235 }
StTofSimParam()
Slow simulator for MRPC-TOF.
~StTofSimParam()
default empty destructor
void init()
initializes calibration from XDF or dBase (not functioning yet)