//////////////////////////////////////////////////////////////////////// /// /// \class MultiPDF /// /// \brief Fitter method for using different PDFs for different PMT /// or PDF position /// /// \author Will Parker william.parker@physics.ox.ac.uk /// /// REVISION HISTORY: /// Oct 22, 2020 : Will Parker First revision, new file. /// /// Mar 17, 2021 : Will Parker Generalising method so not so specific /// to partial fill case. Now initialise /// with string to determine whether to use /// full fill or partial (this determines /// which db tables to use, and which set of pdfs). /// For using position dependent pdfs, instead of /// "position relative to fill level center" we now /// have a "position relative to origin". In partial /// fill the "origin" is set as center of fill level /// as pdfs are split by distance relative to fill /// level. For full fill the origin is set as center /// of AV. But you could set the 'origin' as any /// point and use the distance from that to split /// pdfs. /// /// Jan 16, 2024 : Will Parker Use seed result to determine which radial shell /// to select PDF for. PDF now gets chosen once per /// event instead of per fit iteration /// /// \detail Method uses different pdfs to fit vertex position. The /// different pdfs correspond to different regions of the av, /// and different pmt heights. If the seed position is within /// 50 cm of the boundary separating the position-dependent /// pdfs, then non-vertex-position dependent pdfs are used //////////////////////////////////////////////////////////////////////// #ifndef __RAT_MultiPDF__ #define __RAT_MultiPDF__ #include #include #include #include #include #include #include "TVectorD.h" namespace RAT { namespace Methods { class MultiPDF : public SeededMethod, SelectorMethod { public: /// Returns the name virtual std::string GetName() const { return MultiPDF::Name(); } /// Fitter structure name static std::string Name() { return std::string("multipdf"); } /// Constructor MultiPDF(); /// Destructor ~MultiPDF(); /// Initialise the method void Initialise( const std::string& ); /// Set the default seed (origin, t=230ns, big errors) virtual void DefaultSeed(); /// Reads constants from the database /// FIT_MULTIPDF.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(); // Default fitters may have subroutines that set the same FOM name for different parameters // Add a prefix for the FOM name in the final result to distinguish them. void SetFOMs( DS::FitResult& fitResult, const DS::FitResult& MultiPDF, const std::string& prefix ); protected: Methods::Method* fPositionTime; Methods::Method* fPositionTimeNonPosDep; Optimisers::Optimiser* fPowell; PMTSelectors::PMTSelector* fNullSelector; PDFs::PDF* fMultiPDFs; PDFs::PDF* fMultiPDFsNonPosDep; std::string fGeo; // Full scintillator fill ("scint") or partial fill ("scintwater") int fNumPosDepPDFs; // Number of position dependent pdfs int fNumNonPosDepPDFs; // Number of non-position depdendent pdfs double fFillLevel; std::vector fAV_offset; TVector3 fFillLevelCentre; // For determining if seed result is in different region to final result TVector3 fOrigin; // For determining if seed result is in different region to final result. This is the center of the fill Level for partial fill, center of AV for full fill std::vector fRBoundary; // For determining if seed result is close to boundary between position depedent pdfs int fBoundaryRange; // If seed result within this range of position boundary, use non-position-dependent PDFs. Units: mm }; } //::Methods } //::RAT #endif