Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CaloCellContainerFinalizerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /********************************************************************
6 
7 NAME: CaloCellContainerFinalizerTool
8 PACKAGE: offline/Calorimeter/CaloRec
9 
10 AUTHORS: David Rousseau
11 CREATED: May 12,2004
12 
13 PURPOSE: Apply necessary finalising operation to CaloCellContainer
14 
15 ********************************************************************/
16 
18 
22 
23 
25 // INITIALIZE:
26 // The initialize method will create all the required algorithm objects
28 
30 {
31 
32  ATH_CHECK(detStore()->retrieve(m_theCaloCCIDM,"CaloCell_ID"));
33  return StatusCode::SUCCESS;
34 }
35 
36 template <class CONTAINER>
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 }
115 
116 
119  const EventContext& /*ctx*/) const
120 {
121  CHECK( doProcess (theCont) );
122  return StatusCode::SUCCESS;
123 }
124 
125 
128  const EventContext& /*ctx*/) const
129 {
130  // Container will automatically be locked when recorded.
131  return doProcess (theCont);
132 }
133 
134 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CaloCellContainerFinalizerTool.h
CaloCellContainerFinalizerTool::process
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
Definition: CaloCellContainerFinalizerTool.cxx:118
CaloCell_ID.h
CaloCellContainerFinalizerTool::m_theCaloCCIDM
const CaloCell_ID * m_theCaloCCIDM
Definition: CaloCellContainerFinalizerTool.h:36
CaloCellContainerFinalizerTool::initialize
virtual StatusCode initialize() override
Definition: CaloCellContainerFinalizerTool.cxx:29
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
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
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloConstCellContainer
CaloCellContainer that can accept const cell pointers.
Definition: CaloConstCellContainer.h:45
CaloCellContainerFinalizerTool::doProcess
StatusCode doProcess(CONTAINER *theCellContainer) const
Definition: CaloCellContainerFinalizerTool.cxx:37
CaloConstCellContainer.h
CaloCellContainer that can accept const cell pointers.
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