/////////////////////////////////////////////////////////////////////// // // Calculates the Reconstructed Energy from a general Functional Form // // Author: Krish Majumdar -- contact person // // REVISION HISTORY: // - 20/06/2014 : Krish Majumdar - new file // - 04/09/2014 : Krish Majumdar - changes to variable names to make // things more specific // - 28/11/2014 : Matt Strait - Doxygen fixes // - 11/01/2015 : Krish Majumdar - added external event reconstruction // - 06/05/2015 : Matt Mottram - added ability to run in partial fill // - 04/06/2015 : Krish Majumdar - code review changes // // The general function is: H = f(E) * f(r) * f(z), where: // H is a "segmentor parameter", // f(E) is a function of energy, // f(r) is a function of radius, the exact form of which is radius-dependent, // f(z) is a function of z. // This general function is inverted to give the energy. // // See DocDB-2782 for more information on this fitter. // /////////////////////////////////////////////////////////////////////// #ifndef __RAT_Method_EnergyFunctional__ #define __RAT_Method_EnergyFunctional__ #include #include #include #include namespace RAT { namespace Methods { class EnergyFunctional : public SeededMethod { public: // Returns the method's name virtual std::string GetName() const { return EnergyFunctional::Name(); } // Returns the method's name static std::string Name() { return std::string("energyFunctional"); } // Initialise the method // // "param" is an optional index in the db to use void Initialise(const std::string& param); // Load the table from the database void BeginOfRun(DS::Run& run); void EndOfRun(DS::Run& run); // Set the seed to the default void DefaultSeed(); // Calculate and return the best fit for the seed virtual DS::FitResult GetBestFit(); private: std::string fIndex; // Optional index override for the db table std::string fMaterial; // Material being used in the simulation ... must be a global variable to set the validity in the GetBestFit() function std::vector fEnergyCoefficients; // f(E) parameters std::vector fRadiusCoefficients_Internal_Low; // f(r) parameters when r in the low-radius internal region double fRadiusCutoff_Internal_Mid; // Radius cutoff defining the boundary between the low- and middle-radius internal regions std::vector fRadiusCoefficients_Internal_Mid; // f(r) parameters when r in the middle-radius internal region double fRadiusCutoff_Internal_High; // Radius cutoff defining the boundary between the middle- and high-radius internal regions std::vector fRadiusCoefficients_Internal_High; // f(r) parameters when r in the high-radius internal region double fRadiusCutoff_External_Low; // Radius cutoff defining the boundary between the high-radius internal and low-radius external regions std::vector fRadiusCoefficients_External_Low; // f(r) parameters when r in the low-radius external region double fRadiusCutoff_External_High; // Radius cutoff defining the boundary between the low- and high-radius external regions std::vector fRadiusCoefficients_External_High; // f(r) parameters when r in the high-radius external region std::vector fZCoefficients; // f(z) parameters, covering both internal and external regions double fAVRadius; // AV radius, taken from geometry file // General function for calculating the value of a polynomial of any order // // "coefficients" is a vector of coefficients, ordered by increasing power of "parameter" // "parameter" is the independent variable in the polynomial double EvaluatePolynomial(std::vector coefficients, double parameter); }; } //::Method } //::RAT #endif