293 {
294 MsgStream log(
msgSvc(),
"RootTofCalibDataCnv");
295
296
298 if(!sc)
299 { log<<MSG::ERROR<<"unable to open files"<<endreq;
300 }
301
302 int j;
304
305
321
322 char brname[8], ibrname[8];
323 TTree *btoftree = new TTree("BarTofPar", "BarTofPar");
324 for(
unsigned int i=0; i<
nBarAtten; i++ ) {
325 sprintf( brname, "Atten%i", i );
326 sprintf( ibrname, "Atten%i/D", i );
327 btoftree -> Branch( brname, &cnvBarAtten[i], ibrname );
328 }
329 for(
unsigned int i=0; i<
nBarSpeed; i++ ) {
330 sprintf( brname, "Speed%i", i );
331 sprintf( ibrname, "Speed%i/D", i );
332 btoftree -> Branch( brname, &cnvBarSpeed[i], ibrname );
333 }
334 for(
unsigned int i=0; i<
nBarPar; i++ ) {
335 sprintf( brname, "P%i", i );
336 sprintf( ibrname, "P%i/D", i );
337 btoftree -> Branch( brname, &cnvBarPar1[i], ibrname );
338 }
339 for(
unsigned int i=0; i<
nBarPar; i++ ) {
340 sprintf( brname,
"P%i", i+
nBarPar );
341 sprintf( ibrname,
"P%i/D", i+
nBarPar );
342 btoftree -> Branch( brname, &cnvBarPar2[i], ibrname );
343 }
345 sprintf( brname, "Bunch0_Poff%i", i );
346 sprintf( ibrname, "Bunch0_Poff%i/D", i );
347 btoftree -> Branch( brname, &cnvBarParOff1_bunch0[i], ibrname );
348 }
350 sprintf( brname,
"Bunch0_Poff%i", i+
nBarParOff );
351 sprintf( ibrname,
"Bunch0_Poff%i/D", i+
nBarParOff );
352 btoftree -> Branch( brname, &cnvBarParOff2_bunch0[i], ibrname );
353 }
355 sprintf( brname, "Bunch1_Poff%i", i );
356 sprintf( ibrname, "Bunch1_Poff%i/D", i );
357 btoftree -> Branch( brname, &cnvBarParOff1_bunch1[i], ibrname );
358 }
360 sprintf( brname,
"Bunch1_Poff%i", i+
nBarParOff );
361 sprintf( ibrname,
"Bunch1_Poff%i/D", i+
nBarParOff );
362 btoftree -> Branch( brname, &cnvBarParOff2_bunch1[i], ibrname );
363 }
365 sprintf( brname, "Bunch2_Poff%i", i );
366 sprintf( ibrname, "Bunch2_Poff%i/D", i );
367 btoftree -> Branch( brname, &cnvBarParOff1_bunch2[i], ibrname );
368 }
370 sprintf( brname,
"Bunch2_Poff%i", i+
nBarParOff );
371 sprintf( ibrname,
"Bunch2_Poff%i/D", i+
nBarParOff );
372 btoftree -> Branch( brname, &cnvBarParOff2_bunch2[i], ibrname );
373 }
375 sprintf( brname, "Bunch3_Poff%i", i );
376 sprintf( ibrname, "Bunch3_Poff%i/D", i );
377 btoftree -> Branch( brname, &cnvBarParOff1_bunch3[i], ibrname );
378 }
380 sprintf( brname,
"Bunch3_Poff%i", i+
nBarParOff );
381 sprintf( ibrname,
"Bunch3_Poff%i/D", i+
nBarParOff );
382 btoftree -> Branch( brname, &cnvBarParOff2_bunch3[i], ibrname );
383 }
384 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
385 sprintf( brname, "FLeft%i", i );
386 sprintf( ibrname, "FLeft%i/D", i );
387 btoftree -> Branch( brname, &cnvFLeft[i], ibrname );
388 }
389 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
390 sprintf( brname, "FRight%i", i );
391 sprintf( ibrname, "FRight%i/D", i );
392 btoftree -> Branch( brname, &cnvFRight[i], ibrname );
393 }
395 sprintf( brname, "FCounter%i", i );
396 sprintf( ibrname, "FCounter%i/D", i );
397 btoftree -> Branch( brname, &cnvFCount[i], ibrname );
398 }
399
400 for( int i=0; i<176; i++ ) {
401 for(j=0;j<static_cast<int>(
nBarAtten);j++) {
403 }
404 for(j=0;j<static_cast<int>(
nBarSpeed);j++) {
406 }
407 for(j=0;j<static_cast<int>(
nBarPar);j++){
410 }
414 }
418 }
422 }
426 }
427 for(j=0;j<static_cast<int>(
nBarSigma);j++){
430 }
433 }
434 btoftree -> Fill();
435 }
436
437
442
443 char ecname[8], iecname[8];
444 TTree *etoftree = new TTree("EndTofPar", "EndTofPar");
445 for(
unsigned int i=0; i<
nEndAtten; i++ ) {
446 sprintf( ecname, "Atten%i", i );
447 sprintf( iecname, "Atten%i/D", i );
448 etoftree -> Branch( ecname, &cnvEndAtten[i], iecname );
449 }
450 for(
unsigned int i=0; i<
nEndSpeed; i++ ) {
451 sprintf( ecname, "Speed%i", i );
452 sprintf( iecname, "Speed%i/D", i );
453 etoftree -> Branch( ecname, &cnvEndSpeed[i], iecname );
454 }
455 for(
unsigned int i=0; i<
nEndPar; i++ ) {
456 sprintf( ecname, "P%i", i );
457 sprintf( iecname, "P%i/D", i );
458 etoftree -> Branch( ecname, &cnvEndPar[i], iecname );
459 }
460 for(
unsigned int i=0; i<
nEndSigma; i++ ) {
461 sprintf( ecname, "FCounter%i", i );
462 sprintf( iecname, "FCounter%i/D", i );
463 etoftree -> Branch( ecname, &cnvEndFPar[i], iecname );
464 }
465
466 for(int i=0; i<96; i++){
467 for(j=0;j<static_cast<int>(
nEndAtten);j++) {
469 }
470 for(j=0;j<static_cast<int>(
nEndSpeed);j++) {
472 }
473 for(j=0;j<static_cast<int>(
nEndPar);j++){
475 }
476 for(j=0;j<static_cast<int>(
nEndSigma);j++){
478 }
479 etoftree -> Fill();
480 }
481
482
483 btoftree -> Write();
484 etoftree -> Write();
485 delete btoftree;
486 delete etoftree;
488 log<<MSG::INFO<<"successfully create RootFile"<<endreq;
489
490 return sc;
491}
const unsigned int nBarParOff
const unsigned int nEndPar
const unsigned int nBarPar
const unsigned int nBarSigma
const unsigned int nEndSigma
const unsigned int nEndSpeed
const unsigned int nBarSpeed
const unsigned int nEndAtten
const unsigned int nBarAtten
const unsigned int nBarSigCnt
double getETofFP(int index, int pardex)
double getBTofPoffleft_bunch1(int index, int pardex)
double getBTofPoffleft_bunch3(int index, int pardex)
double getBTofSpeed(int index, int pardex)
double getETofP(int index, int pardex)
double getBTofPoffright_bunch3(int index, int pardex)
double getBTofPoffright_bunch2(int index, int pardex)
double getBTofFleft(int index, int pardex)
double getBTofPoffright_bunch0(int index, int pardex)
double getBTofPoffright_bunch1(int index, int pardex)
double getBTofFright(int index, int pardex)
double getBTofFcounter(int index, int pardex)
double getBTofPoffleft_bunch2(int index, int pardex)
double getETofAtten(int index, int pardex)
double getBTofAtten(int index, int pardex)
double getBTofPoffleft_bunch0(int index, int pardex)
double getBTofPleft(int index, int pardex)
double getETofSpeed(int index, int pardex)
double getBTofPright(int index, int pardex)
virtual StatusCode openWrite(const std::string &fname)