gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
AnalysisContainer.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
26 
27 #pragma once
28 
29 #include <string>
30 #include <stdexcept>
31 #include <vector>
32 #include <map>
33 
34 #include "HEPUtils/Event.h"
35 
36 namespace Gambit
37 {
38 
39  typedef std::string str;
40 
41  namespace ColliderBit
42  {
43 
44  class Analysis;
45 
49  Analysis* mkAnalysis(const str& name);
50 
52  str getDetector(const str& name);
53 
54 
57  {
58 
59  private:
60 
63  std::map<str,std::map<str,Analysis*> > analyses_map;
64 
67 
70 
72  int n_threads;
73 
75  str base_key;
76 
79  static std::map<str,std::map<int,AnalysisContainer*> > instances_map;
80 
81 
82  public:
83 
86 
89 
91  void register_thread(str);
92 
94  void clear();
95 
97  void set_current_collider(str);
98 
100  str get_current_collider() const;
101 
103  bool has_analyses(str) const;
105  bool has_analyses() const;
106 
108  void init(const std::vector<str>&, str);
110  void init(const std::vector<str>&);
111 
113  void reset(str, str);
115  void reset(str);
117  void reset();
119  void reset_all();
120 
122  const Analysis* get_analysis_pointer(str, str) const;
124  const std::map<str,Analysis*>& get_collider_analyses_map(str) const;
126  const std::map<str,Analysis*>& get_current_analyses_map() const;
128  const std::map<str,std::map<str,Analysis*> >& get_full_analyses_map() const;
129 
131  void analyze(const HEPUtils::Event&, str, str) const;
133  void analyze(const HEPUtils::Event&, str) const;
135  void analyze(const HEPUtils::Event&) const;
136 
139  void collect_and_add_signal(str, str);
142  void collect_and_add_signal(str);
145  void collect_and_add_signal();
146 
148  void scale(str, str, double);
150  void scale(str, double);
152  void scale(double);
154  void scale_all(double);
155 
156  };
157 
158  }
159 }
str current_collider
String identifying the currently active collider.
void analyze(const HEPUtils::Event &, str, str) const
Pass event through specific analysis.
void init(const std::vector< str > &, str)
Initialize analyses (by names) for a specified collider.
void reset()
Reset all analyses for the current collider.
const std::map< str, Analysis * > & get_current_analyses_map() const
Get analyses map for the current collider.
const std::map< str, Analysis * > & get_collider_analyses_map(str) const
Get analyses map for a specific collider.
void clear()
Delete and clear the analyses contained within this instance.
static std::map< str, std::map< int, AnalysisContainer * > > instances_map
A map with pointers to all instances of this class.
void register_thread(str)
Add container to instances map.
bool has_analyses() const
Does this instance contain analyses for the current collider.
str base_key
Key for the instances_map.
Analysis * mkAnalysis(const str &name)
Create a new analysis based on a name string.
void reset_all()
Reset all analyses for all colliders.
std::map< str, std::map< str, Analysis * > > analyses_map
A map of maps of pointer-to-Analysis.
const Analysis * get_analysis_pointer(str, str) const
Get pointer to specific analysis.
const std::map< str, std::map< str, Analysis * > > & get_full_analyses_map() const
Get the full analyses map.
void collect_and_add_signal()
Collect signal predictions from other threads and add to this one, for all analyses for the current c...
str get_current_collider() const
Get name of current collider.
A class for collider analyses within ColliderBit.
Definition: Analysis.hpp:41
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
void set_current_collider(str)
Set name of current collider.
str getDetector(const str &name)
Return the detector to be used for a given analysis name, checking that the analysis exists...
void scale_all(double)
Scale results for all analyses across all colliders.
void scale(str, str, double)
Scale results for specific analysis.
A class for managing collections of Analysis instances.
bool is_registered
Has this instance been registered in the instances_map?
TODO: see if we can use this one:
Definition: Analysis.hpp:33