gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::ColliderBit::Analysis Class Referenceabstract

A class for collider analyses within ColliderBit. More...

#include <Analysis.hpp>

Inheritance diagram for Gambit::ColliderBit::Analysis:
Collaboration diagram for Gambit::ColliderBit::Analysis:

Public Member Functions

 Analysis ()
 Construction. More...
 
virtual ~Analysis ()
 Destruction. More...
 
void reset ()
 Public method to reset this instance for reuse, avoiding the need for "new" or "delete". More...
 
double luminosity () const
 Return the integrated luminosity. More...
 
void set_luminosity (double)
 Set the integrated luminosity. More...
 
void set_analysis_name (str)
 Set the analysis name. More...
 
str analysis_name ()
 Get the analysis name. More...
 
const AnalysisDataget_results ()
 Get the collection of SignalRegionData for likelihood computation. More...
 
const AnalysisDataget_results (str &)
 An overload of get_results() with some additional consistency checks. More...
 
const AnalysisDataget_results_ptr ()
 Get a pointer to _results. More...
 
const AnalysisDataget_results_ptr (str &)
 Get a pointer to _results. More...
 
void scale (double)
 Scale by xsec per event. More...
 
Event analysis, event number, and cross section functions:

Analyze the event (accessed by reference).

void analyze (const HEPUtils::Event &)
 Analyze the event (accessed by reference). More...
 
void analyze (const HEPUtils::Event *)
 Analyze the event (accessed by pointer). More...
 
Analysis combination operations

Add the results of another analysis to this one.

Argument is not const, because the other needs to be able to gather its results if necessary.

void add (Analysis *other)
 Add the results of another analysis to this one. Argument is not const, because the other needs to be able to gather its results if necessary. More...
 
virtual void combine (const Analysis *other)=0
 Add the analysis-specific variables of another analysis to this one. More...
 

Protected Member Functions

virtual void analysis_specific_reset ()=0
 Reset the analysis-specific variables. More...
 
Collection functions

Run the analysis.

virtual void run (const HEPUtils::Event *)=0
 
void add_result (const SignalRegionData &sr)
 Add the given result to the internal results list. More...
 
void set_covariance (const Eigen::MatrixXd &srcov)
 Set the covariance matrix, expressing SR correlations. More...
 
void set_covariance (const std::vector< std::vector< double >> &)
 A convenience function for setting the SR covariance from a nested vector/initialiser list. More...
 
virtual void collect_results ()=0
 Gather together the info for likelihood calculation. More...
 

Private Attributes

double _luminosity
 
bool _luminosity_is_set
 
bool _is_scaled
 
bool _needs_collection
 
AnalysisData _results
 
std::string _analysis_name
 

Detailed Description

A class for collider analyses within ColliderBit.

Definition at line 41 of file Analysis.hpp.

Constructor & Destructor Documentation

◆ Analysis()

Gambit::ColliderBit::Analysis::Analysis ( )

Construction.

Definition at line 36 of file Analysis.cpp.

◆ ~Analysis()

virtual Gambit::ColliderBit::Analysis::~Analysis ( )
inlinevirtual

Member Function Documentation

◆ add()

void Gambit::ColliderBit::Analysis::add ( Analysis other)

Add the results of another analysis to this one. Argument is not const, because the other needs to be able to gather its results if necessary.

Definition at line 145 of file Analysis.cpp.

References _results, collect_results(), combine(), Gambit::ColliderBit::AnalysisData::empty(), get_results(), and Gambit::ColliderBit::AnalysisData::size().

Referenced by ~Analysis().

146  {
147  if (_results.empty()) collect_results();
148  if (this == other) return;
149  const AnalysisData otherResults = other->get_results();
151  assert(otherResults.size() == _results.size());
152  for (size_t i = 0; i < _results.size(); ++i)
153  {
154  _results[i].n_sig_MC += otherResults[i].n_sig_MC;
155  }
156  combine(other);
157  }
virtual void collect_results()=0
Gather together the info for likelihood calculation.
virtual void combine(const Analysis *other)=0
Add the analysis-specific variables of another analysis to this one.
bool empty() const
Is this container empty of signal regions?
size_t size() const
Number of analyses.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_result()

void Gambit::ColliderBit::Analysis::add_result ( const SignalRegionData sr)
protected

Add the given result to the internal results list.

Definition at line 113 of file Analysis.cpp.

References _results, and Gambit::ColliderBit::AnalysisData::add().

Referenced by ~Analysis().

113 { _results.add(sr); }
void add(const SignalRegionData &srd)
Add a SignalRegionData.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ analysis_name()

