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

#include <CaloCellContainerFinalizerTool.h>

Inheritance diagram for CaloCellContainerFinalizerTool:
Collaboration diagram for CaloCellContainerFinalizerTool:

Public Member Functions

 CaloCellContainerFinalizerTool (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
 
virtual StatusCode process (CaloConstCellContainer *theCellContainer, const EventContext &ctx) const override
 

Private Member Functions

template<class CONTAINER >
StatusCode doProcess (CONTAINER *theCellContainer) const
 

Private Attributes

const CaloCell_IDm_theCaloCCIDM
 

Detailed Description

Definition at line 18 of file CaloCellContainerFinalizerTool.h.

Constructor & Destructor Documentation

◆ CaloCellContainerFinalizerTool()

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

Definition at line 36 of file CaloCellContainerFinalizerTool.cxx.

40  :base_class (type, name, parent),
41  m_theCaloCCIDM (nullptr)
42 {
43 }

Member Function Documentation

◆ doProcess()

template<class CONTAINER >
StatusCode CaloCellContainerFinalizerTool::doProcess ( CONTAINER *  theCellContainer) const
private

Definition at line 66 of file CaloCellContainerFinalizerTool.cxx.

67 {
68 
69  const unsigned int hashMax=m_theCaloCCIDM->calo_cell_hash_max();
70  if (theCont->size()<hashMax) {
71  ATH_MSG_DEBUG("CaloCellContainer size " << theCont->size() << " smaller than hashMax: " << hashMax);
72  }
73  else if (theCont->size()==hashMax) {
74  ATH_MSG_DEBUG("CaloCellContainer size " << theCont->size() << " correspond to hashMax : " << hashMax);
75  theCont->setHasTotalSize(true);
76  }
77  else {
78  msg(MSG::WARNING) << "CaloCellContainer size " << theCont->size()
79  << " larger than hashMax ! Too many cells ! " << hashMax << endmsg ;
80 
81  }
82 
83 
84  // check whether in order
85  if (theCont->checkOrdered()){
86  ATH_MSG_DEBUG("CaloCellContainer ordered");
87  theCont->setIsOrdered(true);
88  } else {
89  ATH_MSG_DEBUG("CaloCellContainer not ordered");
90  theCont->setIsOrdered(false);
91  }
92 
93  /*
94  CaloCellContainer::const_iterator itrCell=theCont->begin();
95  unsigned int index=0;
96 
97  for (; itrCell!=theCont->end();++itrCell){
98  const CaloDetDescrElement * theDDE=(*itrCell)->caloDDE();
99  std::cout << " index " << index << " hash " << theDDE->calo_hash() << std::endl;
100 
101  ++index ;
102  }
103  */
104 
105 
106  // check whether in order and complete
107  if (theCont->checkOrderedAndComplete()){
108  ATH_MSG_DEBUG("CaloCellContainer ordered and complete");
109  theCont->setIsOrderedAndComplete(true);
110  } else {
111  ATH_MSG_DEBUG("CaloCellContainer not ordered or incomplete");
112  theCont->setIsOrderedAndComplete(false);
113  }
114 
115  if (!theCont->isOrdered()) {
116  ATH_MSG_DEBUG("Now ordering CaloCellContainer");
117  theCont->order();
118 
119  //FIXME check again whether in order
120  ATH_MSG_DEBUG("Now check CaloCellContainer ordered");
121  if (theCont->checkOrdered()){
122  ATH_MSG_DEBUG( "CaloCellContainer ordered");
123  theCont->setIsOrdered(true);
124  } else {
125  ATH_MSG_DEBUG( "CaloCellContainer not ordered");
126  theCont->setIsOrdered(false);
127  }
128 
129 
130  // check whether in order and complete
131  if (theCont->checkOrderedAndComplete()){
132  ATH_MSG_DEBUG( " CaloCellContainer ordered and complete");
133  theCont->setIsOrderedAndComplete(true);
134  } else {
135  ATH_MSG_DEBUG("CaloCellContainer not ordered or incomplete");
136  theCont->setIsOrderedAndComplete(false);
137  }
138  }
139 
140  theCont->updateCaloIterators();
141 
142  return StatusCode::SUCCESS;
143 }

◆ initialize()

StatusCode CaloCellContainerFinalizerTool::initialize ( )
overridevirtual

Definition at line 58 of file CaloCellContainerFinalizerTool.cxx.

59 {
60 
61  ATH_CHECK(detStore()->retrieve(m_theCaloCCIDM,"CaloCell_ID"));
62  return StatusCode::SUCCESS;
63 }

◆ process() [1/2]

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

Definition at line 147 of file CaloCellContainerFinalizerTool.cxx.

149 {
150  CHECK( doProcess (theCont) );
151  return StatusCode::SUCCESS;
152 }

◆ process() [2/2]

StatusCode CaloCellContainerFinalizerTool::process ( CaloConstCellContainer theCellContainer,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 156 of file CaloCellContainerFinalizerTool.cxx.

158 {
159  // Container will automatically be locked when recorded.
160  return doProcess (theCont);
161 }

Member Data Documentation

◆ m_theCaloCCIDM

const CaloCell_ID* CaloCellContainerFinalizerTool::m_theCaloCCIDM
private

Definition at line 39 of file CaloCellContainerFinalizerTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CaloCellContainerFinalizerTool::m_theCaloCCIDM
const CaloCell_ID * m_theCaloCCIDM
Definition: CaloCellContainerFinalizerTool.h:39
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCellContainerFinalizerTool::doProcess
StatusCode doProcess(CONTAINER *theCellContainer) const
Definition: CaloCellContainerFinalizerTool.cxx:66
python.KeyStore.msg
msg
Definition: KeyStore.py:26
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size