ATLAS Offline Software
Loading...
Searching...
No Matches
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{
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ process()

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

Definition at line 38 of file TBCellContainerFillerTool.cxx.

40{
41 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx};
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}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
bool is_lar_hec() const
cell belongs to HEC
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18
str index
Definition DeMoScan.py:362
::StatusCode StatusCode
StatusCode definition for legacy code.

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.

33 { this
34 , "CaloDetDescrManager"
35 , "CaloDetDescrManager"
36 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_hashMax

unsigned int TBCellContainerFillerTool::m_hashMax {0}
private

Definition at line 40 of file TBCellContainerFillerTool.h.

40{0};

◆ m_onlineHelper

const LArOnlineID* TBCellContainerFillerTool::m_onlineHelper {nullptr}
private

Definition at line 39 of file TBCellContainerFillerTool.h.

39{nullptr};

◆ m_theCaloCCIDM

const CaloCell_ID* TBCellContainerFillerTool::m_theCaloCCIDM {nullptr}
private

Definition at line 38 of file TBCellContainerFillerTool.h.

38{nullptr};

The documentation for this class was generated from the following files: