//////////////////////////////////////////////////////////////////////// /// /// \class MultiPath /// /// \brief Fitter method for different media with the possibility of /// multiple path calculations of LLH. /// /// \author Jeff Tseng jeff.tseng@physics.ox.ac.uk /// Aksel Hallin aksel.hallin@ualberta.ca /// Jie Hu jhu9@ualberta.ca /// David Auty auty@ualberta.ca /// Kalpana Singh kalpana.singh@ualberta.ca /// /// REVISION HISTORY: /// Dec 29, 2014 : Aksel Hallin First itteration as part of /// Particle water fitter /// Jul 29, 2015 : Kalpana Singh Split the fitter out to make a /// generic fitter that can run other /// detector states /// Apr 30, 2016 : David Auty Integrated partial air water /// fitter in this structure /// Feb 6, 2018 : Jeff Tseng Restructured /// /// May 1, 2018 : Jie Hu Add partial-fitter and scint-fitter /// /// This method can be invoked from the FitterProcessor. /// /// The position fitter is invoked with /// /rat/proc fitter /// /rat/procset method "multipath-waterposition" /// /rat/procset name "multipath" /// /// The direction fitter requires a seed, from which it copies the /// vertex position, which it leaves fixed. In the following, /// the multipath position fit is used. /// /rat/proc fitter /// /rat/procset/method "multipath-waterdirection" /// /rat/procset/seed "multipath" /// /// The partial fitter is invoked with /// /rat/proc fitter /// /rat/procset method "multipath-scintwater" /// /rat/procset name "multipath" /// /// The scint fitter is invoked with /// /rat/proc fitter /// /rat/procset method "multipath-scint" /// /rat/procset name "multipath" /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_MultiPath__ #define __RAT_MultiPath__ #include #include #include #include #include "TVectorD.h" #include "TMatrixT.h" namespace RAT { namespace Methods { class MultiPath : public SeededMethod, SelectorMethod { public: /// returns the name virtual std::string GetName() const { return MultiPath::Name(); } /// fitter structure name static std::string Name() { return std::string("multipath"); } /// constructor MultiPath(); /// destructor ~MultiPath(); /// initialise the method (by factory) /// "waterposition" : MultiPathWaterPosition /// "waterdirection": MultiPathWaterDirection virtual void Initialise( const std::string& param ); /// set the default seed (origin, t=230ns, big errors) virtual void DefaultSeed(); /// Reads constants from the database /// FIT_MULTIPATH.ratdb virtual void BeginOfRun( DS::Run& run ); /// forwards EndOfRun to VertexFunction virtual void EndOfRun( DS::Run& run ); /// runs the algorithm and returns the answer virtual DS::FitResult GetBestFit(); /// dump likelihood contours to a TFile void DumpLikelihood(int index, int gtid, std::string dumpVariable); protected: /// set the VertexFunction to use void SetFunction(VertexFunction* func); // sum likelihoods from PMTs' Calculate() functions. // Returns log(L), and fBeta and fCov. double SumLikelihoods(const std::vector& par); std::string fInitString; // initialization parameter (waterposition or waterdirection) VertexFunction* fFunction; // the PMT-vertex likelihood function int fStepsBelowTolerance; // number of steps to do after reaching tolerance int fMaximumIterations; // convergence parameter double fTolerance; // chisquare tolerance double fMax_nStart; // for boundaryCut; for boundary events, set a limit for start position double fBoundaryTolerance; // for boundaryCut; boundary tolerance double fFitterPar; // save extra parameters required by special fitter, eg. fWaterLevel for scintwater fitter bool fBoundaryCut; // set to true to reduce iterations for boundary events /// geometry parameters used by partial and scint fitter, to set seeding boundary double fZoff; // z offset of AV to the PSUP double fAVRadius; double fAVRadiusOuter; double fNeckRadius; double fNeckRadiusOuter; double fZneckLo; // bottom of the neck bool fDumpValid; // set to true to dump likelihood contours std::vector fGTID; // GTID's for which to dump likelihood contours int fNEvents; // counter of fits /// reduced PMT data: /// positions and times only for the selected PMTs std::vector< std::vector > fPMTReduced; /// calculated by SumLikelihoods TVectorD fBeta; // derivatives TMatrixT fCov; // covariance matrix /// calculated by GetBestFit std::vector fParsBest; // best fit double fLBest; // best fit likelihood }; } //::Methods } //::RAT #endif