1#include "GaudiKernel/MsgStream.h"
13#include "GaudiKernel/CnvFactory.h"
14#include "GaudiKernel/IOpaqueAddress.h"
15#include "GaudiKernel/DataObject.h"
16#include "GaudiKernel/IAddressCreator.h"
17#include "GaudiKernel/IDataProviderSvc.h"
18#include "GaudiKernel/IConversionSvc.h"
19#include "GaudiKernel/GenericAddress.h"
48 DataObject*& refpObject) {
50 MsgStream log(
msgSvc(),
"TreeMucCalibDataCnv");
51 log<<MSG::DEBUG<<
"SetProperty"<<endreq;
56 TBufferFile *buf1 =
new TBufferFile(TBuffer::kRead);
57 TBufferFile *buf2 =
new TBufferFile(TBuffer::kRead);
58 TBufferFile *buf3 =
new TBufferFile(TBuffer::kRead);
59 buf1->SetBuffer((*records)[
"LayTree"],512000,kFALSE);
60 buf2->SetBuffer((*records)[
"BoxTree"],512000,kFALSE);
61 buf3->SetBuffer((*records)[
"StrTree"],512000,kFALSE);
62 std::cout<<
" SftVer is "<<(*records)[
"SftVer"];
63 std::cout<<
" CalVerSft is "<<(*records)[
"CalParVer"];
64 std::cout<<
" File name is "<<(*records)[
"FileName"]<<std::endl;
67 TTree* laytree =
new TTree();
68 laytree->Streamer(*buf1);
69 log<<MSG::DEBUG<<
"laytree name:\t" << laytree->GetName() << endreq;
70 TTree* boxtree =
new TTree();
71 boxtree->Streamer(*buf2);
72 log<<MSG::DEBUG<<
"boxtree name:\t" << boxtree->GetName() << endreq;
73 TTree* strtree=
new TTree();
74 strtree->Streamer(*buf3);
75 log<<MSG::DEBUG<<
"strtree name:\t" << strtree->GetName() << endreq;
79 Double_t lay_eff,box_eff,str_eff;
80 Double_t lay_cnt, box_cnt, str_cnt;
81 Double_t lay_nos, box_nos, str_nos;
82 Double_t lay_nos_ratio, box_nos_ratio, str_nos_ratio;
83 lay_eff = box_eff = str_eff = 0.0;
84 lay_cnt = box_cnt = str_cnt = 0.0;
85 lay_nos = box_nos = str_nos = 0.0;
86 lay_nos_ratio = box_nos_ratio = str_nos_ratio = 0.0;
89 laytree->SetBranchAddress(
"layer_eff", &lay_eff);
90 laytree->SetBranchAddress(
"layer_cnt", &lay_cnt);
91 laytree->SetBranchAddress(
"layer_noise", &lay_nos);
92 laytree->SetBranchAddress(
"layer_nosratio",&lay_nos_ratio);
94 boxtree->SetBranchAddress(
"box_eff", &box_eff);
95 boxtree->SetBranchAddress(
"box_cnt", &box_cnt);
96 boxtree->SetBranchAddress(
"box_noise", &box_nos);
97 boxtree->SetBranchAddress(
"box_nosratio", &box_nos_ratio);
99 strtree->SetBranchAddress(
"strip_eff", &str_eff);
100 strtree->SetBranchAddress(
"strip_cnt", &str_cnt);
101 strtree->SetBranchAddress(
"strip_noise", &str_nos);
102 strtree->SetBranchAddress(
"strip_nosratio", &str_nos_ratio);
104 int part, segment, layer, strip;
105 part = segment = layer = strip = 0;
106 for(
int i=0; i<LAYER_MAX; i++)
108 laytree->GetEntry(i);
113 sprintf(name,
"LayClstPro");
114 for(
int j=0; j<CLST_MAX; j++) {
119 log<<MSG::DEBUG<<
"layer: " << i <<
"\t" << lay_eff <<endreq;
122 for(
int i=0; i<BOX_MAX; i++)
124 m_ptrIdTr->
SetBoxPos( i, &part, &segment, &layer );
125 boxtree->GetEntry(i);
126 tmpObject->
setBoxEff(box_eff, part, segment, layer);
127 tmpObject->
setBoxCnt(box_cnt, part, segment, layer);
128 tmpObject->
setBoxNos(box_nos, part, segment, layer);
131 sprintf(name,
"BoxClstPro_B%d",i);
132 for(
int j=0; j<CLST_MAX; j++) {
135 tmpObject->
setBoxClstPro(DEFAULT_CLST_PRO[j],part,segment,layer,j);
137 log<<MSG::DEBUG<<
"box: " << i <<
"\t" << box_eff <<endreq;
140 log<<MSG::DEBUG<<
"strtree entries:\t" << strtree->GetEntries() << endreq;
143 m_ptrIdTr->
SetStripPos( i, &part, &segment, &layer, &strip );
144 strtree->GetEntry(i);
145 tmpObject->
setStripEff(str_eff, part, segment, layer, strip);
146 tmpObject->
setStripCnt(str_cnt, part, segment, layer, strip);
147 tmpObject->
setStripNos(str_nos, part, segment, layer, strip);
149 log<<MSG::DEBUG<<
"strip: " << i <<
"\t" << str_eff <<endreq;
153 refpObject=tmpObject;
157 return StatusCode::SUCCESS;
const CLID CLID_Calib_MucCal
void setLayerClstPro(const double layerpro, int i, int j)
void setLayerNos(const double layernos, int i)
void setLayerCnt(const double layercnt, int i)
void setBoxCnt(const double boxcnt, int i, int j, int k)
void setStripNos(const double stripnos, int i, int j, int k, int l)
void setBoxNosRatio(const double boxratio, int i, int j, int k)
void setStripEff(const double stripeff, int i, int j, int k, int l)
void setStripNosRatio(const double stripnosratio, int i, int j, int k, int l)
void setStripCnt(const double stripcnt, int i, int j, int k, int l)
void setBoxEff(const double boxeff, int i, int j, int k)
void setBoxNos(const double boxnos, int i, int j, int k)
void setLayerEff(const double layereff, int i)
void setLayerNosRatio(const double layernosratio, int i)
void setBoxClstPro(const double boxpro, int i, int j, int k, int l)
virtual DatabaseRecord * pp()
virtual StatusCode i_createObj(IOpaqueAddress *address, DataObject *&refpObject)
const CLID & objType() const
static const CLID & classID()
TreeMucCalibDataCnv(ISvcLocator *svc)