ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloRec
src
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
17
#include "
CaloCellContainerFinalizerTool.h
"
18
19
#include "
CaloEvent/CaloCellContainer.h
"
20
#include "
CaloEvent/CaloConstCellContainer.h
"
21
#include "
CaloIdentifier/CaloCell_ID.h
"
22
23
25
// INITIALIZE:
26
// The initialize method will create all the required algorithm objects
28
29
StatusCode
CaloCellContainerFinalizerTool::initialize
()
30
{
31
32
ATH_CHECK
(detStore()->retrieve(
m_theCaloCCIDM
,
"CaloCell_ID"
));
33
return
StatusCode::SUCCESS;
34
}
35
36
template
<
class
CONTAINER>
37
StatusCode
CaloCellContainerFinalizerTool::doProcess
(CONTAINER* theCont )
const
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
117
StatusCode
118
CaloCellContainerFinalizerTool::process
(
CaloCellContainer
* theCont,
119
const
EventContext&
/*ctx*/
)
const
120
{
121
CHECK
(
doProcess
(theCont) );
122
return
StatusCode::SUCCESS;
123
}
124
125
126
StatusCode
127
CaloCellContainerFinalizerTool::process
(
CaloConstCellContainer
* theCont,
128
const
EventContext&
/*ctx*/
)
const
129
{
130
// Container will automatically be locked when recorded.
131
return
doProcess
(theCont);
132
}
133
134
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloCellContainerFinalizerTool.h
CaloCellContainer.h
CaloCell_ID.h
CaloConstCellContainer.h
CaloCellContainer that can accept const cell pointers.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CaloCellContainerFinalizerTool::process
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
Definition
CaloCellContainerFinalizerTool.cxx:118
CaloCellContainerFinalizerTool::initialize
virtual StatusCode initialize() override
Definition
CaloCellContainerFinalizerTool.cxx:29
CaloCellContainerFinalizerTool::doProcess
StatusCode doProcess(CONTAINER *theCellContainer) const
Definition
CaloCellContainerFinalizerTool.cxx:37
CaloCellContainerFinalizerTool::m_theCaloCCIDM
const CaloCell_ID * m_theCaloCCIDM
Definition
CaloCellContainerFinalizerTool.h:36
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloConstCellContainer
CaloCellContainer that can accept const cell pointers.
Definition
CaloConstCellContainer.h:45
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0