BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeInjSigIntervalCnv.cxx
Go to the documentation of this file.
2#include "CalibData/Ets/InjSigIntervalCal.h"
3#include "CalibDataSvc/IInstrumentName.h"
4#include "CalibMySQLCnvSvc/TreeAddress.h"
5#include "GaudiKernel/MsgStream.h"
6#include "TBuffer.h"
7#include "TDirectory.h"
8#include "TFile.h"
9#include "TObject.h"
10#include "TTree.h"
11
12#include "GaudiKernel/DataObject.h"
13#include "GaudiKernel/GenericAddress.h"
14#include "GaudiKernel/IAddressCreator.h"
15#include "GaudiKernel/IConversionSvc.h"
16#include "GaudiKernel/IDataProviderSvc.h"
17#include "GaudiKernel/IOpaqueAddress.h"
18
19#include "CalibDataSvc/ICalibMetaCnvSvc.h"
20#include "CalibDataSvc/ICalibTreeSvc.h" //maybe
21
22// Temporary. Hope to find a better way to do this
23#include "CalibData/CalibModel.h"
24using namespace CalibData;
25
28
30
32
33StatusCode TreeInjSigIntervalCnv::i_createObj( IOpaqueAddress* addr,
34 DataObject*& refpObject ) {
35
36 MsgStream log( msgSvc(), "TreeInjSigIntervalCnv" );
37 log << MSG::DEBUG << "SetProperty" << endmsg;
38 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
39 DatabaseRecord* records = add->pp();
40
41 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
42 buf1->SetBuffer( ( *records )["SigInterval"], 512000, kFALSE );
43
44 std::cout << " SftVer is " << ( *records )["SftVer"];
45 std::cout << " CalVerSft is " << ( *records )["CalParVer"];
46 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
47
48 TTree* Testtree = new TTree();
49 Testtree->Streamer( *buf1 );
50
52 // Read in our object
53 int i;
54
55 // read TestCalibConst ------------------------------------------------------------
56 int tInterval;
57 Testtree->SetBranchAddress( "tInterval", &tInterval );
58 Testtree->GetEntry( 0 );
59 tmpObject->setTInterval( tInterval );
60
61 refpObject = tmpObject;
62
63 delete Testtree;
64 return StatusCode::SUCCESS;
65}
IMessageSvc * msgSvc()
TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)
static const CLID & classID()
virtual StatusCode i_createObj(IOpaqueAddress *address, DataObject *&refpObject)
const CLID & objType() const
TreeInjSigIntervalCnv(ISvcLocator *svc)