BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MucCalibConstSvc Class Reference

#include <MucCalibConstSvc.h>

+ Inheritance diagram for MucCalibConstSvc:

Public Member Functions

 MucCalibConstSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~MucCalibConstSvc ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
int getLevel () const
 
double getEff (int part, int segment, int layer, int strip) const
 
double getCnt (int part, int segment, int layer, int strip) const
 
double getNos (int part, int segment, int layer, int strip) const
 
double getNosRatio (int part, int segment, int layer, int strip) const
 
double getClst (int part, int segment, int layer, double prob) const
 
double getUniformEff () const
 
double getUniformCnt () const
 
double getUniformNos () const
 
double getUniformNosRatio () const
 
double getUniformClst () const
 
double getLayerEff (int layer) const
 
double getLayerCnt (int layer) const
 
double getLayerNos (int layer) const
 
double getLayerNosRatio (int layer) const
 
double getLayerClst (int layer, double prob) const
 
double getBoxEff (int part, int segment, int layer) const
 
double getBoxCnt (int part, int segment, int layer) const
 
double getBoxNos (int part, int segment, int layer) const
 
double getBoxNosRatio (int part, int segment, int layer) const
 
double getBoxClst (int part, int segment, int layer, double prob) const
 
double getStripEff (int part, int segment, int layer, int strip) const
 
double getStripCnt (int part, int segment, int layer, int strip) const
 
double getStripNos (int part, int segment, int layer, int strip) const
 
double getStripNosRatio (int part, int segment, int layer, int strip) const
 

Detailed Description

Definition at line 19 of file MucCalibConstSvc.h.

Constructor & Destructor Documentation

◆ MucCalibConstSvc()

MucCalibConstSvc::MucCalibConstSvc ( const std::string & name,
ISvcLocator * svcloc )

Definition at line 35 of file MucCalibConstSvc.cxx.

35 : base_class (name, svcloc),
36 m_pCalibDataSvc(0)
37{
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);
44}

◆ ~MucCalibConstSvc()

MucCalibConstSvc::~MucCalibConstSvc ( )

Definition at line 46 of file MucCalibConstSvc.cxx.

46{ }

Member Function Documentation

◆ finalize()

StatusCode MucCalibConstSvc::finalize ( )
virtual

Definition at line 77 of file MucCalibConstSvc.cxx.

78{
79 MsgStream log(messageService(), name());
80 log << MSG::INFO << endreq << "finalize()" << endreq << endreq;
81 return StatusCode::SUCCESS;
82}

◆ getBoxClst()

double MucCalibConstSvc::getBoxClst ( int part,
int segment,
int layer,
double prob ) const
inline

Definition at line 499 of file MucCalibConstSvc.cxx.

500{
501 double fClst = 0.0;
502 MsgStream log(messageService(), name());
503
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;
508 }else {
509 fClst= pMucCalibConst->getBoxClst( part, segment, layer, prob );
510 }
511
512 return fClst;
513}

◆ getBoxCnt()

double MucCalibConstSvc::getBoxCnt ( int part,
int segment,
int layer ) const
inline

Definition at line 451 of file MucCalibConstSvc.cxx.

452{
453 double fCnt = 0.0;
454 MsgStream log(messageService(), name());
455
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;
460 }else {
461 fCnt= pMucCalibConst->getBoxCnt( part, segment, layer );
462 }
463
464 return fCnt;
465}

◆ getBoxEff()

double MucCalibConstSvc::getBoxEff ( int part,
int segment,
int layer ) const
inline

Definition at line 434 of file MucCalibConstSvc.cxx.

435{
436 double fEff = 0.0;
437 MsgStream log(messageService(), name());
438
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;
443 }else {
444 fEff= pMucCalibConst->getBoxEff( part, segment, layer );
445 }
446
447 // log << MSG::DEBUG << "Box:\t" << part << "\t" << segment <<"\t" << layer << "\t" << fEff << endreq;
448 return fEff;
449}

◆ getBoxNos()

double MucCalibConstSvc::getBoxNos ( int part,
int segment,
int layer ) const
inline

