gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
xsec.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
20 
21 #include <vector>
22 #include <map>
23 #include <string>
25 
26 
27 #pragma once
28 
29 namespace Gambit
30 {
31 
32  namespace ColliderBit
33  {
34 
35 
38  {
39  public:
40 
42  virtual ~xsec_container() { }
43 
45  void reset();
46 
48  double operator()() const;
49  double xsec() const;
50 
52  double xsec_err() const;
53 
55  double xsec_relerr() const;
56 
58  void set_xsec(double, double);
59 
61  void average_xsec(double, double);
62  void average_xsec(const xsec_container&);
63 
65  void sum_xsecs(double, double);
66  void sum_xsecs(const xsec_container&);
67 
69  std::map<std::string, double> get_content_as_map() const;
70 
72  void set_info_string(std::string);
73 
75  std::string info_string() const;
76 
78  void set_trust_level(int);
79 
81  int trust_level() const;
82 
84  static const std::string unit;
85 
86  protected:
87 
88  double _xsec;
89  double _xsecerr;
90  std::string _info_string;
92  };
93 
94 
97  {
98 
99  public:
100 
102  virtual ~MC_xsec_container() { }
103 
105  void reset();
106 
108  void log_event();
109 
111  long long num_events() const;
112 
114  double xsec_per_event() const;
115 
117  void set_num_events(long long);
118 
119 
121  void average_xsec(double, double, long long);
122  void average_xsec(const MC_xsec_container&);
123 
125  void sum_xsecs(double, double, long long);
126  void sum_xsecs(const MC_xsec_container&);
127 
129  void gather_xsecs();
130 
132  void gather_num_events();
133 
135  std::map<std::string, double> get_content_as_map() const;
136 
137  private:
138 
139  long long _ntot;
140 
142  static std::map<int, const MC_xsec_container*> instances_map;
143  };
144 
145 
146 
149  {
150 
151  public:
154 
156  void reset();
157 
159  void average_xsec(double, double);
161 
163  void sum_xsecs(double, double);
164  void sum_xsecs(const process_xsec_container&);
165 
167  int process_code() const;
168 
170  void set_process_code(int);
171 
175  const std::vector<int>& processes_sharing_xsec() const;
176 
178  void register_process_sharing_xsec(int);
179 
181  const std::vector<PID_pair>& related_pid_pairs() const;
182 
184  void register_related_pid_pair(PID_pair);
185 
186  private:
188  std::vector<int> _processes_sharing_xsec;
189  std::vector<PID_pair> _related_pid_pairs;
190  };
191 
192 
193 
196  {
197 
198  public:
201 
203  void reset();
204 
206  void average_xsec(double, double);
208 
210  void sum_xsecs(double, double);
211  void sum_xsecs(const PID_pair_xsec_container&);
212 
214  const PID_pair& pid_pair() const;
215 
217  void set_pid_pair(const PID_pair&);
218 
222  const std::vector<PID_pair>& pid_pairs_sharing_xsec() const;
223 
225  void register_pid_pair_sharing_xsec(PID_pair);
226 
228  const std::vector<int>& related_processes() const;
229 
231  void register_related_process(int);
232 
233  private:
235  std::vector<PID_pair> _pid_pairs_sharing_xsec;
236  std::vector<int> _related_processes;
237  };
238 
239  }
240 }
A base class for holding cross-section info within ColliderBit.
Definition: xsec.hpp:37
std::string info_string() const
Get the info string.
Definition: xsec.cpp:142
double xsec_err() const
Return the cross-section error (in fb).
Definition: xsec.cpp:60
int trust_level() const
Get the trust level.
Definition: xsec.cpp:148
A class for holding the production cross-section for final state identified by the pair of PID codes...
Definition: xsec.hpp:195
void set_xsec(double, double)
Set the cross-section and its error (in fb).
Definition: xsec.cpp:66
Simple class for holding a sorted pair of particle ID (PID) codes.
Definition: PID_pair.hpp:31
A class for holding a total cross-section calculated via MC across multiple threads.
Definition: xsec.hpp:96
std::vector< PID_pair > _pid_pairs_sharing_xsec
Definition: xsec.hpp:235
void average_xsec(double, double)
Average cross-sections and combine errors.
Definition: xsec.cpp:69
static std::map< int, const MC_xsec_container * > instances_map
A map with pointers to all instances of this class. The key is the OMP thread number.
Definition: xsec.hpp:142
std::vector< PID_pair > _related_pid_pairs
Definition: xsec.hpp:189
std::map< std::string, double > get_content_as_map() const
Get content as map <string,double> map (for easy printing).
Definition: xsec.cpp:115
A class for holding the cross-section of a single Pythia process (identified by the Pythia process co...
Definition: xsec.hpp:148
void sum_xsecs(double, double)
Sum cross-sections and add errors in quadrature.
Definition: xsec.cpp:93
void reset()
Reset this instance for reuse.
Definition: xsec.cpp:47
xsec_container()
Definitions of xsec members.
Definition: xsec.cpp:39
Simple class for holding a sorted pair of particle ID (PID) codes.
static const std::string unit
String Let&#39;s make it clear that we work with fb as unit.
Definition: xsec.hpp:84
void set_info_string(std::string)
Set the info string.
Definition: xsec.cpp:139
double xsec_relerr() const
Return the cross-section relative error.
Definition: xsec.cpp:63
void set_trust_level(int)
Set the trust level.
Definition: xsec.cpp:145
double operator()() const
Return the full cross-section (in fb).
Definition: xsec.cpp:56
std::vector< int > _processes_sharing_xsec
Definition: xsec.hpp:188
TODO: see if we can use this one:
Definition: Analysis.hpp:33