212 {
213
214 std::string filePath =
path +
"/share/TofCorrPID/";
215
216 if(
abs(run)>=8093 &&
abs(run)<=9025 ) {
217 filePath = filePath + "psip2009";
218 m_runBegin = 8093;
219 m_runEnd = 9025;
220 }
221 else if(
abs(run)>=9947 &&
abs(run)<=10878 ) {
222 filePath = filePath + "jpsi2009";
223 m_runBegin = 9947;
224 m_runEnd = 10878;
225 }
226
227 if( run>0 ) {
228 filePath = filePath + "/data/";
229 }
230 else {
231 filePath = filePath + "/mc/";
232 }
233
234
235
236 std::string fileWeight = filePath + "calib_barrel_sigma.txt";
237 ifstream inputWeight( fileWeight.c_str(), std::ios_base::in );
238 if( !inputWeight ) {
239 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileWeight << endreq;
240 exit(1);
241 }
242
243 for( unsigned int tofid=0; tofid<176; tofid++ ) {
244 for( unsigned int readout=0; readout<3; readout++ ) {
245 for( unsigned int p_i=0; p_i<5; p_i++ ) {
246 inputWeight >> m_p_weight[tofid][readout][p_i];
247 }
248 }
249 }
250
251
252
253 std::string fileCommon = filePath + "calib_barrel_common.txt";
254 ifstream inputCommon( fileCommon.c_str(), std::ios_base::in );
255 if( !inputCommon ) {
256 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileCommon << endreq;
257 exit(1);
258 }
259 inputCommon >> m_p_common;
260
261
262
263 std::string fileEcSigma = filePath + "calib_endcap_sigma.txt";
264 ifstream inputEcSigma( fileEcSigma.c_str(), std::ios_base::in );
265 if( !inputEcSigma ) {
266 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileEcSigma << endreq;
267 exit(1);
268 }
269
270 for( unsigned int tofid=0; tofid<96; tofid++ ) {
271 for( unsigned int p_i=0; p_i<3; p_i++ ) {
272 inputEcSigma >> m_ec_sigma[tofid][p_i];
273 }
274 }
275
276
277
278 std::string fileQ0BetaGamma = filePath + "curve_Q0_BetaGamma.txt";
279 ifstream inputQ0BetaGamma( fileQ0BetaGamma.c_str(), std::ios_base::in );
280 if( !inputQ0BetaGamma ) {
281 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileQ0BetaGamma << endreq;
282 exit(1);
283 }
284
285 for( unsigned int layer=0; layer<3; layer++ ) {
286 for( unsigned int ipar=0; ipar<5; ipar++ ) {
287 inputQ0BetaGamma >> m_q0_bg[layer][ipar];
288 }
289 }
290
291
292
293 std::string fileParAB = filePath + "parameter_A_B.txt";
294 ifstream inputParAB( fileParAB.c_str(), std::ios_base::in );
295 if( !inputParAB ) {
296 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileParAB << endreq;
297 exit(1);
298 }
299
300
301 for( unsigned int ipmt=0; ipmt<5; ipmt++ ) {
302 for( unsigned int iab=0; iab<2; iab++ ) {
303 for( unsigned int ipar=0; ipar<5; ipar++ ) {
304 inputParAB >> m_par_ab[ipmt][iab][ipar];
305 }
306 }
307 }
308 for( unsigned int ipmt=0; ipmt<5; ipmt++ ) {
309 for( unsigned int iab=0; iab<2; iab++ ) {
310 for( unsigned int ipar=0; ipar<5; ipar++ ) {
311 inputParAB >> m_par_pbar_ab[ipmt][iab][ipar];
312 }
313 }
314 }
315
316
317
318 std::string fileSigma = filePath + "parameter_sigma.txt";
319 ifstream inputSigma( fileSigma.c_str(), std::ios_base::in );
320 if( !inputSigma ) {
321 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileSigma << endreq;
322 exit(1);
323 }
324
325
326
327
328 for( unsigned int ispecies=0; ispecies<4; ispecies++ ) {
329 for( unsigned int ipmt=0; ipmt<8; ipmt++ ) {
330 for( unsigned int ipar=0; ipar<9; ipar++ ) {
331 inputSigma >> m_par_sigma[ispecies][ipmt][ipar];
332 }
333 }
334 }
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359 std::string fileProtonOffset = filePath + "parameter_offset_proton.txt";
360 ifstream inputProtonOffset( fileProtonOffset.c_str(), std::ios_base::in );
361 if( !inputProtonOffset ) {
362 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileProtonOffset << endreq;
363 exit(1);
364 }
365
366
367 for( unsigned int ispecies=0; ispecies<2; ispecies++ ) {
368 for( unsigned int ipmt=0; ipmt<4; ipmt++ ) {
369 for( unsigned int ipar=0; ipar<10; ipar++ ) {
370 for( unsigned int jpar=0; jpar<20; jpar++ ) {
371 inputProtonOffset >> m_p_offset[ispecies][ipmt][ipar][jpar];
372 }
373 }
374 }
375 }
376
377
378
379 std::string fileProtonSigma = filePath + "parameter_sigma_proton.txt";
380 ifstream inputProtonSigma( fileProtonSigma.c_str(), std::ios_base::in );
381 if( !inputProtonSigma ) {
382 cout << "ParticleID::TofCorrPID: Can NOT open file: " << fileProtonSigma << endreq;
383 exit(1);
384 }
385
386
387
388
389 for( unsigned int ispecies=0; ispecies<2; ispecies++ ) {
390 for( unsigned int ipmt=0; ipmt<7; ipmt++ ) {
391 for( unsigned int ipar=0; ipar<10; ipar++ ) {
392 for( unsigned int jpar=0; jpar<20; jpar++ ) {
393 inputProtonSigma >> m_p_sigma[ispecies][ipmt][ipar][jpar];
394 }
395 }
396 }
397 }
398
399
400
401 return;
402}