Definition at line 467 of file MucCalibConstSvc.cxx.

468{
469 double fNos = 0.0;
470 MsgStream log(messageService(), name());
471
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;
476 }else {
477 fNos= pMucCalibConst->getBoxNos( part, segment, layer );
478 }
479
480 return fNos;
481}

◆ getBoxNosRatio()

double MucCalibConstSvc::getBoxNosRatio ( int part,
int segment,
int layer ) const
inline

Definition at line 483 of file MucCalibConstSvc.cxx.

484{
485 double fNosRatio = 0.0;
486 MsgStream log(messageService(), name());
487
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;
492 }else {
493 fNosRatio= pMucCalibConst->getBoxNosRatio( part, segment, layer );
494 }
495
496 return fNosRatio;
497}

◆ getClst()

double MucCalibConstSvc::getClst ( int part,
int segment,
int layer,
double prob ) const
inline

Definition at line 234 of file MucCalibConstSvc.cxx.

235{
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;
242 }else
243 {
244 switch( m_fConfigMode )
245 {
246 case 0 :
247 if( m_fUniformClst < 0 )
248 cluster = pMucCalibConst->getUniformClst();
249 else
250 cluster = m_fUniformClst;
251 break;
252 case 1 :
253 cluster = pMucCalibConst->getLayerClst( layer, prob );
254 break;
255 case 2 :
256 cluster = pMucCalibConst->getBoxClst( part, segment, layer, prob );
257 break;
258 case 3 :
259 cluster = 0.0;
260 break;
261 default: ;
262 }
263 }
264
265 return cluster;
266}

◆ getCnt()

double MucCalibConstSvc::getCnt ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 129 of file MucCalibConstSvc.cxx.

130{
131 double cnt = 0.0;
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;
137 }else
138 {
139 switch( m_fConfigMode )
140 {
141 case 0 :
142 if( m_fUniformCnt < 0 )
143 cnt = pMucCalibConst->getUniformCnt();
144 else
145 cnt = m_fUniformCnt;
146 break;
147 case 1 :
148 cnt = pMucCalibConst->getLayerCnt( layer );
149 break;
150 case 2 :
151 cnt = pMucCalibConst->getBoxCnt( part, segment, layer );
152 break;
153 case 3 :
154 cnt = pMucCalibConst->getStripCnt( part, segment, layer, strip );
155 break;
156 default: ;
157 }
158 }
159
160 return cnt;
161}

◆ getEff()

double MucCalibConstSvc::getEff ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 92 of file MucCalibConstSvc.cxx.

93{
94 double eff = 0.0;
95 MsgStream log(messageService(), name());
96 // log << MSG::INFO << "In MucCalibDataSvc" << endreq;
97 std::string fullPath = "/Calib/MucCal";
98 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
99
100 if( ! pMucCalibConst ){
101 log << MSG::ERROR << "getEff() can not access to MucCalibData via SmartPtr" << endreq;
102 }else
103 {
104 switch( m_fConfigMode )
105 {
106 case 0 :
107 if( m_fUniformEff < 0 )
108 eff = pMucCalibConst->getUniformEff();
109 else
110 eff = m_fUniformEff;
111 break;
112 case 1 :
113 eff = pMucCalibConst->getLayerEff( layer );
114 break;
115 case 2 :
116 eff = pMucCalibConst->getBoxEff( part, segment, layer );
117 break;
118 case 3 :
119 eff = pMucCalibConst->getStripEff( part, segment, layer, strip );
120 break;
121 default: ;
122 }
123 }
124
125 return eff;
126}

◆ getLayerClst()

double MucCalibConstSvc::getLayerClst ( int layer,
double prob ) const
inline

Definition at line 417 of file MucCalibConstSvc.cxx.

418{
419 double fClst = 0.0;
420 MsgStream log(messageService(), name());
421
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;
426 }else {
427 fClst= pMucCalibConst->getLayerClst( layer, prob );
428 }
429
430 return fClst;
431}

◆ getLayerCnt()

double MucCalibConstSvc::getLayerCnt ( int layer) const
inline

