38{
39 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{
m_caloMgrKey,ctx};
42 std::abort();
43 }
44 const CaloDetDescrManager* caloDDM = *caloMgrHandle;
45
46 ATH_MSG_DEBUG(
"Executing start calo size=" <<theCellContainer->
size()<<
" Event="<<ctx.evt());
47 bool check_exist=false;
48 if(theCellContainer->
size()>0) {
49 check_exist=true;
50 ATH_MSG_DEBUG(
" CaloCells do already exist: check required when creating!");
51 }
52
53 int ncreate=0;
54 int nfound=0;
55 double E_tot=0;
56 double Et_tot=0;
57
58 DataPool<TileCell> CellsPTile(10000);
59 DataPool<CaloCell> CellsPCalo(190000);
60 ATH_MSG_DEBUG(
"before: CellsPTile.capacity()="<<CellsPTile.capacity()<<
" CellsPTile.allocated()="<<CellsPTile.allocated());
61 ATH_MSG_DEBUG(
"before: CellsPCalo.capacity()="<<CellsPCalo.capacity()<<
" CellsPCalo.allocated()="<<CellsPCalo.allocated());
62
63 for (
const CaloDetDescrElement* theDDE : caloDDM->
element_range()) {
64 if (theDDE) {
65 CaloCell* theCaloCell=0;
66
67 if (check_exist) { theCaloCell = (CaloCell*)(theCellContainer->
findCell(theDDE->calo_hash())); }
68
69 if (theCaloCell) {
71 E_tot += theCaloCell->
energy();
72 Et_tot += theCaloCell->
energy() / cosh(theCaloCell->
eta());
73 ++nfound;
74 } else {
77 theCaloCell = CellsPTile.nextElementPtr();
78 } else {
79 theCaloCell = CellsPCalo.nextElementPtr();
80 }
81
87
89 ++ncreate;
90 }
91 }
92 }
93
94 ATH_MSG_DEBUG(ncreate<<
" cells created, "<<nfound<<
" cells already found: size="<<theCellContainer->
size()<<
" e="<<E_tot<<
" ; et="<<Et_tot<<
". Now initialize and order calo...");
95
96
99 if (theCellContainer->
size() < hashMax) {
100 ATH_MSG_DEBUG(
"CaloCellContainer size " << theCellContainer->
size() <<
" smaller than hashMax: " << hashMax);
101 }
102 else if (theCellContainer->
size() == hashMax) {
103 ATH_MSG_DEBUG(
"CaloCellContainer size " << theCellContainer->
size() <<
" correspond to hashMax : " << hashMax);
105 }
106 else {
108 << " larger than hashMax ! Too many cells ! " << hashMax);
109
110 }
111
112
117 } else {
118 ATH_MSG_DEBUG(
"CaloCellContainer not ordered or incomplete");
120
124 } else {
127 }
128 }
129
131
132 ATH_MSG_DEBUG(
"before: CellsPTile.capacity()="<<CellsPTile.capacity()<<
" CellsPTile.allocated()="<<CellsPTile.allocated());
133 ATH_MSG_DEBUG(
"before: CellsPCalo.capacity()="<<CellsPCalo.capacity()<<
" CellsPCalo.allocated()="<<CellsPCalo.allocated());
134}
#define ATH_MSG_WARNING(x)
bool checkOrdered() const
verify one by one the container is ordered
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
void push_back(CaloCell *)
reimplementation of const push_back
void order()
order container
void setHasTotalSize(const bool)
If @ flag is true, then the container size equals the maximum hash.
bool isOrdered() const
tell wether container is ordered
bool checkOrderedAndComplete() const
verify one by one the container is complete (i.e.
void setIsOrderedAndComplete(const bool ordered)
indicate that the container is complete and in order
void setIsOrdered(const bool ordered)
indicates that the container is ordered
size_type calo_cell_hash_max() const
cell 'global' hash table max size
CaloCell_Base_ID::SUBCALO SUBCALO
virtual void setTime(float time)
set time
double energy() const
get energy (data member)
void setCaloDDE(const CaloDetDescrElement *caloDDE)
set pointer to CaloDetDescrElement
virtual double eta() const override final
get eta (through CaloDetDescrElement)
void setGain(CaloGain::CaloGain gain=CaloGain::INVALIDGAIN)
set gain
virtual void setEnergy(float energy)
set energy
void setQuality(uint16_t quality)
set quality
calo_element_range element_range() const
Range over element vector.
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
size_type size() const noexcept
Returns the number of elements in the collection.