ATLAS Offline Software
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 {
27  // Cache pointers:
28  ATH_CHECK(detStore()->retrieve(m_theCaloCCIDM, "CaloCell_ID"));
29 
31 
32  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
33 
34  return StatusCode::SUCCESS;
35 }
36 
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);
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 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TBCellContainerFillerTool::m_hashMax
unsigned int m_hashMax
Definition: TBCellContainerFillerTool.h:40
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
TBCellContainerFillerTool::m_theCaloCCIDM
const CaloCell_ID * m_theCaloCCIDM
Definition: TBCellContainerFillerTool.h:38
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
index
Definition: index.py:1
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
TBCellContainerFillerTool::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: TBCellContainerFillerTool.h:33
TBCellContainerFillerTool::TBCellContainerFillerTool
TBCellContainerFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TBCellContainerFillerTool.cxx:13
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
TBCellContainerFillerTool::initialize
virtual StatusCode initialize() override
Definition: TBCellContainerFillerTool.cxx:24
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
HWIdentifier
Definition: HWIdentifier.h:13
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCell_ID.h
TBCellContainerFillerTool::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: TBCellContainerFillerTool.h:39
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition: LArOnlineID_Base.cxx:1565
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCellContainer::findCell
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Definition: CaloCellContainer.cxx:345
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloCellContainer::order
void order()
order container
Definition: CaloCellContainer.cxx:474
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
DeMoScan.index
string index
Definition: DeMoScan.py:364
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCellContainer::push_back
void push_back(CaloCell *)
reimplementation of const push_back
Definition: CaloCellContainer.cxx:74
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TBCellContainerFillerTool::process
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
Definition: TBCellContainerFillerTool.cxx:38
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloDetDescrElement::is_lar_hec
bool is_lar_hec() const
cell belongs to HEC
Definition: CaloDetDescrElement.cxx:130
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TBCellContainerFillerTool.h
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
LArOnlineID.h
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size
Identifier
Definition: IdentifierFieldParser.cxx:14