Definition at line 369 of file MucCalibConstSvc.cxx.

370{
371 double fCnt = 0.0;
372 MsgStream log(messageService(), name());
373
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;
378 }else {
379 fCnt= pMucCalibConst->getLayerCnt( layer );
380 }
381
382 return fCnt;
383}

◆ getLayerEff()

double MucCalibConstSvc::getLayerEff ( int layer) const
inline

Definition at line 352 of file MucCalibConstSvc.cxx.

353{
354 double fEff = 0.0;
355 MsgStream log(messageService(), name());
356
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;
361 }else {
362 fEff= pMucCalibConst->getLayerEff( layer );
363 }
364
365 // log << MSG::DEBUG << "Layer:\t" << layer << "\t" << fEff << endreq;
366 return fEff;
367}

◆ getLayerNos()

double MucCalibConstSvc::getLayerNos ( int layer) const
inline

Definition at line 385 of file MucCalibConstSvc.cxx.

386{
387 double fNos = 0.0;
388 MsgStream log(messageService(), name());
389
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;
394 }else {
395 fNos= pMucCalibConst->getLayerNos( layer );
396 }
397
398 return fNos;
399}

◆ getLayerNosRatio()

double MucCalibConstSvc::getLayerNosRatio ( int layer) const
inline

Definition at line 401 of file MucCalibConstSvc.cxx.

402{
403 double fNosRatio = 0.0;
404 MsgStream log(messageService(), name());
405
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;
410 }else {
411 fNosRatio= pMucCalibConst->getLayerNosRatio( layer );
412 }
413
414 return fNosRatio;
415}

◆ getLevel()

int MucCalibConstSvc::getLevel ( ) const
inline

Definition at line 89 of file MucCalibConstSvc.cxx.

89{return m_fConfigMode;}

◆ getNos()

double MucCalibConstSvc::getNos ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 164 of file MucCalibConstSvc.cxx.

165{
166 double nos = 0.0;
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;
172 }else
173 {
174 switch( m_fConfigMode )
175 {
176 case 0 :
177 if( m_fUniformNos < 0 )
178 nos = pMucCalibConst->getUniformNos();
179 else
180 nos = m_fUniformNos;
181 break;
182 case 1 :
183 nos = pMucCalibConst->getLayerNos( layer );
184 break;
185 case 2 :
186 nos = pMucCalibConst->getBoxNos( part, segment, layer );
187 break;
188 case 3 :
189 nos = pMucCalibConst->getStripNos( part, segment, layer, strip );
190 break;
191 default: ;
192 }
193 }
194
195 return nos;
196}

◆ getNosRatio()

double MucCalibConstSvc::getNosRatio ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 199 of file MucCalibConstSvc.cxx.

200{
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;
207 }else
208 {
209 switch( m_fConfigMode )
210 {
211 case 0 :
212 if( m_fUniformNosRatio < 0 )
213 nosRatio = pMucCalibConst->getUniformNosRatio();
214 else
215 nosRatio = m_fUniformNosRatio;
216 break;
217 case 1 :
218 nosRatio = pMucCalibConst->getLayerNosRatio( layer );
219 break;
220 case 2 :
221 nosRatio = pMucCalibConst->getBoxNosRatio( part, segment, layer );
222 break;
223 case 3 :
224 nosRatio = pMucCalibConst->getStripNosRatio( part, segment, layer, strip );
225 break;
226 default: ;
227 }
228 }
229
230 return nosRatio;
231}

◆ getStripCnt()

double MucCalibConstSvc::getStripCnt ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 536 of file MucCalibConstSvc.cxx.

537{
538 double fCnt = 0.0;
539 MsgStream log(messageService(), name());
540
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;
545 }else {
546 fCnt= pMucCalibConst->getStripCnt( part, segment, layer, strip );
547 }
548
549 return fCnt;
550}

◆ getStripEff()

double MucCalibConstSvc::getStripEff ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 516 of file MucCalibConstSvc.cxx.

