The Gaudi Framework
v33r1 (b1225454)
Sequencer.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#ifndef ALGORITHM_SEQUENCER_H
12
#define ALGORITHM_SEQUENCER_H
13
14
// Include files
15
#include "
GaudiKernel/Property.h
"
16
#include <
Gaudi/Sequence.h
>
17
18
#include <mutex>
19
20
class
MsgStream
;
21
35
class
GAUDI_API
Sequencer
:
public
Gaudi::Sequence
{
36
public
:
40
using
Gaudi::Sequence::Sequence;
41
/*****************************
42
** Public Function Members **
43
*****************************/
44
51
StatusCode
initialize
()
override
;
52
56
StatusCode
reinitialize
()
override
;
57
61
StatusCode
start
()
override
;
62
67
StatusCode
execute
(
const
EventContext
&
ctx
)
const override
;
68
72
StatusCode
stop
()
override
;
73
77
StatusCode
finalize
()
override
;
78
86
bool
branchFilterPassed(
const
EventContext
&
ctx
)
const
;
87
91
void
setBranchFilterPassed(
const
EventContext
&
ctx
,
bool
state
)
const
;
92
96
virtual
bool
isStopOverride()
const
;
97
101
StatusCode
append(
Gaudi::Algorithm
* pAlgorithm );
102
106
StatusCode
appendToBranch(
Gaudi::Algorithm
* pAlgorithm );
107
117
StatusCode
createAndAppend(
const
std::string
&
type
,
// The concrete algorithm class of the algorithm
118
const
std::string
&
name
,
// The name to be given to the algorithm
119
Gaudi::Algorithm
*& pAlgorithm
// Set to point to the newly created algorithm object
120
);
121
131
StatusCode
createAndAppendToBranch(
const
std::string
&
type
,
// The concrete algorithm class of the algorithm
132
const
std::string
&
name
,
// The name to be given to the algorithm
133
Gaudi::Algorithm
*& pAlgorithm
// Set to point to the newly created algorithm
134
// object
135
);
136
140
StatusCode
remove(
Gaudi::Algorithm
* pAlgorithm );
141
StatusCode
remove(
const
std::string
&
name
);
142
StatusCode
removeFromBranch(
Gaudi::Algorithm
* pAlgorithm );
143
StatusCode
removeFromBranch(
const
std::string
&
name
);
144
151
const
std::vector<Gaudi::Algorithm*>
& branchAlgorithms()
const
;
152
std::vector<Gaudi::Algorithm*>
& branchAlgorithms();
153
155
StatusCode
decodeMemberNames();
156
158
StatusCode
decodeBranchMemberNames();
159
160
protected
:
164
StatusCode
append(
Gaudi::Algorithm
* pAlgorithm,
std::vector<Gaudi::Algorithm*>
& theAlgs );
165
175
StatusCode
createAndAppend(
const
std::string
&
type
,
// The concrete algorithm class of the algorithm
176
const
std::string
&
name
,
// The name to be given to the algorithm
177
Gaudi::Algorithm
*& pAlgorithm,
// Set to point to the newly created algorithm object
178
std::vector<Gaudi::Algorithm*>
& theAlgs );
179
183
StatusCode
decodeNames(
Gaudi::Property
<
std::vector<std::string>
>& theNames,
std::vector<Gaudi::Algorithm*>
& theAlgs,
184
std::vector<bool>
& theLogic );
185
189
StatusCode
execute
(
const
EventContext
&
ctx
,
const
std::vector<Gaudi::Algorithm*>
& theAlgs,
190
const
std::vector<bool>
& theLogic,
Gaudi::Algorithm
*& lastAlgorithm,
191
std::size_t
first = 0 )
const
;
192
196
StatusCode
executeMember(
Gaudi::Algorithm
* theAlgorithm,
const
EventContext
& context )
const
;
197
202
StatusCode
remove(
const
std::string
& algname,
std::vector<Gaudi::Algorithm*>
& theAlgs );
203
204
// NO COPY / ASSIGNMENT ALLOWED
205
Sequencer
(
const
Sequencer
& a ) =
delete
;
206
Sequencer
&
operator=
(
const
Sequencer
& rhs ) =
delete
;
207
208
public
:
210
std::ostream
&
toControlFlowExpression
(
std::ostream
& os )
const override
;
211
212
private
:
213
/**************************
214
** Private Data Members **
215
**************************/
216
217
Gaudi::Property<std::vector<std::string>
> m_names{
this
,
218
"Members"
,
219
{},
220
[
this
](
auto
& ) {
221
if
( this->
isInitialized
() ) this->decodeMemberNames().
ignore
();
222
},
223
"member names"
};
224
Gaudi::Property<std::vector<std::string>
> m_branchNames{
this
,
225
"BranchMembers"
,
226
{},
227
[
this
](
auto
& ) {
228
if
( this->
isInitialized
() )
229
this->decodeBranchMemberNames().
ignore
();
230
},
231
"branch member names"
};
232
Gaudi::Property<bool>
m_stopOverride{
this
,
"StopOverride"
,
false
,
"stop on filter failure override"
};
233
234
std::vector<bool>
m_isInverted
;
// Member logic inverted list
235
std::vector<Gaudi::Algorithm*>
m_branchAlgs
;
// Branch algorithms
236
std::vector<bool>
m_isBranchInverted
;
// Branch Member logic inverted list
237
238
mutable
std::mutex
m_branchFilterMutex
;
239
mutable
std::map<EventContext::ContextID_t, bool>
m_branchFilterPassed
;
// Branch filter passed flag
240
};
241
242
#endif // ALGORITHM_SEQUENCER_H
Gaudi::Sequence::initialize
StatusCode initialize() override
Initialization method invoked by the framework.
Definition:
Sequence.cpp:24
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition:
MsgStream.h:34
gaudiComponentHelp.name
name
Definition:
gaudiComponentHelp.py:52
Gaudi::Property
Implementation of property with value of concrete type.
Definition:
Property.h:370
Gaudi::Algorithm::operator=
Algorithm & operator=(const Algorithm &)=delete
delete assignment operator: NO ASSIGNMENT ALLOWED
Sequence.h
GaudiPython.Pythonizations.ctx
ctx
Definition:
Pythonizations.py:566
Sequencer::m_branchAlgs
std::vector< Gaudi::Algorithm * > m_branchAlgs
Definition:
Sequencer.h:235
Gaudi::Algorithm::toControlFlowExpression
std::ostream & toControlFlowExpression(std::ostream &os) const override
Produce string represention of the control flow expression.
Definition:
Algorithm.cpp:697
Gaudi::Sequence::stop
StatusCode stop() override
System stop.
Definition:
Sequence.cpp:66
std::size_t
EventContext
This class represents an entry point to all the event specific data.
Definition:
EventContext.h:34
std::map< EventContext::ContextID_t, bool >
std::mutex
Sequencer::m_branchFilterMutex
std::mutex m_branchFilterMutex
Definition:
Sequencer.h:238
std::string
STL class.
Gaudi::Sequence::reinitialize
StatusCode reinitialize() override
Reinitialization method invoked by the framework.
Definition:
Sequence.cpp:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:61
gaudirun.type
type
Definition:
gaudirun.py:154
compareRootHistos.state
def state
Definition:
compareRootHistos.py:468
Gaudi::Sequence::finalize
StatusCode finalize() override
System finalization.
Definition:
Sequence.cpp:36
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition:
StatusCode.h:168
Gaudi::Algorithm::isInitialized
bool isInitialized() const override
Has the Algorithm already been initialized?
Definition:
Algorithm.h:429
std::vector< Gaudi::Algorithm * >
Sequencer::m_isInverted
std::vector< bool > m_isInverted
Definition:
Sequencer.h:234
Gaudi::Sequence::start
StatusCode start() override
System start.
Definition:
Sequence.cpp:54
Property.h
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition:
Algorithm.h:89
Sequencer::m_branchFilterPassed
std::map< EventContext::ContextID_t, bool > m_branchFilterPassed
Definition:
Sequencer.h:239
GaudiPython.Pythonizations.execute
execute
Definition:
Pythonizations.py:566
Sequencer
ClassName: Sequencer.
Definition:
Sequencer.h:35
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:81
std::ostream
STL class.
Gaudi::Sequence
Definition:
Sequence.h:18
Sequencer::m_isBranchInverted
std::vector< bool > m_isBranchInverted
Definition:
Sequencer.h:236
GaudiAlg
GaudiAlg
Sequencer.h
Generated on Mon Mar 23 2020 15:30:58 for The Gaudi Framework by
1.8.15