BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
RootTofCalibDataCnv Class Reference

#include <RootTofCalibDataCnv.h>

+ Inheritance diagram for RootTofCalibDataCnv:

Public Member Functions

const CLID & objType () const
 
 RootTofCalibDataCnv (ISvcLocator *svc)
 
virtual ~RootTofCalibDataCnv ()
 
virtual StatusCode createRoot (const std::string &fname, CalibData::CalibBase1 *pTDSObj)
 
virtual long repSvcType () const
 
- Public Member Functions inherited from RootCalBaseCnv
virtual ~RootCalBaseCnv ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&refpObject)
 
ICalibRootSvcgetCalibRootSvc ()
 
 RootCalBaseCnv (ISvcLocator *svc, const CLID &clid)
 
virtual StatusCode createRoot (const std::string &fname, CalibData::CalibBase1 *pTDSObj)
 
virtual StatusCode readRootObj (const std::string &treename, const std::string &branch, TObject *&pCalib, unsigned index=0)
 
virtual StatusCode readRootObj (TTree *tree, const std::string &branch, TObject *&pCalib, unsigned index=0)
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
- Static Public Member Functions inherited from RootCalBaseCnv
static const unsigned char storageType ()
 

Protected Member Functions

virtual StatusCode i_createObj (const std::string &fname, DataObject *&refpObject)
 
- Protected Member Functions inherited from RootCalBaseCnv
virtual StatusCode internalCreateObj (const std::string &fname, DataObject *&refpObject, IOpaqueAddress *address)
 
virtual StatusCode i_createObj (const std::string &fname, DataObject *&refpObject)
 
virtual StatusCode i_processObj (DataObject *pObject, IOpaqueAddress *address)
 In case there is additional work to do on the created object.
 
virtual StatusCode fillRoot (CalibData::CalibBase *pTDSObj, TObject *pRootObj)
 
virtual StatusCode openWrite (const std::string &fname)
 
StatusCode closeWrite ()
 
StatusCode openRead (const std::string &fname)
 
StatusCode closeRead ()
 
void setBaseInfo (CalibData::CalibBase1 *pObj)
 Another utility for derived classes to use.
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RootTofCalibDataCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RootCalBaseCnv
ICalibRootSvcm_rootSvc
 
ICalibMetaCnvSvcm_metaSvc
 
IInstrumentNamem_instrSvc
 
int m_serNo
 
ITime * m_vstart
 
ITime * m_vend
 
int m_runfrm
 
int m_runto
 
TFile * m_outFile
 
TTree * m_ttree
 
TFile * m_inFile
 
TDirectory * m_saveDir
 

Detailed Description

Definition at line 20 of file RootTofCalibDataCnv.h.

Constructor & Destructor Documentation

◆ RootTofCalibDataCnv()

RootTofCalibDataCnv::RootTofCalibDataCnv ( ISvcLocator *  svc)

Definition at line 51 of file RootTofCalibDataCnv.cxx.

51 :
53 }
const CLID CLID_Calib_TofCal
Definition: CalibModel.h:43

◆ ~RootTofCalibDataCnv()

virtual RootTofCalibDataCnv::~RootTofCalibDataCnv ( )
inlinevirtual

Definition at line 29 of file RootTofCalibDataCnv.h.

29{};

Member Function Documentation

◆ classID()

const CLID & RootTofCalibDataCnv::classID ( )
static

Definition at line 60 of file RootTofCalibDataCnv.cxx.

60 {
61 return CLID_Calib_TofCal;
62}

◆ createRoot()

StatusCode RootTofCalibDataCnv::createRoot ( const std::string &  fname,
CalibData::CalibBase1 pTDSObj 
)
virtual

Create ROOT file corresponding to TDS object input.
Default implementation is to return an error. Must be separately implemented for each calibration type.

Parameters
fnameFilename for output file
pTDSObjPointer to tds object to be converted

Reimplemented from RootCalBaseCnv.

Definition at line 372 of file RootTofCalibDataCnv.cxx.

