//////////////////////////////////////////////////////////////////////// /// \class RAT::MultiPathScintWater /// /// /// \brief Fitter for a partial AV fill with /// /// \author Kalpana Singh /// /// REVISION HISTORY:\n /// 10 April 2016 : David Auty \n /// 12 Mar 2018 : Jie Hu - modified to J Tseng's fitter structure \n /// /// Fitter that evaluates the possible straight path and reflected light /// path for light to get to the PMT. After the best position is found /// it give the best direction /// ////////////////////////////////////////////////////////////////////////// #ifndef __RAT_MultiPathScintWater__ #define __RAT_MultiPathScintWater__ #include #include #include //#define MULTIPATH_FIXED_SEED namespace RAT { class MultiPathScintWater : public VertexFunction { public: /// constructor MultiPathScintWater(); /// return the name virtual std::string GetName() const { return MultiPathScintWater::Name(); } /// fitter structure name static std::string Name() { return std::string("multiPathScintWater"); } /// called at beginning of run virtual void BeginOfRun( DS::Run& ); /// called at end of run virtual void EndOfRun( DS::Run& ) { } /// initialise the function (when instantiated by MultiPath method) virtual void Initialise( const std::string& param ); /// set seed from a previous result virtual void SetSeed(const DS::FitResult& result); /// set a result from the parameters virtual DS::FitResult MakeResult(const std::vector& pars); /// set a starting set of parameters for one iteration virtual std::vector GetStart(); /// calculates the figure of merit for a given PMT and vertex. virtual double Calculate( const std::vector& pmt, const std::vector& par, std::vector& diff ); /// check whether the parameters yield a valid result virtual bool ValidResult(const std::vector& pars); private: /// returns likelihood and derivative // different structure in partial fitter since time of flight is calculated in different ways double LAnddLdt( double tDiff, double tof, double& dLdt ); double LAnddLdtScint( double tDiff, double tof, double& dLdt ); /// database table FIT_MULTIPATH std::vector fPDFDataCh; // sPDF_multipathfit, reserved for 2-pdf fit, not used here std::vector fPDFxCh; // bin edges std::vector fPDFCh; // histogram std::vector fDerivativeCh; // derivative histogram int fEntriesTimeCh; // number of histogram bins double fMaxPMTtRes; // max_PMT_tRes double fBoundary; //boundary tolerance double fPSUPRadius; double fPSUPRadius2; // psup_rad, squared double fAVRadiusOuter; // outer radius, 6060 mm double fAVRadius; // inner radius, 6005 mm double fNeckRadiusOuter; // outer radius of neck double fNeckRadius; // inner radius of neck double fZoff; // z offset of AV to the PSUP std::vector fPDFDataScint; // sPDF_scint std::vector fPDFxScint; // bin edges std::vector fPDFScint; // histogram std::vector fDerivativeScint; // derivative histogram /// special components used by Scint-Water fitter double fWaterLevel; // distance of water level from 0 z double fSpeedOfLightWater; //speed of light in water double fSpeedOfLightScint; // speed of light in scintillator int fMaxReflects; // maximum reflection and refraction probabilities double fDepth; // waterLevel - trial vertex Z (par[2]), depth of vertex below water unsigned int fNumFitFactors; // num fit factors (const/DB) unsigned int fMaxNumStartPos; // maximum number of start positions to be tested double fRhoCut; // limit in rho to generate candidate vertexes TMatrixT fFactor;// transverse distance from dh to the surface of the water std::vector fRWater;// reflectivity of Water-air interface as function of cosTheta std::vector fRScint;// average (over polarizations) reflectivity of ScintWater interface as function of cosTheta double fWaterRI; double fScintRI; double fWaterRIeff; double fScintRIeff; bool fNeckpathEnable; // enable neck path calculation double fZneckLo; // bottom of the neck in z position double fHeight;// pmtZ - waterLevel /// calculates fraction of transverse distance from sDepth to the surface by interpolating, based on sDepth and fHeigh double Factor( double transverse, double dh); double FactorN( double transverse, bool pmtBot ); void CalculateScintPath( double *vtxdata, std::vector& pathResults ); #ifdef MULTIPATH_FIXED_SEED double step; #endif }; } //::RAT #endif