UnivUtilities.h
Go to the documentation of this file.
1 #ifndef _UNIV_Utilities_
2 #define _UNIV_Utilities_
3 
4 #include <iostream>
5 #include <map>
6 #include <unordered_map>
7 #include <string>
8 #include <vector>
9 #include <functional>
10 
11 namespace un2 {
12 
13  //------------------------------------
14  //--- Utilities
15  //------------------------------------
16 
17  const std::string PREFIX = "/home/max/Universality/universality-v2";
18  //extern const std::string BOOTSTRAP;
19 
20 /* old crap that should be removed soon
21  *
22  *
23  * //------------------------------------
24  * //--- Simulation Constants
25  * //------------------------------------
26  *
27  * extern const std::vector<std::string> fComponents;
28  * extern const std::vector<std::string> fReducedComponents;
29  *
30  * extern const std::vector<std::string> fModel;
31  * extern const int nModels;
32  *
33  * extern const std::vector<std::string> fPrim ;
34  * extern const int nPrim;
35  *
36  * extern const std::vector<double> flgE;
37  * extern const std::vector<std::string> flgE_std::string;
38  * extern const int nlgE;
39  *
40  * extern const std::vector<double> fTh;
41  * extern const std::vector<std::string> fTh_std::string;
42  * extern const int nTh;
43  * extern const int nSh;
44  *
45  * // unit [m]
46  * extern const std::vector<double> fRing;
47  * extern const std::vector<std::string> fRing_std::string;
48  * extern const std::vector<std::string> fRing_std::stringXML;
49  *
50  * extern const unsigned int nRings;
51  *
52  * // unit [m]
53  * // note: fRadialBorders must NOT contain an element smaller than the smallest sampling area
54  * // coordinate (same goes later for fAzimuthBorders)
55  * extern const std::vector<double> fRadialBorders;
56  *
57  * // unit [rad]
58  * extern const std::vector<double> fAzimuth;
59  * // unit [deg]
60  * extern const std::vector<int> fSlice;
61  * extern const std::vector<std::string> fSlice_std::string;
62  *
63  * extern const unsigned int nAzimuths;
64  *
65  * // note: areas close to +pi get assigned the az.coordinate -pi (which is the same)
66  * // following the lower-inclusive upper-exclusive convention
67  * extern const std::vector<double> fAzimuthBorders;
68  *
69  * extern const std::vector<double> nSlices_R;
70  *
71  * // the gronud level depth in g/cm**2 for months 0.. jan to 11.. dec
72  * // these are taken directly from corsika
73  * extern const std::vector<double> groundLevelDepth;
74  *
75  * //------------------------------------
76  * //--- List & Map known Detector types (WCD, SSD, MD)
77  * //------------------------------------
78  * extern const std::vector<std::string> DetectorTypes;
79  * extern const map<std::string, int> DetTypeID;
80  *
81  */
82  class UniversalityConfig {
83 
84  public:
85 
86  // obviously the same for all configs
87  const std::string GetPrefix()
88  {
89 
90  const std::string prefix = "/home/max/Universality/universality-v2";
91  return prefix;
92 
93  };
94 
95  const std::string GetBootstrap()
96  {
97 
98  const std::string bootstrap = "/home/max/Universality/universality-v2/src/bootstrap.xml";
99  return bootstrap;
100 
101  };
102 
103  // top level simulation config
104  virtual const std::vector<std::string> GetComponents();
105  virtual const std::vector<std::string> GetReducedComponents();
106  virtual const std::vector<std::string> GetHadronModels();
107  virtual const std::vector<std::string> GetPrimaries();
108  virtual const std::vector<double> GetLogEnergies();
109  virtual const std::vector<std::string> GetLogEnergiesStrings();
110  virtual const std::vector<double> GetZeniths();
111  virtual const std::vector<std::string> GetZenithsStrings();
112  virtual const std::vector<double> GetGroundLevelDepths();
113 
114  // detector and station config
115  virtual const std::vector<std::string> GetDetectors();
116  virtual const std::vector<double> GetStationRings();
117  virtual const std::vector<std::string> GetStationRingsStrings();
118  virtual const std::vector<double> GetStationSlices();
119  virtual const std::vector<double> GetStationSlicesRad();
120  virtual const std::vector<std::string> GetStationSlicesStrings();
121  virtual const std::vector<std::string> GetStationRingsXML();
122  virtual const std::vector<std::string> GetStationSlicesXML();
123 
124  virtual const std::unordered_map<std::string, unsigned int> GetStationRingsStringsMap();
125  virtual const std::unordered_map<std::string, unsigned int> GetStationSlicesStringsMap();
126  virtual const std::unordered_map<std::string, unsigned int> GetMonthsMap();
127  virtual const std::unordered_map<unsigned int, std::string> GetMonthsMapReverse();
128 
129  };
130 
131  // Singleton specific config
132  // Create a similar class, if you have a different config!
133  class PowerConfig : public UniversalityConfig {
134 
135  private:
136 
139 
140  public:
141 
142  static PowerConfig* getConfig();
143 
144  static const std::vector<std::string> components;
145  static const std::vector<std::string> reducedComponents;
146  static const std::vector<std::string> hadronModels;
147  static const std::vector<std::string> primaries;
148  static const std::vector<double> logEnergies;
149  static const std::vector<std::string> logEnergiesStrings;
150  static const std::vector<double> zeniths;
151  static const std::vector<std::string> zenithsStrings;
152  static const std::vector<double> groundLevelDepths;
153 
154  static const std::vector<std::string> detectors;
155  static const std::vector<double> stationRings;
156  static const std::vector<std::string> stationRingsStrings;
157  static const std::vector<double> stationSlices;
158  static const std::vector<double> stationSlicesRad;
159  static const std::vector<std::string> stationSlicesStrings;
160  static const std::vector<std::string> stationRingsXML;
161  static const std::vector<std::string> stationSlicesXML;
162 
163  static const std::unordered_map<std::string, unsigned int> stationRingsStringsMap;
164  static const std::unordered_map<std::string, unsigned int> stationSlicesStringsMap;
165  static const std::unordered_map<std::string, unsigned int> monthsMap;
166  static const std::unordered_map<unsigned int, std::string> monthsMapReverse;
167 
168  };
169 
170 };
171 
172 #endif
virtual const std::vector< std::string > & GetStationRingsXML() const =0
const std::string GetBootstrap()
Definition: UnivUtilities.h:95
virtual const std::vector< double > & GetLogEnergies() const =0
static const std::vector< std::string > detectors
const std::string GetPrefix()
Definition: UnivUtilities.h:87
static const std::vector< std::string > zenithsStrings
static PowerConfig * getConfig()
static const std::vector< double > stationSlicesRad
static const std::unordered_map< std::string, unsigned int > stationRingsStringsMap
static const std::vector< std::string > stationSlicesXML
static const std::vector< std::string > stationRingsStrings
static PowerConfig * config
virtual const std::vector< double > & GetStationSlicesRad() const =0
virtual const std::vector< std::string > & GetDetectors() const =0
virtual const std::vector< std::string > & GetComponents() const =0
virtual const std::vector< std::string > & GetZenithsStrings() const =0
static const std::vector< std::string > stationSlicesStrings
virtual const std::vector< double > & GetGroundLevelDepths() const =0
static const std::vector< double > stationSlices
static const std::vector< double > zeniths
const std::string PREFIX
virtual const std::vector< std::string > & GetLogEnergiesStrings() const =0
virtual const std::vector< double > & GetZeniths() const =0
virtual const std::vector< std::string > & GetPrimaries() const =0
static const std::vector< std::string > logEnergiesStrings
static const std::vector< std::string > hadronModels
virtual const std::vector< double > & GetStationSlices() const =0
virtual const std::vector< double > & GetStationRings() const =0
virtual const std::vector< std::string > & GetStationSlicesXML() const =0
static const std::vector< std::string > reducedComponents
virtual const std::vector< std::string > & GetReducedComponents() const =0
static const std::unordered_map< unsigned int, std::string > monthsMapReverse
static const std::vector< std::string > components
static const std::unordered_map< std::string, unsigned int > monthsMap
static const std::unordered_map< std::string, unsigned int > stationSlicesStringsMap
static const std::vector< double > logEnergies
virtual const std::vector< std::string > & GetStationRingsStrings() const =0
static const std::vector< double > stationRings
virtual const std::map< std::string, unsigned int > & GetStationSlicesStringsMap() const =0
virtual const std::map< std::string, unsigned int > & GetMonthsMap() const =0
static const std::vector< double > groundLevelDepths
virtual const std::map< std::string, unsigned int > & GetStationRingsStringsMap() const =0
static const std::vector< std::string > primaries
virtual const std::map< unsigned int, std::string > & GetMonthsMapReverse() const =0
virtual const std::vector< std::string > & GetStationSlicesStrings() const =0
static const std::vector< std::string > stationRingsXML
virtual const std::vector< std::string > & GetHadronModels() const =0

, generated on Tue Sep 26 2023.