119 m_param.setPar( m_nstep, m_E_weight, m_V );
126 if ( tdcRes_const < 0 ) tdcRes_const = 38;
131 if ( adcRes_const < 0 ) adcRes_const = 27;
134 time_leading_sphi = -999;
135 time_leading_xphi = -999;
136 time_trailing_sphi = -999;
137 time_trailing_xphi = -999;
139 cout <<
"Property:" << endl
140 <<
" FileName= " << m_fileName <<
" E= " << m_V <<
" Threshold= " << m_threshold
141 <<
" nstep= " << m_nstep <<
" E_weight= " << m_E_weight
142 <<
" saturationFlag= " << m_saturationFlag <<
" tdcRes_const= " << tdcRes_const
143 <<
" adcRes_const= " << adcRes_const
144 <<
" calTdcRes_charge_flag= " << m_calTdcRes_charge_flag
145 <<
" charge2Time_flag= " << m_charge2Time_flag
146 <<
" calAdcRes_charge_flag= " << m_calAdcRes_charge_flag << endl;
151 G4DigiManager* digiManager = G4DigiManager::GetDMpointer();
152 G4int THCID = digiManager->GetHitsCollectionID(
"BesTofHitsCollection" );
154 if ( !
m_THC )
return;
157 module = single_module->GetModule_mrpc();
161 int nstrip = m_param.nstrip;
163 for (
int i = 0; i < nstrip; i++ )
165 stripStruct[i].
m_param = m_param;
166 stripStruct[i].
setPar( m_param.alpha, m_param.eta, m_param.v_drift, m_threshold,
188 hitStruct.
x = hit->
GetPos().x() / mm;
189 hitStruct.
y = hit->
GetPos().y() / mm;
190 hitStruct.
z = hit->
GetPos().z() / mm;
191 hitStruct.
px = hit->
GetMomentum().x() / ( GeV / ( 3e+08 * m /
s ) );
192 hitStruct.
py = hit->
GetMomentum().y() / ( GeV / ( 3e+08 * m /
s ) );
193 hitStruct.
pz = hit->
GetMomentum().z() / ( GeV / ( 3e+08 * m /
s ) );
203 for (
int i = 0; i < nstrip; i++ )
205 if ( stripStruct[i].hitStructCol.size() == 0 )
continue;
206 stripStruct[i].
strip = i;
211 if ( stripStruct[i].tThreshold <= 0 )
continue;
218 double tdcRes_charge = 0;
219 if ( m_calTdcRes_charge_flag == 0 )
223 else if ( m_calTdcRes_charge_flag == 1 )
225 else if ( m_calTdcRes_charge_flag == 2 ) { tdcRes_charge = 0; }
227 tdcRes = sqrt( tdcRes_charge * tdcRes_charge + tdcRes_const * tdcRes_const ) / 1000;
229 tdc_sphi = G4RandGauss::shoot( tdc_sphi, tdcRes );
230 tdc_xphi = G4RandGauss::shoot( tdc_xphi, tdcRes );
232 if ( m_charge2Time_flag == 0 )
236 else if ( m_charge2Time_flag == 1 ) { adc =
charge2Time1( stripStruct[i].charge * 1000 ); }
238 double adcRes_charge = 0;
239 if ( m_calAdcRes_charge_flag == 0 )
243 else if ( m_calAdcRes_charge_flag == 1 )
245 else if ( m_calAdcRes_charge_flag == 2 ) { adcRes_charge = 0; }
247 adcRes = sqrt( adcRes_charge * adcRes_charge + adcRes_const * adcRes_const ) / 1000;
248 adc = G4RandGauss::shoot( adc, adcRes );
249 if ( adc < 0 ) adc = 0;
251 time_leading_sphi = tdc_sphi;
252 time_leading_xphi = tdc_xphi;
253 time_trailing_sphi = tdc_sphi + adc;
254 time_trailing_xphi = tdc_xphi + adc;
261 digi->
SetStrip( stripStruct[i].strip );
262 int mo = ( partId - 3 ) * 36 + module;
263 int st = stripStruct[i].
strip;
264 if ( m_param.deadChannel[mo][st] == 0 || m_param.deadChannel[mo][st] == 2 )
275 if ( m_param.deadChannel[mo][st] == 1 || m_param.deadChannel[mo][st] == 2 )
301 m_time_leading_sphi = time_leading_sphi;
302 m_time_leading_xphi = time_leading_xphi;
303 m_time_trailing_sphi = time_trailing_sphi;
304 m_time_trailing_xphi = time_trailing_xphi;
306 m_tdcRes_charge = tdcRes_charge;
309 m_adcRes_charge = adcRes_charge;
311 m_strip = stripStruct[i].
strip;
312 m_trkIndex = stripStruct[i].
trkIndex;
313 m_tStart = stripStruct[i].
tStart;
317 m_charge = stripStruct[i].
charge;
321 for (
int j = 0; j < m_nhit; j++ )
324 m_trkIndex_hit[j] = stripStruct[i].
hitStructCol[j].trkIndex;
325 m_pdgCode_hit[j] = stripStruct[i].
hitStructCol[j].pdgCode;
327 m_underStrip_hit[j] = stripStruct[i].
hitStructCol[j].underStrip;
674 double e[22] = { 65, 70, 75, 80, 85, 90, 95, 100, 102, 104, 106,
675 108, 110, 112, 114, 116, 118, 120, 125, 130, 135, 140 };
679 383.5 / 10, 471 / 10, 564.5 / 10, 663.6 / 10, 777.1 / 10, 877 / 10,
680 990.8 / 10, 1106 / 10, 1154 / 10, 1199 / 10, 1253 / 10, 1296 / 10,
681 1344 / 10, 1396 / 10, 1448 / 10, 1502 / 10, 1545 / 10, 1597 / 10,
682 1726 / 10, 1858 / 10, 1992 / 10, 2124 / 10,
685 TSpline3* sp_alpha =
new TSpline3(
"sp_alpha", e,
alpha, 22 );
686 double alphaVal = sp_alpha->Eval(
E );
694 double e[22] = { 65, 70, 75, 80, 85, 90, 95, 100, 102, 104, 106,
695 108, 110, 112, 114, 116, 118, 120, 125, 130, 135, 140 };
698 double eta[22] = { 132.6 / 10, 117.2 / 10, 102.6 / 10, 88.26 / 10, 79.81 / 10, 74.0 / 10,
699 66.7 / 10, 62.7 / 10, 61.4 / 10, 57.4 / 10, 55.45 / 10, 54.35 / 10,
700 52.48 / 10, 51.3 / 10, 50.1 / 10, 48.3 / 10, 48.28 / 10, 46.00 / 10,
701 44.08 / 10, 41.67 / 10, 39.97 / 10, 38.04 / 10 };
703 TSpline3* sp_eta =
new TSpline3(
"sp_eta", e,
eta, 22 );
704 double etaVal = sp_eta->Eval(
E );
712 double e[22] = { 65, 70, 75, 80, 85, 90, 95, 100, 102, 104, 106,
713 108, 110, 112, 114, 116, 118, 120, 125, 130, 135, 140 };
716 double v[22] = { 130.2 / 1000, 138.5 / 1000, 146.7 / 1000, 155.0 / 1000, 163.3 / 1000,
717 171.4 / 1000, 179.7 / 1000, 187.7 / 1000, 191.2 / 1000, 194.5 / 1000,
718 197.9 / 1000, 201.2 / 1000, 204.5 / 1000, 207.6 / 1000, 210.9 / 1000,
719 214.4 / 1000, 217.5 / 1000, 220.9 / 1000, 228.8 / 1000, 237.0 / 1000,
720 244.7 / 1000, 252.9 / 1000 };
722 TSpline3* sp_v =
new TSpline3(
"sp_v", e,
v, 22 );
723 double vVal = sp_v->Eval(
E );