Jpp  test_elongated_shower_pde
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JTOOLS::JWeight Class Reference

Weight calculator. More...

#include <JWeight.hh>

Inheritance diagram for JTOOLS::JWeight:
JLANG::JTitle

Public Member Functions

 JWeight (const JTitle &title="")
 Constructor. More...
 
void reset ()
 Reset. More...
 
void put (const double w)
 Put weight. More...
 
long long int getCount () const
 Get total count. More...
 
double getTotal () const
 Get total weight. More...
 
double getError () const
 Get total error. More...
 
const std::string & getTitle () const
 Get title. More...
 
void setTitle (const std::string &title)
 Set title. More...
 

Protected Attributes

double tot
 
double err
 
long long int num
 
std::string title
 

Detailed Description

Weight calculator.

Definition at line 23 of file JWeight.hh.

Constructor & Destructor Documentation

JTOOLS::JWeight::JWeight ( const JTitle title = "")
inline

Constructor.

Parameters
titletitle

Definition at line 32 of file JWeight.hh.

32  :
33  JTitle(title)
34  {
35  reset();
36  }
void reset()
Reset.
Definition: JWeight.hh:42
JTitle()
Default constructor.
Definition: JTitle.hh:24
std::string title
Definition: JTitle.hh:73

Member Function Documentation

void JTOOLS::JWeight::reset ( )
inline

Reset.

Definition at line 42 of file JWeight.hh.

43  {
44  tot = 0.0;
45  err = 0.0;
46  num = 0;
47  }
double err
Definition: JWeight.hh:97
double tot
Definition: JWeight.hh:96
long long int num
Definition: JWeight.hh:98
void JTOOLS::JWeight::put ( const double  w)
inline

Put weight.

Parameters
wweight

Definition at line 55 of file JWeight.hh.

56  {
57  tot += w;
58  err += w*w;
59  num += 1;
60  }
data_type w[N+1][M+1]
Definition: JPolint.hh:757
double err
Definition: JWeight.hh:97
double tot
Definition: JWeight.hh:96
long long int num
Definition: JWeight.hh:98
long long int JTOOLS::JWeight::getCount ( ) const
inline

Get total count.

Returns
count

Definition at line 68 of file JWeight.hh.

69  {
70  return num;
71  }
long long int num
Definition: JWeight.hh:98
double JTOOLS::JWeight::getTotal ( ) const
inline

Get total weight.

Returns
weight

Definition at line 79 of file JWeight.hh.

80  {
81  return tot;
82  }
double tot
Definition: JWeight.hh:96
double JTOOLS::JWeight::getError ( ) const
inline

Get total error.

Returns
error

Definition at line 90 of file JWeight.hh.

91  {
92  return sqrt(err);
93  }
double err
Definition: JWeight.hh:97
const std::string& JLANG::JTitle::getTitle ( ) const
inlineinherited

Get title.

Returns
title

Definition at line 55 of file JTitle.hh.

56  {
57  return this->title;
58  }
std::string title
Definition: JTitle.hh:73
void JLANG::JTitle::setTitle ( const std::string &  title)
inlineinherited

Set title.

Parameters
titletitle

Definition at line 66 of file JTitle.hh.

67  {
68  this->title = title;
69  }
std::string title
Definition: JTitle.hh:73

Member Data Documentation

double JTOOLS::JWeight::tot
protected

Definition at line 96 of file JWeight.hh.

double JTOOLS::JWeight::err
protected

Definition at line 97 of file JWeight.hh.

long long int JTOOLS::JWeight::num
protected

Definition at line 98 of file JWeight.hh.

std::string JLANG::JTitle::title
protectedinherited

Definition at line 73 of file JTitle.hh.


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