str Gambit::ColliderBit::Analysis::analysis_name ( )

Get the analysis name.

Definition at line 75 of file Analysis.cpp.

References _analysis_name.

Referenced by ~Analysis().

75 { return _analysis_name; }
Here is the caller graph for this function:

◆ analysis_specific_reset()

virtual void Gambit::ColliderBit::Analysis::analysis_specific_reset ( )
protectedpure virtual

Reset the analysis-specific variables.

Referenced by reset(), and ~Analysis().

Here is the caller graph for this function:

◆ analyze() [1/2]

void Gambit::ColliderBit::Analysis::analyze ( const HEPUtils::Event &  e)

Analyze the event (accessed by reference).

Definition at line 52 of file Analysis.cpp.

Referenced by ~Analysis().

52 { analyze(&e); }
void analyze(const HEPUtils::Event &)
Analyze the event (accessed by reference).
Definition: Analysis.cpp:52
Here is the caller graph for this function:

◆ analyze() [2/2]

void Gambit::ColliderBit::Analysis::analyze ( const HEPUtils::Event *  e)

Analyze the event (accessed by pointer).

Definition at line 55 of file Analysis.cpp.

References _needs_collection, and run().

56  {
57  _needs_collection = true;
58  run(e);
59  }
virtual void run(const HEPUtils::Event *)=0
Here is the call graph for this function:

◆ collect_results()

virtual void Gambit::ColliderBit::Analysis::collect_results ( )
protectedpure virtual

Gather together the info for likelihood calculation.

Referenced by add(), get_results(), and ~Analysis().

Here is the caller graph for this function:

◆ combine()

virtual void Gambit::ColliderBit::Analysis::combine ( const Analysis other)
pure virtual

Add the analysis-specific variables of another analysis to this one.

Referenced by add(), and ~Analysis().

Here is the caller graph for this function:

◆ get_results() [1/2]

const AnalysisData & Gambit::ColliderBit::Analysis::get_results ( )

Get the collection of SignalRegionData for likelihood computation.

Definition at line 78 of file Analysis.cpp.

References _needs_collection, _results, and collect_results().

Referenced by add(), get_results(), get_results_ptr(), and ~Analysis().

79  {
81  {
83  _needs_collection = false;
84  }
85  return _results;
86  }
virtual void collect_results()=0
Gather together the info for likelihood calculation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_results() [2/2]

const AnalysisData & Gambit::ColliderBit::Analysis::get_results ( str warning)

An overload of get_results() with some additional consistency checks.

Definition at line 89 of file Analysis.cpp.

References _analysis_name, _is_scaled, _luminosity_is_set, and get_results().

90  {
91  warning = "";
92  if (not _luminosity_is_set)
93  warning += "Luminosity has not been set for analysis " + _analysis_name + ".";
94  if (not _is_scaled)
95  warning += "Results have not been scaled for analysis " + _analysis_name + ".";
96 
97  return get_results();
98  }
const AnalysisData & get_results()
Get the collection of SignalRegionData for likelihood computation.
Definition: Analysis.cpp:78
Here is the call graph for this function:

◆ get_results_ptr() [1/2]

const AnalysisData * Gambit::ColliderBit::Analysis::get_results_ptr ( )

Get a pointer to _results.

Definition at line 101 of file Analysis.cpp.

References get_results().

Referenced by ~Analysis().

102  {
103  return &get_results();
104  }
const AnalysisData & get_results()
Get the collection of SignalRegionData for likelihood computation.
Definition: Analysis.cpp:78
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_results_ptr() [2/2]

const AnalysisData * Gambit::ColliderBit::Analysis::get_results_ptr ( str warning)

Get a pointer to _results.

Definition at line 107 of file Analysis.cpp.

References get_results().

108  {
109  return &get_results(warning);
110  }
const AnalysisData & get_results()
Get the collection of SignalRegionData for likelihood computation.
Definition: Analysis.cpp:78
Here is the call graph for this function:

◆ luminosity()

double Gambit::ColliderBit::Analysis::luminosity ( ) const

Return the integrated luminosity.

Definition at line 62 of file Analysis.cpp.

References _luminosity.

Referenced by scale(), and ~Analysis().

62 { return _luminosity; }
Here is the caller graph for this function:

◆ reset()

void Gambit::ColliderBit::Analysis::reset ( )

Public method to reset this instance for reuse, avoiding the need for "new" or "delete".

Definition at line 43 of file Analysis.cpp.

References _is_scaled, _needs_collection, _results, analysis_specific_reset(), and Gambit::ColliderBit::AnalysisData::clear().

