BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeInjSigTimeCnv.cxx
Go to the documentation of this file.
1#include "TreeInjSigTimeCnv.h"
2#include "CalibData/Ets/InjSigTimeCal.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 TreeInjSigTimeCnv::i_createObj( IOpaqueAddress* addr, DataObject*& refpObject ) {
34
35 MsgStream log( msgSvc(), "TreeInjSigTimeCnv" );
36 log << MSG::DEBUG << "SetProperty" << endmsg;
37 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
38 DatabaseRecord* records = add->pp();
39
40 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
41 buf1->SetBuffer( ( *records )["ist"], 51200000, kFALSE );
42
43 std::cout << " SftVer is " << ( *records )["SftVer"];
44 std::cout << " CalVerSft is " << ( *records )["CalParVer"];
45 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
46
47 TTree* tree = new TTree();
48 tree->Streamer( *buf1 );
49
51 // Read in our object
52 int i, no;
53
54 // read TestCalibConst ------------------------------------------------------------
55
56 ULong64_t IST;
57 int flag;
58 tree->SetBranchAddress( "flag", &flag );
59 tree->SetBranchAddress( "IST", &IST );
60
61 no = tree->GetEntries();
62 tmpObject->setNpar( no );
63 for ( i = 0; i < no; i++ )
64 {
65 tree->GetEntry( i );
66 tmpObject->setFlag( flag );
67 tmpObject->setIST( IST );
68 }
69
70 refpObject = tmpObject;
71
72 delete tree;
73 return StatusCode::SUCCESS;
74}
IMessageSvc * msgSvc()
void setIST(const ULong64_t Ist)
void setFlag(const int flag)
TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)
static const CLID & classID()
TreeInjSigTimeCnv(ISvcLocator *svc)
const CLID & objType() const
virtual StatusCode i_createObj(IOpaqueAddress *address, DataObject *&refpObject)