ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TBCellContainerFillerTool Class Reference

#include <TBCellContainerFillerTool.h>

Inheritance diagram for TBCellContainerFillerTool:
Collaboration diagram for TBCellContainerFillerTool:

Public Member Functions

 TBCellContainerFillerTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override
 

Private Attributes

SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
 
const CaloCell_IDm_theCaloCCIDM {nullptr}
 
const LArOnlineIDm_onlineHelper {nullptr}
 
unsigned int m_hashMax {0}
 

Detailed Description

Definition at line 18 of file TBCellContainerFillerTool.h.

Constructor & Destructor Documentation

◆ TBCellContainerFillerTool()

TBCellContainerFillerTool::TBCellContainerFillerTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 13 of file TBCellContainerFillerTool.cxx.

17  :base_class (type, name, parent)
18 {
19 }

Member Function Documentation

◆ initialize()

StatusCode TBCellContainerFillerTool::initialize ( )
overridevirtual

Definition at line 24 of file TBCellContainerFillerTool.cxx.

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 }

◆ process()

StatusCode TBCellContainerFillerTool::process ( CaloCellContainer theCellContainer,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 38 of file TBCellContainerFillerTool.cxx.

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 }

Member Data Documentation

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> TBCellContainerFillerTool::m_caloMgrKey
private
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 33 of file TBCellContainerFillerTool.h.

◆ m_hashMax

unsigned int TBCellContainerFillerTool::m_hashMax {0}
private

Definition at line 40 of file TBCellContainerFillerTool.h.

◆ m_onlineHelper

const LArOnlineID* TBCellContainerFillerTool::m_onlineHelper {nullptr}
private

Definition at line 39 of file TBCellContainerFillerTool.h.

◆ m_theCaloCCIDM

const CaloCell_ID* TBCellContainerFillerTool::m_theCaloCCIDM {nullptr}
private

Definition at line 38 of file TBCellContainerFillerTool.h.


The documentation for this class was generated from the following files:
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
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
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
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
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
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,...
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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
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