2#include "GaudiKernel/MsgStream.h"
4#include "CalibData/Tof/TofSimData.h"
5#include "CalibData/Tof/BTofSimBase.h"
6#include "CalibData/Tof/ETofSimBase.h"
7#include "CalibData/Tof/TofSimConstBase.h"
8#include "CalibDataSvc/IInstrumentName.h"
12#include "TDirectory.h"
15#include "GaudiKernel/CnvFactory.h"
16#include "GaudiKernel/IOpaqueAddress.h"
17#include "GaudiKernel/DataObject.h"
18#include "GaudiKernel/IAddressCreator.h"
19#include "GaudiKernel/IDataProviderSvc.h"
20#include "GaudiKernel/IConversionSvc.h"
21#include "GaudiKernel/GenericAddress.h"
23#include "CalibDataSvc/ICalibRootSvc.h"
24#include "CalibDataSvc/ICalibMetaCnvSvc.h"
30#include "CalibData/CalibModel.h"
51 DataObject*& refpObject) {
53 MsgStream log(
msgSvc(),
"RootTofSimDataCnv");
54 log<<MSG::DEBUG<<
"SetProperty"<<endreq;
59 { log<<MSG::ERROR<<
"unable to open files"<<endreq;
65 std::vector<CalibData::BTofSimBase> tmpbTof;
66 std::vector<CalibData::ETofSimBase> tmpeTof;
67 std::vector<CalibData::TofSimConstBase> tofbaseCol;
75 TTree *btoftree = (TTree*)
m_inFile -> Get(
"BTofSim");
79 int entries=btoftree->GetEntries();
80 for(cnt=0; cnt<entries; cnt++){
85 tmpbTof.push_back(bTof);
88 TTree *etoftree = (TTree*)
m_inFile -> Get(
"ETofSim");
92 entries=etoftree->GetEntries();
93 for(cnt=0; cnt<entries; cnt++){
94 etoftree->GetEntry(cnt);
98 tmpeTof.push_back(eTof);
102 double BarConstant,BarPMTGain,BarHighThres,BarLowThres,EndConstant,EndPMTGain,EndHighThres,EndLowThres,EndNoiseSwitch;
103 TTree *btofcommontree = (TTree*)
m_inFile -> Get(
"SimConstants");
113 entries = btofcommontree->GetEntries();
114 for(cnt=0;cnt<entries;cnt++){
115 btofcommontree->GetEntry(cnt);
125 tofbaseCol.push_back(tofbase);
131 refpObject=tmpObject;
133 return StatusCode::SUCCESS;
138 MsgStream log(
msgSvc(),
"RootTofSimDataCnv");
143 { log<<MSG::ERROR<<
"unable to open files"<<endreq;
const CLID CLID_Calib_TofSim
data SetBranchAddress("time",&time)
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)
StatusCode openRead(const std::string &fname)
virtual StatusCode openWrite(const std::string &fname)
static const CLID & classID()
RootTofSimDataCnv(ISvcLocator *svc)
const CLID & objType() const
virtual StatusCode createRoot(const std::string &fname, CalibData::CalibBase1 *pTDSObj)
virtual StatusCode i_createObj(const std::string &fname, DataObject *&refpObject)