99{
100 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{
m_caloMgrKey};
102 const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
103
104
105 CaloCellContainer*
cnt =
nullptr;
106 CaloCellContainer* cnt_1 = nullptr;
107 CaloCellContainer* cnt_2 = nullptr;
108 CaloCellContainer* cnt_3 = nullptr;
111 if(
m_store_Em) cnt_2 =
new CaloCellContainer();
113
114
121
122
129
130 ATH_MSG_DEBUG(
"CaloCalibrationHitContainers retrieved successfuly" );
131
132
134 int em_nchan=0;
135 int hec_nchan=0;
136 int fcal_nchan=0;
137 int lar_unknown_nchan=0;
138 int tile_nchan=0;
139 int tile_unknown_nchan = 0 ;
140
141 bool new_id = false;
142
143 std::vector<Identifier>
ID;
144
145
146
151
152
153 if(lar_inactHitCnt)
154 {
155 if( lar_inactHitCnt->
Size() != 0 )
156 {
157 for (const CaloCalibrationHit* hit : *lar_inactHitCnt)
158 {
159 double Etot = hit->energyTotal();
160 double Eem = hit->energy(0);
161 double Enonem = hit->energy(1);
162 double Evis = Eem + Enonem;
163
164 Identifier id=hit->cellID();
165
166
168 {
169 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
170
174 }
175
179 }
180
184 }
185
189 }
190
193 }
194
195 else
196 {
198 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
200 {
201 ATH_MSG_DEBUG(
"Ianctive CalibHit doesn't respect to any LArCell - "
202 <<"create dummy LArCell to store energy " );
203
205 LArCell* calibCell = new LArCell();
208 }
209
211 LArCell* calibCell_1 = new LArCell();
214 }
215
217 LArCell* calibCell_2 = new LArCell();
220 }
221
223 LArCell* calibCell_3 = new LArCell();
226 }
227
230 }
231 }
232 }
233 }
234 }
235
236
237 if(lar_actHitCnt)
238 {
239 if( lar_actHitCnt->
Size() != 0 )
240 {
241
242 int hits_vec_size = (
int)
ID.size() ;
243
244 for (const CaloCalibrationHit* hit : *lar_actHitCnt)
245 {
246 Identifier id=hit->cellID();
247
248
249
250 for (
int n=0;
n!=hits_vec_size;
n++)
251 {
253 {
258
259 new_id = false;
260 break;
261 }
262 else
263 {
264 new_id = true;
265 }
266 }
267 if(new_id)
268 {
269 double Etot = hit->energyTotal();
270 double Eem = hit->energy(0);
271 double Enonem = hit->energy(1);
272 double Evis = Eem + Enonem;
273
275 {
276 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
277
281 }
282
286 }
287
291 }
292
296 }
297
300 }
301
302 else
303 {
305 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
307 {
308 ATH_MSG_DEBUG(
"Active CalibHit doesn't respect to any LArCell - "
309 <<"create dummy LArCell to store energy " );
310
311
313 LArCell* calibCell = new LArCell();
316 }
317
319 LArCell* calibCell_1 = new LArCell();
322 }
323
325 LArCell* calibCell_2 = new LArCell();
328 }
329
331 LArCell* calibCell_3 = new LArCell();
334 }
335
338 }
339 }
340 }
341 }
342 }
343 }
344
345
346
348 {
349 for(
int itr=0; itr!=
m_nchan; itr++)
350 {
352 {
357
358 ++em_nchan;
359 }
360 }
361 if(em_nchan!=0)
362 {
367 }
368
369 for(
int itr=0; itr!=
m_nchan; itr++)
370 {
372 {
377
378 ++hec_nchan;
379 }
380 }
381 if(hec_nchan!=0)
382 {
387 }
388
389 for(
int itr=0; itr!=
m_nchan; itr++)
390 {
392 {
397
398 ++fcal_nchan;
399 }
400 }
401 if(fcal_nchan!=0)
402 {
407 }
408
409
411 {
412 for(
int itr=0; itr!=
m_nchan; itr++)
413 {
415 {
420
421 ++lar_unknown_nchan;
422 }
423 }
424
425 if(lar_unknown_nchan!=0)
426 {
431 }
432 }
433 }
434
441
442
443 if(tile_actHitCnt)
444 {
445 if( (tile_actHitCnt->
Size()) != 0 )
446 {
447 for (const CaloCalibrationHit* hit : *tile_actHitCnt)
448 {
449 Identifier id=hit->cellID();
450
451 double Etot = hit->energyTotal();
452 double Eem = hit->energy(0);
453 double Enonem = hit->energy(1);
454 double Evis = Eem + Enonem;
455
457 {
458 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
459
462 cnt->push_back(calibCell);
463 }
464
468 }
469
473 }
474
476 TileCell* calibCell_3 =
new TileCell(caloDDE,
id, Enonem, 0., 0, 0,
CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
478 }
479
481 ++tile_nchan;
483 }
484 else
485 {
487 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
489 {
490 ATH_MSG_DEBUG(
"Active CalibHit doesn't respect to any TileCell - "
491 <<"create dummy TileCell to store energy " );
492
494 TileCell* calibCell = new TileCell();
496 cnt->push_back(calibCell);
497 }
498
500 TileCell* calibCell_1 = new TileCell();
503 }
504
506 TileCell* calibCell_2 = new TileCell();
509 }
510
512 TileCell* calibCell_3 = new TileCell();
515 }
516
518 ++tile_unknown_nchan;
520 }
521 }
522 }
523
524 if(tile_nchan!=0)
525 {
530 }
531
532 if(tile_unknown_nchan!=0)
533 {
535 {
540 }
541 }
542 }
543 }
544
545
546 if(tile_inactHitCnt)
547 {
548 if( (tile_inactHitCnt->
Size()) != 0 )
549 {
550
551 for (const CaloCalibrationHit* hit : *tile_actHitCnt)
552 {
553 Identifier id=hit->cellID();
554
555 double Etot = hit->energyTotal();
556 double Eem = hit->energy(0);
557 double Enonem = hit->energy(1);
558 double Evis = Eem + Enonem;
559
561 {
562 const CaloDetDescrElement* caloDDE = caloDDMgr->
get_element(
id);
563
566 cnt->push_back(calibCell);
567 }
568
572 }
573
577 }
578
580 TileCell* calibCell_3 =
new TileCell(caloDDE,
id, Enonem, 0., 0, 0,
CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
582 }
583
585 ++tile_nchan;
587 }
588 else
589 {
591 <<
id.getString() <<
" sub_calo " <<
m_caloCell_ID->sub_calo(
id) );
593 {
594 ATH_MSG_DEBUG(
"Inactive CalibHit doesn't respect to any TileCell - "
595 <<"create dummy TileCell to store energy " );
596
598 TileCell* calibCell = new TileCell();
600 cnt->push_back(calibCell);
601 }
602
604 TileCell* calibCell_1 = new TileCell();
607 }
608
610 TileCell* calibCell_2 = new TileCell();
613 }
614
616 TileCell* calibCell_3 = new TileCell();
619 }
620
622 ++tile_unknown_nchan;
624 }
625 }
626 }
627
628 if(tile_nchan!=0)
629 {
634 }
635
636 if(tile_unknown_nchan!=0)
637 {
639 {
644 }
645 }
646 }
647 }
648
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
673
674
675
676
677
678
679
684
686
688 return StatusCode::SUCCESS;
689}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
std::vector< Identifier > ID
CaloCalibrationHitContainer
ServiceHandle< StoreGateSvc > & evtStore()
const CaloCell_ID * m_caloCell_ID
std::vector< LArCell * > m_Cells_Vis
std::vector< LArCell * > m_Cells_Tot
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
std::vector< LArCell * > m_Cells_NonEm
std::vector< LArCell * > m_Cells_Em
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)
retrieve(aClass, aKey=None)