BOSS 6.6.4.p01
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 49 of file RootTofCalibDataCnv.cxx.

49 :
51 }
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 58 of file RootTofCalibDataCnv.cxx.

58 {
59 return CLID_Calib_TofCal;
60}

◆ 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 292 of file RootTofCalibDataCnv.cxx.

293 {
294 MsgStream log(msgSvc(), "RootTofCalibDataCnv");
295
296 // Open the file, create the branch
297 StatusCode sc = openWrite(fname);
298 if(!sc)
299 { log<<MSG::ERROR<<"unable to open files"<<endreq;
300 }
301 // write the Data in the TCDS to RootFile
302 int j;
303 CalibData::TofCalibData* btof = dynamic_cast<CalibData::TofCalibData*>(pTDSObj);
304
305 // write btoftree----------------------------------------------------------------
306 double cnvBarAtten[nBarAtten];
307 double cnvBarSpeed[nBarSpeed];
308 double cnvBarPar1[nBarPar];
309 double cnvBarPar2[nBarPar];
310 double cnvBarParOff1_bunch0[nBarParOff];
311 double cnvBarParOff2_bunch0[nBarParOff];
312 double cnvBarParOff1_bunch1[nBarParOff];
313 double cnvBarParOff2_bunch1[nBarParOff];
314 double cnvBarParOff1_bunch2[nBarParOff];
315 double cnvBarParOff2_bunch2[nBarParOff];
316 double cnvBarParOff1_bunch3[nBarParOff];
317 double cnvBarParOff2_bunch3[nBarParOff];
318 double cnvFLeft[nBarSigma];
319 double cnvFRight[nBarSigma];
320 double cnvFCount[nBarSigCnt];
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 }
344 for( unsigned int i=0; i<nBarParOff; i++ ) {
345 sprintf( brname, "Bunch0_Poff%i", i );
346 sprintf( ibrname, "Bunch0_Poff%i/D", i );
347 btoftree -> Branch( brname, &cnvBarParOff1_bunch0[i], ibrname );
348 }
349 for( unsigned int i=0; i<nBarParOff; i++ ) {
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 }
354 for( unsigned int i=0; i<nBarParOff; i++ ) {
355 sprintf( brname, "Bunch1_Poff%i", i );
356 sprintf( ibrname, "Bunch1_Poff%i/D", i );
357 btoftree -> Branch( brname, &cnvBarParOff1_bunch1[i], ibrname );
358 }
359 for( unsigned int i=0; i<nBarParOff; i++ ) {
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 }
364 for( unsigned int i=0; i<nBarParOff; i++ ) {
365 sprintf( brname, "Bunch2_Poff%i", i );
366 sprintf( ibrname, "Bunch2_Poff%i/D", i );
367 btoftree -> Branch( brname, &cnvBarParOff1_bunch2[i], ibrname );
368 }
369 for( unsigned int i=0; i<nBarParOff; i++ ) {
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 }
374 for( unsigned int i=0; i<nBarParOff; i++ ) {
375 sprintf( brname, "Bunch3_Poff%i", i );
376 sprintf( ibrname, "Bunch3_Poff%i/D", i );
377 btoftree -> Branch( brname, &cnvBarParOff1_bunch3[i], ibrname );
378 }
379 for( unsigned int i=0; i<nBarParOff; i++ ) {
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 }
394 for( unsigned int i=0; i<nBarSigCnt; i++ ) {
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++) {
402 cnvBarAtten[j] = btof->getBTofAtten(i,j);
403 }
404 for(j=0;j<static_cast<int>(nBarSpeed);j++) {
405 cnvBarSpeed[j] = btof->getBTofSpeed(i,j);
406 }
407 for(j=0;j<static_cast<int>(nBarPar);j++){
408 cnvBarPar1[j] = btof->getBTofPleft(i,j);
409 cnvBarPar2[j] = btof->getBTofPright(i,j);
410 }
411 for(j=0;j<static_cast<int>(nBarParOff);j++){
412 cnvBarParOff1_bunch0[j] = btof->getBTofPoffleft_bunch0(i,j);
413 cnvBarParOff2_bunch0[j] = btof->getBTofPoffright_bunch0(i,j);
414 }
415 for(j=0;j<static_cast<int>(nBarParOff);j++){
416 cnvBarParOff1_bunch1[j] = btof->getBTofPoffleft_bunch1(i,j);
417 cnvBarParOff2_bunch1[j] = btof->getBTofPoffright_bunch1(i,j);
418 }
419 for(j=0;j<static_cast<int>(nBarParOff);j++){
420 cnvBarParOff1_bunch2[j] = btof->getBTofPoffleft_bunch2(i,j);
421 cnvBarParOff2_bunch2[j] = btof->getBTofPoffright_bunch2(i,j);
422 }
423 for(j=0;j<static_cast<int>(nBarParOff);j++){
424 cnvBarParOff1_bunch3[j] = btof->getBTofPoffleft_bunch3(i,j);
425 cnvBarParOff2_bunch3[j] = btof->getBTofPoffright_bunch3(i,j);
426 }
427 for(j=0;j<static_cast<int>(nBarSigma);j++){
428 cnvFLeft[j] = btof->getBTofFleft(i,j);
429 cnvFRight[j] = btof->getBTofFright(i,j);
430 }
431 for(j=0;j<static_cast<int>(nBarSigCnt);j++){
432 cnvFCount[j] = btof->getBTofFcounter(i,j);
433 }
434 btoftree -> Fill();
435 }
436
437 //write etoftree----------------------------------------------------------------
438 double cnvEndAtten[nEndAtten];
439 double cnvEndSpeed[nEndSpeed];
440 double cnvEndPar[nEndPar];
441 double cnvEndFPar[nEndSigma];
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++) {
468 cnvEndAtten[j] = btof->getETofAtten(i,j);
469 }
470 for(j=0;j<static_cast<int>(nEndSpeed);j++) {
471 cnvEndSpeed[j] = btof->getETofSpeed(i,j);
472 }
473 for(j=0;j<static_cast<int>(nEndPar);j++){
474 cnvEndPar[j] = btof->getETofP(i,j);
475 }
476 for(j=0;j<static_cast<int>(nEndSigma);j++){
477 cnvEndFPar[j] = btof->getETofFP(i,j);
478 }
479 etoftree -> Fill();
480 }
481
482 // write all the trees
483 btoftree -> Write();
484 etoftree -> Write();
485 delete btoftree;
486 delete etoftree;
487 closeWrite();
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
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 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)
StatusCode closeWrite()
virtual StatusCode openWrite(const std::string &fname)

