////////////////////////////////////////////////////////////////////////
/// \class RAT::SOCFitterProc
///
/// \brief RAT Processor which invokes methods
///
/// \author Phil Jones
/// \author Matthew Mottram -- contact person
/// \author Jose Maneira -- contact person
///
/// REVISION HISTORY:
/// - 05/10/2012 : P.Jones - First Revision, new file.
/// - 2014-03-29 : P G Jones - Updated lifetime, added BeginOfRun method
/// - 2014-12-09 : P G Jones - Allow chained PMTSelectors
///
/// \details Assembles the fit components then invokes a method, based on
/// command inputs. The data passed to the method is collated
/// from the SOC data. The result is then placed in the SOC.
///
////////////////////////////////////////////////////////////////////////
#ifndef __RAT_SOCFitterProc__
#define __RAT_SOCFitterProc__
#include
#include
#include
namespace RAT
{
namespace DS
{
class Run;
class SOC;
class SOCPMT;
}
namespace Methods
{
class Method;
}
namespace PDFs
{
class PDF;
}
namespace Optimisers
{
class Optimiser;
}
namespace PMTSelectors
{
class PMTSelector;
}
class SOCFitterProc : public Processor
{
public:
/// Constructor, gets Factory instances
SOCFitterProc();
/// Destructor deletes the components
virtual ~SOCFitterProc();
/// Called at the start of a run
virtual void BeginOfRun( DS::Run& run );
/// Called to invoke the SOCFitterProc at the end of a run
virtual void EndOfRun( DS::Run& run );
/// Set a int command
///
/// @param[in] param is method, optimiser, pdf, seed or selector or something to be passed to the component
/// @param[in] value is any value (component will check validity)
virtual void SetI( const std::string& param,
const int value );
/// Set a double command
///
/// @param[in] param is method, optimiser, pdf, seed or selector or something to be passed to the component
/// @param[in] value is any value (component will check validity)
virtual void SetD( const std::string& param,
const double value );
/// Set a string command
///
/// @param[in] param is method, optimiser, pdf, seed or selector or something to be passed to the component
/// @param[in] value is any value (component will check validity)
virtual void SetS( const std::string& param,
const std::string& value );
protected:
/// Execute the chosen fitter with the pmtData, soc and run
Processor::Result ExecuteFitter( std::vector& pmtData,
DS::SOC& soc,
DS::Run& run );
std::vector< std::string > fSeeds; ///< Name of seeds must be full fit result name, optional
Methods::Method* fMethod; ///< The method
PDFs::PDF* fPDF; ///< The PDF (optional)
Optimisers::Optimiser* fOptimiser; ///< The optimiser (optional)
PMTSelectors::PMTSelector* fSelector; ///< The selector (optional)
};
} // ::RAT
#endif