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

A simple class for counting events of type HEPUtils::Event. More...

#include <EventCounter.hpp>

Collaboration diagram for Gambit::ColliderBit::EventCounter:

Public Member Functions

 EventCounter ()
 
 EventCounter (const std::string name)
 
void init (const std::string name)
 
void reset ()
 
void set_name (const std::string name)
 
std::string name () const
 
void set_sum (int sum)
 
int sum () const
 
void set_weight_sum (double weight_sum)
 
double weight_sum () const
 
void set_weight_sum_err (double weight_sum_err)
 
double weight_sum_err () const
 
void add_event (double w=1.0, double werr=0.0)
 
void add_event (const HEPUtils::Event &event)
 
void add_event (const HEPUtils::Event *event_ptr)
 
EventCounteroperator+= (const HEPUtils::Event &event)
 
EventCounteroperator+= (const EventCounter &rhs)
 
EventCountercombine (const EventCounter &other)
 

Private Attributes

std::string _name
 
int _sum
 
double _weight_sum
 
double _weight_sum_err
 

Detailed Description

A simple class for counting events of type HEPUtils::Event.

Definition at line 26 of file EventCounter.hpp.

Constructor & Destructor Documentation

◆ EventCounter() [1/2]

Gambit::ColliderBit::EventCounter::EventCounter ( )
inline

Definition at line 39 of file EventCounter.hpp.

◆ EventCounter() [2/2]

Gambit::ColliderBit::EventCounter::EventCounter ( const std::string  name)
inline

Member Function Documentation

◆ add_event() [1/3]

void Gambit::ColliderBit::EventCounter::add_event ( double  w = 1.0,
double  werr = 0.0 
)
inline

Definition at line 92 of file EventCounter.hpp.

Referenced by add_event(), and operator+=().

Here is the caller graph for this function:

◆ add_event() [2/3]

void Gambit::ColliderBit::EventCounter::add_event ( const HEPUtils::Event &  event)
inline

Definition at line 100 of file EventCounter.hpp.

References add_event().

101  {
102  add_event(event.weight(), event.weight_err());
103  }
void add_event(double w=1.0, double werr=0.0)
Here is the call graph for this function:

◆ add_event() [3/3]

void Gambit::ColliderBit::EventCounter::add_event ( const HEPUtils::Event *  event_ptr)
inline

Definition at line 105 of file EventCounter.hpp.

References add_event().

106  {
107  add_event(*event_ptr);
108  }
void add_event(double w=1.0, double werr=0.0)
Here is the call graph for this function:

◆ combine()

EventCounter& Gambit::ColliderBit::EventCounter::combine ( const EventCounter other)
inline

Definition at line 127 of file EventCounter.hpp.

References sum(), weight_sum(), and weight_sum_err().

128  {
129  _sum += other.sum();
130  _weight_sum += other.weight_sum();
131 
132  double other_weight_sum_err = other.weight_sum_err();
133  _weight_sum_err = sqrt((_weight_sum_err * _weight_sum_err) + (other_weight_sum_err * other_weight_sum_err));
134 
135  return *this;
136  }
Here is the call graph for this function:

◆ init()

void Gambit::ColliderBit::EventCounter::init ( const std::string  name)
inline

Definition at line 55 of file EventCounter.hpp.

References name().

Here is the call graph for this function:

◆ name()

std::string Gambit::ColliderBit::EventCounter::name ( ) const
inline

Definition at line 74 of file EventCounter.hpp.

References _name.

Referenced by init(), and set_name().

74 { return _name; }
Here is the caller graph for this function:

◆ operator+=() [1/2]

EventCounter& Gambit::ColliderBit::EventCounter::operator+= ( const HEPUtils::Event &  event)
inline

Definition at line 111 of file EventCounter.hpp.

References add_event().

112  {
113  add_event(event);
114  return *this;
115  }
void add_event(double w=1.0, double werr=0.0)
Here is the call graph for this function:

◆ operator+=() [2/2]

EventCounter& Gambit::ColliderBit::EventCounter::operator+= ( const EventCounter rhs)
inline

Definition at line 118 of file EventCounter.hpp.

References sum(), weight_sum(), and weight_sum_err().

119  {
120  _sum += rhs.sum();
121  _weight_sum += rhs.weight_sum();
122  _weight_sum_err = sqrt( (_weight_sum_err * _weight_sum_err) + (rhs.weight_sum_err() * rhs.weight_sum_err()) );
123  return *this;
124  }
Here is the call graph for this function:

◆ reset()

void Gambit::ColliderBit::EventCounter::reset ( )
inline

Definition at line 64 of file EventCounter.hpp.

◆ set_name()

void Gambit::ColliderBit::EventCounter::set_name ( const std::string  name)
inline

Definition at line 72 of file EventCounter.hpp.

References name().

Here is the call graph for this function:

◆ set_sum()

void Gambit::ColliderBit::EventCounter::set_sum ( int  sum)
inline

Definition at line 77 of file EventCounter.hpp.

References sum().

Here is the call graph for this function:

◆ set_weight_sum()

void Gambit::ColliderBit::EventCounter::set_weight_sum ( double  weight_sum)
inline

Definition at line 82 of file EventCounter.hpp.

References weight_sum().

Here is the call graph for this function:

◆ set_weight_sum_err()

void Gambit::ColliderBit::EventCounter::set_weight_sum_err ( double  weight_sum_err)
inline

Definition at line 87 of file EventCounter.hpp.

References weight_sum_err().

Here is the call graph for this function:

◆ sum()

int Gambit::ColliderBit::EventCounter::sum ( ) const
inline

Definition at line 79 of file EventCounter.hpp.

References _sum.

Referenced by combine(), operator+=(), and set_sum().

Here is the caller graph for this function:

◆ weight_sum()

double Gambit::ColliderBit::EventCounter::weight_sum ( ) const
inline

Definition at line 84 of file EventCounter.hpp.

References _weight_sum.

Referenced by combine(), operator+=(), and set_weight_sum().

Here is the caller graph for this function:

◆ weight_sum_err()

double Gambit::ColliderBit::EventCounter::weight_sum_err ( ) const
inline

Definition at line 89 of file EventCounter.hpp.

References _weight_sum_err.

Referenced by combine(), operator+=(), and set_weight_sum_err().

Here is the caller graph for this function:

Member Data Documentation

◆ _name

std::string Gambit::ColliderBit::EventCounter::_name
private

Definition at line 31 of file EventCounter.hpp.

Referenced by name().

◆ _sum

int Gambit::ColliderBit::EventCounter::_sum
private

Definition at line 32 of file EventCounter.hpp.

Referenced by sum().

◆ _weight_sum

double Gambit::ColliderBit::EventCounter::_weight_sum
private

Definition at line 33 of file EventCounter.hpp.

Referenced by weight_sum().

◆ _weight_sum_err

double Gambit::ColliderBit::EventCounter::_weight_sum_err
private

Definition at line 34 of file EventCounter.hpp.

Referenced by weight_sum_err().


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