373 {
374 MsgStream log(msgSvc(), "RootTofCalibDataCnv");
375
376 // Open the file, create the branch
377 StatusCode sc = openWrite(fname);
378 if(!sc)
379 { log<<MSG::ERROR<<"unable to open files"<<endreq;
380 }
381 // write the Data in the TCDS to RootFile
382 int j;
383 CalibData::TofCalibData* btof = dynamic_cast<CalibData::TofCalibData*>(pTDSObj);
384
385 // write btoftree----------------------------------------------------------------
386 double cnvBarAtten[nBarAtten];
387 double cnvBarSpeed[nBarSpeed];
388 double cnvBarPar1[nBarPar];
389 double cnvBarPar2[nBarPar];
390 double cnvBarParOff1_bunch0[nBarParOff];
391 double cnvBarParOff2_bunch0[nBarParOff];
392 double cnvBarParOff1_bunch1[nBarParOff];
393 double cnvBarParOff2_bunch1[nBarParOff];
394 double cnvBarParOff1_bunch2[nBarParOff];
395 double cnvBarParOff2_bunch2[nBarParOff];
396 double cnvBarParOff1_bunch3[nBarParOff];
397 double cnvBarParOff2_bunch3[nBarParOff];
398 double cnvFLeft[nBarSigma];
399 double cnvFRight[nBarSigma];
400 double cnvFCount[nBarSigCnt];
401
402 char brname[8], ibrname[8];
403 TTree *btoftree = new TTree("BarTofPar", "BarTofPar");
404 for( unsigned int i=0; i<nBarAtten; i++ ) {
405 sprintf( brname, "Atten%i", i );
406 sprintf( ibrname, "Atten%i/D", i );
407 btoftree -> Branch( brname, &cnvBarAtten[i], ibrname );
408 }
409 for( unsigned int i=0; i<nBarSpeed; i++ ) {
410 sprintf( brname, "Speed%i", i );
411 sprintf( ibrname, "Speed%i/D", i );
412 btoftree -> Branch( brname, &cnvBarSpeed[i], ibrname );
413 }
414 for( unsigned int i=0; i<nBarPar; i++ ) {
415 sprintf( brname, "P%i", i );
416 sprintf( ibrname, "P%i/D", i );
417 btoftree -> Branch( brname, &cnvBarPar1[i], ibrname );
418 }
419 for( unsigned int i=0; i<nBarPar; i++ ) {
420 sprintf( brname, "P%i", i+nBarPar );
421 sprintf( ibrname, "P%i/D", i+nBarPar );
422 btoftree -> Branch( brname, &cnvBarPar2[i], ibrname );
423 }
424 for( unsigned int i=0; i<nBarParOff; i++ ) {
425 sprintf( brname, "Bunch0_Poff%i", i );
426 sprintf( ibrname, "Bunch0_Poff%i/D", i );
427 btoftree -> Branch( brname, &cnvBarParOff1_bunch0[i], ibrname );
428 }
429 for( unsigned int i=0; i<nBarParOff; i++ ) {
430 sprintf( brname, "Bunch0_Poff%i", i+nBarParOff );
431 sprintf( ibrname, "Bunch0_Poff%i/D", i+nBarParOff );
432 btoftree -> Branch( brname, &cnvBarParOff2_bunch0[i], ibrname );
433 }
434 for( unsigned int i=0; i<nBarParOff; i++ ) {
435 sprintf( brname, "Bunch1_Poff%i", i );
436 sprintf( ibrname, "Bunch1_Poff%i/D", i );
437 btoftree -> Branch( brname, &cnvBarParOff1_bunch1[i], ibrname );
438 }
439 for( unsigned int i=0; i<nBarParOff; i++ ) {
440 sprintf( brname, "Bunch1_Poff%i", i+nBarParOff );
441 sprintf( ibrname, "Bunch1_Poff%i/D", i+nBarParOff );
442 btoftree -> Branch( brname, &cnvBarParOff2_bunch1[i], ibrname );
443 }
444 for( unsigned int i=0; i<nBarParOff; i++ ) {
445 sprintf( brname, "Bunch2_Poff%i", i );
446 sprintf( ibrname, "Bunch2_Poff%i/D", i );
447 btoftree -> Branch( brname, &cnvBarParOff1_bunch2[i], ibrname );
448 }
449 for( unsigned int i=0; i<nBarParOff; i++ ) {
450 sprintf( brname, "Bunch2_Poff%i", i+nBarParOff );
451 sprintf( ibrname, "Bunch2_Poff%i/D", i+nBarParOff );
452 btoftree -> Branch( brname, &cnvBarParOff2_bunch2[i], ibrname );
453 }
454 for( unsigned int i=0; i<nBarParOff; i++ ) {
455 sprintf( brname, "Bunch3_Poff%i", i );
456 sprintf( ibrname, "Bunch3_Poff%i/D", i );
457 btoftree -> Branch( brname, &cnvBarParOff1_bunch3[i], ibrname );
458 }
459 for( unsigned int i=0; i<nBarParOff; i++ ) {
460 sprintf( brname, "Bunch3_Poff%i", i+nBarParOff );
461 sprintf( ibrname, "Bunch3_Poff%i/D", i+nBarParOff );
462 btoftree -> Branch( brname, &cnvBarParOff2_bunch3[i], ibrname );
463 }
464 for( unsigned int i=0; i<nBarSigma; i++ ) {
465 sprintf( brname, "FLeft%i", i );
466 sprintf( ibrname, "FLeft%i/D", i );
467 btoftree -> Branch( brname, &cnvFLeft[i], ibrname );
468 }
469 for( unsigned int i=0; i<nBarSigma; i++ ) {
470 sprintf( brname, "FRight%i", i );
471 sprintf( ibrname, "FRight%i/D", i );
472 btoftree -> Branch( brname, &cnvFRight[i], ibrname );
473 }
474 for( unsigned int i=0; i<nBarSigCnt; i++ ) {
475 sprintf( brname, "FCounter%i", i );
476 sprintf( ibrname, "FCounter%i/D", i );
477 btoftree -> Branch( brname, &cnvFCount[i], ibrname );
478 }
479
480 for( int i=0; i<176; i++ ) {
481 for(j=0;j<static_cast<int>(nBarAtten);j++) {
482 cnvBarAtten[j] = btof->getBTofAtten(i,j);
483 }
484 for(j=0;j<static_cast<int>(nBarSpeed);j++) {
485 cnvBarSpeed[j] = btof->getBTofSpeed(i,j);
486 }
487 for(j=0;j<static_cast<int>(nBarPar);j++){
488 cnvBarPar1[j] = btof->getBTofPleft(i,j);
489 cnvBarPar2[j] = btof->getBTofPright(i,j);
490 }
491 for(j=0;j<static_cast<int>(nBarParOff);j++){
492 cnvBarParOff1_bunch0[j] = btof->getBTofPoffleft_bunch0(i,j);
493 cnvBarParOff2_bunch0[j] = btof->getBTofPoffright_bunch0(i,j);
494 }
495 for(j=0;j<static_cast<int>(nBarParOff);j++){
496 cnvBarParOff1_bunch1[j] = btof->getBTofPoffleft_bunch1(i,j);
497 cnvBarParOff2_bunch1[j] = btof->getBTofPoffright_bunch1(i,j);
498 }
499 for(j=0;j<static_cast<int>(nBarParOff);j++){
500 cnvBarParOff1_bunch2[j] = btof->getBTofPoffleft_bunch2(i,j);
501 cnvBarParOff2_bunch2[j] = btof->getBTofPoffright_bunch2(i,j);
502 }
503 for(j=0;j<static_cast<int>(nBarParOff);j++){
504 cnvBarParOff1_bunch3[j] = btof->getBTofPoffleft_bunch3(i,j);
505 cnvBarParOff2_bunch3[j] = btof->getBTofPoffright_bunch3(i,j);
506 }
507 for(j=0;j<static_cast<int>(nBarSigma);j++){
508 cnvFLeft[j] = btof->getBTofFleft(i,j);
509 cnvFRight[j] = btof->getBTofFright(i,j);
510 }
511 for(j=0;j<static_cast<int>(nBarSigCnt);j++){
512 cnvFCount[j] = btof->getBTofFcounter(i,j);
513 }
514 btoftree -> Fill();
515 }
516
517 //write etoftree----------------------------------------------------------------
518 double cnvEndAtten[nEndAtten];
519 double cnvEndSpeed[nEndSpeed];
520 double cnvEndPar[nEndPar];
521 double cnvEndFPar[nEndSigma];
522
523 char ecname[8], iecname[8];
524 TTree *etoftree = new TTree("EndTofPar", "EndTofPar");
525 for( unsigned int i=0; i<nEndAtten; i++ ) {
526 sprintf( ecname, "Atten%i", i );
527 sprintf( iecname, "Atten%i/D", i );
528 etoftree -> Branch( ecname, &cnvEndAtten[i], iecname );
529 }
530 for( unsigned int i=0; i<nEndSpeed; i++ ) {
531 sprintf( ecname, "Speed%i", i );
532 sprintf( iecname, "Speed%i/D", i );
533 etoftree -> Branch( ecname, &cnvEndSpeed[i], iecname );
534 }
535 for( unsigned int i=0; i<nEndPar; i++ ) {
536 sprintf( ecname, "P%i", i );
537 sprintf( iecname, "P%i/D", i );
538 etoftree -> Branch( ecname, &cnvEndPar[i], iecname );
539 }
540 for( unsigned int i=0; i<nEndSigma; i++ ) {
541 sprintf( ecname, "FCounter%i", i );
542 sprintf( iecname, "FCounter%i/D", i );
543 etoftree -> Branch( ecname, &cnvEndFPar[i], iecname );
544 }
545
546 for(int i=0; i<96; i++){
547 for(j=0;j<static_cast<int>(nEndAtten);j++) {
548 cnvEndAtten[j] = btof->getETofAtten(i,j);
549 }
550 for(j=0;j<static_cast<int>(nEndSpeed);j++) {
551 cnvEndSpeed[j] = btof->getETofSpeed(i,j);
552 }
553 for(j=0;j<static_cast<int>(nEndPar);j++){
554 cnvEndPar[j] = btof->getETofP(i,j);
555 }
556 for(j=0;j<static_cast<int>(nEndSigma);j++){
557 cnvEndFPar[j] = btof->getETofFP(i,j);
558 }
559 etoftree -> Fill();
560 }
561
562 //write etftree----------------------------------------------------------------
563 double cnvEtfSpeed[nEtfSpeed];
564 double cnvEtfPar[nEtfPar];
565 double cnvEtfPar1[nEtfPar];
566 double cnvEtfPar2[nEtfPar];
567
568 char etfname[8], ietfname[8];
569 TTree *etftree = new TTree("EtfTofPar", "EtfTofPar");
570 for( unsigned int i=0; i<nEtfSpeed; i++ ) {
571 sprintf( etfname, "Speed%i", i );
572 sprintf( ietfname, "Speed%i/D", i );
573 etftree -> Branch( etfname, &cnvEtfSpeed[i], ietfname );
574 }
575 for( unsigned int i=0; i<nEtfPar; i++ ) {
576 sprintf( etfname, "P%i", i );
577 sprintf( ietfname, "P%i/D", i );
578 etftree -> Branch( etfname, &cnvEtfPar[i], ietfname );
579 }
580 for( unsigned int i=0; i<nEtfPar; i++ ) {
581 sprintf( etfname, "P%i", i+nEtfPar );
582 sprintf( ietfname, "P%i/D", i+nEtfPar );
583 etftree -> Branch( etfname, &cnvEtfPar1[i], ietfname );
584 }
585 for( unsigned int i=0; i<nEtfPar; i++ ) {
586 sprintf( etfname, "P%i", i+2*nEtfPar );
587 sprintf( ietfname, "P%i/D", i+2*nEtfPar );
588 etftree -> Branch( etfname, &cnvEtfPar2[i], ietfname );
589 }
590
591 for( int i=0; i<72; i++ ) {
592 for( int k=0; k<12; k++ ) {
593 for(j=0;j<static_cast<int>(nEtfSpeed);j++) {
594 cnvEtfSpeed[j] = btof->getEtfSpeed(i,k,j);
595 }
596 for(j=0;j<static_cast<int>(nEtfPar);j++){
597 cnvEtfPar[j] = btof->getEtfPcombine(i,k,j);
598 cnvEtfPar1[j] = btof->getEtfPleft(i,k,j);
599 cnvEtfPar2[j] = btof->getEtfPright(i,k,j);
600 }
601 etftree -> Fill();
602 }
603 }
604
605 //write etftree----------------------------------------------------------------
606 double cnvEtfBunchP[nEtfBunch];
607
608 char etfbunchname[8], ietfbunchname[8];
609 TTree *etfbunchtree = new TTree("EtfTofBunch", "EtfTofBunch");
610 for( unsigned int i=0; i<nEtfBunch; i++ ) {
611 sprintf( etfbunchname, "pbunch%i", i );
612 sprintf( ietfbunchname, "pbunch%i/D", i );
613 etfbunchtree -> Branch( etfbunchname, &cnvEtfBunchP[i], ietfbunchname );
614 }
615
616 for(j=0;j<static_cast<int>(nEtfBunch);j++) {
617 cnvEtfBunchP[j] = btof->getEtfPBunch(0,j);
618 }
619 etfbunchtree -> Fill();
620
621
622 // write all the trees
623 btoftree -> Write();
624 etoftree -> Write();
625 etftree -> Write();
626 etfbunchtree -> Write();
627 delete btoftree;
628 delete etoftree;
629 delete etftree;
630 delete etfbunchtree;
631 closeWrite();
632 log<<MSG::INFO<<"successfully create RootFile"<<endreq;
633
634 return sc;
635}
curve Branch("CurveSize",&CurveSize,"CurveSize/I")
curve Fill()
curve Write()
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
IMessageSvc * msgSvc()
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 getEtfPBunch(int cnx, 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 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)
StatusCode closeWrite()
virtual StatusCode openWrite(const std::string &fname)
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)

