/////////////////////////////////////////////////////////////////////////////
// Conditional return on a classifier result. Returns OKTRUE if the
// classifier result value is less than or equal to the cut value
// specified by the user, OKFALSE if it's greater then. It will return
// FAIL if the classifier result or classification don't exist or there
// is more than 1 triggered event.
//
// Author: P G Jones
//
// REVISION HISTORY:
// 2014-08-06 : P Jones - New file.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef __RAT_ClassifierCutProc__
#define __RAT_ClassifierCutProc__
#include
#include
namespace RAT
{
class ClassifierCutProc : public Processor
{
public:
// Create a new cut processor, cuts events with the wrong classification
ClassifierCutProc() : Processor("ClassifierCutProc"), fValue(0.0) { }
// Destroy the processor
virtual ~ClassifierCutProc() { }
// Applies the set double commands.
//
// param should be value
// value should be the maximum value
// throws ParamUnknown if param is not value
virtual void SetD( const std::string& param, const double value );
// Applies the set string commands.
//
// param should be classifier or classification
// value should be the name
// throws ParamUnknown if param is not classifier or classification
virtual void SetS( const std::string& param, const std::string& value );
// Process the event
//
// Conditional on the classifier value
//
// run: Data structure for the run
// ds: Data structure for the event
// returns OKTRUE if the classifier's classification is <= value
virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds );
protected:
std::string fClassifier; // The classifier to check
std::string fClassification; // The classification of the classifier to check
double fValue; // The value to check
};
} // namespace RAT
#endif