1#include "GaudiKernel/MsgStream.h"
12#include "GaudiKernel/CnvFactory.h"
13#include "GaudiKernel/IOpaqueAddress.h"
14#include "GaudiKernel/DataObject.h"
15#include "GaudiKernel/IAddressCreator.h"
16#include "GaudiKernel/IDataProviderSvc.h"
17#include "GaudiKernel/IConversionSvc.h"
18#include "GaudiKernel/GenericAddress.h"
49 DataObject*& refpObject) {
51 MsgStream log(
msgSvc(),
"TreeEstTofCalibDataCnv");
52 log<<MSG::DEBUG<<
"SetProperty"<<endreq;
57 TBufferFile *buf1 =
new TBufferFile(TBuffer::kRead);
58 TBufferFile *buf2 =
new TBufferFile(TBuffer::kRead);
59 TBufferFile *buf3 =
new TBufferFile(TBuffer::kRead);
60 TBufferFile *buf4 =
new TBufferFile(TBuffer::kRead);
62 buf1->SetBuffer((*records)[
"BarTofPar"],512000,kFALSE);
63 buf2->SetBuffer((*records)[
"EndTofPar"],512000,kFALSE);
64 buf3->SetBuffer((*records)[
"TofConPar"],512000,kFALSE);
65 buf4->SetBuffer((*records)[
"BarTof"],512000,kFALSE);
67 std::cout<<
" CalVerSft is "<<(*records)[
"CalParVer"];
68 std::cout<<
" File name is "<<(*records)[
"FileName"]<<std::endl;
70 TTree *btoftree=
new TTree();
71 TTree *etoftree=
new TTree();
72 TTree *btofcommontree =
new TTree();
73 TTree *CalibInfo =
new TTree();
75 btoftree->Streamer(*buf1);
76 etoftree->Streamer(*buf2);
77 btofcommontree->Streamer(*buf3);
78 CalibInfo->Streamer(*buf4);
85 std::vector<CalibData::bTofCalibBase> tmpbTof;
86 std::vector<CalibData::eTofCalibBase> tmpeTof;
87 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
88 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
105 for(
unsigned int i=0; i<
nBarPar; i++ ) {
106 sprintf( brname,
"P%i", i );
109 for(
unsigned int i=0; i<
nBarPar; i++ ) {
110 sprintf( brname,
"P%i", i+
nBarPar );
114 sprintf( brname,
"Bunch0_Poff%i", i );
118 sprintf( brname,
"Bunch0_Poff%i", i+
nBarParOff );
122 sprintf( brname,
"Bunch1_Poff%i", i );
126 sprintf( brname,
"Bunch1_Poff%i", i+
nBarParOff );
130 sprintf( brname,
"Bunch2_Poff%i", i );
134 sprintf( brname,
"Bunch2_Poff%i", i+
nBarParOff );
138 sprintf( brname,
"Bunch3_Poff%i", i );
142 sprintf( brname,
"Bunch3_Poff%i", i+
nBarParOff );
146 for(cnt=0; cnt<176; cnt++){
148 bTof.
setP1( cnvBarPar1 );
149 bTof.
setP2( cnvBarPar2 );
158 tmpbTof.push_back(bTof);
165 for(
unsigned int i=0; i<
nEndPar; i++ ) {
166 sprintf( ecname,
"P%i", i );
170 for( cnt=0; cnt<96; cnt++ ) {
172 eTof.
setP( cnvEndPar );
173 tmpeTof.push_back( eTof );
179 sprintf( brname,
"t0offset%i", i );
183 int entries = btofcommontree->GetEntries();
184 for(cnt=0;cnt<entries;cnt++){
185 btofcommontree->GetEntry(cnt);
187 tmpbTofCommon.push_back(bTofCommon);
192 refpObject=tmpObject;
195 delete btofcommontree;
198 return StatusCode::SUCCESS;
const CLID CLID_Calib_EstTofCal
data SetBranchAddress("time",&time)
const unsigned int nBarOffset
const unsigned int nBarParOff
const unsigned int nEndPar
const unsigned int nBarPar
const unsigned int nBarOffset
const unsigned int nBarParOff
const unsigned int nEndPar
const unsigned int nBarPar
void setP2(const double *TofP2)
void setPoff1_bunch3(const double *TofPoff1_bunch3)
void setPoff2_bunch1(const double *TofPoff2_bunch1)
void setPoff1_bunch0(const double *TofPoff1_bunch0)
void setPoff2_bunch2(const double *TofPoff2_bunch2)
void setPoff1_bunch1(const double *TofPoff1_bunch1)
void setPoff1_bunch2(const double *TofPoff1_bunch2)
void setPoff2_bunch3(const double *TofPoff2_bunch3)
void setPoff2_bunch0(const double *TofPoff2_bunch0)
void setP1(const double *TofP1)
void setOffset(const double *offset)
void setP(const double *TofP)
virtual DatabaseRecord * pp()
TreeEstTofCalibDataCnv(ISvcLocator *svc)
const CLID & objType() const
static const CLID & classID()
virtual StatusCode i_createObj(IOpaqueAddress *address, DataObject *&refpObject)