15class UseDedx : public Algorithm {
18 UseDedx(const std::string& name, ISvcLocator* pSvcLocator);
20 StatusCode initialize();
24 StatusCode finalize();
27 IDataProviderSvc* m_pCalibDataSvc;
28 ICalibRootSvc* m_pRootSvc;
29 // Maybe something to say which kind of data to look up?
34//static const AlgFactory<UseDedx> Factory;
35//const IAlgFactory& UseCalibFactory = Factory;
36//const IAlgFactory& UseDedxFactory = Factory;
40 ISvcLocator* pSvcLocator )
41 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
50 MsgStream log(
msgSvc(), name());
51 log << MSG::INFO <<
"Initialize()" << endreq;
56 log<<MSG::INFO <<
"setProperties()" << endreq;
58 sc = service(
"CalibDataSvc", m_pCalibDataSvc,
true);
60 if ( !sc.isSuccess() ) {
62 <<
"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
67 <<
"Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
71sc = service(
"CalibRootCnvSvc", m_pRootSvc,
true);
72 if ( !sc.isSuccess() ) {
74 <<
"Could not get ICalibRootSvc interface of CalibRootCnvSvc"
83 return StatusCode::SUCCESS;
90 MsgStream log(
msgSvc(), name());
93 std::string fullPath =
"/Calib/DedxCal";
95 log << MSG::INFO<<
"execute() fullPath = "<<fullPath<< endreq;
97 SmartDataPtr<CalibData::DedxCalibData>
test(m_pCalibDataSvc, fullPath);
118 ddg =
test->getddg(i,j);
119 ggs =
test->getggs(i,j);
120 zdep =
test->getzdep(i,j);
128 for(
int i=0;i<1600;i++){
129 m_id_doca =
test->get_id_doca(i);
130 m_iner_chi=
test->get_iner_chi(i);
131 m_iner_gain=
test->get_iner_gain(i);
132 m_iner_hits=
test->get_iner_hits(i);
133 m_ip_eangle=
test->get_ip_eangle(i);
134 m_out_chi=
test->get_out_chi(i);
135 m_out_gain=
test->get_out_gain(i);
136 m_out_hits=
test->get_out_hits(i);
137 std::cout<<
"m_id_doca: "<<m_id_doca<<
" m_iner_chi: "<<m_iner_chi<<
" m_iner_gain: "<<m_iner_gain<<
" m_iner_hits:"<<m_iner_hits<<
" m_ip_eangle:"<<m_ip_eangle<<
" m_out_chi="<<m_out_chi<<
" m_out_gain:"<<m_out_gain<<
" m_out_hits="<<m_out_hits<<std::endl;
139 gain =
test->getgain();
142 for(
int i=0;i<80;i++){
143 m_costheta =
test->get_costheta(i);
144 std::cout<<
" m_costheta="<<m_costheta;
145 if(i%5==0) std::cout<<
"\n"<<std::endl;
148 for(
int i=0;i<35;i++){
150 dedx=
test->get_dedx(i);
151 std::cout<<
"t0 ="<<t0<<
" dedx="<<dedx;
152 if(i%5==0) std::cout<<
"\n"<<std::endl;
155 resol =
test->getresol();
159 { layerg =
test -> getlayerg(i);
164 { wireg =
test -> getwireg(i);
169 std::cout<<
"hadron "<<i<<
" = "<<
test->get_hadron(i);
174 return StatusCode::SUCCESS;
179 MsgStream log(
msgSvc(), name());
181 <<
" UseDedx FINALIZE!! "
184 return StatusCode::SUCCESS;
UseDedx(const std::string &name, ISvcLocator *pSvcLocator)