Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef RINGERSELECTORTOOLS_PROCEDURES_IPROCEDURE_H
6 #define RINGERSELECTORTOOLS_PROCEDURES_IPROCEDURE_H
13 #include <TDirectory.h>
18 #include "RingerSelectorTools/tools/IRedirectMsgStream.h"
19 #include <type_traits>
21 #ifndef INCLUDE_HEADER_ONLY
22 #define INCLUDE_HEADER_ONLY
23 #endif // INCLUDE_HEADER_ONLY
24 #include "RingerSelectorTools/procedures/Types.h"
25 #undef INCLUDE_HEADER_ONLY
38 #define RINGER_PROCEDURE_BASE_METHODS(self) \
42 template <typename T = const char*> \
43 static T procType(); \
45 virtual std::string name() const = 0; \
47 virtual void print(MSG::Level lvl) const = 0;
52 #define RINGER_DEFINE_INTERFACE_DEFAULT_METHODS(self) \
56 const char* self::procType() \
63 Ringer::RingerProcedureType<self>::procEnum_t self::procType() \
65 return Ringer::getType< \
66 Ringer::RingerProcedureType<self>::procEnum_t>(#self); \
69 #define __RINGER_DEFINE_PROCEDURE_STANDARD_METHODS__(self) \
71 virtual std::string name() const \
73 template <typename T = const char*> \
74 static T procType(); \
80 #define RINGER_DEFINE_PROCEDURE(self) \
83 __RINGER_DEFINE_PROCEDURE_STANDARD_METHODS__(self) \
85 virtual void print(MSG::Level lvl) const \
91 #define RINGER_DEFINE_NOMEMBER_PROCEDURE(self) \
94 __RINGER_DEFINE_PROCEDURE_STANDARD_METHODS__(self) \
96 virtual void print(MSG::Level lvl) const \
99 if ( !this->isStreamAvailable() ) { \
100 std::cerr << "Cannot print " << this->name() << ", stream unavailable" \
103 if ( this->level() > lvl ) { \
106 ATH_MSG_LVL(lvl, "Procedure hasn't any property."); \
117 #define RINGER_DEFINE_PROCEDURE_DEFAULT_METHODS(self) \
119 RINGER_DEFINE_INTERFACE_DEFAULT_METHODS(self) \
122 std::string self::name() const \
124 return this->procType<const char*>(); \
149 virtual void write(TDirectory *configDir,
const char*idxStr =
"")
162 namespace PreProcessing {
167 namespace Discrimination {
189 template<
typename procedure_t >
193 "Requested to check Ringer procedure type from class that is not a IRingerProcedure.");
204 "Couldn't find a procedure type.");
238 template<
typename procedure_t >
244 namespace PreProcessing {
258 virtual void execute(std::vector<float> &inputSpace)
const = 0;
288 namespace Discrimination {
299 virtual void execute(
const std::vector<float> &input,
300 std::vector<float> &output)
const = 0;
337 virtual void execute(
const std::vector<float> &input,
338 std::vector<bool> &output,
const DepVarStruct &depVar)
const = 0;
366 namespace PreProcessing {
370 namespace Discrimination {
379 #endif // RINGERSELECTORTOOLS_PROCEDURES_IPROCEDURE_H
static constexpr bool is_discriminator
virtual void write(TDirectory *configDir, const char *idxStr="") const =0
Write Ringer procedure to configuration directory.
The base interface for all Ringer procedures.
std::conditional< is_pre_processor, preProcEnum_t, typename std::conditional< is_discriminator, discrEnum_t, thresEnum_t >::type >::type procEnum_t
virtual void execute(const std::vector< float > &input, std::vector< float > &output) const =0
static constexpr bool is_pre_processor
virtual ~IRingerProcedure()
Ensures virtual dtor for all inherited classes.
virtual void execute(const std::vector< float > &input, std::vector< bool > &output, const DepVarStruct &depVar) const =0
Execute threshold for input and retrieve throw output.
std::conditional< is_pre_processor, typename std::conditional< inherits_from_var_dep, PreProcessing::IPreProcessorVarDep, PreProcessing::IPreProcessor >::type, typename std::conditional< is_discriminator, typename std::conditional< inherits_from_var_dep, Discrimination::IDiscriminatorVarDep, Discrimination::IDiscriminator >::type, typename std::conditional< inherits_from_var_dep, Discrimination::IThresholdVarDep, Discrimination::IThreshold >::type >::type >::type baseInterface_t
Check Ringer Procedure type.
PreProcessor interface to be used by Ringer Wrapper.
PreProcessing interface to be inherited by PreProcessing procedures.
static constexpr bool is_threshold
Discriminator interface to be inherited by discrimination procedures.
static constexpr bool inherits_from_var_dep
Threshold interface to be inherited by thresholding procedures.
static IDiscriminatorVarDep * read(TDirectory *)
virtual void execute(std::vector< float > &inputSpace) const =0
#define RINGER_PROCEDURE_BASE_METHODS(self)
Define ringer interface default methods.
Threshold interface to be used by Ringer Wrapper.
Interface for possible Eta and Et variable dependency.
static IThresholdVarDep * read(TDirectory *)
Discriminator interface to be used by Ringer Wrapper.
static IPreProcessorVarDep * read(TDirectory *)
#define RINGER_DEFINE_INTERFACE_DEFAULT_METHODS(self)
Define Ringer interface procedure type methods.
Namespace dedicated for Ringer utilities.