ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
D3PDMakerCoreComps
src
ContainedMultiAssociationFillerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id: ContainedMultiAssociationFillerTool.cxx 618070 2014-09-22 19:05:34Z ssnyder $
12
13
14
#include "
ContainedMultiAssociationFillerTool.h
"
15
#include "
AthenaKernel/errorcheck.h
"
16
17
18
namespace
D3PD
{
19
20
27
ContainedMultiAssociationFillerTool::ContainedMultiAssociationFillerTool
28
(
const
std::string&
type
,
29
const
std::string& name,
30
const
IInterface* parent)
31
: base_class (
type
, name, parent),
32
AddVariable
(
m_prefix
,
m_blockName
),
33
m_associator (this),
34
m_blockFillers
(this),
35
m_next
(0)
36
{
37
declareProperty (
"Associator"
, m_associator,
38
"The IMultiAssociationTool instance."
);
39
declareProperty (
"BlockFillers"
,
m_blockFillers
,
40
"List of contained block filler tools."
);
41
declareProperty (
"BlockName"
,
m_blockName
= this->name(),
42
"The name of this block."
);
43
declareProperty (
"Prefix"
,
m_prefix
=
""
,
44
"Variable name prefix for the contained blocks."
);
45
}
46
47
51
StatusCode
52
ContainedMultiAssociationFillerTool::initialize
()
53
{
54
CHECK
( AthAlgTool::initialize() );
55
CHECK
( m_associator.retrieve() );
56
CHECK
(
m_blockFillers
.retrieve() );
57
return
StatusCode::SUCCESS;
58
}
59
60
64
StatusCode
65
ContainedMultiAssociationFillerTool::finalize
()
66
{
67
CHECK
( AlgTool::finalize() );
68
if
(
m_next
) {
69
m_associator->releaseElementUntyped (
m_next
);
70
m_next
= 0;
71
}
72
return
StatusCode::SUCCESS;
73
}
74
75
84
StatusCode
85
ContainedMultiAssociationFillerTool::configureD3PD
(
IAddVariable
*
tree
,
86
const
std::type_info& ti)
87
{
88
CHECK
(
AddVariable::configureD3PD
(
tree
) );
89
CHECK
( m_associator->configureD3PD (
this
, ti) );
90
const
std::type_info& ati = m_associator->elementTypeinfo();
91
for
(
size_t
i = 0; i <
m_blockFillers
.size(); i++)
92
CHECK
(
m_blockFillers
[i]->
configureD3PD
(
this
, ati ) );
93
94
return
StatusCode::SUCCESS;
95
}
96
97
103
StatusCode
ContainedMultiAssociationFillerTool::book
()
104
{
105
CHECK
( m_associator->book () );
106
for
(
size_t
i = 0; i <
m_blockFillers
.size(); i++)
107
CHECK
(
m_blockFillers
[i]->
book
( ) );
108
109
return
StatusCode::SUCCESS;
110
}
111
112
142
StatusCode
143
ContainedMultiAssociationFillerTool::fillUntyped (
const
void
* p,
144
bool
again
/*= false*/
)
145
{
146
// ??? Doesn't handle nested AGAIN.
147
148
if
(!
again
) {
149
if
(
m_next
) {
150
m_associator->releaseElementUntyped (
m_next
);
151
m_next
= 0;
152
}
153
154
// Start the association.
155
CHECK
( m_associator->resetUntyped (p) );
156
157
// Get the first result.
158
m_next
= m_associator->nextUntyped();
159
}
160
161
if
(!
m_next
)
162
return
StatusCode
(
EMPTY
);
163
164
for
(
size_t
i = 0; i <
m_blockFillers
.size(); i++) {
165
StatusCode
sc
=
m_blockFillers
[i]->fillUntyped (
m_next
);
166
CHECK
( IBlockFillerTool::againok (
sc
) );
167
if
(!
sc
.isSuccess()) {
168
REPORT_MESSAGE
(MSG::WARNING)
169
<<
"Got AGAIN/EMPTY: "
170
<<
"Nested ContainedMultiAssociationFillerTool not supported."
;
171
}
172
}
173
174
m_associator->releaseElementUntyped (
m_next
);
175
m_next
= m_associator->nextUntyped();
176
177
// Always return AGAIN for the first object, even if it's the last one.
178
// We'll return EMPTY on the next call.
179
// If we don't do this, then we can have problems if multiple
180
// ContainedMultiAssociationFillerTools are used; any that return
181
// a list of size 1 will have that object duplicated in all rows.
182
if
(
m_next
|| !
again
)
183
return
StatusCode(AGAIN);
184
185
return
StatusCode::SUCCESS;
186
}
187
188
189
190
}
// namespace D3PD
ClusterMessageType::EMPTY
@ EMPTY
Definition
ClusterMessage.h:25
ContainedMultiAssociationFillerTool.h
Represent a multiple association by containment.
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:365
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
D3PD::AddVariable::configureD3PD
StatusCode configureD3PD(IAddVariable *tree)
Configure the parent tree.
Definition
AddVariable.cxx:61
D3PD::AddVariable::AddVariable
AddVariable(const std::string &prefix, const std::string &blockName=s_emptyString)
Constructor.
Definition
AddVariable.cxx:29
D3PD::AddVariable::m_prefix
const std::string & m_prefix
Reference to the variable prefix.
Definition
AddVariable.h:134
D3PD::ContainedMultiAssociationFillerTool::finalize
virtual StatusCode finalize()
Standard Gaudi finalize method.
Definition
ContainedMultiAssociationFillerTool.cxx:65
D3PD::ContainedMultiAssociationFillerTool::ContainedMultiAssociationFillerTool
ContainedMultiAssociationFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
ContainedMultiAssociationFillerTool.cxx:28
D3PD::ContainedMultiAssociationFillerTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition
ContainedMultiAssociationFillerTool.cxx:52
D3PD::ContainedMultiAssociationFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition
ContainedMultiAssociationFillerTool.cxx:103
D3PD::ContainedMultiAssociationFillerTool::configureD3PD
virtual StatusCode configureD3PD(IAddVariable *tree, const std::type_info &ti)
Configure during initialization: type-check.
Definition
ContainedMultiAssociationFillerTool.cxx:85
D3PD::IAddVariable
Common interface for adding a variable to a tuple.
Definition
IAddVariable.h:70
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
D3PD::m_next
m_next
Definition
ContainedMultiAssociationFillerTool.cxx:175
D3PD::m_blockName
std::string m_blockName
Property: the name of this block.
Definition
IndexAssociationFillerTool.h:142
D3PD::again
bool again
Definition
VoidBlockFillerTool.cxx:79
D3PD::m_blockFillers
ToolHandleArray< IBlockFillerTool > m_blockFillers
Property: The list of block filler tools.
Definition
VectorFillerToolBase.h:189
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
type
tree
TChain * tree
Definition
tile_monitor.h:30
Generated on
for ATLAS Offline Software by
1.17.0