/////////////////////////////////////////////////////////////////////// // // Energy fit using a seed position, direction and the nhit // // Author: name John Walker // // REVISION HISTORY: // 27/01/2015 : J Walker - New file // 15/07/2015 : J Walker - Changed to cubic spline interpolation, // different prompt windows for materials, // and added material private variable // 01/10/2015 : J Walker - Scaling energy by number of working PMTs // 09/03/2016 : M Mottram - Fix compiler warnings // 08/06/2016 : J Walker - Remove Cerenkov limit for scintillator // // This method uses a position and direction dependent lookup // table to scale the prompt nhits of the event. The prompt nhits are // then converted to an energy using another lookup table. This fitter // is only for a detector geometry with light water in the inner av. // /////////////////////////////////////////////////////////////////////// #ifndef __RAT_Method_EnergyPromptLookup__ #define __RAT_Method_EnergyPromptLookup__ #include #include #include #include namespace RAT { namespace Methods { class EnergyPromptLookup : public SeededMethod { public: // Returns the method's name virtual std::string GetName() const { return EnergyPromptLookup::Name(); } // Returns the method's name static std::string Name() { return std::string( "energyPromptLookup" ); } // Initialise the method // // "param" is an optional index in the db to use void Initialise( const std::string& param ); // This will load the tables 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(); // Performs a 1D interpolation using the TSpline3 method // // "inValue" is the input value // "inTable" is a table of values corresponding to the input // "outTable" is a table of corresponding coordinates to "inTable" values Double_t Interpolate1D( const Double_t inValue, const std::vector inTable, const std::vector outTable ); // Performs a 2D interpolation using the TSpline3 method // // "inValue1" is the first input value // "inValue2" is the second input value // "inTable1" is a table of values corresponding to input value 1 // "inTable2" is a table of values corresponding to input value 2 // "outTable" is a table of corresponding coordinates to "inTable1" and "inTable2" values Double_t Interpolate2D( const Double_t inValue1, const Double_t inValue2, const std::vector inTable1, const std::vector inTable2, const std::vector outTable ); private: std::string fMaterial; // Material used to fill inner AV double fRBins; // Number of radius bins between 0 and 6005 mm double fCosThetaBins; // Number of costheta bins between -1 and 1 double fRMax; // Maximum radius double fWorkingPMTs; // Number of working PMTs at time of coordination std::vector fPromptWindow; // The prompt hit time window std::vector fScalingFactor; // The scaling factor as a function of radius and costheta std::vector fMeVValues; // The lookup table for energies std::vector fNhitValues; // The lookup table for radii std::string fIndex; // Optional index override for the db table - unused at the moment PMTSelectors::PMTSelector* fTimeResidualCut; // Time residual cut PMT selector PMTSelectors::PMTSelector* fPMTCalSelector; // PMTCalSelector }; } //::Method } //::RAT #endif