Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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

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 =nullptr
 

Detailed Description

Definition at line 18 of file CaloCellContainerFinalizerTool.h.

Member Function Documentation

◆ doProcess()

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

Definition at line 37 of file CaloCellContainerFinalizerTool.cxx.

38 {
39 
40  const unsigned int hashMax=m_theCaloCCIDM->calo_cell_hash_max();
41  if (theCont->size()<hashMax) {
42  ATH_MSG_DEBUG("CaloCellContainer size " << theCont->size() << " smaller than hashMax: " << hashMax);
43  }
44  else if (theCont->size()==hashMax) {
45  ATH_MSG_DEBUG("CaloCellContainer size " << theCont->size() << " correspond to hashMax : " << hashMax);
46  theCont->setHasTotalSize(true);
47  }
48  else {
49  msg(MSG::WARNING) << "CaloCellContainer size " << theCont->size()
50  << " larger than hashMax ! Too many cells ! " << hashMax << endmsg ;
51 
52  }
53 
54 
55  // check whether in order
56  if (theCont->checkOrdered()){
57  ATH_MSG_DEBUG("CaloCellContainer ordered");
58  theCont->setIsOrdered(true);
59  } else {
60  ATH_MSG_DEBUG("CaloCellContainer not ordered");
61  theCont->setIsOrdered(false);
62  }
63 
64  /*
65  CaloCellContainer::const_iterator itrCell=theCont->begin();
66  unsigned int index=0;
67 
68  for (; itrCell!=theCont->end();++itrCell){
69  const CaloDetDescrElement * theDDE=(*itrCell)->caloDDE();
70  std::cout << " index " << index << " hash " << theDDE->calo_hash() << std::endl;
71 
72  ++index ;
73  }
74  */
75 
76 
77  // check whether in order and complete
78  if (theCont->checkOrderedAndComplete()){
79  ATH_MSG_DEBUG("CaloCellContainer ordered and complete");
80  theCont->setIsOrderedAndComplete(true);
81  } else {
82  ATH_MSG_DEBUG("CaloCellContainer not ordered or incomplete");
83  theCont->setIsOrderedAndComplete(false);
84  }
85 
86  if (!theCont->isOrdered()) {
87  ATH_MSG_DEBUG("Now ordering CaloCellContainer");
88  theCont->order();
89 
90  //FIXME check again whether in order
91  ATH_MSG_DEBUG("Now check CaloCellContainer ordered");
92  if (theCont->checkOrdered()){
93  ATH_MSG_DEBUG( "CaloCellContainer ordered");
94  theCont->setIsOrdered(true);
95  } else {
96  ATH_MSG_DEBUG( "CaloCellContainer not ordered");
97  theCont->setIsOrdered(false);
98  }
99 
100 
101  // check whether in order and complete
102  if (theCont->checkOrderedAndComplete()){
103  ATH_MSG_DEBUG( " CaloCellContainer ordered and complete");
104  theCont->setIsOrderedAndComplete(true);
105  } else {
106  ATH_MSG_DEBUG("CaloCellContainer not ordered or incomplete");
107  theCont->setIsOrderedAndComplete(false);
108  }
109  }
110 
111  theCont->updateCaloIterators();
112 
113  return StatusCode::SUCCESS;
114 }

◆ initialize()

StatusCode CaloCellContainerFinalizerTool::initialize ( )
overridevirtual

Definition at line 29 of file CaloCellContainerFinalizerTool.cxx.

30 {
31 
32  ATH_CHECK(detStore()->retrieve(m_theCaloCCIDM,"CaloCell_ID"));
33  return StatusCode::SUCCESS;
34 }

◆ process() [1/2]

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

Definition at line 118 of file CaloCellContainerFinalizerTool.cxx.

120 {
121  CHECK( doProcess (theCont) );
122  return StatusCode::SUCCESS;
123 }

◆ process() [2/2]

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

Definition at line 127 of file CaloCellContainerFinalizerTool.cxx.

129 {
130  // Container will automatically be locked when recorded.
131  return doProcess (theCont);
132 }

Member Data Documentation

◆ m_theCaloCCIDM

const CaloCell_ID* CaloCellContainerFinalizerTool::m_theCaloCCIDM =nullptr
private

Definition at line 36 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:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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
CaloCellContainerFinalizerTool::doProcess
StatusCode doProcess(CONTAINER *theCellContainer) const
Definition: CaloCellContainerFinalizerTool.cxx:37
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size