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

A base class for holding cross-section info within ColliderBit. More...

#include <xsec.hpp>

Inheritance diagram for Gambit::ColliderBit::xsec_container:
Collaboration diagram for Gambit::ColliderBit::xsec_container:

Public Member Functions

 xsec_container ()
 Definitions of xsec members. More...
 
virtual ~xsec_container ()
 
void reset ()
 Reset this instance for reuse. More...
 
double operator() () const
 Return the full cross-section (in fb). More...
 
double xsec () const
 
double xsec_err () const
 Return the cross-section error (in fb). More...
 
double xsec_relerr () const
 Return the cross-section relative error. More...
 
void set_xsec (double, double)
 Set the cross-section and its error (in fb). More...
 
void average_xsec (double, double)
 Average cross-sections and combine errors. More...
 
void average_xsec (const xsec_container &)
 
void sum_xsecs (double, double)
 Sum cross-sections and add errors in quadrature. More...
 
void sum_xsecs (const xsec_container &)
 
std::map< std::string, doubleget_content_as_map () const
 Get content as map <string,double> map (for easy printing). More...
 
void set_info_string (std::string)
 Set the info string. More...
 
std::string info_string () const
 Get the info string. More...
 
void set_trust_level (int)
 Set the trust level. More...
 
int trust_level () const
 Get the trust level. More...
 

Static Public Attributes

static const std::string unit = "fb"
 String Let's make it clear that we work with fb as unit. More...
 

Protected Attributes

double _xsec
 
double _xsecerr
 
std::string _info_string
 
int _trust_level
 

Detailed Description

A base class for holding cross-section info within ColliderBit.

Definition at line 37 of file xsec.hpp.

Constructor & Destructor Documentation

◆ xsec_container()

Gambit::ColliderBit::xsec_container::xsec_container ( )

Definitions of xsec members.

Constructor

Definition at line 39 of file xsec.cpp.

◆ ~xsec_container()

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

Definition at line 42 of file xsec.hpp.

References average_xsec(), get_content_as_map(), info_string(), operator()(), reset(), set_info_string(), set_trust_level(), set_xsec(), sum_xsecs(), trust_level(), xsec(), xsec_err(), and xsec_relerr().

42 { }
Here is the call graph for this function:

Member Function Documentation

◆ average_xsec() [1/2]

void Gambit::ColliderBit::xsec_container::average_xsec ( double  other_xsec,
double  other_xsecerr 
)

Average cross-sections and combine errors.

Definition at line 69 of file xsec.cpp.

References _xsec, _xsecerr, and set_xsec().

Referenced by average_xsec(), Gambit::ColliderBit::MC_xsec_container::average_xsec(), Gambit::ColliderBit::process_xsec_container::average_xsec(), Gambit::ColliderBit::PID_pair_xsec_container::average_xsec(), Gambit::ColliderBit::MC_xsec_container::~MC_xsec_container(), Gambit::ColliderBit::PID_pair_xsec_container::~PID_pair_xsec_container(), Gambit::ColliderBit::process_xsec_container::~process_xsec_container(), and ~xsec_container().

70  {
71  if (other_xsec > 0)
72  {
73  if (_xsec <= 0)
74  {
75  set_xsec(other_xsec, other_xsecerr);
76  }
77  else
78  {
79  double w = 1./(_xsecerr*_xsecerr);
80  double other_w = 1./(other_xsecerr*other_xsecerr);
81  _xsec = (w * _xsec + other_w * other_xsec) / (w + other_w);
82  _xsecerr = 1./sqrt(w + other_w);
83  }
84  }
85  }
void set_xsec(double, double)
Set the cross-section and its error (in fb).
Definition: xsec.cpp:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ average_xsec() [2/2]

void Gambit::ColliderBit::xsec_container::average_xsec ( const xsec_container other)

Definition at line 87 of file xsec.cpp.

References average_xsec(), and xsec_err().

88  {
89  average_xsec(other(), other.xsec_err());
90  }
void average_xsec(double, double)
Average cross-sections and combine errors.
Definition: xsec.cpp:69
Here is the call graph for this function:

◆ get_content_as_map()

std::map< std::string, double > Gambit::ColliderBit::xsec_container::get_content_as_map ( ) const

Get content as map <string,double> map (for easy printing).

Get content as a <string,double> map (for easy printing).

Definition at line 115 of file xsec.cpp.

References _info_string, trust_level(), unit, xsec(), xsec_err(), and xsec_relerr().

Referenced by Gambit::ColliderBit::MC_xsec_container::get_content_as_map(), Gambit::ColliderBit::MC_xsec_container::~MC_xsec_container(), and ~xsec_container().

116  {
117  std::map<std::string, double> content_map;
118 
119  std::string key;
120  std::string base_key;
121  if (_info_string != "") base_key = _info_string + "__";
122  else base_key = "";
123 
124  key = base_key + "xsec_" + unit;
125  content_map[key] = this->xsec();
126 
127  key = base_key + "xsec_err_" + unit;
128  content_map[key] = this->xsec_err();
129 
130  key = base_key + "xsec_relerr";
131  content_map[key] = this->xsec_relerr();
132 
133  content_map["trust_level"] = static_cast<double>(this->trust_level());
134 
135  return content_map;
136  }
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
static const std::string unit
String Let&#39;s make it clear that we work with fb as unit.
Definition: xsec.hpp:84
double xsec_relerr() const
Return the cross-section relative error.
Definition: xsec.cpp:63
Here is the call graph for this function:
Here is the caller graph for this function:

