///////////////////////////////////////////////////////////////////////
//
// Energy fit using a seed position and the nhit
//
// Author: name Phil G Jones
// Author: Matthew Mottram -- contact person
//
// REVISION HISTORY:
// 26/04/2011 : P G Jones - New file
// 2014-03-29 : P G Jones - Updated lifetime, added BeginOfRun method
//
// This method uses a position and nhit dependent lookup table
// to calculate the energy of the event. The table is automatically
// loaded for the material in the `scint` volume, this can be overridden
// by passing a initialisation parameter.
//
///////////////////////////////////////////////////////////////////////
#ifndef __RAT_Method_EnergyLookup__
#define __RAT_Method_EnergyLookup__
#include
#include
#include
namespace RAT
{
namespace Methods
{
class EnergyLookup : public SeededMethod
{
public:
// Returns the method's name
virtual std::string GetName() const { return EnergyLookup::Name(); }
// Returns the method's name
static std::string Name() { return std::string( "energyLookup" ); }
// Initialise the method
//
// "param" is an optional index in the db to use
void Initialise( const std::string& param );
// This will load the table from the database
void BeginOfRun( DS::Run& run );
void EndOfRun( DS::Run& run );
// Calculate and return the best fit for the seed
virtual DS::FitResult GetBestFit();
// Set the seed to the default
void DefaultSeed();
private:
std::vector fRadii; // The lookup table radii bins
std::vector fEnergies; // The lookup table energy bins
std::vector fNhitVEnergyVRadius; // The nhit values as a function of radii and energy
std::string fIndex; // Optional index override for the db table
};
} //::Method
} //::RAT
#endif