The Gaudi Framework  master (cc9a61f4)
Loading...
Searching...
No Matches
IAlgorithm.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2026 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#pragma once
12
15#include <map>
16#include <string>
17
18class IAlgTool;
19class AlgResourcePool;
20class AlgExecStateRef;
21class EventContext;
22
23namespace Gaudi {
24 class StringKey;
25}
26
37class GAUDI_API IAlgorithm : virtual public extend_interfaces<INamedInterface, IStateful> {
38public:
40
43
46 using AlgResources_t = std::map<Gaudi::StringKey, unsigned int, std::less<>>;
47
50 virtual const std::string& version() const = 0;
51
54 virtual const std::string& type() const = 0;
55 virtual void setType( std::string ) = 0;
56
59 virtual const Gaudi::StringKey& nameKey() const = 0;
60
63 virtual unsigned int index() const = 0;
64
67 virtual bool isClonable() const { return false; }
68
72 virtual unsigned int cardinality() const = 0;
73
76 virtual const AlgResources_t& neededResources() const = 0;
77
81 virtual StatusCode execute( const EventContext& ) const = 0;
82
84 virtual bool isInitialized() const = 0;
86 virtual bool isFinalized() const = 0;
87
94
100 virtual StatusCode sysStart() = 0;
101
108
114 virtual StatusCode sysRestart() = 0;
115
117#define GAUDI_SYSEXECUTE_WITHCONTEXT 1
118
120 virtual StatusCode sysExecute( const EventContext& ) = 0;
121
125 virtual StatusCode sysStop() = 0;
126
130 virtual StatusCode sysFinalize() = 0;
131
135 virtual AlgExecStateRef execState( const EventContext& ctx ) const = 0;
136
138 virtual bool isEnabled() const = 0;
139
141 virtual bool isSequence() const = 0;
142
144 virtual std::ostream& toControlFlowExpression( std::ostream& os ) const = 0;
145
147 virtual void setIndex( const unsigned int& idx ) = 0;
148
149 virtual bool isReEntrant() const = 0;
150};
#define GAUDI_API
Definition Kernel.h:49
wrapper on an Algorithm state.
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
This class represents an entry point to all the event specific data.
Helper class for efficient "key" access for strings.
Definition StringKey.h:67
The interface implemented by the AlgTool base class.
Definition IAlgTool.h:29
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition IAlgorithm.h:37
virtual unsigned int index() const =0
The index of the algorithm.
virtual void setType(std::string)=0
virtual bool isClonable() const
Specify if the algorithm is clonable.
Definition IAlgorithm.h:67
virtual StatusCode sysStart()=0
Startup method invoked by the framework.
virtual StatusCode sysReinitialize()=0
Re-initialization method invoked by the framework.
virtual AlgExecStateRef execState(const EventContext &ctx) const =0
get the AlgExecStateRef of current algorithm Actually a small wrapper around it, thus the plain objec...
virtual bool isFinalized() const =0
check if the algorithm is finalized properly
virtual const std::string & version() const =0
The version of the algorithm.
virtual StatusCode execute(const EventContext &) const =0
The action to be performed by the algorithm on an event.
friend AlgResourcePool
Definition IAlgorithm.h:39
virtual std::ostream & toControlFlowExpression(std::ostream &os) const =0
Produce string represention of the control flow expression.
virtual StatusCode sysStop()=0
System stop.
virtual bool isEnabled() const =0
Is this algorithm enabled or disabled?
virtual StatusCode sysRestart()=0
Re-start method invoked by the framework.
virtual bool isInitialized() const =0
check if the algorithm is initialized properly
virtual const AlgResources_t & neededResources() const =0
Named, non thread-safe resources used during event processing.
virtual StatusCode sysExecute(const EventContext &)=0
System execution. This method invokes the execute() method of a concrete algorithm.
std::map< Gaudi::StringKey, unsigned int, std::less<> > AlgResources_t
Type for resources needed by the algorithm (name, value).
Definition IAlgorithm.h:46
virtual unsigned int cardinality() const =0
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentra...
virtual const std::string & type() const =0
The type of the algorithm.
DeclareInterfaceID(IAlgorithm, 7, 0)
InterfaceID.
virtual StatusCode sysFinalize()=0
System finalization.
virtual StatusCode sysInitialize()=0
Initialization method invoked by the framework.
virtual bool isSequence() const =0
Are we a Sequence?
virtual const Gaudi::StringKey & nameKey() const =0
StringKey rep of name.
virtual void setIndex(const unsigned int &idx)=0
Set instantiation index of Alg.
virtual bool isReEntrant() const =0
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
Base class to be used to extend an interface.