BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
RootInjSigIntervalCnv.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
5
6#include "TFile.h"
7#include "TTree.h"
8#include "TDirectory.h"
9#include "TObject.h"
10
11#include "GaudiKernel/CnvFactory.h"
12#include "GaudiKernel/IOpaqueAddress.h"
13#include "GaudiKernel/DataObject.h"
14#include "GaudiKernel/IAddressCreator.h"
15#include "GaudiKernel/IDataProviderSvc.h"
16#include "GaudiKernel/IConversionSvc.h"
17#include "GaudiKernel/GenericAddress.h"
18
19#include "CalibDataSvc/ICalibRootSvc.h" //maybe
21
22// Temporary. Hope to find a better way to do this
24using namespace CalibData;
25
30
31
32const CLID& RootInjSigIntervalCnv::objType() const {
34}
35
39
40StatusCode RootInjSigIntervalCnv::i_createObj(const std::string& fname,
41 DataObject*& refpObject) {
42
43 MsgStream log(msgSvc(), "RootInjSigIntervalCnv");
44 log<<MSG::DEBUG<<"SetProperty"<<endreq;
45
46 StatusCode sc = openRead(fname);
47 if(!sc)
48 { log<<MSG::ERROR<<"unable to open files"<<endreq;
49 }
50
52 // Read in our object
53
54 // read InjSigInterval ------------------------------------------------------------
55
56 int tInterval;
57 if( m_inFile->Read("interval") ) {
58 TTree *tree = (TTree*)m_inFile -> Get("interval");
59 tree->SetBranchAddress("tInterval", &tInterval);
60 tree->GetEntry(0);
61 tmpObject ->setTInterval(tInterval);
62 }
63
64 refpObject=tmpObject;
65
66 return StatusCode::SUCCESS;
67}
68
69StatusCode RootInjSigIntervalCnv::createRoot(const std::string& fname,
70 CalibData::CalibBase1* pTDSObj) {
71
72 MsgStream log(msgSvc(), "RootInjSigIntervalCnv");
73
74 // Open the file, create the branch
75 StatusCode sc = openWrite(fname);
76 if(!sc)
77 { log<<MSG::ERROR<<"unable to open files"<<endreq;
78 }
79 log<<MSG::INFO<<"successfully create RootFile"<<endreq;
80 return sc;
81
82}
const CLID CLID_Calib_InjSigInterval
Definition CalibModel.h:65
IMessageSvc * msgSvc()
void setTInterval(int tInterval)
StatusCode openRead(const std::string &fname)
virtual StatusCode openWrite(const std::string &fname)
const CLID & objType() const
virtual StatusCode i_createObj(const std::string &fname, DataObject *&refpObject)
virtual StatusCode createRoot(const std::string &fname, CalibData::CalibBase1 *pTDSObj)
RootInjSigIntervalCnv(ISvcLocator *svc)
static const CLID & classID()