//////////////////////////////////////////////////////////////////////////////
// Conditional cut on fit energy. Returns OKTRUE if the default energy fit value is
// between the two specified values
// If multiple FitVertexes are present then will check the first one only
//
// Author: Jeanne Wilson <j.r.wilson@qmul.ac.uk>
//
// REVISION HISTORY:
//  - 2015/11/11: j. Wilson: first instance
//
//////////////////////////////////////////////////////////////////////////////

#ifndef __RAT_FitEnergyCutProc__
#define __RAT_FitEnergyCutProc__

#include <RAT/Processor.hh>

namespace RAT{

class FitEnergyCutProc : public Processor
{

public:
  // New instance of the named processor
  FitEnergyCutProc() : Processor("FitEnergyCutProc"),fenergyLowCut(0),fenergyHighCut(9999.) { };

  // Destructor
  virtual ~FitEnergyCutProc() { }

  // Set string fitname parameter via /rat/procset
  virtual void SetS( const std::string& param, const std::string& value );

  // Set double cut values parameter via /rat/procset
  virtual void SetD( const std::string& param, const double value );

  // Process the event
  virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds );

protected:
  double fenergyLowCut; // low cut value
  double fenergyHighCut; // high cut value
  std::string fFitName; // Name of FitResult to access
};

}

#endif // __RAT_FitEnergyCutProc__