File indexing completed on 2025-04-19 09:09:53
0001 #ifndef ATOOLS_Org_Run_Parameter_H
0002 #define ATOOLS_Org_Run_Parameter_H
0003
0004 #include "ATOOLS/Org/CXXFLAGS.H"
0005 #include <string>
0006 #include <map>
0007 #include <array>
0008 #include "ATOOLS/Phys/Flavour.H"
0009 #include "ATOOLS/Math/Matrix.H"
0010 #include "ATOOLS/Math/Function_Base.H"
0011 #include "ATOOLS/Org/MyTiming.H"
0012
0013 namespace PDF {
0014 class PDF_Base;
0015 }
0016
0017 namespace ATOOLS {
0018
0019 class Run_Parameter {
0020 std::string m_path, m_file;
0021 void RegisterDefaults();
0022 public:
0023 Run_Parameter();
0024 ~Run_Parameter();
0025 void Init();
0026 void AnalyseEnvironment();
0027
0028 class Gen {
0029
0030 long int m_nevents, m_ngenevents, m_ntrials;
0031 long int m_seeds[4];
0032 double m_ecms;
0033 double m_accu, m_sqrtaccu;
0034 Flavour m_beam1, m_beam2, p_bunch[2];
0035 std::array<Vec4D, 2> m_pbeam;
0036 std::array<Vec4D, 2> m_pbunch;
0037 PDF::PDF_Base* m_pdfset[2];
0038 MyTiming m_timer;
0039 double m_timeout;
0040 int m_batchmode;
0041 std::string m_username,m_hostname;
0042 bool m_softsc, m_hardsc;
0043 std::map<std::string,std::string> m_variables;
0044 std::vector<std::string> m_cites;
0045 size_t m_clevel;
0046 public:
0047 inline long NumberOfEvents() { return m_nevents; }
0048 inline long NumberOfGeneratedEvents() { return m_ngenevents; }
0049 inline long NumberOfTrials() { return m_ntrials; }
0050 inline void SetNumberOfEvents(long N) { m_nevents = N; }
0051 inline double Ecms() { return m_ecms; }
0052 void SetEcms(double _ecms);
0053 inline Vec4D PBeam(short unsigned int i) { return m_pbeam[i]; }
0054 void SetPBeam(short unsigned int i,Vec4D pbeam);
0055 inline Vec4D PBunch(short unsigned int i) { return m_pbunch[i]; }
0056 void SetPBunch(short unsigned int i,Vec4D pbunch);
0057 inline bool SoftSC() { return m_softsc; }
0058 inline void SetSoftSC(bool sc) { m_softsc = sc;}
0059 inline bool HardSC() { return m_hardsc; }
0060 inline void SetHardSC(bool sc) { m_hardsc = sc;}
0061 inline const Flavour Beam1() { return m_beam1; }
0062 inline const Flavour Beam2() { return m_beam2; }
0063 void SetBeam1(const Flavour b);
0064 void SetBeam2(const Flavour b);
0065 inline void SetPDF(size_t i, PDF::PDF_Base* pdf) { m_pdfset[i]=pdf; }
0066 inline PDF::PDF_Base* PDF(size_t i) { return m_pdfset[i]; }
0067 inline const Flavour Bunch(const size_t i) { return p_bunch[i]; }
0068 inline void SetBunch(const Flavour b,const size_t i) { p_bunch[i] = b; }
0069 inline void SetTimeOut(const long int timeout) { m_timeout=timeout; }
0070 inline double TimeOut() { return m_timeout; }
0071 inline MyTiming &Timer() { return m_timer; }
0072 inline int BatchMode() { return m_batchmode; }
0073 bool CheckTime(const double limit=0.);
0074 inline void SetNumberOfGeneratedEvents(const long gen) { m_ngenevents=gen; }
0075 inline void SetNumberOfTrials(const long trials) { m_ntrials=trials; }
0076 inline const std::string &UserName() { return m_username; }
0077 inline const std::string &HostName() { return m_hostname; }
0078 std::string Variable(const std::string &key);
0079 inline void SetVariable(const std::string &key,const std::string &value)
0080 { m_variables[key]=value; }
0081 inline void AddToVariable(const std::string &key,const std::string &value)
0082 { m_variables[key]+=value; }
0083 inline const std::vector<std::string> &Citations() { return m_cites; }
0084 void AddCitation(const size_t &level,const std::string &cite);
0085 void WriteCitationInfo();
0086 void PrintGitVersion(std::ostream &str,
0087 const bool& shouldprintversioninfo,
0088 const std::string &prefix="");
0089
0090 inline double Accu() { return m_accu; }
0091 inline double SqrtAccu() { return m_sqrtaccu; }
0092
0093 friend class Run_Parameter;
0094 } gen;
0095
0096 #if defined(__GNUC__) && __GNUC__ < 5
0097 double Picobarn() { return 3.89379656e8;}
0098 double c() { return 299.792458e9;}
0099 double hBar() { return 6.58211889e-25;}
0100 #else
0101 constexpr double Picobarn() { return 3.89379656e8;}
0102 constexpr double c() { return 299.792458e9;}
0103 constexpr double hBar() { return 6.58211889e-25;}
0104 #endif
0105 std::string GetPath() { return m_path;}
0106 std::string SetPath(std::string path) { return m_path = path;}
0107 };
0108
0109 extern Run_Parameter *rpa;
0110
0111 std::ostream &operator<<(std::ostream &str,const Run_Parameter &rp);
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132 }
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171 #endif