◆ info_string()

std::string Gambit::ColliderBit::xsec_container::info_string ( ) const

Get the info string.

Definition at line 142 of file xsec.cpp.

References _info_string.

Referenced by Gambit::ColliderBit::getPIDPairCrossSectionsInfo(), and ~xsec_container().

142 { return _info_string; }
Here is the caller graph for this function:

◆ operator()()

double Gambit::ColliderBit::xsec_container::operator() ( ) const

Return the full cross-section (in fb).

Return the cross-section (in fb).

Definition at line 56 of file xsec.cpp.

References _xsec.

Referenced by ~xsec_container().

56 { return _xsec; }
Here is the caller graph for this function:

◆ reset()

◆ set_info_string()

void Gambit::ColliderBit::xsec_container::set_info_string ( std::string  info_string_in)

Set the info string.

Definition at line 139 of file xsec.cpp.

References _info_string.

Referenced by Gambit::ColliderBit::convert_xsecs_to_fb(), Gambit::ColliderBit::getPIDPairCrossSectionsMap_prospino(), Gambit::ColliderBit::getProcessCrossSectionsMap(), and ~xsec_container().

139 { _info_string = info_string_in; }
Here is the caller graph for this function:

◆ set_trust_level()

void Gambit::ColliderBit::xsec_container::set_trust_level ( int  trust_level_in)

Set the trust level.

Definition at line 145 of file xsec.cpp.

References _trust_level.

Referenced by Gambit::ColliderBit::convert_xsecs_to_fb(), Gambit::ColliderBit::getPIDPairCrossSectionsMap_prospino(), Gambit::ColliderBit::getProcessCrossSectionsMap(), and ~xsec_container().

145 { _trust_level = trust_level_in; }
Here is the caller graph for this function:

◆ set_xsec()

◆ sum_xsecs() [1/2]

void Gambit::ColliderBit::xsec_container::sum_xsecs ( double  other_xsec,
double  other_xsecerr 
)

Sum cross-sections and add errors in quadrature.

Definition at line 93 of file xsec.cpp.

References _xsec, _xsecerr, and set_xsec().

Referenced by sum_xsecs(), Gambit::ColliderBit::MC_xsec_container::sum_xsecs(), Gambit::ColliderBit::process_xsec_container::sum_xsecs(), Gambit::ColliderBit::PID_pair_xsec_container::sum_xsecs(), Gambit::ColliderBit::MC_xsec_container::~MC_xsec_container(), Gambit::ColliderBit::PID_pair_xsec_container::~PID_pair_xsec_container(), Gambit::ColliderBit::process_xsec_container::~process_xsec_container(), and ~xsec_container().

94  {
95  if (other_xsec > 0)
96  {
97  if (_xsec <= 0)
98  {
99  set_xsec(other_xsec, other_xsecerr);
100  }
101  else
102  {
103  _xsec += other_xsec;
104  _xsecerr = sqrt(_xsecerr * _xsecerr + other_xsecerr * other_xsecerr);
105  }
106  }
107  }
void set_xsec(double, double)
Set the cross-section and its error (in fb).
Definition: xsec.cpp:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sum_xsecs() [2/2]

void Gambit::ColliderBit::xsec_container::sum_xsecs ( const xsec_container other)

Definition at line 109 of file xsec.cpp.

References sum_xsecs(), and xsec_err().

110  {
111  sum_xsecs(other(), other.xsec_err());
112  }
void sum_xsecs(double, double)
Sum cross-sections and add errors in quadrature.
Definition: xsec.cpp:93
Here is the call graph for this function:

◆ trust_level()

int Gambit::ColliderBit::xsec_container::trust_level ( ) const

Get the trust level.

Get the info string.

Definition at line 148 of file xsec.cpp.

References _trust_level, and unit.

Referenced by Gambit::ColliderBit::_setEventWeight_fromCrossSection(), get_content_as_map(), Gambit::ColliderBit::getPIDPairCrossSectionsInfo(), Gambit::ColliderBit::getProcessCrossSectionsMap(), and ~xsec_container().

Here is the caller graph for this function:

◆ xsec()

◆ xsec_err()

◆ xsec_relerr()

double Gambit::ColliderBit::xsec_container::xsec_relerr ( ) const

Return the cross-section relative error.

Definition at line 63 of file xsec.cpp.

References _xsec, and _xsecerr.

Referenced by get_content_as_map(), and ~xsec_container().

Here is the caller graph for this function:

Member Data Documentation

◆ _info_string

std::string Gambit::ColliderBit::xsec_container::_info_string
protected

◆ _trust_level

int Gambit::ColliderBit::xsec_container::_trust_level
protected

Definition at line 91 of file xsec.hpp.

Referenced by reset(), set_trust_level(), and trust_level().

◆ _xsec

◆ _xsecerr

double Gambit::ColliderBit::xsec_container::_xsecerr
protected

Definition at line 89 of file xsec.hpp.

Referenced by average_xsec(), reset(), set_xsec(), sum_xsecs(), xsec_err(), and xsec_relerr().

◆ unit

const std::string Gambit::ColliderBit::xsec_container::unit = "fb"
static

String Let's make it clear that we work with fb as unit.

Set the unit string.

Definition at line 84 of file xsec.hpp.

Referenced by get_content_as_map(), Gambit::ColliderBit::MC_xsec_container::get_content_as_map(), and trust_level().


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