517{
518 double fEff = 0.0;
519 MsgStream log(messageService(), name());
520
521 log << MSG::INFO << "in MucCalibConstSvc::getStripEff" << endreq;
522
523 std::string fullPath = "/Calib/MucCal";
524 SmartDataPtr<CalibData::MucCalibData> pMucCalibConst(m_pCalibDataSvc, fullPath);
525
526 if( ! pMucCalibConst ){
527 log << MSG::ERROR << "can not access to MucCalibData via SmartPtr" << endreq;
528 }else {
529 fEff = pMucCalibConst->getStripEff( part, segment, layer, strip );
530 }
531
532 // log << MSG::DEBUG << "Strip:\t" << part << "\t" << segment <<"\t" << layer << "\t" << strip << "\t" << fEff << endreq;
533 return fEff;
534}

◆ getStripNos()

double MucCalibConstSvc::getStripNos ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 552 of file MucCalibConstSvc.cxx.

553{
554 double fNos = 0.0;
555 MsgStream log(messageService(), name());
556
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;
561 }else {
562 fNos= pMucCalibConst->getStripNos( part, segment, layer, strip );
563 }
564
565 return fNos;
566}

◆ getStripNosRatio()

double MucCalibConstSvc::getStripNosRatio ( int part,
int segment,
int layer,
int strip ) const
inline

Definition at line 568 of file MucCalibConstSvc.cxx.

569{
570 double fNosRatio = 0.0;
571 MsgStream log(messageService(), name());
572
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;
577 }else {
578 fNosRatio= pMucCalibConst->getStripNosRatio( part, segment, layer, strip );
579 }
580
581 return fNosRatio;
582}

◆ getUniformClst()

double MucCalibConstSvc::getUniformClst ( ) const
inline

Definition at line 335 of file MucCalibConstSvc.cxx.

336{
337 double fUniformClst = 0.0;
338 MsgStream log(messageService(), name());
339
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;
344 }else {
345 fUniformClst= pMucCalibConst->getUniformClst();
346 }
347
348 return fUniformClst;
349}

◆ getUniformCnt()

double MucCalibConstSvc::getUniformCnt ( ) const
inline

Definition at line 286 of file MucCalibConstSvc.cxx.

287{
288 double fUniformCnt = 0.0;
289 MsgStream log(messageService(), name());
290
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;
295 }else {
296 fUniformCnt= pMucCalibConst->getUniformCnt();
297 }
298
299 return fUniformCnt;
300}

◆ getUniformEff()

double MucCalibConstSvc::getUniformEff ( ) const
inline

Definition at line 270 of file MucCalibConstSvc.cxx.

271{
272 double fUniformEff = 0.0;
273 MsgStream log(messageService(), name());
274
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;
279 }else {
280 fUniformEff= pMucCalibConst->getUniformEff();
281 }
282
283 return fUniformEff;
284}

◆ getUniformNos()

double MucCalibConstSvc::getUniformNos ( ) const
inline

Definition at line 319 of file MucCalibConstSvc.cxx.

320{
321 double fUniformNos = 0.0;
322 MsgStream log(messageService(), name());
323
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;
328 }else {
329 fUniformNos= pMucCalibConst->getUniformNos();
330 }
331
332 return fUniformNos;
333}

◆ getUniformNosRatio()

double MucCalibConstSvc::getUniformNosRatio ( ) const
inline

Definition at line 302 of file MucCalibConstSvc.cxx.

303{
304 double fUniformNosRatio = 0.0;
305 MsgStream log(messageService(), name());
306
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;
311 }else {
312 fUniformNosRatio= pMucCalibConst->getUniformNosRatio();
313 }
314
315 return fUniformNosRatio;
316}

◆ initialize()

StatusCode MucCalibConstSvc::initialize ( )
virtual

Definition at line 59 of file MucCalibConstSvc.cxx.

60{
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;
66
67 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
68 if( sc == StatusCode::SUCCESS ) {
69 log << MSG::INFO << "Retrieve IDataProviderSvc" << endreq;
70 }else{
71 log << MSG::FATAL << "can not get IDataProviderSvc" << endreq;
72 }
73
74 return StatusCode::SUCCESS;
75}

The documentation for this class was generated from the following files: