10#include "GaudiKernel/IInterface.h"
11#include "GaudiKernel/StatusCode.h"
13#include "GaudiKernel/SvcFactory.h"
14#include "GaudiKernel/MsgStream.h"
16#include "GaudiKernel/ISvcLocator.h"
17#include "GaudiKernel/Bootstrap.h"
19#include "GaudiKernel/IDataProviderSvc.h"
20#include "GaudiKernel/SmartDataPtr.h"
21#include "GaudiKernel/DataSvc.h"
36 declareProperty(
"ConfigMode", m_fConfigMode=3);
37 declareProperty(
"UniformEff", m_fUniformEff=0.95);
38 declareProperty(
"UniformCnt", m_fUniformEff=0.05);
39 declareProperty(
"UniformNos", m_fUniformEff=0.001);
40 declareProperty(
"UniformNosRatio",m_fUniformNos=0.05);
41 declareProperty(
"UniformClst", m_fUniformClst=4);
48 if( IID_IMucCalibConstSvc.versionMatch(riid) ){
51 return Service::queryInterface(riid, ppvInterface);
53 return StatusCode::SUCCESS;
58 MsgStream log(messageService(), name());
59 log << MSG::INFO << endreq <<
"initialize()" << endreq << endreq;
60 log << MSG::INFO <<
"Config mode:\t" << m_fConfigMode << endreq;
61 StatusCode sc = Service::initialize();
62 if( sc.isFailure() )
return sc;
64 sc = service(
"CalibDataSvc", m_pCalibDataSvc,
true);
65 if( sc == StatusCode::SUCCESS ) {
66 log << MSG::INFO <<
"Retrieve IDataProviderSvc" << endreq;
68 log << MSG::FATAL <<
"can not get IDataProviderSvc" << endreq;
71 return StatusCode::SUCCESS;
76 MsgStream log(messageService(), name());
77 log << MSG::INFO << endreq <<
"finalize()" << endreq << endreq;
78 return StatusCode::SUCCESS;
92 MsgStream log(messageService(), name());
94 std::string fullPath =
"/Calib/MucCal";
95 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
97 if( ! pMucCalibConst ){
98 log << MSG::ERROR <<
"getEff() can not access to MucCalibData via SmartPtr" << endreq;
101 switch( m_fConfigMode )
104 if( m_fUniformEff < 0 )
105 eff = pMucCalibConst->getUniformEff();
110 eff = pMucCalibConst->getLayerEff( layer );
113 eff = pMucCalibConst->getBoxEff( part, segment, layer );
116 eff = pMucCalibConst->getStripEff( part, segment, layer, strip );
129 MsgStream log(messageService(), name());
130 std::string fullPath =
"/Calib/MucCal";
131 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
132 if( ! pMucCalibConst ){
133 log << MSG::ERROR <<
"getCnt() can not access to MucCalibData via SmartPtr" << endreq;
136 switch( m_fConfigMode )
139 if( m_fUniformCnt < 0 )
140 cnt = pMucCalibConst->getUniformCnt();
145 cnt = pMucCalibConst->getLayerCnt( layer );
148 cnt = pMucCalibConst->getBoxCnt( part, segment, layer );
151 cnt = pMucCalibConst->getStripCnt( part, segment, layer, strip );
164 MsgStream log(messageService(), name());
165 std::string fullPath =
"/Calib/MucCal";
166 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
167 if( ! pMucCalibConst ){
168 log << MSG::ERROR <<
"getNos() can not access to MucCalibData via SmartPtr" << endreq;
171 switch( m_fConfigMode )
174 if( m_fUniformNos < 0 )
175 nos = pMucCalibConst->getUniformNos();
180 nos = pMucCalibConst->getLayerNos( layer );
183 nos = pMucCalibConst->getBoxNos( part, segment, layer );
186 nos = pMucCalibConst->getStripNos( part, segment, layer, strip );
198 double nosRatio = 0.0;
199 MsgStream log(messageService(), name());
200 std::string fullPath =
"/Calib/MucCal";
201 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
202 if( ! pMucCalibConst ){
203 log << MSG::ERROR <<
"getNosRatio() can not access to MucCalibData via SmartPtr" << endreq;
206 switch( m_fConfigMode )
209 if( m_fUniformNosRatio < 0 )
210 nosRatio = pMucCalibConst->getUniformNosRatio();
212 nosRatio = m_fUniformNosRatio;
215 nosRatio = pMucCalibConst->getLayerNosRatio( layer );
218 nosRatio = pMucCalibConst->getBoxNosRatio( part, segment, layer );
221 nosRatio = pMucCalibConst->getStripNosRatio( part, segment, layer, strip );
233 double cluster = 0.0;
234 MsgStream log(messageService(), name());
235 std::string fullPath =
"/Calib/MucCal";
236 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
237 if( ! pMucCalibConst ){
238 log << MSG::ERROR <<
"getClst() can not access to MucCalibData via SmartPtr" << endreq;
241 switch( m_fConfigMode )
244 if( m_fUniformClst < 0 )
245 cluster = pMucCalibConst->getUniformClst();
247 cluster = m_fUniformClst;
250 cluster = pMucCalibConst->getLayerClst( layer, prob );
253 cluster = pMucCalibConst->getBoxClst( part, segment, layer, prob );
269 double fUniformEff = 0.0;
270 MsgStream log(messageService(), name());
272 std::string fullPath =
"/Calib/MucCal";
273 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
274 if( ! pMucCalibConst ){
275 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
277 fUniformEff= pMucCalibConst->getUniformEff();
285 double fUniformCnt = 0.0;
286 MsgStream log(messageService(), name());
288 std::string fullPath =
"/Calib/MucCal";
289 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
290 if( ! pMucCalibConst ){
291 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
293 fUniformCnt= pMucCalibConst->getUniformCnt();
301 double fUniformNosRatio = 0.0;
302 MsgStream log(messageService(), name());
304 std::string fullPath =
"/Calib/MucCal";
305 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
306 if( ! pMucCalibConst ){
307 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
309 fUniformNosRatio= pMucCalibConst->getUniformNosRatio();
312 return fUniformNosRatio;
318 double fUniformNos = 0.0;
319 MsgStream log(messageService(), name());
321 std::string fullPath =
"/Calib/MucCal";
322 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
323 if( ! pMucCalibConst ){
324 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
326 fUniformNos= pMucCalibConst->getUniformNos();
334 double fUniformClst = 0.0;
335 MsgStream log(messageService(), name());
337 std::string fullPath =
"/Calib/MucCal";
338 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
339 if( ! pMucCalibConst ){
340 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
342 fUniformClst= pMucCalibConst->getUniformClst();
352 MsgStream log(messageService(), name());
354 std::string fullPath =
"/Calib/MucCal";
355 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
356 if( ! pMucCalibConst ){
357 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
359 fEff= pMucCalibConst->getLayerEff( layer );
369 MsgStream log(messageService(), name());
371 std::string fullPath =
"/Calib/MucCal";
372 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
373 if( ! pMucCalibConst ){
374 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
376 fCnt= pMucCalibConst->getLayerCnt( layer );
385 MsgStream log(messageService(), name());
387 std::string fullPath =
"/Calib/MucCal";
388 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
389 if( ! pMucCalibConst ){
390 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
392 fNos= pMucCalibConst->getLayerNos( layer );
400 double fNosRatio = 0.0;
401 MsgStream log(messageService(), name());
403 std::string fullPath =
"/Calib/MucCal";
404 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
405 if( ! pMucCalibConst ){
406 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
408 fNosRatio= pMucCalibConst->getLayerNosRatio( layer );
417 MsgStream log(messageService(), name());
419 std::string fullPath =
"/Calib/MucCal";
420 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
421 if( ! pMucCalibConst ){
422 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
424 fClst= pMucCalibConst->getLayerClst( layer, prob );
434 MsgStream log(messageService(), name());
436 std::string fullPath =
"/Calib/MucCal";
437 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
438 if( ! pMucCalibConst ){
439 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
441 fEff= pMucCalibConst->getBoxEff( part, segment, layer );
451 MsgStream log(messageService(), name());
453 std::string fullPath =
"/Calib/MucCal";
454 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
455 if( ! pMucCalibConst ){
456 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
458 fCnt= pMucCalibConst->getBoxCnt( part, segment, layer );
467 MsgStream log(messageService(), name());
469 std::string fullPath =
"/Calib/MucCal";
470 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
471 if( ! pMucCalibConst ){
472 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
474 fNos= pMucCalibConst->getBoxNos( part, segment, layer );
482 double fNosRatio = 0.0;
483 MsgStream log(messageService(), name());
485 std::string fullPath =
"/Calib/MucCal";
486 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
487 if( ! pMucCalibConst ){
488 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
490 fNosRatio= pMucCalibConst->getBoxNosRatio( part, segment, layer );
499 MsgStream log(messageService(), name());
501 std::string fullPath =
"/Calib/MucCal";
502 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
503 if( ! pMucCalibConst ){
504 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
506 fClst= pMucCalibConst->getBoxClst( part, segment, layer, prob );
516 MsgStream log(messageService(), name());
518 log << MSG::INFO <<
"in MucCalibConstSvc::getStripEff" << endreq;
520 std::string fullPath =
"/Calib/MucCal";
521 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
523 if( ! pMucCalibConst ){
524 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
526 fEff = pMucCalibConst->getStripEff( part, segment, layer, strip );
536 MsgStream log(messageService(), name());
538 std::string fullPath =
"/Calib/MucCal";
539 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
540 if( ! pMucCalibConst ){
541 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
543 fCnt= pMucCalibConst->getStripCnt( part, segment, layer, strip );
552 MsgStream log(messageService(), name());
554 std::string fullPath =
"/Calib/MucCal";
555 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
556 if( ! pMucCalibConst ){
557 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
559 fNos= pMucCalibConst->getStripNos( part, segment, layer, strip );
567 double fNosRatio = 0.0;
568 MsgStream log(messageService(), name());
570 std::string fullPath =
"/Calib/MucCal";
571 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
572 if( ! pMucCalibConst ){
573 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
575 fNosRatio= pMucCalibConst->getStripNosRatio( part, segment, layer, strip );
double getBoxNos(int part, int segment, int layer) const
double getStripNosRatio(int part, int segment, int layer, int strip) const
double getClst(int part, int segment, int layer, double prob) const
double getUniformNos() const
double getBoxClst(int part, int segment, int layer, double prob) const
double getLayerNos(int layer) const
double getCnt(int part, int segment, int layer, int strip) const
double getStripCnt(int part, int segment, int layer, int strip) const
double getBoxEff(int part, int segment, int layer) const
double getEff(int part, int segment, int layer, int strip) const
double getUniformEff() const
virtual StatusCode finalize()
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
double getLayerEff(int layer) const
MucCalibConstSvc(const std::string &name, ISvcLocator *svcloc)
double getUniformClst() const
double getBoxCnt(int part, int segment, int layer) const
double getBoxNosRatio(int part, int segment, int layer) const
double getUniformCnt() const
double getStripNos(int part, int segment, int layer, int strip) const
double getNosRatio(int part, int segment, int layer, int strip) const
double getLayerNosRatio(int layer) const
double getLayerClst(int layer, double prob) const
double getUniformNosRatio() const
double getLayerCnt(int layer) const
virtual StatusCode initialize()
double getNos(int part, int segment, int layer, int strip) const
double getStripEff(int part, int segment, int layer, int strip) const