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