◆ i_createObj()

StatusCode RootTofCalibDataCnv::i_createObj ( const std::string &  fname,
DataObject *&  refpObject 
)
protectedvirtual

Create the transient representation of an object, given an opaque address. This and the following update method comprise the core functionality of calibration converters. Convenience routine used by most CAL calibration types, which have a <dimension> element describing how the remainder of the Data is laid out. Read from TDS; store information internally in protected members.
Given a pointer to a TDS object which can be cast to "our" type, fill in corresponding information in the corresponding root class

Parameters
pTDSObjPointer to tds object to be converted
pRootObjPointer to destination root object Read in object from specified branch. Don't need tree name; it's always Calib

Reimplemented from RootCalBaseCnv.

Definition at line 64 of file RootTofCalibDataCnv.cxx.

65 {
66
67 MsgStream log(msgSvc(), "RootTofCalibDataCnv");
68 log<<MSG::DEBUG<<"SetProperty"<<endreq;
69
70 // open the file
71 StatusCode sc = openRead(fname);
72 if(!sc)
73 { log<<MSG::ERROR<<"unable to open files"<<endreq;
74 }
75
82
83 std::vector<CalibData::bTofCalibBase> tmpbTof;
84 std::vector<CalibData::eTofCalibBase> tmpeTof;
85 std::vector<CalibData::etfCalibBase> tmpetf;
86 std::vector<CalibData::etfBunchCalibBase> tmpetfBunch;
87 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
88 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
89 // Read in the object
90 int cnt;
91 // read btoftree ------------------------------------------------------------
92
93 double cnvBarAtten[nBarAtten];
94 double cnvBarSpeed[nBarSpeed];
95 double cnvBarPar1[nBarPar];
96 double cnvBarPar2[nBarPar];
97 double cnvBarParOff1_bunch0[nBarParOff];
98 double cnvBarParOff2_bunch0[nBarParOff];
99 double cnvBarParOff1_bunch1[nBarParOff];
100 double cnvBarParOff2_bunch1[nBarParOff];
101 double cnvBarParOff1_bunch2[nBarParOff];
102 double cnvBarParOff2_bunch2[nBarParOff];
103 double cnvBarParOff1_bunch3[nBarParOff];
104 double cnvBarParOff2_bunch3[nBarParOff];
105 double cnvFLeft[nBarSigma];
106 double cnvFRight[nBarSigma];
107 double cnvFCount[nBarSigCnt];
108
109 TTree *btoftree = (TTree*)m_inFile -> Get("BarTofPar");
110
111 char brname[10];
112 for( unsigned int i=0; i<nBarAtten; i++ ) {
113 sprintf( brname, "Atten%i", i );
114 btoftree -> SetBranchAddress( brname, &cnvBarAtten[i] );
115 }
116 for( unsigned int i=0; i<nBarSpeed; i++ ) {
117 sprintf( brname, "Speed%i", i );
118 btoftree -> SetBranchAddress( brname, &cnvBarSpeed[i] );
119 }
120 for( unsigned int i=0; i<nBarPar; i++ ) {
121 sprintf( brname, "P%i", i );
122 btoftree -> SetBranchAddress( brname, &cnvBarPar1[i] );
123 }
124 for( unsigned int i=0; i<nBarPar; i++ ) {
125 sprintf( brname, "P%i", i+nBarPar );
126 btoftree -> SetBranchAddress( brname, &cnvBarPar2[i] );
127 }
128 for( unsigned int i=0; i<nBarParOff; i++ ) {
129 sprintf( brname, "Bunch0_Poff%i", i );
130 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch0[i] );
131 }
132 for( unsigned int i=0; i<nBarParOff; i++ ) {
133 sprintf( brname, "Bunch0_Poff%i", i+nBarParOff );
134 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch0[i] );
135 }
136 for( unsigned int i=0; i<nBarParOff; i++ ) {
137 sprintf( brname, "Bunch1_Poff%i", i );
138 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch1[i] );
139 }
140 for( unsigned int i=0; i<nBarParOff; i++ ) {
141 sprintf( brname, "Bunch1_Poff%i", i+nBarParOff );
142 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch1[i] );
143 }
144 for( unsigned int i=0; i<nBarParOff; i++ ) {
145 sprintf( brname, "Bunch2_Poff%i", i );
146 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch2[i] );
147 }
148 for( unsigned int i=0; i<nBarParOff; i++ ) {
149 sprintf( brname, "Bunch2_Poff%i", i+nBarParOff );
150 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch2[i] );
151 }
152 for( unsigned int i=0; i<nBarParOff; i++ ) {
153 sprintf( brname, "Bunch3_Poff%i", i );
154 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch3[i] );
155 }
156 for( unsigned int i=0; i<nBarParOff; i++ ) {
157 sprintf( brname, "Bunch3_Poff%i", i+nBarParOff );
158 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch3[i] );
159 }
160 for( unsigned int i=0; i<nBarSigma; i++ ) {
161 sprintf( brname, "FLeft%i", i );
162 btoftree -> SetBranchAddress( brname, &cnvFLeft[i] );
163 }
164 for( unsigned int i=0; i<nBarSigma; i++ ) {
165 sprintf( brname, "FRight%i", i );
166 btoftree -> SetBranchAddress( brname, &cnvFRight[i] );
167 }
168 for( unsigned int i=0; i<nBarSigCnt; i++ ) {
169 sprintf( brname, "FCounter%i", i );
170 btoftree -> SetBranchAddress( brname, &cnvFCount[i] );
171 }
172
173 for(cnt=0; cnt<btoftree->GetEntries(); cnt++){
174 btoftree -> GetEntry(cnt);
175 bTof.setAtten( cnvBarAtten );
176 bTof.setSpeed( cnvBarSpeed );
177 bTof.setP1( cnvBarPar1 );
178 bTof.setP2( cnvBarPar2 );
179 bTof.setPoff1_bunch0( cnvBarParOff1_bunch0 );
180 bTof.setPoff2_bunch0( cnvBarParOff2_bunch0 );
181 bTof.setPoff1_bunch1( cnvBarParOff1_bunch1 );
182 bTof.setPoff2_bunch1( cnvBarParOff2_bunch1 );
183 bTof.setPoff1_bunch2( cnvBarParOff1_bunch2 );
184 bTof.setPoff2_bunch2( cnvBarParOff2_bunch2 );
185 bTof.setPoff1_bunch3( cnvBarParOff1_bunch3 );
186 bTof.setPoff2_bunch3( cnvBarParOff2_bunch3 );
187 bTof.setFPleft( cnvFLeft );
188 bTof.setFPright( cnvFRight );
189 bTof.setFPcounter( cnvFCount );
190 tmpbTof.push_back(bTof);
191 }
192
193 //read etoftree
194 double cnvEndAtten[nEndAtten];
195 double cnvEndSpeed[nEndSpeed];
196 double cnvEndPar[nEndPar];
197 double cnvEndFPar[nEndSigma];
198
199 TTree *etoftree = (TTree*)m_inFile -> Get("EndTofPar");
200
201 char ecname[10];
202 for( unsigned int i=0; i<nEndAtten; i++ ) {
203 sprintf( ecname, "Atten%i", i );
204 etoftree -> SetBranchAddress( ecname, &cnvEndAtten[i] );
205 }
206 for( unsigned int i=0; i<nEndSpeed; i++ ) {
207 sprintf( ecname, "Speed%i", i );
208 etoftree -> SetBranchAddress( ecname, &cnvEndSpeed[i] );
209 }
210 for( unsigned int i=0; i<nEndPar; i++ ) {
211 sprintf( ecname, "P%i", i );
212 etoftree -> SetBranchAddress( ecname, &cnvEndPar[i] );
213 }
214 for( unsigned int i=0; i<nEndSigma; i++ ) {
215 sprintf( ecname, "FCounter%i", i );
216 etoftree -> SetBranchAddress( ecname, &cnvEndFPar[i] );
217 }
218
219 for(cnt=0; cnt<etoftree->GetEntries(); cnt++){
220 etoftree -> GetEntry(cnt);
221 eTof.setAtten( cnvEndAtten );
222 eTof.setSpeed( cnvEndSpeed );
223 eTof.setP( cnvEndPar );
224 eTof.setFP( cnvEndFPar );
225 tmpeTof.push_back(eTof);
226 }
227
228 //read etftree
229 double cnvEtfSpeed[nEtfSpeed];
230 double cnvEtfPar[nEtfPar];
231 double cnvEtfPar1[nEtfPar];
232 double cnvEtfPar2[nEtfPar];
233
234 if( NULL!=m_inFile->Get("EtfTofPar") ) {
235 TTree *etftree = (TTree*)m_inFile -> Get("EtfTofPar");
236
237 char etfname[10];
238 for( unsigned int i=0; i<nEtfSpeed; i++ ) {
239 sprintf( etfname, "Speed%i", i );
240 etftree -> SetBranchAddress( etfname, &cnvEtfSpeed[i] );
241 }
242 for( unsigned int i=0; i<nEtfPar; i++ ) {
243 sprintf( etfname, "P%i", i );
244 etftree -> SetBranchAddress( etfname, &cnvEtfPar[i] );
245 }
246 for( unsigned int i=0; i<nEtfPar; i++ ) {
247 sprintf( etfname, "P%i", i+nEtfPar );
248 etftree -> SetBranchAddress( etfname, &cnvEtfPar1[i] );
249 }
250 for( unsigned int i=0; i<nEtfPar; i++ ) {
251 sprintf( etfname, "P%i", i+2*nEtfPar );
252 etftree -> SetBranchAddress( etfname, &cnvEtfPar2[i] );
253 }
254
255 for(cnt=0; cnt<etftree->GetEntries(); cnt++){
256 etftree -> GetEntry(cnt);
257 etf.setSpeed( cnvEtfSpeed );
258 etf.setP( cnvEtfPar );
259 etf.setP1( cnvEtfPar1 );
260 etf.setP2( cnvEtfPar2 );
261 tmpetf.push_back(etf);
262 }
263 }
264
265 //read etfbunchtree
266 double cnvEtfBunchP[nEtfBunch];
267
268 if( NULL!=m_inFile->Get("EtfTofBunch") ) {
269 TTree *etfbunchtree = (TTree*)m_inFile -> Get("EtfTofBunch");
270
271 char etfbunchname[10];
272 for( unsigned int i=0; i<nEtfBunch; i++ ) {
273 sprintf( etfbunchname, "pbunch%i", i );
274 etfbunchtree -> SetBranchAddress( etfbunchname, &cnvEtfBunchP[i] );
275 }
276
277 int entries= etfbunchtree->GetEntries();
278 for(cnt=0;cnt<entries;cnt++){
279 etfbunchtree -> GetEntry(cnt);
280 etfBunch.setPBunch( cnvEtfBunchP );
281 tmpetfBunch.push_back( etfBunch );
282 }
283 }
284
285 //read bTofCommonCalibBase
286 double cnvBarSigCor[nBarSigCor];
287 double cnvBarOffset[nBarOffset];
288 TTree *btofcommontree = (TTree*)m_inFile -> Get("BarTofParCommon");
289 for( unsigned int i=0; i<nBarSigCor; i++ ) {
290 sprintf( brname, "sigmaCorr%i", i );
291 btofcommontree-> SetBranchAddress( brname, &cnvBarSigCor[i] );
292 }
293 for( unsigned int i=0; i<nBarOffset; i++ ) {
294 sprintf( brname, "t0offset%i", i );
295 btofcommontree-> SetBranchAddress( brname, &cnvBarOffset[i]);
296 }
297
298 int entries = btofcommontree->GetEntries();
299 for(cnt=0;cnt<entries;cnt++){
300 btofcommontree->GetEntry(cnt);
301 bTofCommon.setSigmaCorr( cnvBarSigCor );
302 bTofCommon.setOffset( cnvBarOffset );
303 tmpbTofCommon.push_back(bTofCommon);
304 }
305
306 int m_run1, m_run2, m_version;
307 int m_qCorr, m_qElec, m_misLable;
308 int m_tofidEast[5], m_tofidWest[5], m_tofidEndcap[5];
309 int m_runFrom, m_runTo, m_eventFrom, m_eventTo;
310
311 TTree *CalibInfo = (TTree*)m_inFile -> Get("CalibInfo");
312 CalibInfo->SetBranchAddress("Run1", &m_run1 );
313 CalibInfo->SetBranchAddress("Run2", &m_run2 );
314 CalibInfo->SetBranchAddress("Version", &m_version );
315 CalibInfo->SetBranchAddress("ebrId0", &m_tofidEast[0] );
316 CalibInfo->SetBranchAddress("ebrId1", &m_tofidEast[1] );
317 CalibInfo->SetBranchAddress("ebrId2", &m_tofidEast[2] );
318 CalibInfo->SetBranchAddress("ebrId3", &m_tofidEast[3] );
319 CalibInfo->SetBranchAddress("ebrId4", &m_tofidEast[4] );
320 CalibInfo->SetBranchAddress("ecId0", &m_tofidEndcap[0] );
321 CalibInfo->SetBranchAddress("ecId1", &m_tofidEndcap[1] );
322 CalibInfo->SetBranchAddress("ecId2", &m_tofidEndcap[2] );
323 CalibInfo->SetBranchAddress("ecId3", &m_tofidEndcap[3] );
324 CalibInfo->SetBranchAddress("ecId4", &m_tofidEndcap[4] );
325 CalibInfo->SetBranchAddress("wbrId0", &m_tofidWest[0] );
326 CalibInfo->SetBranchAddress("wbrId1", &m_tofidWest[1] );
327 CalibInfo->SetBranchAddress("wbrId2", &m_tofidWest[2] );
328 CalibInfo->SetBranchAddress("wbrId3", &m_tofidWest[3] );
329 CalibInfo->SetBranchAddress("wbrId4", &m_tofidWest[4] );
330 CalibInfo->SetBranchAddress("misLable",&m_misLable );
331 CalibInfo->SetBranchAddress("qCorr", &m_qCorr );
332 CalibInfo->SetBranchAddress("qElec", &m_qElec );
333 if( CalibInfo->GetBranchStatus("runFrom") ){
334 CalibInfo->SetBranchAddress("runFrom", &m_runFrom );
335 CalibInfo->SetBranchAddress("runTo", &m_runTo );
336 CalibInfo->SetBranchAddress("eventFrom", &m_eventFrom );
337 CalibInfo->SetBranchAddress("eventTo", &m_eventTo );
338 }
339 else {
340 m_runFrom = -1;
341 m_runTo = -1;
342 m_eventFrom = -1;
343 m_eventTo = -1;
344 }
345
346 entries= CalibInfo->GetEntries();
347 for(cnt=0;cnt<entries;cnt++){
348 CalibInfo->GetEntry(cnt);
349 tofinfo.setRunBegin(m_run1);
350 tofinfo.setRunEnd(m_run2);
351 tofinfo.setVersion(m_version);
352 tofinfo.setQCorr(m_qCorr);
353 tofinfo.setQElec(m_qElec);
354 tofinfo.setMisLable(m_misLable);
355 tofinfo.setBrEast(m_tofidEast);
356 tofinfo.setBrWest(m_tofidWest);
357 tofinfo.setEndcap(m_tofidEndcap);
358 tofinfo.setRunFrom(m_runFrom);
359 tofinfo.setRunTo(m_runTo);
360 tofinfo.setEventFrom(m_eventFrom);
361 tofinfo.setEventTo(m_eventTo);
362 tofinfoCol.push_back(tofinfo);
363 }
364
365 CalibData::TofCalibData *tmpObject = new CalibData::TofCalibData(&tmpbTof,&tmpbTofCommon,&tmpeTof,&tmpetf,&tmpetfBunch,&tofinfoCol);
366
367 refpObject=tmpObject;
368
369 return StatusCode::SUCCESS;
370}
const unsigned int nBarOffset
const unsigned int nBarSigCor
void setP2(const double *TofP2)
void setPoff1_bunch3(const double *TofPoff1_bunch3)
void setFPleft(const double *FP1)
void setPoff2_bunch1(const double *TofPoff2_bunch1)
void setSpeed(const double *Speed)
void setAtten(const double *Atten)
void setPoff1_bunch0(const double *TofPoff1_bunch0)
void setPoff2_bunch2(const double *TofPoff2_bunch2)
void setPoff1_bunch1(const double *TofPoff1_bunch1)
void setFPcounter(const double *FP3)
void setPoff1_bunch2(const double *TofPoff1_bunch2)
void setPoff2_bunch3(const double *TofPoff2_bunch3)
void setFPright(const double *FP2)
void setPoff2_bunch0(const double *TofPoff2_bunch0)
void setP1(const double *TofP1)
void setSigmaCorr(const double *sigmaCorr)
void setOffset(const double *offset)
void setAtten(const double *Atten)
void setP(const double *TofP)
void setFP(const double *FP)
void setSpeed(const double *Speed)
void setPBunch(const double *etfBunchP)
void setSpeed(const double *Speed)
Definition: etfCalibBase.cxx:6
void setP(const double *etfP)
void setP1(const double *etfP1)
void setP2(const double *etfP2)
void setRunFrom(const int runFrom)
void setBrWest(const int *tofidWest)
void setRunEnd(const int run2)
void setVersion(const int version)
void setMisLable(const int misLable)
void setRunBegin(const int run1)
void setEventTo(const int eventTo)
void setRunTo(const int runTo)
void setBrEast(const int *tofidEast)
void setQElec(const int qElec)
void setEventFrom(const int eventFrom)
void setQCorr(const int qCorr)
void setEndcap(const int *tofidEndcap)
StatusCode openRead(const std::string &fname)
curve GetEntry(0)
curve SetBranchAddress("CurveSize",&CurveSize)

◆ objType()

const CLID & RootTofCalibDataCnv::objType ( ) const

Definition at line 56 of file RootTofCalibDataCnv.cxx.

56 {
57 return CLID_Calib_TofCal;
58}

◆ repSvcType()

virtual long RootTofCalibDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file RootTofCalibDataCnv.h.

34 {
36 }
unsigned const char CALIBROOT_StorageType
Definition: ICalibRootSvc.h:20

Friends And Related Function Documentation

◆ CnvFactory< RootTofCalibDataCnv >

friend class CnvFactory< RootTofCalibDataCnv >
friend

Definition at line 1 of file RootTofCalibDataCnv.h.


The documentation for this class was generated from the following files: