4#include "GaudiKernel/MsgStream.h"
12#include "TDirectory.h"
15#include "GaudiKernel/CnvFactory.h"
16#include "GaudiKernel/IOpaqueAddress.h"
17#include "GaudiKernel/DataObject.h"
18#include "GaudiKernel/IAddressCreator.h"
19#include "GaudiKernel/IDataProviderSvc.h"
20#include "GaudiKernel/IConversionSvc.h"
21#include "GaudiKernel/GenericAddress.h"
54 DataObject*& refpObject) {
56 MsgStream log(
msgSvc(),
"RootMucCalibDataCnv");
57 log<<MSG::DEBUG<<
"SetProperty"<<endreq;
61 { log<<MSG::ERROR<<
"unable to open files"<<endreq;
62 return StatusCode::FAILURE;
72 Double_t lay_eff, box_eff, str_eff;
73 Double_t lay_cnt, box_cnt, str_cnt;
74 Double_t lay_nos, box_nos, str_nos;
75 Double_t lay_nos_ratio, box_nos_ratio, str_nos_ratio;
76 lay_eff = box_eff = str_eff = 0.0;
77 lay_cnt = box_cnt = str_cnt = 0.0;
78 lay_nos = box_nos = str_nos = 0.0;
79 lay_nos_ratio = box_nos_ratio = str_nos_ratio = 0.0;
87 tr_Lvl[0] = (TTree*)
m_inFile->Get(
"LayConst");
88 tr_Lvl[0]->SetBranchAddress(
"layer_eff", &lay_eff);
89 tr_Lvl[0]->SetBranchAddress(
"layer_cnt", &lay_cnt);
90 tr_Lvl[0]->SetBranchAddress(
"layer_noise", &lay_nos);
91 tr_Lvl[0]->SetBranchAddress(
"layer_nosratio", &lay_nos_ratio);
93 tr_Lvl[1] = (TTree*)
m_inFile->Get(
"BoxConst");
94 tr_Lvl[1]->SetBranchAddress(
"box_eff", &box_eff);
95 tr_Lvl[1]->SetBranchAddress(
"box_cnt", &box_cnt);
96 tr_Lvl[1]->SetBranchAddress(
"box_noise", &box_nos);
97 tr_Lvl[1]->SetBranchAddress(
"box_nosratio", &box_nos_ratio);
99 tr_Lvl[2] = (TTree*)
m_inFile->Get(
"StrConst");
100 tr_Lvl[2]->SetBranchAddress(
"strip_eff", &str_eff);
101 tr_Lvl[2]->SetBranchAddress(
"strip_cnt", &str_cnt);
102 tr_Lvl[2]->SetBranchAddress(
"strip_noise", &str_nos);
103 tr_Lvl[2]->SetBranchAddress(
"strip_nosratio", &str_nos_ratio);
107 int part, segment, layer, strip;
108 part = segment = layer = strip = 0;
109 for(
int i=0; i<LAYER_MAX; i++)
112 tr_Lvl[0]->GetEntry(i);
120 for(
int j=0; j<CLST_MAX; j++) {
128 for(
int i=0; i<BOX_MAX; i++)
130 m_ptrIdTr->
SetBoxPos( i, &part, &segment, &layer );
131 tr_Lvl[1]->GetEntry(i);
132 tmpObject->
setBoxEff(box_eff, part, segment, layer);
133 tmpObject->
setBoxCnt(box_cnt, part, segment, layer);
134 tmpObject->
setBoxNos(box_nos, part, segment, layer);
137 sprintf(name,
"BoxClstPro_B%d",i);
139 for(
int j=0; j<CLST_MAX; j++) {
142 tmpObject->
setBoxClstPro(DEFAULT_CLST_PRO[j],part,segment,layer,j);
149 m_ptrIdTr->
SetStripPos( i, &part, &segment, &layer, &strip );
150 tr_Lvl[2]->GetEntry(i);
151 tmpObject->
setStripEff(str_eff, part, segment, layer, strip);
152 tmpObject->
setStripCnt(str_cnt, part, segment, layer, strip);
153 tmpObject->
setStripNos(str_nos, part, segment, layer, strip);
157 refpObject=tmpObject;
159 return StatusCode::SUCCESS;
165 MsgStream log(
msgSvc(),
"RootMucCalibDataCnv");
221 return StatusCode::SUCCESS;
const CLID CLID_Calib_MucCal
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
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)
StatusCode openRead(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)
RootMucCalibDataCnv(ISvcLocator *svc)
static const CLID & classID()