//////////////////////////////////////////////////////////////////////// /// \class RAT::IBDCrossSec /// \author Nuno Barros -- contact person /// \date 17-Oct-2016 /// /// \brief Standalone, easily expandable class to calculate IBD cross sections. /// /// REVISION HISTORY: /// - 17-Oct-2016 : Nuno Barros /// - Initial revision. /// /// - 16-Jul-2019 : Charlie Mills /// * Changed default definition of Sigma0, see docDB #5805 /// * Default strategy can be changed in line 39 to use different definition of Sigma0 /// /// - 11-Oct-2019 : Nuno Barros /// * Modified code to maintain consistency with the CrossSectionBase class /// * Refactored code to use the cross section manager (maintains backwards compatibility) /// /// - 14-Oct-2019 : Nuno Barros /// * Introduced pre-computed tables for both strategies /// * Refactored and cleaned the code to avoid code duplication. /// //////////////////////////////////////////////////////////////////////// #ifndef SRC_UTIL_IBDCROSSSEC_HH_ #define SRC_UTIL_IBDCROSSSEC_HH_ #include #include #include #include class TFile; class TH2F; namespace RAT { class IBDCrossSecMessenger; class IBDCrossSec : public CrossSectionBase { public: enum Strategy {Unknown=-1,Vogel=0,VogelTable,VogelNeutron,VogelNeutronTable,NoStrategy}; IBDCrossSec(); virtual ~IBDCrossSec(); void SetStrategy(Strategy strat); virtual void SetStrategy(const short int strat); double dSigmadTheta(const double Enu, const double cosThetaLab) const ; virtual double Sigma(const double E) const; static std::string GetStrategyName(Strategy str) { return _str_map.find(str)->second; } static Strategy GetStrategyCode(std::string str) { std::map::const_iterator it; Strategy st = Unknown; for (it = _str_map.begin(); it != _str_map.end(); ++it) { if(it->second == str) { st = it->first; } } if (st == Unknown) { Log::Die("Strategy [" + str + "] does not exist."); } return st; } protected: // Concrete cross section implementations using different strategies double dSigmadThetaVogel(const double Enu, const double cosThetaLab) const; double dSigmadThetaVogelTable(const double Enu, const double cosThetaLab) const; double SigmaVogel(const double Enu) const; double Sigma_numericInt(const double Enu) const; virtual void LoadTablesDB(); double Sigma0() const; double Sigma0_Neutron() const; double Sigma0_Original() const; private: static std::map init_map() { std::map m; m[Vogel] = "Vogel"; m[VogelNeutron] = "VogelNeutron"; m[VogelTable] = "VogelTable"; m[VogelNeutronTable] = "VogelNeutronTable"; return m; } static const std::map _str_map; Strategy convert_strategy(const short int strat); TFile *fInputFile; TH2F* fXsTable; /// Define a series of constants that are used througout the code, /// these are invariant with respect to the strategy used // -- couplings static const double fPhase_f; static const double fPhase_f2; static const double fPhase_g; static const double fPhaseFactor; // -- neutron lifetime static const double fNeutronLifetime; // -- delta mass static const double fDelta; // -- fermi coupling constant static const double fGFermi; static const double fCosThetaC; }; } /* namespace RAT */ #endif /* SRC_UTIL_IBDCROSSSEC_HH_ */