ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
StoreGate
src
ThinningHandleBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
12
#include "
StoreGate/ThinningHandleBase.h
"
13
#include "
StoreGate/exceptions.h
"
14
#include "
AthenaKernel/getMessageSvc.h
"
15
16
17
namespace
SG
{
18
19
26
ThinningHandleBase::ThinningHandleBase
27
(
const
WriteHandleKey<ThinningDecision>
& dkey,
28
const
std::string& sgkey,
29
const
EventContext& ctx)
30
:
m_decisionHandle
(dkey, ctx),
31
m_decision
(
std
::make_unique<
ThinningDecision
> (sgkey))
32
{
33
}
34
35
41
ThinningHandleBase::~ThinningHandleBase
()
42
{
43
StatusCode
sc
= StatusCode::FAILURE;
44
try
{
45
sc
=
m_decisionHandle
.record (std::move (
m_decision
));
46
}
47
catch
(
const
GaudiException&) {
48
sc
= StatusCode::FAILURE;
49
}
50
if
(
sc
.isFailure()) {
51
MsgStream
msg
(
Athena::getMessageSvc
(),
"ThinningHandleBase"
);
52
msg
<< MSG::ERROR
53
<<
"Can't record SG::ThinningDecision object: "
54
<<
m_decisionHandle
.store() <<
"+"
<<
m_decisionHandle
.key()
55
<<
endmsg
;
56
}
57
}
58
59
64
void
ThinningHandleBase::thin
(
size_t
ndx)
65
{
66
m_decision
->thin (ndx);
67
}
68
69
75
void
ThinningHandleBase::keep
(
size_t
ndx)
76
{
77
m_decision
->keep (ndx);
78
}
79
80
90
void
ThinningHandleBase::thin
(
const
std::vector<bool>& v,
Op
op
/*= Op::Set*/
)
91
{
92
m_decision
->thin (v, op);
93
}
94
95
105
void
ThinningHandleBase::keep
(
const
std::vector<bool>& v,
Op
op
/*= Op::Set*/
)
106
{
107
m_decision
->keep (v, op);
108
}
109
119
void
ThinningHandleBase::thin
(
const
ThinningDecisionBase
& other,
Op
op
/*= Op::Set*/
)
120
{
121
m_decision
->thin (other, op);
122
}
123
124
134
void
ThinningHandleBase::keep
(
const
ThinningDecisionBase
& other,
Op
op
/*= Op::Set*/
)
135
{
136
m_decision
->keep (other, op);
137
}
138
139
143
void
ThinningHandleBase::thinAll
()
144
{
145
return
m_decision
->thinAll();
146
}
147
148
152
void
ThinningHandleBase::keepAll
()
153
{
154
return
m_decision
->keepAll();
155
}
156
157
161
const
ThinningDecision
&
ThinningHandleBase::decision
()
const
162
{
163
return
*
m_decision
;
164
}
165
166
167
}
// namespace SG
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
exceptions.h
Exceptions that can be thrown from StoreGate.
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ThinningHandleBase.h
Handle for requesting thinning: factor out type-independent code.
SG::ThinningDecisionBase
Hold thinning decisions for one container.
Definition
ThinningDecisionBase.h:39
SG::ThinningDecision
Hold thinning decisions for one container.
Definition
ThinningDecision.h:40
SG::ThinningHandleBase::thin
void thin(size_t ndx)
Mark that index ndx in the container should be thinned away.
Definition
ThinningHandleBase.cxx:64
SG::ThinningHandleBase::ThinningHandleBase
ThinningHandleBase(const WriteHandleKey< ThinningDecision > &dkey, const std::string &sgkey, const EventContext &ctx)
Constructor.
Definition
ThinningHandleBase.cxx:27
SG::ThinningHandleBase::thinAll
void thinAll()
Mark that all elements should be thinned away.
Definition
ThinningHandleBase.cxx:143
SG::ThinningHandleBase::decision
const ThinningDecision & decision() const
Return the thinning object we're building.
Definition
ThinningHandleBase.cxx:161
SG::ThinningHandleBase::keepAll
void keepAll()
Mark that all elements should be kept (not thinned).
Definition
ThinningHandleBase.cxx:152
SG::ThinningHandleBase::m_decision
std::unique_ptr< ThinningDecision > m_decision
The thinning object we're building.
Definition
ThinningHandleBase.h:141
SG::ThinningHandleBase::keep
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Definition
ThinningHandleBase.cxx:75
SG::ThinningHandleBase::m_decisionHandle
WriteHandle< ThinningDecision > m_decisionHandle
Handle for writing the decision object.
Definition
ThinningHandleBase.h:138
SG::ThinningHandleBase::Op
ThinningDecision::Op Op
Definition
ThinningHandleBase.h:34
SG::ThinningHandleBase::~ThinningHandleBase
~ThinningHandleBase()
Destructor.
Definition
ThinningHandleBase.cxx:41
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition
StoreGate/StoreGate/WriteHandleKey.h:40
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
std
STL namespace.
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0