356 {
357 MsgStream log(
msgSvc(),
"RootTofCalibDataCnv");
358
359
361 if(!sc)
362 { log<<MSG::ERROR<<"unable to open files"<<endreq;
363 }
364
365 int j;
367
368
384
385 char brname[8], ibrname[8];
386 TTree *btoftree = new TTree("BarTofPar", "BarTofPar");
387 for(
unsigned int i=0; i<
nBarAtten; i++ ) {
388 sprintf( brname, "Atten%i", i );
389 sprintf( ibrname, "Atten%i/D", i );
390 btoftree -> Branch( brname, &cnvBarAtten[i], ibrname );
391 }
392 for(
unsigned int i=0; i<
nBarSpeed; i++ ) {
393 sprintf( brname, "Speed%i", i );
394 sprintf( ibrname, "Speed%i/D", i );
395 btoftree -> Branch( brname, &cnvBarSpeed[i], ibrname );
396 }
397 for(
unsigned int i=0; i<
nBarPar; i++ ) {
398 sprintf( brname, "P%i", i );
399 sprintf( ibrname, "P%i/D", i );
400 btoftree -> Branch( brname, &cnvBarPar1[i], ibrname );
401 }
402 for(
unsigned int i=0; i<
nBarPar; i++ ) {
403 sprintf( brname,
"P%i", i+
nBarPar );
404 sprintf( ibrname,
"P%i/D", i+
nBarPar );
405 btoftree -> Branch( brname, &cnvBarPar2[i], ibrname );
406 }
408 sprintf( brname, "Bunch0_Poff%i", i );
409 sprintf( ibrname, "Bunch0_Poff%i/D", i );
410 btoftree -> Branch( brname, &cnvBarParOff1_bunch0[i], ibrname );
411 }
413 sprintf( brname,
"Bunch0_Poff%i", i+
nBarParOff );
414 sprintf( ibrname,
"Bunch0_Poff%i/D", i+
nBarParOff );
415 btoftree -> Branch( brname, &cnvBarParOff2_bunch0[i], ibrname );
416 }
418 sprintf( brname, "Bunch1_Poff%i", i );
419 sprintf( ibrname, "Bunch1_Poff%i/D", i );
420 btoftree -> Branch( brname, &cnvBarParOff1_bunch1[i], ibrname );
421 }
423 sprintf( brname,
"Bunch1_Poff%i", i+
nBarParOff );
424 sprintf( ibrname,
"Bunch1_Poff%i/D", i+
nBarParOff );
425 btoftree -> Branch( brname, &cnvBarParOff2_bunch1[i], ibrname );
426 }
428 sprintf( brname, "Bunch2_Poff%i", i );
429 sprintf( ibrname, "Bunch2_Poff%i/D", i );
430 btoftree -> Branch( brname, &cnvBarParOff1_bunch2[i], ibrname );
431 }
433 sprintf( brname,
"Bunch2_Poff%i", i+
nBarParOff );
434 sprintf( ibrname,
"Bunch2_Poff%i/D", i+
nBarParOff );
435 btoftree -> Branch( brname, &cnvBarParOff2_bunch2[i], ibrname );
436 }
438 sprintf( brname, "Bunch3_Poff%i", i );
439 sprintf( ibrname, "Bunch3_Poff%i/D", i );
440 btoftree -> Branch( brname, &cnvBarParOff1_bunch3[i], ibrname );
441 }
443 sprintf( brname,
"Bunch3_Poff%i", i+
nBarParOff );
444 sprintf( ibrname,
"Bunch3_Poff%i/D", i+
nBarParOff );
445 btoftree -> Branch( brname, &cnvBarParOff2_bunch3[i], ibrname );
446 }
447 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
448 sprintf( brname, "FLeft%i", i );
449 sprintf( ibrname, "FLeft%i/D", i );
450 btoftree -> Branch( brname, &cnvFLeft[i], ibrname );
451 }
452 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
453 sprintf( brname, "FRight%i", i );
454 sprintf( ibrname, "FRight%i/D", i );
455 btoftree -> Branch( brname, &cnvFRight[i], ibrname );
456 }
458 sprintf( brname, "FCounter%i", i );
459 sprintf( ibrname, "FCounter%i/D", i );
460 btoftree -> Branch( brname, &cnvFCount[i], ibrname );
461 }
462
463 for( int i=0; i<176; i++ ) {
464 for(j=0;j<static_cast<int>(
nBarAtten);j++) {
466 }
467 for(j=0;j<static_cast<int>(
nBarSpeed);j++) {
469 }
470 for(j=0;j<static_cast<int>(
nBarPar);j++){
473 }
477 }
481 }
485 }
489 }
490 for(j=0;j<static_cast<int>(
nBarSigma);j++){
493 }
496 }
497 btoftree -> Fill();
498 }
499
500
505
506 char ecname[8], iecname[8];
507 TTree *etoftree = new TTree("EndTofPar", "EndTofPar");
508 for(
unsigned int i=0; i<
nEndAtten; i++ ) {
509 sprintf( ecname, "Atten%i", i );
510 sprintf( iecname, "Atten%i/D", i );
511 etoftree -> Branch( ecname, &cnvEndAtten[i], iecname );
512 }
513 for(
unsigned int i=0; i<
nEndSpeed; i++ ) {
514 sprintf( ecname, "Speed%i", i );
515 sprintf( iecname, "Speed%i/D", i );
516 etoftree -> Branch( ecname, &cnvEndSpeed[i], iecname );
517 }
518 for(
unsigned int i=0; i<
nEndPar; i++ ) {
519 sprintf( ecname, "P%i", i );
520 sprintf( iecname, "P%i/D", i );
521 etoftree -> Branch( ecname, &cnvEndPar[i], iecname );
522 }
523 for(
unsigned int i=0; i<
nEndSigma; i++ ) {
524 sprintf( ecname, "FCounter%i", i );
525 sprintf( iecname, "FCounter%i/D", i );
526 etoftree -> Branch( ecname, &cnvEndFPar[i], iecname );
527 }
528
529 for(int i=0; i<96; i++){
530 for(j=0;j<static_cast<int>(
nEndAtten);j++) {
532 }
533 for(j=0;j<static_cast<int>(
nEndSpeed);j++) {
535 }
536 for(j=0;j<static_cast<int>(
nEndPar);j++){
538 }
539 for(j=0;j<static_cast<int>(
nEndSigma);j++){
541 }
542 etoftree -> Fill();
543 }
544
545
550
551 char etfname[8], ietfname[8];
552 TTree *etftree = new TTree("EtfTofPar", "EtfTofPar");
553 for(
unsigned int i=0; i<
nEtfSpeed; i++ ) {
554 sprintf( etfname, "Speed%i", i );
555 sprintf( ietfname, "Speed%i/D", i );
556 etftree -> Branch( etfname, &cnvEtfSpeed[i], ietfname );
557 }
558 for(
unsigned int i=0; i<
nEtfPar; i++ ) {
559 sprintf( etfname, "P%i", i );
560 sprintf( ietfname, "P%i/D", i );
561 etftree -> Branch( etfname, &cnvEtfPar[i], ietfname );
562 }
563 for(
unsigned int i=0; i<
nEtfPar; i++ ) {
564 sprintf( etfname,
"P%i", i+
nEtfPar );
565 sprintf( ietfname,
"P%i/D", i+
nEtfPar );
566 etftree -> Branch( etfname, &cnvEtfPar1[i], ietfname );
567 }
568 for(
unsigned int i=0; i<
nEtfPar; i++ ) {
569 sprintf( etfname,
"P%i", i+2*
nEtfPar );
570 sprintf( ietfname,
"P%i/D", i+2*
nEtfPar );
571 etftree -> Branch( etfname, &cnvEtfPar2[i], ietfname );
572 }
573
574 for( int i=0; i<72; i++ ) {
575 for( int k=0; k<12; k++ ) {
576 for(j=0;j<static_cast<int>(
nEtfSpeed);j++) {
578 }
579 for(j=0;j<static_cast<int>(
nEtfPar);j++){
583 }
584 etftree -> Fill();
585 }
586 }
587
588
590
591 char etfbunchname[8], ietfbunchname[8];
592 TTree *etfbunchtree = new TTree("EtfTofBunch", "EtfTofBunch");
593 for(
unsigned int i=0; i<
nEtfBunch; i++ ) {
594 sprintf( etfbunchname, "pbunch%i", i );
595 sprintf( ietfbunchname, "pbunch%i/D", i );
596 etfbunchtree -> Branch( etfbunchname, &cnvEtfBunchP[i], ietfbunchname );
597 }
598
599 for(j=0;j<static_cast<int>(
nEtfBunch);j++) {
601 }
602 etfbunchtree -> Fill();
603
604
605
606 btoftree -> Write();
607 etoftree -> Write();
608 etftree -> Write();
609 etfbunchtree -> Write();
610 delete btoftree;
611 delete etoftree;
612 delete etftree;
613 delete etfbunchtree;
615 log<<MSG::INFO<<"successfully create RootFile"<<endreq;
616
617 return sc;
618}
const unsigned int nBarParOff
const unsigned int nEndPar
const unsigned int nEtfPar
const unsigned int nBarPar
const unsigned int nBarSigma
const unsigned int nEndSigma
const unsigned int nEndSpeed
const unsigned int nEtfSpeed
const unsigned int nEtfBunch
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 getEtfSpeed(int index, int strip, int pardex)
double getBTofFright(int index, int pardex)
double getBTofFcounter(int index, int pardex)
double getBTofPoffleft_bunch2(int index, int pardex)
double getEtfPleft(int index, int strip, int pardex)
double getEtfPcombine(int index, int strip, int pardex)
double getETofAtten(int index, int pardex)
double getBTofAtten(int index, int pardex)
double getEtfPBunch(int pardex)
double getBTofPoffleft_bunch0(int index, int pardex)
double getEtfPright(int index, int strip, 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)