BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcCalibConstSvc Class Reference

#include <EmcCalibConstSvc.h>

Inheritance diagram for EmcCalibConstSvc:

Public Member Functions

 EmcCalibConstSvc (const std::string &name, ISvcLocator *svcloc)
 ~EmcCalibConstSvc ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void handle (const Incident &)
double getDigiCalibConst (int No) const
int getIxtalNumber (int No) const
int getDigiCalibConstNo () const
int getIxtalNumberNo () const
int getIndex (unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const
unsigned int getPartID (int Index) const
unsigned int getThetaIndex (int Index) const
unsigned int getPhiIndex (int Index) const
double getCrystalEmaxData (int Index) const
void setCrystalEmaxData (double CrystalEmaxData[6240])
double getCrystalDeadEcut (int Index) const
void setCrystalDeadEcut (double CrystalDeadEcut[6240])
void Dump ()

Public Attributes

IDataProviderSvc * m_calDataSvc
EmcStructurem_theEmcStruc
double m_CrystalEmaxData [6240]
double m_CrystalEmaxData_1 [6240]
double m_CrystalEmaxData_2 [6240]
double m_CrystalEmaxData_4740 [6240]
double m_CrystalEmaxData_4750 [6240]
double m_CrystalEmaxData_4780 [6240]
double m_CrystalEmaxData_4840 [6240]
double m_CrystalEmaxData_4914 [6240]
double m_CrystalEmaxData_4946 [6240]
bool m_EmaxVersion1
bool m_EmaxVersion2
bool m_EmaxVersion4740
bool m_EmaxVersion4750
bool m_EmaxVersion4780
bool m_EmaxVersion4840
bool m_EmaxVersion4914
bool m_EmaxVersion4946
double m_CrystalDeadEcut [6240]
double m_CrystalDeadEcut_2020 [6240]
bool m_DeadEcutVersion2020

Detailed Description

Definition at line 16 of file EmcCalibConstSvc.h.

Constructor & Destructor Documentation

◆ EmcCalibConstSvc()

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

for version 1/////////

Definition at line 33 of file EmcCalibConstSvc.cxx.

34 : base_class( name, svcloc ) {
35 declareProperty( "ReadSatuDeadEnDb", m_readSatuDeadEnDb = true );
36
37 for ( int i = 0; i < 6240; i++ )
38 {
39 m_CrystalEmaxData[i] = 0;
40 m_CrystalDeadEcut[i] = -1;
41 }
42 if ( m_readSatuDeadEnDb == true )
43 {
44 m_runFrom = 0;
45 m_runTo = 0;
46 m_inFlag = false;
47 }
48 /////////////////////////
49 if ( m_readSatuDeadEnDb == false )
50 {
51 m_EmaxVersion1 = false;
52 m_EmaxVersion2 = false;
53 m_EmaxVersion4740 = false;
54 m_EmaxVersion4750 = false;
55 m_EmaxVersion4780 = false;
56 m_EmaxVersion4840 = false;
57 m_EmaxVersion4914 = false;
58 m_EmaxVersion4946 = false;
59
61
62 for ( int i = 0; i < 6240; i++ )
63 {
72
74 }
75
76 int ixtal;
77 double emaxData;
78 int Nixt = 0;
79
80 /// for version 1/////////
81 string paraPath = getenv( "EMCCALIBCONSTSVCROOT" );
82 paraPath += "/share/emax_data.dat"; // version=1
83 ifstream in;
84 in.open( paraPath.c_str() );
85 assert( in );
86
87 while ( in.peek() != EOF )
88 {
89
90 in >> ixtal >> emaxData;
91
92 m_CrystalEmaxData_1[ixtal] = emaxData;
93 Nixt++;
94 // cout<<"readFile==============="<<emaxData<<endl;
95 }
96
97 in.close();
98 // at the end of version 1/////
99
100 ////version 2-4680data@2020///////////
101 string paraPath2 = getenv( "EMCCALIBCONSTSVCROOT" );
102 paraPath2 += "/share/emax_data_2.dat"; // version=2
103
104 ifstream in2;
105 in2.open( paraPath2.c_str() );
106 assert( in2 );
107
108 Nixt = 0;
109 while ( in2.peek() != EOF )
110 {
111
112 in2 >> ixtal >> emaxData;
113
114 m_CrystalEmaxData_2[ixtal] = emaxData;
115
116 Nixt++;
117 // cout<<"readFile2==============="<<emaxData<<endl;
118 }
119
120 in2.close();
121 // at the end of version 2/////
122
123 ////version 4740data@2021///////////
124 string paraPath4740 = getenv( "EMCCALIBCONSTSVCROOT" );
125 paraPath4740 += "/share/emax_data_4740.dat"; // version=4740
126
127 ifstream in4740;
128 in4740.open( paraPath4740.c_str() );
129 assert( in4740 );
130
131 Nixt = 0;
132 while ( in4740.peek() != EOF )
133 {
134
135 in4740 >> ixtal >> emaxData;
136
137 m_CrystalEmaxData_4740[ixtal] = emaxData;
138
139 Nixt++;
140 // cout<<"readFile4740==============="<<emaxData<<endl;
141 }
142
143 in4740.close();
144 // at the end of version 4740/////
145
146 ////version 4750data@2021///////////
147 string paraPath4750 = getenv( "EMCCALIBCONSTSVCROOT" );
148 paraPath4750 += "/share/emax_data_4750.dat"; // version=4750
149
150 ifstream in4750;
151 in4750.open( paraPath4750.c_str() );
152 assert( in4750 );
153
154 Nixt = 0;
155 while ( in4750.peek() != EOF )
156 {
157
158 in4750 >> ixtal >> emaxData;
159
160 m_CrystalEmaxData_4750[ixtal] = emaxData;
161
162 Nixt++;
163 // cout<<"readFile4750==============="<<emaxData<<endl;
164 }
165
166 in4750.close();
167 // at the end of version 4750/////
168
169 ////version 4780data@2021///////////
170 string paraPath4780 = getenv( "EMCCALIBCONSTSVCROOT" );
171 paraPath4780 += "/share/emax_data_4780.dat"; // version=4780
172
173 ifstream in4780;
174 in4780.open( paraPath4780.c_str() );
175 assert( in4780 );
176
177 Nixt = 0;
178 while ( in4780.peek() != EOF )
179 {
180
181 in4780 >> ixtal >> emaxData;
182
183 m_CrystalEmaxData_4780[ixtal] = emaxData;
184
185 Nixt++;
186 // cout<<"readFile4780==============="<<emaxData<<endl;
187 }
188
189 in4780.close();
190 // at the end of version 4780/////
191
192 ////version 4840data@2021///////////
193 string paraPath4840 = getenv( "EMCCALIBCONSTSVCROOT" );
194 paraPath4840 += "/share/emax_data_4840.dat"; // version=4840
195
196 ifstream in4840;
197 in4840.open( paraPath4840.c_str() );
198 assert( in4840 );
199
200 Nixt = 0;
201 while ( in4840.peek() != EOF )
202 {
203
204 in4840 >> ixtal >> emaxData;
205
206 m_CrystalEmaxData_4840[ixtal] = emaxData;
207
208 Nixt++;
209 // cout<<"readFile4840==============="<<emaxData<<endl;
210 }
211
212 in4840.close();
213 // at the end of version 4840/////
214
215 ////version 4914data@2021///////////
216 string paraPath4914 = getenv( "EMCCALIBCONSTSVCROOT" );
217 paraPath4914 += "/share/emax_data_4914.dat"; // version=4914
218
219 ifstream in4914;
220 in4914.open( paraPath4914.c_str() );
221 assert( in4914 );
222
223 Nixt = 0;
224 while ( in4914.peek() != EOF )
225 {
226
227 in4914 >> ixtal >> emaxData;
228
229 m_CrystalEmaxData_4914[ixtal] = emaxData;
230
231 Nixt++;
232 // cout<<"readFile4914==============="<<emaxData<<endl;
233 }
234
235 in4914.close();
236 // at the end of version 4914/////
237
238 ////version 4946data@2021///////////
239 string paraPath4946 = getenv( "EMCCALIBCONSTSVCROOT" );
240 paraPath4946 += "/share/emax_data_4946.dat"; // version=4946
241
242 ifstream in4946;
243 in4946.open( paraPath4946.c_str() );
244 assert( in4946 );
245
246 Nixt = 0;
247 while ( in4946.peek() != EOF )
248 {
249
250 in4946 >> ixtal >> emaxData;
251
252 m_CrystalEmaxData_4946[ixtal] = emaxData;
253
254 Nixt++;
255 // cout<<"readFile4946==============="<<emaxData<<endl;
256 }
257
258 in4946.close();
259 // at the end of version 4946/////
260
261 ////read dead channel energy threshould Ecut///////////
262 string paraPath3 = getenv( "EMCCALIBCONSTSVCROOT" );
263 paraPath3 += "/share/DeadThresholdEcut_2020.conf";
264
265 ifstream in3;
266 in3.open( paraPath3.c_str() );
267 assert( in3 );
268
269 Nixt = 0;
270 double satuEn, Ecut;
271 double DeltaEcut = 0.0;
272
273 while ( in3.peek() != EOF )
274 {
275
276 in3 >> ixtal >> satuEn >> Ecut;
277 if ( ( Ecut - satuEn ) > DeltaEcut )
278 { m_CrystalDeadEcut_2020[ixtal] = Ecut - DeltaEcut; }
279 else { m_CrystalDeadEcut_2020[ixtal] = Ecut; }
280 Nixt++;
281 }
282
283 in3.close();
284
285 } // end of m_readSatuDeadEnDb==false
286}
double m_CrystalEmaxData_4740[6240]
double m_CrystalDeadEcut_2020[6240]
double m_CrystalEmaxData_2[6240]
double m_CrystalEmaxData[6240]
double m_CrystalEmaxData_4946[6240]
double m_CrystalEmaxData_1[6240]
double m_CrystalDeadEcut[6240]
double m_CrystalEmaxData_4840[6240]
double m_CrystalEmaxData_4750[6240]
double m_CrystalEmaxData_4914[6240]
double m_CrystalEmaxData_4780[6240]

Referenced by EmcCalibConstSvc().

◆ ~EmcCalibConstSvc()

EmcCalibConstSvc::~EmcCalibConstSvc ( )

Definition at line 288 of file EmcCalibConstSvc.cxx.

288{}

Member Function Documentation

◆ Dump()

void EmcCalibConstSvc::Dump ( )

Definition at line 709 of file EmcCalibConstSvc.cxx.

709 {
710
711 for ( int iNo = 0; iNo < 6; iNo++ )
712 { cout << "getDigiCalibConst " << getDigiCalibConst( iNo ) << endl; }
713 /*
714 cout<<"getDigiCalibConstNo "<<getDigiCalibConstNo()<<endl;
715
716
717 cout<<"ind"<<" "<<"getThetaIndex(ind)"<<" "
718 <<"getPhiIndex(ind)"<<"getPartID"<<endl;
719
720 for(int ind=0; ind<6240;ind++){
721
722 cout<<ind<<" "<<getThetaIndex(ind)<<" "
723 <<getPhiIndex(ind)<<" "<<getPartID(ind)<<endl;
724
725 }
726
727 cout<<"getIndex(0,5,95)="<<getIndex(0,5,95)<<endl;
728 cout<<"getIndex(1,43,119)="<<getIndex(1,43,119)<<endl;
729 cout<<"getIndex(2,5,95)="<<getIndex(2,5,95)<<endl;
730 cout<<"getIndex(0,5,96)="<<getIndex(0,5,96)<<endl;
731 cout<<"getIndex(1,43,120)="<<getIndex(1,43,120)<<endl;
732 cout<<"getIndex(2,5,96)="<<getIndex(2,5,96)<<endl;
733 */
734 for ( int i = 480; i < 600; i++ )
735 { cout << i << "\t" << getCrystalEmaxData( i ) << "\t" << getCrystalDeadEcut( i ) << endl; }
736}
double getCrystalEmaxData(int Index) const
double getDigiCalibConst(int No) const
double getCrystalDeadEcut(int Index) const

◆ finalize()

StatusCode EmcCalibConstSvc::finalize ( )
virtual

Definition at line 348 of file EmcCalibConstSvc.cxx.

348 {
349
350 delete m_theEmcStruc;
351
352 MsgStream log( msgSvc(), name() );
353 log << MSG::INFO << "EmcCalibConstSvc::finalize()" << endmsg;
354 return StatusCode::SUCCESS;
355}
IMessageSvc * msgSvc()
EmcStructure * m_theEmcStruc

◆ getCrystalDeadEcut()

double EmcCalibConstSvc::getCrystalDeadEcut ( int Index) const

Definition at line 701 of file EmcCalibConstSvc.cxx.

701 {
702 // using the percent m_CrystalDeadEcut[ixtal]=deadEn/satuEn, the deadEcut of the
703 // corresponding data are calulated by m_CrystalDeadEcut[ixtal]*m_CrystalEmaxData[ixtal].
704 double CrystalDeadEcut;
705 CrystalDeadEcut = m_CrystalDeadEcut[Index] * m_CrystalEmaxData[Index];
706 return CrystalDeadEcut;
707}
Index
Definition EvtCyclic3.hh:19

Referenced by Dump().

◆ getCrystalEmaxData()

double EmcCalibConstSvc::getCrystalEmaxData ( int Index) const

Definition at line 697 of file EmcCalibConstSvc.cxx.

697 {
698 return m_CrystalEmaxData[Index];
699}

Referenced by Dump().

◆ getDigiCalibConst()

double EmcCalibConstSvc::getDigiCalibConst ( int No) const

Definition at line 628 of file EmcCalibConstSvc.cxx.

628 {
629 double digiCalibConst = 0.0;
630 MsgStream log( msgSvc(), name() );
631
632 std::string fullPath = "/Calib/EmcCal";
633 SmartDataPtr<CalibData::EmcCalibData> calConst( m_calDataSvc, fullPath );
634 if ( !calConst )
635 { log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr" << endmsg; }
636 else { digiCalibConst = calConst->getDigiCalibConst( No ); }
637
638 return digiCalibConst;
639}
IDataProviderSvc * m_calDataSvc

Referenced by Dump().

◆ getDigiCalibConstNo()

int EmcCalibConstSvc::getDigiCalibConstNo ( ) const

Definition at line 654 of file EmcCalibConstSvc.cxx.

654 {
655 int digiCalibConstNo = 0;
656 MsgStream log( msgSvc(), name() );
657
658 std::string fullPath = "/Calib/EmcCal";
659 SmartDataPtr<CalibData::EmcCalibData> calConst( m_calDataSvc, fullPath );
660 if ( !calConst )
661 { log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr" << endmsg; }
662 else { digiCalibConstNo = calConst->getDigiCalibConstNo(); }
663
664 return digiCalibConstNo;
665}

◆ getIndex()

int EmcCalibConstSvc::getIndex ( unsigned int PartId,
unsigned int ThetaIndex,
unsigned int PhiIndex ) const

Definition at line 680 of file EmcCalibConstSvc.cxx.

681 {
682 return m_theEmcStruc->getGeomIndex( PartId, ThetaIndex, PhiIndex );
683}

◆ getIxtalNumber()

int EmcCalibConstSvc::getIxtalNumber ( int No) const

Definition at line 641 of file EmcCalibConstSvc.cxx.

641 {
642 int IxtalNumber = 999999;
643 MsgStream log( msgSvc(), name() );
644
645 std::string fullPath = "/Calib/EmcCal";
646 SmartDataPtr<CalibData::EmcCalibData> calConst( m_calDataSvc, fullPath );
647 if ( !calConst )
648 { log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr" << endmsg; }
649 else { IxtalNumber = calConst->getIxtalNumber( No ); }
650
651 return IxtalNumber;
652}

◆ getIxtalNumberNo()

int EmcCalibConstSvc::getIxtalNumberNo ( ) const

Definition at line 667 of file EmcCalibConstSvc.cxx.

667 {
668 int IxtalNumberNo = 0;
669 MsgStream log( msgSvc(), name() );
670
671 std::string fullPath = "/Calib/EmcCal";
672 SmartDataPtr<CalibData::EmcCalibData> calConst( m_calDataSvc, fullPath );
673 if ( !calConst )
674 { log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr" << endmsg; }
675 else { IxtalNumberNo = calConst->getIxtalNumberNo(); }
676
677 return IxtalNumberNo;
678}

◆ getPartID()

unsigned int EmcCalibConstSvc::getPartID ( int Index) const

Definition at line 685 of file EmcCalibConstSvc.cxx.

685 {
686 return m_theEmcStruc->getPartId( Index );
687}

◆ getPhiIndex()

unsigned int EmcCalibConstSvc::getPhiIndex ( int Index) const

Definition at line 693 of file EmcCalibConstSvc.cxx.

693 {
694 return m_theEmcStruc->getPhi( Index );
695}

◆ getThetaIndex()

unsigned int EmcCalibConstSvc::getThetaIndex ( int Index) const

Definition at line 689 of file EmcCalibConstSvc.cxx.

689 {
690 return m_theEmcStruc->getTheta( Index );
691}

◆ handle()

void EmcCalibConstSvc::handle ( const Incident & inc)

to read EMC saturation energy and the energy threshold of 'special' dead channel from DataBase///////

Definition at line 357 of file EmcCalibConstSvc.cxx.

357 {
358 MsgStream log( msgSvc(), name() );
359 log << MSG::DEBUG << "handle: " << inc.type() << endmsg;
360
361 if ( inc.type() == "NewRun" )
362 {
363 log << MSG::DEBUG << "NewRun" << endmsg;
364
365 SmartDataPtr<Event::EventHeader> eventHeader( m_eventSvc, "/Event/EventHeader" );
366 int run = eventHeader->runNumber();
367
368 log << MSG::DEBUG << "handle: "
369 << "Run in handle is: " << run << endmsg;
370
371 if ( m_readSatuDeadEnDb == true )
372 { //for MC and data
373
374 if ( run < 0 ) run = -run;
375
376 if ( run >= m_runFrom && run <= m_runTo ) { m_inFlag = true; }
377 else { m_inFlag = false; }
378 if ( m_inFlag == false )
379 {
380 bool getSatuDead;
381 getSatuDead = m_EmcSatuDeadEnSvc->getEmcSatuDeadEnSvcInfo();
382 if ( !getSatuDead ) { log << MSG::ERROR << "can not get EmcSatuDeadEnSvc" << endmsg; }
383 else
384 {
385 m_runFrom = m_EmcSatuDeadEnSvc->getRunFrom();
386 m_runTo = m_EmcSatuDeadEnSvc->getRunTo();
387 ////to read EMC saturation energy and the energy threshold of 'special' dead channel
388 /// from DataBase///////
389 cout << "current run=" << run << endl;
390 cout << "RunFrom=" << m_runFrom << ",RunTo=" << m_runTo << endl;
391 cout << "in EmcCalibConstSvc open getSatuEnFile()= "
392 << m_EmcSatuDeadEnSvc->getSatuEnFile() << endl;
393 cout << "open getDeadEnFile()= " << m_EmcSatuDeadEnSvc->getDeadEnFile() << endl;
394 string aEmcSatuEnFile;
395 string aEmcDeadEnFile;
396 aEmcSatuEnFile = m_EmcSatuDeadEnSvc->getSatuEnFile();
397 aEmcDeadEnFile = m_EmcSatuDeadEnSvc->getDeadEnFile();
398
399 ifstream inSatuEn;
400 inSatuEn.open( aEmcSatuEnFile.c_str() );
401
402 int ixtal;
403 if ( inSatuEn.is_open() )
404 {
405
406 assert( inSatuEn );
407 double emaxData;
408 while ( inSatuEn.peek() != EOF )
409 {
410 inSatuEn >> ixtal >> emaxData;
411 m_CrystalEmaxData[ixtal] = emaxData;
412 }
413 inSatuEn.close();
414 }
415 else
416 {
417 std::cout << "EmcCalibConstSvc ERROR::Could not open the file of "
418 << aEmcSatuEnFile << endl;
419 exit( 1 );
420 }
421
422 ifstream inDeadEn;
423 inDeadEn.open( aEmcDeadEnFile.c_str() );
424
425 if ( inDeadEn.is_open() )
426 {
427
428 assert( inDeadEn );
429 double satuEn, deadEn;
430 while ( inDeadEn.peek() != EOF )
431 {
432 inDeadEn >> ixtal >> satuEn >> deadEn;
433 // using the percent deadEn/satuEn, the deadEcut of the corresponding data are
434 // calulated by the emaxData*(deadEn/satuEn),i.e.
435 // m_CrystalDeadEcut[ixtal]*m_CrystalEmaxData[ixtal].
436 m_CrystalDeadEcut[ixtal] = deadEn / satuEn;
437 }
438 inDeadEn.close();
439 }
440 else
441 {
442
443 std::cout << "EmcCalibConstSvc ERROR::Could not open the file of "
444 << aEmcDeadEnFile << endl;
445 exit( 1 );
446 }
447 }
448 // Dump();
449 } // end of m_inFlag==false
450 } // end of m_readSatuDeadEnDb==ture
451
452 /////////////////////////////
453
454 if ( m_readSatuDeadEnDb == false )
455 { // for MC and data
456
457 // cout<<"&&&&&&&&&&&&&&:&&&&&&&&&&&&&&&&&&&& EmcCalibConstSvc handle,run="<<run<<endl;
458 if ( run < 0 ) run = -run;
459
460 log << MSG::DEBUG << "handle: "
461 << "Run in handle is: " << run << endmsg;
462 // run <63075: EmaxVersion=1; run>=63075: EmaxVersion=2;
463 cout << "handle: "
464 << "Run in handle is: " << run << endl;
465
466 if ( run < 63075 && !m_EmaxVersion1 )
467 {
469
470 m_EmaxVersion1 = true;
471 m_EmaxVersion2 = false;
472 m_EmaxVersion4740 = false;
473 m_EmaxVersion4750 = false;
474 m_EmaxVersion4780 = false;
475 m_EmaxVersion4840 = false;
476 m_EmaxVersion4914 = false;
477 m_EmaxVersion4946 = false;
478
479 cout << "handle: "
480 << "EmaxVersion="
481 << "111111111111111" << endl;
482 }
483
484 if ( run >= 63075 && run <= 65207 && !m_EmaxVersion2 )
485 { // 2020 topup data~4680
487
488 m_EmaxVersion1 = false;
489 m_EmaxVersion2 = true;
490 m_EmaxVersion4740 = false;
491 m_EmaxVersion4750 = false;
492 m_EmaxVersion4780 = false;
493 m_EmaxVersion4840 = false;
494 m_EmaxVersion4914 = false;
495 m_EmaxVersion4946 = false;
496 cout << "handle: "
497 << "EmaxVersion="
498 << "emax data from topup data 4680@2020" << endl;
499 }
500
501 if ( run >= 65208 && run <= 65321 && !m_EmaxVersion4740 )
502 { // 2021 data~4740
504
505 m_EmaxVersion1 = false;
506 m_EmaxVersion2 = false;
507 m_EmaxVersion4740 = true;
508 m_EmaxVersion4750 = false;
509 m_EmaxVersion4780 = false;
510 m_EmaxVersion4840 = false;
511 m_EmaxVersion4914 = false;
512 m_EmaxVersion4946 = false;
513
514 cout << "handle: "
515 << "EmaxVersion="
516 << "emax data from 4740data@2021" << endl;
517 }
518
519 if ( run >= 65322 && run <= 65494 && !m_EmaxVersion4750 )
520 { // 2021 data~4750
522
523 m_EmaxVersion1 = false;
524 m_EmaxVersion2 = false;
525 m_EmaxVersion4740 = false;
526 m_EmaxVersion4750 = true;
527 m_EmaxVersion4780 = false;
528 m_EmaxVersion4840 = false;
529 m_EmaxVersion4914 = false;
530 m_EmaxVersion4946 = false;
531
532 cout << "handle: "
533 << "EmaxVersion="
534 << "emax data from 4750data@2021" << endl;
535 }
536
537 if ( run >= 65495 && run <= 65646 && !m_EmaxVersion4780 )
538 { // 2021 data~4780
540
541 m_EmaxVersion1 = false;
542 m_EmaxVersion2 = false;
543 m_EmaxVersion4740 = false;
544 m_EmaxVersion4750 = false;
545 m_EmaxVersion4780 = true;
546 m_EmaxVersion4840 = false;
547 m_EmaxVersion4914 = false;
548 m_EmaxVersion4946 = false;
549
550 cout << "handle: "
551 << "EmaxVersion="
552 << "emax data from 4780data@2021" << endl;
553 }
554
555 if ( run >= 65647 && run <= 65866 && !m_EmaxVersion4840 )
556 { // 2021 data~4840
558
559 m_EmaxVersion1 = false;
560 m_EmaxVersion2 = false;
561 m_EmaxVersion4740 = false;
562 m_EmaxVersion4750 = false;
563 m_EmaxVersion4780 = false;
564 m_EmaxVersion4840 = true;
565 m_EmaxVersion4914 = false;
566 m_EmaxVersion4946 = false;
567
568 cout << "handle: "
569 << "EmaxVersion="
570 << "emax data from 4840data@2021" << endl;
571 }
572
573 if ( run >= 65867 && run <= 65937 && !m_EmaxVersion4914 )
574 { // 2021 data~4914
576
577 m_EmaxVersion1 = false;
578 m_EmaxVersion2 = false;
579 m_EmaxVersion4740 = false;
580 m_EmaxVersion4750 = false;
581 m_EmaxVersion4780 = false;
582 m_EmaxVersion4840 = false;
583 m_EmaxVersion4914 = true;
584 m_EmaxVersion4946 = false;
585
586 cout << "handle: "
587 << "EmaxVersion="
588 << "emax data from 4914data@2021" << endl;
589 }
590
591 if ( run >= 65938 && !m_EmaxVersion4946 )
592 { // 2021 data~4946
594
595 m_EmaxVersion1 = false;
596 m_EmaxVersion2 = false;
597 m_EmaxVersion4740 = false;
598 m_EmaxVersion4750 = false;
599 m_EmaxVersion4780 = false;
600 m_EmaxVersion4840 = false;
601 m_EmaxVersion4914 = false;
602 m_EmaxVersion4946 = true;
603
604 cout << "handle: "
605 << "EmaxVersion="
606 << "emax data from 4946data@2021" << endl;
607 }
608
610 {
613 cout << "handle: "
614 << "DeadEcutVersion="
615 << "2020" << endl;
616 }
617
618 // if(!getCrystalEmaxDataFileInfo()){
619 // log << MSG::ERROR << "can not find the crystal EmaxData file" << endmsg;
620 // }
621
622 // Dump();
623 } // end of m_readSatuDeadEnDb==false
624
625 } // end of NewRun
626}
void setCrystalDeadEcut(double CrystalDeadEcut[6240])
void setCrystalEmaxData(double CrystalEmaxData[6240])

◆ initialize()

StatusCode EmcCalibConstSvc::initialize ( )
virtual

Definition at line 299 of file EmcCalibConstSvc.cxx.

299 {
300 MsgStream log( msgSvc(), name() );
301 log << MSG::INFO << "EmcCalibConstSvc::initialize()" << endmsg;
302
303 StatusCode sc = Service::initialize();
304 if ( sc.isFailure() ) return sc;
305
306 IIncidentSvc* incsvc;
307 sc = service( "IncidentSvc", incsvc );
308 int priority = 100;
309 if ( sc.isSuccess() ) { incsvc->addListener( this, "NewRun", priority ); }
310
311 sc = serviceLocator()->service( "EventDataSvc", m_eventSvc, true );
312 if ( sc.isFailure() )
313 {
314 log << MSG::ERROR << "Unable to find EventDataSvc " << endmsg;
315 return sc;
316 }
317
318 sc = service( "CalibDataSvc", m_calDataSvc, true );
319 if ( sc == StatusCode::SUCCESS )
320 { log << MSG::INFO << "Retrieve IDataProviderSvc" << endmsg; }
321 else { log << MSG::FATAL << "can not get IDataProviderSvc" << endmsg; }
322
323 // sc = service("EmcRecGeoSvc", m_emcGeomSvc);
324 // if( sc != StatusCode::SUCCESS ){
325 // log << MSG::ERROR << "can not use EmcRecGeoSvc" << endmsg;
326 // }
327
328 m_theEmcStruc = new EmcStructure();
329 m_theEmcStruc->setEmcStruc();
330
331 /////////////////
332 ISvcLocator* svcLocator = Gaudi::svcLocator();
333 sc = svcLocator->service( "EmcSatuDeadEnSvc", m_EmcSatuDeadEnSvc );
334
335 // sc = serviceLocator()->service("EmcSatuDeadEnSvc", m_EmcSatuDeadEnSvc,true);
336 if ( sc == StatusCode::SUCCESS )
337 {
338 // log << MSG::INFO
339 std::cout << "Retrieve EmcSatuDeadEnSvc" << endl;
340 }
341 else { log << MSG::FATAL << "can not get EmcSatuDeadEnSvc" << endmsg; }
342
343 // Dump();
344 // cout<<"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& EmcCalibConstSvc initialize"<<endl;
345 return StatusCode::SUCCESS;
346}

◆ setCrystalDeadEcut()

void EmcCalibConstSvc::setCrystalDeadEcut ( double CrystalDeadEcut[6240])
inline

Definition at line 54 of file EmcCalibConstSvc.h.

54 {
55 for ( int i = 0; i < 6240; i++ ) { m_CrystalDeadEcut[i] = CrystalDeadEcut[i]; }
56 };

Referenced by handle().

◆ setCrystalEmaxData()

void EmcCalibConstSvc::setCrystalEmaxData ( double CrystalEmaxData[6240])
inline

Definition at line 48 of file EmcCalibConstSvc.h.

48 {
49 for ( int i = 0; i < 6240; i++ ) { m_CrystalEmaxData[i] = CrystalEmaxData[i]; }
50 };

Referenced by handle().

Member Data Documentation

◆ m_calDataSvc

IDataProviderSvc* EmcCalibConstSvc::m_calDataSvc

◆ m_CrystalDeadEcut

double EmcCalibConstSvc::m_CrystalDeadEcut[6240]

◆ m_CrystalDeadEcut_2020

double EmcCalibConstSvc::m_CrystalDeadEcut_2020[6240]

Definition at line 83 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData

double EmcCalibConstSvc::m_CrystalEmaxData[6240]

◆ m_CrystalEmaxData_1

double EmcCalibConstSvc::m_CrystalEmaxData_1[6240]

Definition at line 64 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData_2

double EmcCalibConstSvc::m_CrystalEmaxData_2[6240]

Definition at line 65 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData_4740

double EmcCalibConstSvc::m_CrystalEmaxData_4740[6240]

Definition at line 66 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData_4750

double EmcCalibConstSvc::m_CrystalEmaxData_4750[6240]

Definition at line 67 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData_4780

double EmcCalibConstSvc::m_CrystalEmaxData_4780[6240]

Definition at line 68 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData_4840

double EmcCalibConstSvc::m_CrystalEmaxData_4840[6240]

Definition at line 69 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData_4914

double EmcCalibConstSvc::m_CrystalEmaxData_4914[6240]

Definition at line 70 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_CrystalEmaxData_4946

double EmcCalibConstSvc::m_CrystalEmaxData_4946[6240]

Definition at line 71 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_DeadEcutVersion2020

bool EmcCalibConstSvc::m_DeadEcutVersion2020

Definition at line 85 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion1

bool EmcCalibConstSvc::m_EmaxVersion1

Definition at line 73 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion2

bool EmcCalibConstSvc::m_EmaxVersion2

Definition at line 74 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion4740

bool EmcCalibConstSvc::m_EmaxVersion4740

Definition at line 75 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion4750

bool EmcCalibConstSvc::m_EmaxVersion4750

Definition at line 76 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion4780

bool EmcCalibConstSvc::m_EmaxVersion4780

Definition at line 77 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion4840

bool EmcCalibConstSvc::m_EmaxVersion4840

Definition at line 78 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion4914

bool EmcCalibConstSvc::m_EmaxVersion4914

Definition at line 79 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_EmaxVersion4946

bool EmcCalibConstSvc::m_EmaxVersion4946

Definition at line 80 of file EmcCalibConstSvc.h.

Referenced by EmcCalibConstSvc(), and handle().

◆ m_theEmcStruc

EmcStructure* EmcCalibConstSvc::m_theEmcStruc

Definition at line 61 of file EmcCalibConstSvc.h.

Referenced by finalize(), getIndex(), getPartID(), getPhiIndex(), getThetaIndex(), and initialize().


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