71{
72 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{
m_caloMgrKey};
74 const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
75
76
77 CaloCellContainer*
cnt =
nullptr;
78 CaloCellContainer* cnt_1 = nullptr;
79 CaloCellContainer* cnt_2 = nullptr;
80 CaloCellContainer* cnt_3 = nullptr;
83 if(
m_store_Em) cnt_2 =
new CaloCellContainer();
85
86
93
94
101
102 ATH_MSG_DEBUG(
"CaloCalibrationHitContainers retrieved successfuly" );
103
104
106 int em_nchan=0;
107 int hec_nchan=0;
108 int fcal_nchan=0;
109 int lar_unknown_nchan=0;
110 int tile_nchan=0;
111 int tile_unknown_nchan = 0 ;
112
113 bool new_id = false;
114
115 std::vector<Identifier>
ID;
116
117
118
123
124
125 if(lar_inactHitCnt)
126 {
127 if( lar_inactHitCnt->
Size() != 0 )
128 {
129 for (
const CaloCalibrationHit*
hit : *lar_inactHitCnt)
130 {
131 double Etot =
hit->energyTotal();
132 double Eem =
hit->energy(0);
133 double Enonem =
hit->energy(1);
134 double Evis = Eem + Enonem;
135
136 Identifier
id=
hit->cellID();
137
138
140 {
141 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
142
146 }
147
151 }
152
156 }
157
161 }
162
165 }
166
167 else
168 {
170 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
172 {
173 ATH_MSG_DEBUG(
"Ianctive CalibHit doesn't respect to any LArCell - "
174 <<"create dummy LArCell to store energy " );
175
177 LArCell* calibCell = new LArCell();
180 }
181
183 LArCell* calibCell_1 = new LArCell();
186 }
187
189 LArCell* calibCell_2 = new LArCell();
192 }
193
195 LArCell* calibCell_3 = new LArCell();
198 }
199
202 }
203 }
204 }
205 }
206 }
207
208
209 if(lar_actHitCnt)
210 {
211 if( lar_actHitCnt->
Size() != 0 )
212 {
213
214 int hits_vec_size = (
int)
ID.size() ;
215
216 for (
const CaloCalibrationHit*
hit : *lar_actHitCnt)
217 {
218 Identifier
id=
hit->cellID();
219
220
221
222 for (
int n=0;
n!=hits_vec_size;
n++)
223 {
224 if( id == ID[n] )
225 {
230
231 new_id = false;
232 break;
233 }
234 else
235 {
236 new_id = true;
237 }
238 }
239 if(new_id)
240 {
241 double Etot =
hit->energyTotal();
242 double Eem =
hit->energy(0);
243 double Enonem =
hit->energy(1);
244 double Evis = Eem + Enonem;
245
247 {
248 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
249
253 }
254
258 }
259
263 }
264
268 }
269
272 }
273
274 else
275 {
277 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
279 {
280 ATH_MSG_DEBUG(
"Active CalibHit doesn't respect to any LArCell - "
281 <<"create dummy LArCell to store energy " );
282
283
285 LArCell* calibCell = new LArCell();
288 }
289
291 LArCell* calibCell_1 = new LArCell();
294 }
295
297 LArCell* calibCell_2 = new LArCell();
300 }
301
303 LArCell* calibCell_3 = new LArCell();
306 }
307
310 }
311 }
312 }
313 }
314 }
315 }
316
317
318
320 {
321 for(
int itr=0; itr!=
m_nchan; itr++)
322 {
324 {
329
330 ++em_nchan;
331 }
332 }
333 if(em_nchan!=0)
334 {
339 }
340
341 for(
int itr=0; itr!=
m_nchan; itr++)
342 {
344 {
349
350 ++hec_nchan;
351 }
352 }
353 if(hec_nchan!=0)
354 {
359 }
360
361 for(
int itr=0; itr!=
m_nchan; itr++)
362 {
364 {
369
370 ++fcal_nchan;
371 }
372 }
373 if(fcal_nchan!=0)
374 {
379 }
380
381
383 {
384 for(
int itr=0; itr!=
m_nchan; itr++)
385 {
387 {
392
393 ++lar_unknown_nchan;
394 }
395 }
396
397 if(lar_unknown_nchan!=0)
398 {
403 }
404 }
405 }
406
413
414
415 if(tile_actHitCnt)
416 {
417 if( (tile_actHitCnt->
Size()) != 0 )
418 {
419 for (
const CaloCalibrationHit*
hit : *tile_actHitCnt)
420 {
421 Identifier
id=
hit->cellID();
422
423 double Etot =
hit->energyTotal();
424 double Eem =
hit->energy(0);
425 double Enonem =
hit->energy(1);
426 double Evis = Eem + Enonem;
427
429 {
430 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
431
434 cnt->push_back(calibCell);
435 }
436
440 }
441
445 }
446
448 TileCell* calibCell_3 =
new TileCell(caloDDE,
id, Enonem, 0., 0, 0,
CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
450 }
451
453 ++tile_nchan;
455 }
456 else
457 {
459 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
461 {
462 ATH_MSG_DEBUG(
"Active CalibHit doesn't respect to any TileCell - "
463 <<"create dummy TileCell to store energy " );
464
466 TileCell* calibCell = new TileCell();
468 cnt->push_back(calibCell);
469 }
470
472 TileCell* calibCell_1 = new TileCell();
475 }
476
478 TileCell* calibCell_2 = new TileCell();
481 }
482
484 TileCell* calibCell_3 = new TileCell();
487 }
488
490 ++tile_unknown_nchan;
492 }
493 }
494 }
495
496 if(tile_nchan!=0)
497 {
502 }
503
504 if(tile_unknown_nchan!=0)
505 {
507 {
512 }
513 }
514 }
515 }
516
517
518 if(tile_inactHitCnt)
519 {
520 if( (tile_inactHitCnt->
Size()) != 0 )
521 {
522
523 for (
const CaloCalibrationHit*
hit : *tile_actHitCnt)
524 {
525 Identifier
id=
hit->cellID();
526
527 double Etot =
hit->energyTotal();
528 double Eem =
hit->energy(0);
529 double Enonem =
hit->energy(1);
530 double Evis = Eem + Enonem;
531
533 {
534 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
535
538 cnt->push_back(calibCell);
539 }
540
544 }
545
549 }
550
552 TileCell* calibCell_3 =
new TileCell(caloDDE,
id, Enonem, 0., 0, 0,
CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
554 }
555
557 ++tile_nchan;
559 }
560 else
561 {
563 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
565 {
566 ATH_MSG_DEBUG(
"Inactive CalibHit doesn't respect to any TileCell - "
567 <<"create dummy TileCell to store energy " );
568
570 TileCell* calibCell = new TileCell();
572 cnt->push_back(calibCell);
573 }
574
576 TileCell* calibCell_1 = new TileCell();
579 }
580
582 TileCell* calibCell_2 = new TileCell();
585 }
586
588 TileCell* calibCell_3 = new TileCell();
591 }
592
594 ++tile_unknown_nchan;
596 }
597 }
598 }
599
600 if(tile_nchan!=0)
601 {
606 }
607
608 if(tile_unknown_nchan!=0)
609 {
611 {
616 }
617 }
618 }
619 }
620
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
645
646
647
648
649
650
651
656
658
660 return StatusCode::SUCCESS;
661}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
CaloCalibrationHitContainer
ServiceHandle< StoreGateSvc > & evtStore()
std::string m_larActHitCnt
const CaloCell_ID * m_caloCell_ID
std::vector< LArCell * > m_Cells_Vis
std::vector< LArCell * > m_Cells_Tot
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Gaudi::Property< std::string > m_caloCell_Vis
Gaudi::Property< std::string > m_caloCell_NonEm
std::string m_tileActiveHitCnt
std::string m_tileInactiveHitCnt
std::string m_larInactHitCnt
std::vector< LArCell * > m_Cells_NonEm
std::string m_larDMHitCnt
std::vector< LArCell * > m_Cells_Em
Gaudi::Property< std::string > m_caloCell_Tot
std::string m_tileDMHitCnt
Gaudi::Property< std::string > m_caloCell_Em
Gaudi::Property< bool > m_storeUnknown
void push_back(CaloCell *)
reimplementation of const push_back
void setHasCalo(const CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
virtual void setEnergy(float energy)
set energy
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero (final override of CaloCell method)
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...