////////////////////////////////////////////////////////////////////////
/// \class RAT::PDFs::ET1D
///
/// \brief   Effective time 1d pdf
///
/// \author name Phil G Jones <p.jones22@physics.ox.ac.uk>
/// \author Matt Mottram < m.mottram@qmul.ac.uk> -- contact person
///
/// REVISION HISTORY:\n
///     15/07/2011 : P G Jones - New file \n
///     2019/06/16 : Logan Lebanowski - Handle outlier positions
///
/// \details Returns probabilities for a 1d pdf using the effective velocity
///         transit time routine.
///
////////////////////////////////////////////////////////////////////////

#ifndef __RAT_PDF_ET1D__
#define __RAT_PDF_ET1D__

#include <RAT/PDF.hh>
#include <RAT/DU/TimeResidualCalculator.hh>

#include <string>

class G4PhysicsOrderedFreeVector;

namespace RAT
{

class FitterPMT;

namespace DS
{
  class FitVertex;
}

namespace PDFs
{

class ET1D : public PDF
{
public:
  double GetProbability( const FitterPMT& pmt, const DS::FitVertex& vertex );

  std::string GetName() const { return Name(); }
  static std::string Name() { return std::string( "et1d" ); }

  /// Initialise the scintTiming PDF
  void Initialise( const std::string& param );

  void BeginOfRun( DS::Run& run );

  void EndOfRun( DS::Run& run );
protected:
  std::string fIndex; ///< Optional database index
  G4PhysicsOrderedFreeVector* fProbability; ///< PDF in a convenient interpolating structure
  DU::TimeResidualCalculator fTRCalc; ///< Time residual calculator for a given run
};

} //::PDFs

} //::RAT

#endif