Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JGIZMO::JVolume Struct Reference

Auxiliary class for histogramming of effective volume. More...

#include <JVolume.hh>

Public Member Functions

 JVolume (const Head &head, const bool Elog10=false)
 Constructor. More...
 
double getAlpha () const
 Get spectral index of energy distribution. More...
 
double getWall () const
 Get generation dependent weight. More...
 
Double_t getXmin () const
 Get minimal abscissa value. More...
 
Double_t getXmax () const
 Get maximal abscissa value. More...
 
Double_t getX (const Double_t E, double constrain=false) const
 Get abscissa value. More...
 
Double_t getE (const Double_t x, double constrain=false) const
 Get energy. More...
 
Double_t getW (TAxis *axis, const Double_t E) const
 Get bin width corrected energy spectrum dependent weight. More...
 
double getW (const double E) const
 Get generation dependent integral value of given energy. More...
 
JVolumemul (const double factor)
 Multiply weight. More...
 
JVolumediv (const double factor)
 Divide weight. More...
 

Protected Attributes

bool elog
 histogram option More...
 
double Emin
 minimal energy More...
 
double Emax
 maximal energy More...
 
double alpha
 spectral index More...
 
double Wall
 generation volume More...
 

Detailed Description

Auxiliary class for histogramming of effective volume.

In this, it is assumed that events are generated according $\frac{dN}{dE} \propto E^{\alpha}$. The weight is expressed in $\mathrm{km}^{3}$.

Definition at line 26 of file JVolume.hh.

Constructor & Destructor Documentation

JGIZMO::JVolume::JVolume ( const Head &  head,
const bool  Elog10 = false 
)
inline

Constructor.

Parameters
headMonte Carlo run header
Elog10application of log10 to energy

Definition at line 33 of file JVolume.hh.

34  :
35  elog (Elog10),
36  Emin (1.0),
37  Emax (1.0),
38  alpha(0.0),
39  Wall (1.0)
40  {
41  using namespace JAANET;
42 
43  const JHead buffer(head);
44 
45  if (is_valid(buffer.spectrum) &&
46  is_valid(buffer.cut_nu) &&
47  is_valid(buffer.genvol)) {
48 
49  alpha = buffer.spectrum.alpha;
50  Emin = buffer.cut_nu.Emin;
51  Emax = buffer.cut_nu.Emax;
52  Wall = 1.0e-9 * (getW(Emax) - getW(Emin)) * buffer.genvol.volume / buffer.genvol.numberOfEvents; // km^3
53 
54  } else if (is_valid(buffer.cut_in) &&
55  is_valid(buffer.livetime)) {
56 
57  Emin = buffer.cut_in.Emin;
58  Emax = buffer.cut_in.Emax;
59  Wall = 1.0 / buffer.livetime.numberOfSeconds; // Hz
60  }
61  }
double alpha
spectral index
Definition: JVolume.hh:222
double Emin
minimal energy
Definition: JVolume.hh:220
double Emax
maximal energy
Definition: JVolume.hh:221
Double_t getW(TAxis *axis, const Double_t E) const
Get bin width corrected energy spectrum dependent weight.
Definition: JVolume.hh:161
Monte Carlo run header.
Definition: JHead.hh:727
double Wall
generation volume
Definition: JVolume.hh:223
bool elog
histogram option
Definition: JVolume.hh:219
bool is_valid(const T &value)
Check validity of given value.
Definition: JHead.hh:711

Member Function Documentation

double JGIZMO::JVolume::getAlpha ( ) const
inline

Get spectral index of energy distribution.

Returns
spectral index

Definition at line 69 of file JVolume.hh.

70  {
71  return alpha;
72  }
double alpha
spectral index
Definition: JVolume.hh:222
double JGIZMO::JVolume::getWall ( ) const
inline

Get generation dependent weight.

Returns
weight

Definition at line 80 of file JVolume.hh.

81  {
82  return Wall;
83  }
double Wall
generation volume
Definition: JVolume.hh:223
Double_t JGIZMO::JVolume::getXmin ( ) const
inline

Get minimal abscissa value.

Returns
abscissa value

Definition at line 91 of file JVolume.hh.

92  {
93  return getX(Emin);
94  }
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
Definition: JVolume.hh:115
double Emin
minimal energy
Definition: JVolume.hh:220
Double_t JGIZMO::JVolume::getXmax ( ) const
inline

Get maximal abscissa value.

