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"
38 declareProperty(
"ConfigMode", m_fConfigMode=3);
39 declareProperty(
"UniformEff", m_fUniformEff=0.95);
40 declareProperty(
"UniformCnt", m_fUniformEff=0.05);
41 declareProperty(
"UniformNos", m_fUniformEff=0.001);
42 declareProperty(
"UniformNosRatio",m_fUniformNos=0.05);
43 declareProperty(
"UniformClst", m_fUniformClst=4);
61 MsgStream log(messageService(), name());
62 log << MSG::INFO << endreq <<
"initialize()" << endreq << endreq;
63 log << MSG::INFO <<
"Config mode:\t" << m_fConfigMode << endreq;
64 StatusCode sc = Service::initialize();
65 if( sc.isFailure() )
return sc;
67 sc = service(
"CalibDataSvc", m_pCalibDataSvc,
true);
68 if( sc == StatusCode::SUCCESS ) {
69 log << MSG::INFO <<
"Retrieve IDataProviderSvc" << endreq;
71 log << MSG::FATAL <<
"can not get IDataProviderSvc" << endreq;
74 return StatusCode::SUCCESS;
79 MsgStream log(messageService(), name());
80 log << MSG::INFO << endreq <<
"finalize()" << endreq << endreq;
81 return StatusCode::SUCCESS;
95 MsgStream log(messageService(), name());
97 std::string fullPath =
"/Calib/MucCal";
98 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
100 if( ! pMucCalibConst ){
101 log << MSG::ERROR <<
"getEff() can not access to MucCalibData via SmartPtr" << endreq;
104 switch( m_fConfigMode )
107 if( m_fUniformEff < 0 )
108 eff = pMucCalibConst->getUniformEff();
113 eff = pMucCalibConst->getLayerEff( layer );
116 eff = pMucCalibConst->getBoxEff( part, segment, layer );
119 eff = pMucCalibConst->getStripEff( part, segment, layer, strip );
132 MsgStream log(messageService(), name());
133 std::string fullPath =
"/Calib/MucCal";
134 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
135 if( ! pMucCalibConst ){
136 log << MSG::ERROR <<
"getCnt() can not access to MucCalibData via SmartPtr" << endreq;
139 switch( m_fConfigMode )
142 if( m_fUniformCnt < 0 )
143 cnt = pMucCalibConst->getUniformCnt();
148 cnt = pMucCalibConst->getLayerCnt( layer );
151 cnt = pMucCalibConst->getBoxCnt( part, segment, layer );
154 cnt = pMucCalibConst->getStripCnt( part, segment, layer, strip );
167 MsgStream log(messageService(), name());
168 std::string fullPath =
"/Calib/MucCal";
169 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
170 if( ! pMucCalibConst ){
171 log << MSG::ERROR <<
"getNos() can not access to MucCalibData via SmartPtr" << endreq;
174 switch( m_fConfigMode )
177 if( m_fUniformNos < 0 )
178 nos = pMucCalibConst->getUniformNos();
183 nos = pMucCalibConst->getLayerNos( layer );
186 nos = pMucCalibConst->getBoxNos( part, segment, layer );
189 nos = pMucCalibConst->getStripNos( part, segment, layer, strip );
201 double nosRatio = 0.0;
202 MsgStream log(messageService(), name());
203 std::string fullPath =
"/Calib/MucCal";
204 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
205 if( ! pMucCalibConst ){
206 log << MSG::ERROR <<
"getNosRatio() can not access to MucCalibData via SmartPtr" << endreq;
209 switch( m_fConfigMode )
212 if( m_fUniformNosRatio < 0 )
213 nosRatio = pMucCalibConst->getUniformNosRatio();
215 nosRatio = m_fUniformNosRatio;
218 nosRatio = pMucCalibConst->getLayerNosRatio( layer );
221 nosRatio = pMucCalibConst->getBoxNosRatio( part, segment, layer );
224 nosRatio = pMucCalibConst->getStripNosRatio( part, segment, layer, strip );
236 double cluster = 0.0;
237 MsgStream log(messageService(), name());
238 std::string fullPath =
"/Calib/MucCal";
239 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
240 if( ! pMucCalibConst ){
241 log << MSG::ERROR <<
"getClst() can not access to MucCalibData via SmartPtr" << endreq;
244 switch( m_fConfigMode )
247 if( m_fUniformClst < 0 )
248 cluster = pMucCalibConst->getUniformClst();
250 cluster = m_fUniformClst;
253 cluster = pMucCalibConst->getLayerClst( layer, prob );
256 cluster = pMucCalibConst->getBoxClst( part, segment, layer, prob );
272 double fUniformEff = 0.0;
273 MsgStream log(messageService(), name());
275 std::string fullPath =
"/Calib/MucCal";
276 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
277 if( ! pMucCalibConst ){
278 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
280 fUniformEff= pMucCalibConst->getUniformEff();
288 double fUniformCnt = 0.0;
289 MsgStream log(messageService(), name());
291 std::string fullPath =
"/Calib/MucCal";
292 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
293 if( ! pMucCalibConst ){
294 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
296 fUniformCnt= pMucCalibConst->getUniformCnt();
304 double fUniformNosRatio = 0.0;
305 MsgStream log(messageService(), name());
307 std::string fullPath =
"/Calib/MucCal";
308 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
309 if( ! pMucCalibConst ){
310 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
312 fUniformNosRatio= pMucCalibConst->getUniformNosRatio();
315 return fUniformNosRatio;
321 double fUniformNos = 0.0;
322 MsgStream log(messageService(), name());
324 std::string fullPath =
"/Calib/MucCal";
325 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
326 if( ! pMucCalibConst ){
327 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
329 fUniformNos= pMucCalibConst->getUniformNos();
337 double fUniformClst = 0.0;
338 MsgStream log(messageService(), name());
340 std::string fullPath =
"/Calib/MucCal";
341 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
342 if( ! pMucCalibConst ){
343 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
345 fUniformClst= pMucCalibConst->getUniformClst();
355 MsgStream log(messageService(), name());
357 std::string fullPath =
"/Calib/MucCal";
358 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
359 if( ! pMucCalibConst ){
360 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
362 fEff= pMucCalibConst->getLayerEff( layer );
372 MsgStream log(messageService(), name());
374 std::string fullPath =
"/Calib/MucCal";
375 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
376 if( ! pMucCalibConst ){
377 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
379 fCnt= pMucCalibConst->getLayerCnt( layer );
388 MsgStream log(messageService(), name());
390 std::string fullPath =
"/Calib/MucCal";
391 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
392 if( ! pMucCalibConst ){
393 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
395 fNos= pMucCalibConst->getLayerNos( layer );
403 double fNosRatio = 0.0;
404 MsgStream log(messageService(), name());
406 std::string fullPath =
"/Calib/MucCal";
407 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
408 if( ! pMucCalibConst ){
409 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
411 fNosRatio= pMucCalibConst->getLayerNosRatio( layer );
420 MsgStream log(messageService(), name());
422 std::string fullPath =
"/Calib/MucCal";
423 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
424 if( ! pMucCalibConst ){
425 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
427 fClst= pMucCalibConst->getLayerClst( layer, prob );
437 MsgStream log(messageService(), name());
439 std::string fullPath =
"/Calib/MucCal";
440 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
441 if( ! pMucCalibConst ){
442 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
444 fEff= pMucCalibConst->getBoxEff( part, segment, layer );
454 MsgStream log(messageService(), name());
456 std::string fullPath =
"/Calib/MucCal";
457 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
458 if( ! pMucCalibConst ){
459 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
461 fCnt= pMucCalibConst->getBoxCnt( part, segment, layer );
470 MsgStream log(messageService(), name());
472 std::string fullPath =
"/Calib/MucCal";
473 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
474 if( ! pMucCalibConst ){
475 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
477 fNos= pMucCalibConst->getBoxNos( part, segment, layer );
485 double fNosRatio = 0.0;
486 MsgStream log(messageService(), name());
488 std::string fullPath =
"/Calib/MucCal";
489 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
490 if( ! pMucCalibConst ){
491 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
493 fNosRatio= pMucCalibConst->getBoxNosRatio( part, segment, layer );
502 MsgStream log(messageService(), name());
504 std::string fullPath =
"/Calib/MucCal";
505 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
506 if( ! pMucCalibConst ){
507 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
509 fClst= pMucCalibConst->getBoxClst( part, segment, layer, prob );
519 MsgStream log(messageService(), name());
521 log << MSG::INFO <<
"in MucCalibConstSvc::getStripEff" << endreq;
523 std::string fullPath =
"/Calib/MucCal";
524 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
526 if( ! pMucCalibConst ){
527 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
529 fEff = pMucCalibConst->getStripEff( part, segment, layer, strip );
539 MsgStream log(messageService(), name());
541 std::string fullPath =
"/Calib/MucCal";
542 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
543 if( ! pMucCalibConst ){
544 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
546 fCnt= pMucCalibConst->getStripCnt( part, segment, layer, strip );
555 MsgStream log(messageService(), name());
557 std::string fullPath =
"/Calib/MucCal";
558 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
559 if( ! pMucCalibConst ){
560 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
562 fNos= pMucCalibConst->getStripNos( part, segment, layer, strip );
570 double fNosRatio = 0.0;
571 MsgStream log(messageService(), name());
573 std::string fullPath =
"/Calib/MucCal";
574 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
575 if( ! pMucCalibConst ){
576 log << MSG::ERROR <<
"can not access to MucCalibData via SmartPtr" << endreq;
578 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()
double getLayerEff(int layer) const
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