ATLAS Offline Software
Loading...
Searching...
No Matches
TBCellContainerFillerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6
11
12
14 const std::string& type,
15 const std::string& name,
16 const IInterface* parent)
17 :base_class (type, name, parent)
18{
19}
20
21
22
23
25{
26 ATH_CHECK(m_caloMgrKey.initialize());
27 // Cache pointers:
28 ATH_CHECK(detStore()->retrieve(m_theCaloCCIDM, "CaloCell_ID"));
29
30 m_hashMax = m_theCaloCCIDM->calo_cell_hash_max();
31
32 ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
33
34 return StatusCode::SUCCESS;
35}
36
37StatusCode
39 const EventContext& ctx) const
40{
42 ATH_CHECK(caloMgrHandle.isValid());
43 const CaloDetDescrManager* caloMgr = *caloMgrHandle;
44
45 StatusCode returnSc = StatusCode::SUCCESS ;
46
47 unsigned int index = 0;
49 if (msgLvl(MSG::VERBOSE)) {
50 for (itrCell=theCont->begin();itrCell!=theCont->end();++itrCell){
51 const CaloDetDescrElement * theDDE=(*itrCell)->caloDDE();
52 ATH_MSG_VERBOSE ( index << " " << (*itrCell)
53 << " hash id " << theDDE->calo_hash()
54 << " eta " << theDDE->eta()
55 << " phi " << theDDE->phi()
56 << "e " << (*itrCell)->e() );
57 ++index;
58 }
59 }
60
61
62 // fill holes with 0 energy cells
63
64 ATH_MSG_DEBUG ( " Now check all cells give meaningfull answer " );
65 ATH_MSG_DEBUG ( " Size of original container: "<<theCont->size() );
66 for (unsigned int theHash=0;theHash<m_hashMax;++theHash){
67 const CaloCell * theCell = theCont->findCell(IdentifierHash(theHash)) ;
68 CaloCell *nCell;
69 if(!theCell) {
70 Identifier cellid = m_theCaloCCIDM->cell_id(theHash);
71 HWIdentifier chid = m_onlineHelper->channel_Id(m_theCaloCCIDM->calo_cell_hash(cellid));
72 if(!chid.get_identifier32().get_compact()) continue;
73 const CaloDetDescrElement* cDDE = caloMgr->get_element(cellid);
74 if(!cDDE) continue;
75 if(cDDE->is_lar_hec()) {
76 nCell = new CaloCell(cDDE,0.,0.,0.,CaloGain::LARMEDIUMGAIN);
77 }
78 else {
79 nCell = new CaloCell(cDDE,0.,0.,0.,CaloGain::LARHIGHGAIN);
80 }
81 ATH_MSG_VERBOSE ( "Adding 0. energy cell: " << m_theCaloCCIDM->cell_id(theHash));
82 theCont->push_back(nCell);
83 }
84 }
85
86 theCont->order();
87
88 return returnSc ;
89}
90
91
92
93
94
95
96
97
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Definition of CaloDetDescrManager.
Container class for CaloCell.
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
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class groups all DetDescr information related to a CaloCell.
bool is_lar_hec() const
cell belongs to HEC
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
This class provides the client interface for accessing the detector description information common to...
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
value_type get_compact() const
Get the compact id.
This is a "hash" representation of an Identifier.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
TBCellContainerFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
virtual StatusCode initialize() override
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18
Definition index.py:1