Returns
abscissa value

Definition at line 102 of file JVolume.hh.

103  {
104  return getX(Emax);
105  }
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
Definition: JVolume.hh:115
double Emax
maximal energy
Definition: JVolume.hh:221
Double_t JGIZMO::JVolume::getX ( const Double_t  E,
double  constrain = false 
) const
inline

Get abscissa value.

Parameters
Eenergy
constrainconstrain
Returns
abscissa value

Definition at line 115 of file JVolume.hh.

116  {
117  const double x = (elog ? log10(E) : E);
118 
119  if (constrain) {
120  if (x < getXmin()) {
121  return getXmin();
122  } else if (x > getXmax()) {
123  return getXmax();
124  }
125  }
126 
127  return x;
128  }
Double_t getXmin() const
Get minimal abscissa value.
Definition: JVolume.hh:91
bool elog
histogram option
Definition: JVolume.hh:219
Double_t getXmax() const
Get maximal abscissa value.
Definition: JVolume.hh:102
Double_t JGIZMO::JVolume::getE ( const Double_t  x,
double  constrain = false 
) const
inline

Get energy.

Parameters
xabscissa value
constrainconstrain
Returns
energy

Definition at line 138 of file JVolume.hh.

139  {
140  const double E = (elog ? pow(10.0, x) : x);
141 
142  if (constrain) {
143  if (E < Emin) {
144  return Emin;
145  } else if (E > Emax) {
146  return Emax;
147  }
148  }
149 
150  return E;
151  }
double Emin
minimal energy
Definition: JVolume.hh:220
double Emax
maximal energy
Definition: JVolume.hh:221
bool elog
histogram option
Definition: JVolume.hh:219
Double_t JGIZMO::JVolume::getW ( TAxis *  axis,
const Double_t  E 
) const
inline

Get bin width corrected energy spectrum dependent weight.

Parameters
axisaxis
Eenergy
Returns
weight [km^3]

Definition at line 161 of file JVolume.hh.

162  {
163  const Int_t index = axis->FindBin(getX(E));
164 
165  const Double_t xmin = axis->GetBinLowEdge(index);
166  const Double_t xmax = axis->GetBinUpEdge (index);
167 
168  const Double_t Wmin = getW(getE(xmin));
169  const Double_t Wmax = getW(getE(xmax));
170 
171  return Wall / (Wmax - Wmin);
172  }
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
Definition: JVolume.hh:115
Double_t getW(TAxis *axis, const Double_t E) const
Get bin width corrected energy spectrum dependent weight.
Definition: JVolume.hh:161
double Wall
generation volume
Definition: JVolume.hh:223
Double_t getE(const Double_t x, double constrain=false) const
Get energy.
Definition: JVolume.hh:138
double JGIZMO::JVolume::getW ( const double  E) const
inline

Get generation dependent integral value of given energy.

Parameters
Eenergy
Returns
integral value

Definition at line 181 of file JVolume.hh.

182  {
183  if (alpha != -1.0)
184  return pow(E, 1.0 + alpha) / (1.0 + alpha);
185  else
186  return log(E);
187  }
double alpha
spectral index
Definition: JVolume.hh:222
JVolume& JGIZMO::JVolume::mul ( const double  factor)
inline

Multiply weight.

Parameters
factorfactor
Returns
this volume

Definition at line 196 of file JVolume.hh.

197  {
198  Wall *= factor;
199 
200  return *this;
201  }
double Wall
generation volume
Definition: JVolume.hh:223
JVolume& JGIZMO::JVolume::div ( const double  factor)
inline

Divide weight.

Parameters
factorfactor
Returns
this volume

Definition at line 210 of file JVolume.hh.

211  {
212  Wall /= factor;
213 
214  return *this;
215  }
double Wall
generation volume
Definition: JVolume.hh:223

Member Data Documentation

bool JGIZMO::JVolume::elog
protected

histogram option

Definition at line 219 of file JVolume.hh.

double JGIZMO::JVolume::Emin
protected

minimal energy

Definition at line 220 of file JVolume.hh.

double JGIZMO::JVolume::Emax
protected

maximal energy

Definition at line 221 of file JVolume.hh.

double JGIZMO::JVolume::alpha
protected

spectral index

Definition at line 222 of file JVolume.hh.

double JGIZMO::JVolume::Wall
protected

generation volume

Definition at line 223 of file JVolume.hh.


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