ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
D3PDMakerCoreComps
src
ContainedAssociationFillerTool.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: ContainedAssociationFillerTool.cxx 618070 2014-09-22 19:05:34Z ssnyder $
12
13
14
#include "
ContainedAssociationFillerTool.h
"
15
#include "
AthenaKernel/errorcheck.h
"
16
17
18
namespace
D3PD
{
19
20
27
ContainedAssociationFillerTool::ContainedAssociationFillerTool
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
,
m_suffix
),
33
m_associator (this),
34
m_blockFillers
(this),
35
m_matched (0)
36
{
37
declareProperty (
"Associator"
, m_associator,
38
"The ISingleAssociationTool instance."
);
39
declareProperty (
"BlockFillers"
,
m_blockFillers
,
40
"List of contained block filler tools."
);
41
declareProperty (
"Prefix"
,
m_prefix
=
""
,
42
"Variable name prefix for the contained blocks."
);
43
declareProperty (
"Suffix"
,
m_suffix
=
""
,
44
"Variable name suffix for the contained blocks."
);
45
declareProperty (
"BlockName"
,
m_blockName
= this->name(),
46
"The name of this block."
);
47
declareProperty (
"Matched"
, m_matchedName =
"matched"
,
48
"Variable name to use for the matched flag. "
49
"Omitted if empty."
);
50
}
51
52
56
StatusCode
57
ContainedAssociationFillerTool::initialize
()
58
{
59
CHECK
( AthAlgTool::initialize() );
60
CHECK
( m_associator.retrieve() );
61
CHECK
(
m_blockFillers
.retrieve() );
62
return
StatusCode::SUCCESS;
63
}
64
65
74
StatusCode
75
ContainedAssociationFillerTool::configureD3PD
(
IAddVariable
*
tree
,
76
const
std::type_info& ti)
77
{
78
CHECK
(
AddVariable::configureD3PD
(
tree
) );
79
CHECK
( m_associator->configureD3PD (
this
, ti) );
80
const
std::type_info& ati = m_associator->typeinfo();
81
for
(
size_t
i = 0; i <
m_blockFillers
.size(); i++)
82
CHECK
(
m_blockFillers
[i]->
configureD3PD
(
this
, ati ) );
83
84
return
StatusCode::SUCCESS;
85
}
86
87
93
StatusCode
ContainedAssociationFillerTool::book
()
94
{
95
CHECK
( m_associator->book () );
96
for
(
size_t
i = 0; i <
m_blockFillers
.size(); i++)
97
CHECK
(
m_blockFillers
[i]->
book
( ) );
98
99
if
(!m_matchedName.empty())
100
CHECK
(
addVariable
(m_matchedName, m_matched) );
101
102
return
StatusCode::SUCCESS;
103
}
104
105
135
StatusCode
136
ContainedAssociationFillerTool::fillUntyped (
const
void
* p,
137
bool
again
/*= false*/
)
138
{
139
const
void
*
pout
= m_associator->getUntyped (p);
140
StatusCode
scout
(
EMPTY
);
141
if
(
pout
) {
142
if
(!m_matchedName.empty())
143
*m_matched =
true
;
144
for
(
size_t
i = 0; i <
m_blockFillers
.size(); i++) {
145
// Set checked flag on scout.
146
// Otherwise, if we get an exception in the child, all we'll see
147
// is an unchecked status code error with no mention of the
148
// actual exception...
149
scout
.ignore();
150
CHECK
(
againok
(
m_blockFillers
[i]->fillUntyped (
pout
,
again
),
scout
) );
151
}
152
}
153
m_associator->releaseObjectUntyped (
pout
);
154
155
scout
= StatusCode(
scout
.getCode());
// Make sure checked flag is clear again.
156
return
againok
(
scout
);
157
}
158
159
160
161
}
// namespace D3PD
ClusterMessageType::EMPTY
@ EMPTY
Definition
ClusterMessage.h:25
ContainedAssociationFillerTool.h
Represent a single association by containment.
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition
AddVariable.cxx:85
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::AddVariable::m_suffix
const std::string & m_suffix
Reference to the variable suffix.
Definition
AddVariable.h:137
D3PD::ContainedAssociationFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition
ContainedAssociationFillerTool.cxx:93
D3PD::ContainedAssociationFillerTool::configureD3PD
virtual StatusCode configureD3PD(IAddVariable *tree, const std::type_info &ti)
Configure during initialization: type-check.
Definition
ContainedAssociationFillerTool.cxx:75
D3PD::ContainedAssociationFillerTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition
ContainedAssociationFillerTool.cxx:57
D3PD::ContainedAssociationFillerTool::ContainedAssociationFillerTool
ContainedAssociationFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
ContainedAssociationFillerTool.cxx:28
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::pout
const void * pout
Definition
IndexAssociationFillerTool.cxx:161
D3PD::scout
scout
Definition
ContainedAssociationFillerTool.cxx:155
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::againok
return againok(scout)
D3PD::m_blockFillers
ToolHandleArray< IBlockFillerTool > m_blockFillers
Property: The list of block filler tools.
Definition
VectorFillerToolBase.h:189
type
tree
TChain * tree
Definition
tile_monitor.h:30
Generated on
for ATLAS Offline Software by
1.17.0