//////////////////////////////////////////////////////////////////////// /// \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. /// //////////////////////////////////////////////////////////////////////// #ifndef SRC_GEN_IBDCROSSSEC_HH_ #define SRC_GEN_IBDCROSSSEC_HH_ #include #include #include class TFile; class TH2F; using std::string; using std::map; namespace RAT { class IBDCrossSecMessenger; class IBDCrossSec { public: enum Strategy {Vogel=0,VogelTable}; IBDCrossSec(); virtual ~IBDCrossSec(); short int GetStrategy() const { return _strategy; } void SetStrategy(Strategy strat); double dSigmadTheta(const double Enu, const double cosThetaLab); double Sigma(const double Enu); static string GetStrategyName(Strategy str) { return _str_map.find(str)->second; } static Strategy GetStrategyCode(string str) { map::const_iterator it; for (it = _str_map.begin(); it != _str_map.end(); ++it) { if(it->second == str) { return it->first; } else { Log::Die("Strategy [" + str + "] does not exist."); } } } protected: // Concrete cross section implementations using different strategies double dSigmadThetaVogel(const double Enu, const double cosThetaLab); double dSigmadThetaVogelTable(const double Enu, const double cosThetaLab); void LoadTable(Strategy strat); private: static map init_map() { map m; m[Vogel] = "Vogel"; m[VogelTable] = "VogelTable"; return m; } static const map _str_map; Strategy _strategy; TFile *_input_file; TH2F* _xs_table; IBDCrossSecMessenger *fMessenger; }; } /* namespace RAT */ #endif /* SRC_GEN_IBDCROSSSEC_HH_ */