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"
46 DataObject*& refpObject) {
48 MsgStream log(
msgSvc(),
"TreeTofSimDataCnv");
49 log<<MSG::DEBUG<<
"SetProperty"<<endreq;
55 TBufferFile *buf1 =
new TBufferFile(TBuffer::kRead);
56 TBufferFile *buf2 =
new TBufferFile(TBuffer::kRead);
57 TBufferFile *buf3 =
new TBufferFile(TBuffer::kRead);
59 buf1->SetBuffer((*records)[
"BTofSim"],512000,kFALSE);
60 buf2->SetBuffer((*records)[
"ETofSim"],512000,kFALSE);
61 buf3->SetBuffer((*records)[
"SimConstants"],512000,kFALSE);
64 std::cout<<
" SftVer is "<<(*records)[
"SftVer"];
65 std::cout<<
" CalVerSft is "<<(*records)[
"TofSimParVer"];
66 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 btoftree->Streamer(*buf1);
74 etoftree->Streamer(*buf2);
75 btofcommontree->Streamer(*buf3);
80 std::vector<CalibData::BTofSimBase> tmpbTof;
81 std::vector<CalibData::ETofSimBase> tmpeTof;
82 std::vector<CalibData::TofSimConstBase> tofbaseCol;
93 int entries=btoftree->GetEntries();
94 for(cnt=0; cnt<entries; cnt++){
99 tmpbTof.push_back(bTof);
105 entries=etoftree->GetEntries();
106 for(cnt=0; cnt<entries; cnt++){
107 etoftree->GetEntry(cnt);
111 tmpeTof.push_back(eTof);
114 double BarConstant,BarPMTGain,BarHighThres,BarLowThres,EndConstant,EndPMTGain,EndHighThres,EndLowThres,EndNoiseSwitch;
124 entries = btofcommontree->GetEntries();
125 for(cnt=0;cnt<entries;cnt++){
126 btofcommontree->GetEntry(cnt);
136 tofbaseCol.push_back(tofbase);
140 refpObject=tmpObject;
143 delete btofcommontree;
145 return StatusCode::SUCCESS;
const CLID CLID_Calib_TofSim
void setRatio(double ratio)
void setGain(double gain)
void setAttenLength(double length)
void setGain(double gain)
void setAttenLength(double length)
void setNoiseSmear(double noisesmear)
void setBarConstant(const double bc)
void setBarHighThres(const double bhth)
void setEndNoiseSwitch(const double eswitch)
void setEndHighThres(const double ehth)
void setEndConstant(const double ec)
void setBarPMTGain(const double bg)
void setEndPMTGain(const double eg)
void setEndLowThres(const double elth)
void setBarLowThres(const double blth)
virtual DatabaseRecord * pp()
virtual StatusCode i_createObj(IOpaqueAddress *address, DataObject *&refpObject)
const CLID & objType() const
TreeTofSimDataCnv(ISvcLocator *svc)
static const CLID & classID()
curve SetBranchAddress("CurveSize",&CurveSize)