Referenced by ~Analysis().

44  {
45  _is_scaled = false;
46  _needs_collection = true;
47  _results.clear();
49  }
virtual void analysis_specific_reset()=0
Reset the analysis-specific variables.
void clear()
Clear the list of SignalRegionData, and nullify the covariance matrix.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

virtual void Gambit::ColliderBit::Analysis::run ( const HEPUtils::Event *  )
protectedpure virtual

Referenced by analyze(), and ~Analysis().

Here is the caller graph for this function:

◆ scale()

void Gambit::ColliderBit::Analysis::scale ( double  xsec_per_event)

Scale by xsec per event.

Definition at line 133 of file Analysis.cpp.

References _is_scaled, _results, and luminosity().

Referenced by ~Analysis().

134  {
135  double factor = luminosity() * xsec_per_event;
136  assert(factor >= 0);
137  for (SignalRegionData& sr : _results)
138  {
139  sr.n_sig_scaled = factor * sr.n_sig_MC;
140  }
141  _is_scaled = true;
142  }
double luminosity() const
Return the integrated luminosity.
Definition: Analysis.cpp:62
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_analysis_name()

void Gambit::ColliderBit::Analysis::set_analysis_name ( str  aname)

Set the analysis name.

Definition at line 68 of file Analysis.cpp.

References _analysis_name, _results, and Gambit::ColliderBit::AnalysisData::analysis_name.

Referenced by ~Analysis().

69  {
70  _analysis_name = aname;
72  }
std::string analysis_name
Analysis name.
Here is the caller graph for this function:

◆ set_covariance() [1/2]

void Gambit::ColliderBit::Analysis::set_covariance ( const Eigen::MatrixXd &  srcov)
protected

Set the covariance matrix, expressing SR correlations.

Definition at line 116 of file Analysis.cpp.

References _results, and Gambit::ColliderBit::AnalysisData::srcov.

Referenced by set_covariance(), and ~Analysis().

116 { _results.srcov = srcov; }
Eigen::MatrixXd srcov
Optional covariance matrix between SRs (0x0 null matrix = no correlation info)
Here is the caller graph for this function:

◆ set_covariance() [2/2]

void Gambit::ColliderBit::Analysis::set_covariance ( const std::vector< std::vector< double >> &  srcov)
protected

A convenience function for setting the SR covariance from a nested vector/initialiser list.

Definition at line 119 of file Analysis.cpp.

References set_covariance().

120  {
121  Eigen::MatrixXd cov(srcov.size(), srcov.front().size());
122  for (size_t i = 0; i < srcov.size(); ++i)
123  {
124  for (size_t j = 0; j < srcov.front().size(); ++j)
125  {
126  cov(i,j) = srcov[i][j];
127  }
128  }
129  set_covariance(cov);
130  }
void set_covariance(const Eigen::MatrixXd &srcov)
Set the covariance matrix, expressing SR correlations.
Definition: Analysis.cpp:116
Here is the call graph for this function:

◆ set_luminosity()

void Gambit::ColliderBit::Analysis::set_luminosity ( double  lumi)

Set the integrated luminosity.

Definition at line 65 of file Analysis.cpp.

References _luminosity, and _luminosity_is_set.

Referenced by ~Analysis().

Here is the caller graph for this function:

Member Data Documentation

◆ _analysis_name

std::string Gambit::ColliderBit::Analysis::_analysis_name
private

Definition at line 118 of file Analysis.hpp.

Referenced by analysis_name(), get_results(), and set_analysis_name().

◆ _is_scaled

bool Gambit::ColliderBit::Analysis::_is_scaled
private

Definition at line 115 of file Analysis.hpp.

Referenced by get_results(), reset(), and scale().

◆ _luminosity

double Gambit::ColliderBit::Analysis::_luminosity
private

Definition at line 113 of file Analysis.hpp.

Referenced by luminosity(), and set_luminosity().

◆ _luminosity_is_set

bool Gambit::ColliderBit::Analysis::_luminosity_is_set
private

Definition at line 114 of file Analysis.hpp.

Referenced by get_results(), and set_luminosity().

◆ _needs_collection

bool Gambit::ColliderBit::Analysis::_needs_collection
private

Definition at line 116 of file Analysis.hpp.

Referenced by analyze(), get_results(), and reset().

◆ _results

AnalysisData Gambit::ColliderBit::Analysis::_results
private

Definition at line 117 of file Analysis.hpp.

Referenced by add(), add_result(), get_results(), reset(), scale(), set_analysis_name(), and set_covariance().


The documentation for this class was generated from the following files: