16class UseDedx : public Algorithm {
19 UseDedx(const std::string& name, ISvcLocator* pSvcLocator);
21 StatusCode initialize();
25 StatusCode finalize();
28 IDataProviderSvc* m_pCalibDataSvc;
29 ICalibRootSvc* m_pRootSvc;
30 // Maybe something to say which kind of data to look up?
35//static const AlgFactory<UseDedx> Factory;
36//const IAlgFactory& UseCalibFactory = Factory;
37//const IAlgFactory& UseDedxFactory = Factory;
41 : Algorithm( name, pSvcLocator ), m_pCalibDataSvc( 0 ) {
47 MsgStream log(
msgSvc(), name() );
48 log << MSG::INFO <<
"Initialize()" << endmsg;
53 log << MSG::INFO <<
"setProperties()" << endmsg;
55 sc = service(
"CalibDataSvc", m_pCalibDataSvc,
true );
57 if ( !sc.isSuccess() )
59 log << MSG::ERROR <<
"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
64 { log << MSG::DEBUG <<
"Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" << endmsg; }
66 sc = service(
"CalibRootCnvSvc", m_pRootSvc,
true );
67 if ( !sc.isSuccess() )
69 log << MSG::ERROR <<
"Could not get ICalibRootSvc interface of CalibRootCnvSvc" << endmsg;
77 return StatusCode::SUCCESS;
82 MsgStream log(
msgSvc(), name() );
84 std::string fullPath =
"/Calib/DedxCal";
86 log << MSG::INFO <<
"execute() fullPath = " << fullPath << endmsg;
88 SmartDataPtr<CalibData::DedxCalibData>
test( m_pCalibDataSvc, fullPath );
107 for ( i = 0; i < 4; i++ )
109 for ( j = 0; j < 43; j++ )
111 ddg =
test->getddg( i, j );
112 ggs =
test->getggs( i, j );
113 zdep =
test->getzdep( i, j );
121 for (
int i = 0; i < 1600; i++ )
123 m_id_doca =
test->get_id_doca( i );
124 m_iner_chi =
test->get_iner_chi( i );
125 m_iner_gain =
test->get_iner_gain( i );
126 m_iner_hits =
test->get_iner_hits( i );
127 m_ip_eangle =
test->get_ip_eangle( i );
128 m_out_chi =
test->get_out_chi( i );
129 m_out_gain =
test->get_out_gain( i );
130 m_out_hits =
test->get_out_hits( i );
131 std::cout <<
"m_id_doca: " << m_id_doca <<
" m_iner_chi: " << m_iner_chi
132 <<
" m_iner_gain: " << m_iner_gain <<
" m_iner_hits:" << m_iner_hits
133 <<
" m_ip_eangle:" << m_ip_eangle <<
" m_out_chi=" << m_out_chi
134 <<
" m_out_gain:" << m_out_gain <<
" m_out_hits=" << m_out_hits << std::endl;
136 gain =
test->getgain();
139 for (
int i = 0; i < 80; i++ )
141 m_costheta =
test->get_costheta( i );
142 std::cout <<
" m_costheta=" << m_costheta;
143 if ( i % 5 == 0 ) std::cout <<
"\n" << std::endl;
146 for (
int i = 0; i < 35; i++ )
148 t0 =
test->get_t0( i );
149 dedx =
test->get_dedx( i );
150 std::cout <<
"t0 =" << t0 <<
" dedx=" << dedx;
151 if ( i % 5 == 0 ) std::cout <<
"\n" << std::endl;
154 resol =
test->getresol();
157 for ( i = 0; i < 43; i++ )
159 layerg =
test->getlayerg( i );
163 for ( i = 0; i < 60; i++ )
165 wireg =
test->getwireg( i );
169 for ( i = 0; i < 20; i++ ) { std::cout <<
"hadron " << i <<
" = " <<
test->get_hadron( i ); }
173 return StatusCode::SUCCESS;
178 MsgStream log(
msgSvc(), name() );
179 log << MSG::INFO <<
" UseDedx FINALIZE!! " << endmsg;
181 return StatusCode::SUCCESS;
UseDedx(const std::string &name, ISvcLocator *pSvcLocator)