BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
CalibTreeCnv-00-02-02-bak/src/cnv/TreeInjSigIntervalCnv.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
6#include "TFile.h"
7#include "TTree.h"
8#include "TDirectory.h"
9#include "TObject.h"
10#include "TBuffer.h"
11
12#include "GaudiKernel/CnvFactory.h"
13#include "GaudiKernel/IOpaqueAddress.h"
14#include "GaudiKernel/DataObject.h"
15#include "GaudiKernel/IAddressCreator.h"
16#include "GaudiKernel/IDataProviderSvc.h"
17#include "GaudiKernel/IConversionSvc.h"
18#include "GaudiKernel/GenericAddress.h"
19
20#include "CalibDataSvc/ICalibTreeSvc.h" //maybe
22
23// Temporary. Hope to find a better way to do this
25using namespace CalibData;
26
29
30 }
31
32
33const CLID& TreeInjSigIntervalCnv::objType() const {
35}
36
39}
40
41StatusCode TreeInjSigIntervalCnv::i_createObj(IOpaqueAddress* addr,
42 DataObject*& refpObject) {
43
44 MsgStream log(msgSvc(), "TreeInjSigIntervalCnv");
45 log<<MSG::DEBUG<<"SetProperty"<<endreq;
46 TreeAddress* add = dynamic_cast<TreeAddress*>(addr);
47 DatabaseRecord *records=add->pp();
48
49 TBufferFile *buf1 = new TBufferFile(TBuffer::kRead);
50 buf1->SetBuffer((*records)["SigInterval"],512000,kFALSE);
51
52 std::cout<<" SftVer is "<<(*records)["SftVer"];
53 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
54 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
55
56 TTree* Testtree= new TTree();
57 Testtree->Streamer(*buf1);
58
60 // Read in our object
61 int i;
62
63 // read TestCalibConst ------------------------------------------------------------
64 int tInterval;
65 Testtree -> SetBranchAddress("tInterval", &tInterval);
66 Testtree->GetEntry(0);
67 tmpObject ->setTInterval(tInterval);
68
69 refpObject=tmpObject;
70
71 delete Testtree;
72 return StatusCode::SUCCESS;
73
74
75}
76
const CLID CLID_Calib_InjSigInterval
Definition: CalibModel.h:65
data SetBranchAddress("time",&time)
IMessageSvc * msgSvc()
void setTInterval(int tInterval)
virtual DatabaseRecord * pp()
Definition: TreeAddress.h:130
virtual StatusCode i_createObj(IOpaqueAddress *address, DataObject *&refpObject)