BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RootInjSigIntervalCnv.cxx
Go to the documentation of this file.
2#include "CalibData/Ets/InjSigIntervalCal.h"
3#include "CalibDataSvc/IInstrumentName.h"
4#include "GaudiKernel/MsgStream.h"
5
6#include "TDirectory.h"
7#include "TFile.h"
8#include "TObject.h"
9#include "TTree.h"
10
11#include "GaudiKernel/DataObject.h"
12#include "GaudiKernel/GenericAddress.h"
13#include "GaudiKernel/IAddressCreator.h"
14#include "GaudiKernel/IConversionSvc.h"
15#include "GaudiKernel/IDataProviderSvc.h"
16#include "GaudiKernel/IOpaqueAddress.h"
17
18#include "CalibDataSvc/ICalibMetaCnvSvc.h"
19#include "CalibDataSvc/ICalibRootSvc.h" //maybe
20
21// Temporary. Hope to find a better way to do this
22#include "CalibData/CalibModel.h"
23using namespace CalibData;
24
27
29
31
32StatusCode RootInjSigIntervalCnv::i_createObj( const std::string& fname,
33 DataObject*& refpObject ) {
34
35 MsgStream log( msgSvc(), "RootInjSigIntervalCnv" );
36 log << MSG::DEBUG << "SetProperty" << endmsg;
37
38 StatusCode sc = openRead( fname );
39 if ( !sc ) { log << MSG::ERROR << "unable to open files" << endmsg; }
40
42 // Read in our object
43
44 // read InjSigInterval ------------------------------------------------------------
45
46 int tInterval;
47 if ( m_inFile->Read( "interval" ) )
48 {
49 TTree* tree = (TTree*)m_inFile->Get( "interval" );
50 tree->SetBranchAddress( "tInterval", &tInterval );
51 tree->GetEntry( 0 );
52 tmpObject->setTInterval( tInterval );
53 }
54
55 refpObject = tmpObject;
56
57 return StatusCode::SUCCESS;
58}
59
60StatusCode RootInjSigIntervalCnv::createRoot( const std::string& fname,
61 CalibData::CalibBase1* pTDSObj ) {
62
63 MsgStream log( msgSvc(), "RootInjSigIntervalCnv" );
64
65 // Open the file, create the branch
66 StatusCode sc = openWrite( fname );
67 if ( !sc ) { log << MSG::ERROR << "unable to open files" << endmsg; }
68 log << MSG::INFO << "successfully create RootFile" << endmsg;
69 return sc;
70}
IMessageSvc * msgSvc()
StatusCode openRead(const std::string &fname)
RootCalBaseCnv(ISvcLocator *svc, const CLID &clid)
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()