◆ 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 62 of file RootTofCalibDataCnv.cxx.

63 {
64
65 MsgStream log(msgSvc(), "RootTofCalibDataCnv");
66 log<<MSG::DEBUG<<"SetProperty"<<endreq;
67
68 // open the file
69 StatusCode sc = openRead(fname);
70 if(!sc)
71 { log<<MSG::ERROR<<"unable to open files"<<endreq;
72 }
73
78
79 std::vector<CalibData::bTofCalibBase> tmpbTof;//; = new vector<CalibData::bTofCalibBase>;
80 std::vector<CalibData::eTofCalibBase> tmpeTof;
81 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
82 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
83 // Read in the object
84 int cnt;
85 // read btoftree ------------------------------------------------------------
86
87 double cnvBarAtten[nBarAtten];
88 double cnvBarSpeed[nBarSpeed];
89 double cnvBarPar1[nBarPar];
90 double cnvBarPar2[nBarPar];
91 double cnvBarParOff1_bunch0[nBarParOff];
92 double cnvBarParOff2_bunch0[nBarParOff];
93 double cnvBarParOff1_bunch1[nBarParOff];
94 double cnvBarParOff2_bunch1[nBarParOff];
95 double cnvBarParOff1_bunch2[nBarParOff];
96 double cnvBarParOff2_bunch2[nBarParOff];
97 double cnvBarParOff1_bunch3[nBarParOff];
98 double cnvBarParOff2_bunch3[nBarParOff];
99 double cnvFLeft[nBarSigma];
100 double cnvFRight[nBarSigma];
101 double cnvFCount[nBarSigCnt];
102
103 TTree *btoftree = (TTree*)m_inFile -> Get("BarTofPar");
104
105 char brname[10];
106 for( unsigned int i=0; i<nBarAtten; i++ ) {
107 sprintf( brname, "Atten%i", i );
108 btoftree -> SetBranchAddress( brname, &cnvBarAtten[i] );
109 }
110 for( unsigned int i=0; i<nBarSpeed; i++ ) {
111 sprintf( brname, "Speed%i", i );
112 btoftree -> SetBranchAddress( brname, &cnvBarSpeed[i] );
113 }
114 for( unsigned int i=0; i<nBarPar; i++ ) {
115 sprintf( brname, "P%i", i );
116 btoftree -> SetBranchAddress( brname, &cnvBarPar1[i] );
117 }
118 for( unsigned int i=0; i<nBarPar; i++ ) {
119 sprintf( brname, "P%i", i+nBarPar );
120 btoftree -> SetBranchAddress( brname, &cnvBarPar2[i] );
121 }
122 for( unsigned int i=0; i<nBarParOff; i++ ) {
123 sprintf( brname, "Bunch0_Poff%i", i );
124 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch0[i] );
125 }
126 for( unsigned int i=0; i<nBarParOff; i++ ) {
127 sprintf( brname, "Bunch0_Poff%i", i+nBarParOff );
128 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch0[i] );
129 }
130 for( unsigned int i=0; i<nBarParOff; i++ ) {
131 sprintf( brname, "Bunch1_Poff%i", i );
132 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch1[i] );
133 }
134 for( unsigned int i=0; i<nBarParOff; i++ ) {
135 sprintf( brname, "Bunch1_Poff%i", i+nBarParOff );
136 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch1[i] );
137 }
138 for( unsigned int i=0; i<nBarParOff; i++ ) {
139 sprintf( brname, "Bunch2_Poff%i", i );
140 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch2[i] );
141 }
142 for( unsigned int i=0; i<nBarParOff; i++ ) {
143 sprintf( brname, "Bunch2_Poff%i", i+nBarParOff );
144 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch2[i] );
145 }
146 for( unsigned int i=0; i<nBarParOff; i++ ) {
147 sprintf( brname, "Bunch3_Poff%i", i );
148 btoftree -> SetBranchAddress( brname, &cnvBarParOff1_bunch3[i] );
149 }
150 for( unsigned int i=0; i<nBarParOff; i++ ) {
151 sprintf( brname, "Bunch3_Poff%i", i+nBarParOff );
152 btoftree -> SetBranchAddress( brname, &cnvBarParOff2_bunch3[i] );
153 }
154 for( unsigned int i=0; i<nBarSigma; i++ ) {
155 sprintf( brname, "FLeft%i", i );
156 btoftree -> SetBranchAddress( brname, &cnvFLeft[i] );
157 }
158 for( unsigned int i=0; i<nBarSigma; i++ ) {
159 sprintf( brname, "FRight%i", i );
160 btoftree -> SetBranchAddress( brname, &cnvFRight[i] );
161 }
162 for( unsigned int i=0; i<nBarSigCnt; i++ ) {
163 sprintf( brname, "FCounter%i", i );
164 btoftree -> SetBranchAddress( brname, &cnvFCount[i] );
165 }
166
167 for(cnt=0; cnt<176; cnt++){
168 btoftree -> GetEntry(cnt);
169 bTof.setAtten( cnvBarAtten );
170 bTof.setSpeed( cnvBarSpeed );
171 bTof.setP1( cnvBarPar1 );
172 bTof.setP2( cnvBarPar2 );
173 bTof.setPoff1_bunch0( cnvBarParOff1_bunch0 );
174 bTof.setPoff2_bunch0( cnvBarParOff2_bunch0 );
175 bTof.setPoff1_bunch1( cnvBarParOff1_bunch1 );
176 bTof.setPoff2_bunch1( cnvBarParOff2_bunch1 );
177 bTof.setPoff1_bunch2( cnvBarParOff1_bunch2 );
178 bTof.setPoff2_bunch2( cnvBarParOff2_bunch2 );
179 bTof.setPoff1_bunch3( cnvBarParOff1_bunch3 );
180 bTof.setPoff2_bunch3( cnvBarParOff2_bunch3 );
181 bTof.setFPleft( cnvFLeft );
182 bTof.setFPright( cnvFRight );
183 bTof.setFPcounter( cnvFCount );
184 tmpbTof.push_back(bTof);
185 }
186
187 //read etoftree
188 double cnvEndAtten[nEndAtten];
189 double cnvEndSpeed[nEndSpeed];
190 double cnvEndPar[nEndPar];
191 double cnvEndFPar[nEndSigma];
192
193 TTree *etoftree = (TTree*)m_inFile -> Get("EndTofPar");
194
195 char ecname[10];
196 for( unsigned int i=0; i<nEndAtten; i++ ) {
197 sprintf( ecname, "Atten%i", i );
198 etoftree -> SetBranchAddress( ecname, &cnvEndAtten[i] );
199 }
200 for( unsigned int i=0; i<nEndSpeed; i++ ) {
201 sprintf( ecname, "Speed%i", i );
202 etoftree -> SetBranchAddress( ecname, &cnvEndSpeed[i] );
203 }
204 for( unsigned int i=0; i<nEndPar; i++ ) {
205 sprintf( ecname, "P%i", i );
206 etoftree -> SetBranchAddress( ecname, &cnvEndPar[i] );
207 }
208 for( unsigned int i=0; i<nEndSigma; i++ ) {
209 sprintf( ecname, "FCounter%i", i );
210 etoftree -> SetBranchAddress( ecname, &cnvEndFPar[i] );
211 }
212
213 for(cnt=0; cnt<96; cnt++){
214 etoftree -> GetEntry(cnt);
215 eTof.setAtten( cnvEndAtten );
216 eTof.setSpeed( cnvEndSpeed );
217 eTof.setP( cnvEndPar );
218 eTof.setFP( cnvEndFPar );
219 tmpeTof.push_back(eTof);
220 }
221
222 //read bTofCommonCalibBase
223 double cnvBarSigCor[nBarSigCor];
224 double cnvBarOffset[nBarOffset];
225 TTree *btofcommontree = (TTree*)m_inFile -> Get("BarTofParCommon");
226 for( unsigned int i=0; i<nBarSigCor; i++ ) {
227 sprintf( brname, "sigmaCorr%i", i );
228 btofcommontree-> SetBranchAddress( brname, &cnvBarSigCor[i] );
229 }
230 for( unsigned int i=0; i<nBarOffset; i++ ) {
231 sprintf( brname, "t0offset%i", i );
232 btofcommontree-> SetBranchAddress( brname, &cnvBarOffset[i]);
233 }
234
235 int entries = btofcommontree->GetEntries();
236 for(cnt=0;cnt<entries;cnt++){
237 btofcommontree->GetEntry(cnt);
238 bTofCommon.setSigmaCorr( cnvBarSigCor );
239 bTofCommon.setOffset( cnvBarOffset );
240 tmpbTofCommon.push_back(bTofCommon);
241 }
242
243 int m_run1, m_run2, m_version;
244 int m_qCorr, m_qElec, m_misLable;
245 int m_tofidEast[5], m_tofidWest[5], m_tofidEndcap[5];
246
247 TTree *CalibInfo = (TTree*)m_inFile -> Get("CalibInfo");
248 CalibInfo->SetBranchAddress("Run1",&m_run1);
249 CalibInfo->SetBranchAddress("Run2",&m_run2);
250 CalibInfo->SetBranchAddress("Version",&m_version);
251 CalibInfo->SetBranchAddress("ebrId0",&m_tofidEast[0]);
252 CalibInfo->SetBranchAddress("ebrId1",&m_tofidEast[1]);
253 CalibInfo->SetBranchAddress("ebrId2",&m_tofidEast[2]);
254 CalibInfo->SetBranchAddress("ebrId3",&m_tofidEast[3]);
255 CalibInfo->SetBranchAddress("ebrId4",&m_tofidEast[4]);
256 CalibInfo->SetBranchAddress("ecId0",&m_tofidEndcap[0]);
257 CalibInfo->SetBranchAddress("ecId1",&m_tofidEndcap[1]);
258 CalibInfo->SetBranchAddress("ecId2",&m_tofidEndcap[2]);
259 CalibInfo->SetBranchAddress("ecId3",&m_tofidEndcap[3]);
260 CalibInfo->SetBranchAddress("ecId4",&m_tofidEndcap[4]);
261 CalibInfo->SetBranchAddress("wbrId0",&m_tofidWest[0]);
262 CalibInfo->SetBranchAddress("wbrId1",&m_tofidWest[1]);
263 CalibInfo->SetBranchAddress("wbrId2",&m_tofidWest[2]);
264 CalibInfo->SetBranchAddress("wbrId3",&m_tofidWest[3]);
265 CalibInfo->SetBranchAddress("wbrId4",&m_tofidWest[4]);
266 CalibInfo->SetBranchAddress("misLable",&m_misLable);
267 CalibInfo->SetBranchAddress("qCorr",&m_qCorr);
268 CalibInfo->SetBranchAddress("qElec",&m_qElec);
269
270 entries= CalibInfo->GetEntries();
271 for(cnt=0;cnt<entries;cnt++){
272 CalibInfo->GetEntry(cnt);
273 tofinfo.setRunBegin(m_run1);
274 tofinfo.setRunEnd(m_run2);
275 tofinfo.setVersion(m_version);
276 tofinfo.setQCorr(m_qCorr);
277 tofinfo.setQElec(m_qElec);
278 tofinfo.setMisLable(m_misLable);
279 tofinfo.setBrEast(m_tofidEast);
280 tofinfo.setBrWest(m_tofidWest);
281 tofinfo.setEndcap(m_tofidEndcap);
282 tofinfoCol.push_back(tofinfo);
283 }
284
285 CalibData::TofCalibData *tmpObject = new CalibData::TofCalibData(&tmpbTof,&tmpbTofCommon,&tmpeTof,&tofinfoCol);
286
287 refpObject=tmpObject;
288
289 return StatusCode::SUCCESS;
290}
data SetBranchAddress("time",&time)
data GetEntry(0)
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 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 setBrEast(const int *tofidEast)
void setQElec(const int qElec)
void setQCorr(const int qCorr)
void setEndcap(const int *tofidEndcap)
StatusCode openRead(const std::string &fname)

◆ objType()

const CLID & RootTofCalibDataCnv::objType ( ) const

Definition at line 54 of file RootTofCalibDataCnv.cxx.

54 {
55 return CLID_Calib_TofCal;
56}

◆ 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: