Back to home page

EIC code displayed by LXR

 
 

    


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 {  // general parameters
0029       //std::string         m_runtime;
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;}   // pb GeV^2
0098     double c()                    { return 299.792458e9;}   // mm/s
0099     double hBar()                 { return 6.58211889e-25;} // GeV s
0100 #else
0101     constexpr double Picobarn()             { return 3.89379656e8;}   // pb GeV^2
0102     constexpr double c()                    { return 299.792458e9;}   // mm/s
0103     constexpr double hBar()                 { return 6.58211889e-25;} // GeV s
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   \class Run_Parameter
0116   \brief reads in parameter files and provides the main parameters for the rest of the program
0117 
0118   This class reads in the parameter file Run.dat and provides the program with all
0119   parameters an swiches necessary for one run.
0120 */
0121 
0122 /*!
0123   \intern
0124   double Picobarn()                       { return 3.89379656e8;} // pb/GeV^2
0125   double c()                              { return 299792458.e3;} // mm/s
0126   double hBar()                           { return 6.58211889e-25;} // GeV s
0127 
0128   std::string GetPath()                   { return path;}
0129   std::string SetPath(std::string _path)  { path = _path;}
0130 */
0131 
0132 }  // namespace ATOOLS
0133 
0134 
0135 /*!
0136  \file
0137  \brief   contains Run_Parameter and the description the whole ATOOLS package
0138 
0139 */
0140 
0141 /*!
0142   \package ATOOLS
0143 
0144   The ATOOLS package is the basis of the simulation of physics within the SHERPA framework.
0145   It provides a collection of basic classes and function within the namespace ATOOLS.
0146   Three main libraries are defined.
0147 
0148   \section amatools Mathematical Tools
0149   In the directory Math all classes with a pure mathematical meaning are collected.
0150 
0151   \section aphytools Physical Tools
0152   In the directory Phy all basic classes needed for physics descriptions are collected.
0153   Here you can find Flavour, Blob, etc.
0154 
0155   \section aorgtools Organisation Tools
0156   In the directory Org all basic classes needed organisational purposes are collected.
0157   Here you can find classes for reading in and writing out variables (IO_Handler), accessing
0158   runtime parameters (Run_Parameter), etc.
0159 */
0160 
0161 
0162 /*!
0163  \namespace ATOOLS
0164   In the namespace ATOOLS all classes with a pure mathematical meaning are collected.
0165   In addition all basic classes needed for physics descriptions are collected here,
0166   e.g. Flavour, Blob, etc.
0167   Classes needed for organisational purposes can be found as well, e.g. for reading in and
0168   writing out variables (IO_Handler), accessing runtime parameters (Run_Parameter), etc.
0169 */
0170 
0171 #endif  // Run_Parameter_h