////////////////////////////////////////////////////////////////////////
/// \class RAT::FitterProcessor
///
/// \brief RAT Processor which invokes methods
///
/// \author Phil Jones
///
/// REVISION HISTORY:
/// - 27/04/2011 : P.Jones - First Revision, new file.
/// - 2014-03-29 : P G Jones - Updated lifetime, added BeginOfRun method
/// - 2014-09-05 : M Mottram - added catching of optimiser failures
/// - 2014-12-09 : P G Jones - Allow chained PMTSelectors
/// - 2015-03-23 : M Mottram - added ability to seed from previous passes
/// 2015-05-13 : W Heintzelman - added setting of data structure pointer
/// in the call to fMethod->SetEventData
/// - 2015-10-20 : M Mottram - added SeedModifiers
///
/// \details Assembles the fit components then invokes a method, based on
/// command inputs
///
////////////////////////////////////////////////////////////////////////
#ifndef __RAT_FitterProcessor__
#define __RAT_FitterProcessor__
#include
#include
namespace RAT
{
namespace Methods
{
class Method;
}
namespace PDFs
{
class PDF;
}
namespace Optimisers
{
class Optimiser;
}
namespace PMTSelectors
{
class PMTSelector;
}
namespace SeedModifiers
{
class SeedModifier;
}
class FitterProcessor : public Processor
{
public:
/// Constructor, gets Factory instances
FitterProcessor();
/// Destructor deletes the components
virtual ~FitterProcessor();
/// Called at the start of a run
virtual void BeginOfRun( DS::Run& run );
/// Called to invoke the FitterProcessor
virtual Processor::Result DSEvent( DS::Run& run,
DS::Entry& ds );
// Called 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:
std::vector< std::string > fSeeds; ///< Name of seeds, must be full fit result name, optional
std::vector< int > fSeedPass; ///< Pass number of seeds, defaults to current pass
std::vector< std::string > fSelectorName; ///< Name of selectors
Methods::Method* fMethod; ///< The method
PDFs::PDF* fPDF; ///< The PDF (optional)
Optimisers::Optimiser* fOptimiser; ///< The optimiser (optional)
std::vector< PMTSelectors::PMTSelector* > fSelectors; ///< The selector(s) (optional)
SeedModifiers::SeedModifier* fSeedModifier; ///< The seed modifier (optional)
PMTSelectors::PMTSelector* fPMTCalSelector;
};
} // ::RAT
#endif