5#ifndef RINGERSELECTORTOOLS_PROCEDURES_IPROCEDURE_H
6#define RINGERSELECTORTOOLS_PROCEDURES_IPROCEDURE_H
13#include <TDirectory.h>
18#include "RingerSelectorTools/tools/IRedirectMsgStream.h"
21#ifndef INCLUDE_HEADER_ONLY
22#define 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 =
"")
189template<
typename procedure_t >
192 static_assert( (std::is_base_of<IRingerProcedure,procedure_t>::value),
193 "Requested to check Ringer procedure type from class that is not a IRingerProcedure.");
197 std::is_base_of<PreProcessing::IPreProcessor,procedure_t>::value;
199 std::is_base_of<Discrimination::IDiscriminator,procedure_t>::value;
201 std::is_base_of<Discrimination::IThreshold,procedure_t>::value;
204 "Couldn't find a procedure type.");
238template<
typename procedure_t >
258 virtual void execute(std::vector<float> &inputSpace)
const = 0;
288namespace 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;
366namespace PreProcessing {
#define RINGER_DEFINE_INTERFACE_DEFAULT_METHODS(self)
Define Ringer interface procedure type methods.
#define RINGER_PROCEDURE_BASE_METHODS(self)
Define ringer interface default methods.
Discriminator interface to be used by Ringer Wrapper.
static IDiscriminatorVarDep * read(TDirectory *)
Discriminator interface to be inherited by discrimination procedures.
virtual void execute(const std::vector< float > &input, std::vector< float > &output) const =0
Threshold interface to be used by Ringer Wrapper.
static IThresholdVarDep * read(TDirectory *)
Threshold interface to be inherited by thresholding procedures.
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.
The base interface for all Ringer procedures.
virtual ~IRingerProcedure()
Ensures virtual dtor for all inherited classes.
virtual void write(TDirectory *configDir, const char *idxStr="") const =0
Write Ringer procedure to configuration directory.
PreProcessor interface to be used by Ringer Wrapper.
static IPreProcessorVarDep * read(TDirectory *)
PreProcessing interface to be inherited by PreProcessing procedures.
virtual void execute(std::vector< float > &inputSpace) const =0
Check if depVar is within this procedure range.
VariableDependency()=default
Ctor for independent.
Namespace dedicated for Ringer Discrimination utilities.
Namespace dedicated for Ringer pre-processing utilities.
Namespace dedicated for Ringer utilities.
Check Ringer Procedure type.
static constexpr bool is_threshold
static constexpr bool inherits_from_var_dep
static constexpr bool is_pre_processor
std::conditional< is_pre_processor, preProcEnum_t, typenamestd::conditional< is_discriminator, discrEnum_t, thresEnum_t >::type >::type procEnum_t
std::conditional< is_pre_processor, typenamestd::conditional< inherits_from_var_dep, PreProcessing::IPreProcessorVarDep, PreProcessing::IPreProcessor >::type, typenamestd::conditional< is_discriminator, typenamestd::conditional< inherits_from_var_dep, Discrimination::IDiscriminatorVarDep, Discrimination::IDiscriminator >::type, typenamestd::conditional< inherits_from_var_dep, Discrimination::IThresholdVarDep, Discrimination::IThreshold >::type >::type >::type baseInterface_t
static constexpr bool is_discriminator