gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Analysis.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 "HEPUtils/Event.h"
32 
33 namespace Gambit
34 {
35  typedef std::string str;
36 
37  namespace ColliderBit
38  {
39 
41  class Analysis
42  {
43 
44  public:
45 
47  Analysis();
49  virtual ~Analysis() { }
50 
52  void reset();
53 
57  void analyze(const HEPUtils::Event&);
59  void analyze(const HEPUtils::Event*);
61 
63  double luminosity() const;
65  void set_luminosity(double);
67  void set_analysis_name(str);
69  str analysis_name();
70 
72  const AnalysisData& get_results();
74  const AnalysisData& get_results(str&);
78  const AnalysisData* get_results_ptr(str&);
80 
82  void scale(double);
83 
87  void add(Analysis* other);
89  virtual void combine(const Analysis* other) = 0;
91 
92  protected:
93 
95  virtual void analysis_specific_reset() = 0;
96 
100  virtual void run(const HEPUtils::Event*) = 0;
102  void add_result(const SignalRegionData& sr);
104  void set_covariance(const Eigen::MatrixXd& srcov);
106  void set_covariance(const std::vector<std::vector<double>>&);
108  virtual void collect_results() = 0;
110 
111  private:
112 
113  double _luminosity;
118  std::string _analysis_name;
119 
120  };
121 
122 
124  #define DEFINE_ANALYSIS_FACTORY(ANAME) \
125  Analysis* create_Analysis_ ## ANAME() \
126  { \
127  return new Analysis_ ## ANAME(); \
128  } \
129  std::string getDetector_ ## ANAME() \
130  { \
131  return std::string(Analysis_ ## ANAME::detector); \
132  }
133 
134 
135  }
136 }
void add_result(const SignalRegionData &sr)
Add the given result to the internal results list.
Definition: Analysis.cpp:113
void reset()
Public method to reset this instance for reuse, avoiding the need for "new" or "delete".
Definition: Analysis.cpp:43
AnalysisData and SignalRegion structures.
void set_luminosity(double)
Set the integrated luminosity.
Definition: Analysis.cpp:65
void scale(double)
Scale by xsec per event.
Definition: Analysis.cpp:133
void add(Analysis *other)
Add the results of another analysis to this one. Argument is not const, because the other needs to be...
Definition: Analysis.cpp:145
virtual void collect_results()=0
Gather together the info for likelihood calculation.
A container for the result of an analysis, potentially with many signal regions and correlations...
void set_covariance(const Eigen::MatrixXd &srcov)
Set the covariance matrix, expressing SR correlations.
Definition: Analysis.cpp:116
virtual void analysis_specific_reset()=0
Reset the analysis-specific variables.
const AnalysisData * get_results_ptr()
Get a pointer to _results.
Definition: Analysis.cpp:101
void set_analysis_name(str)
Set the analysis name.
Definition: Analysis.cpp:68
A class for collider analyses within ColliderBit.
Definition: Analysis.hpp:41
virtual void run(const HEPUtils::Event *)=0
void analyze(const HEPUtils::Event &)
Analyze the event (accessed by reference).
Definition: Analysis.cpp:52
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
A simple container for the result of one signal region from one analysis.
virtual ~Analysis()
Destruction.
Definition: Analysis.hpp:49
virtual void combine(const Analysis *other)=0
Add the analysis-specific variables of another analysis to this one.
Analysis()
Construction.
Definition: Analysis.cpp:36
str analysis_name()
Get the analysis name.
Definition: Analysis.cpp:75
double luminosity() const
Return the integrated luminosity.
Definition: Analysis.cpp:62
TODO: see if we can use this one:
Definition: Analysis.hpp:33
const AnalysisData & get_results()
Get the collection of SignalRegionData for likelihood computation.
Definition: Analysis.cpp:78