Jpp  15.0.5
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
JAANET::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

JAANET::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  const JHead buffer(head);
42 
43  if (buffer.is_valid(&JHead::spectrum) &&
44  buffer.is_valid(&JHead::cut_nu) &&
45  buffer.is_valid(&JHead::genvol)) {
46 
47  alpha = buffer.spectrum.alpha;
48  Emin = buffer.cut_nu.Emin;
49  Emax = buffer.cut_nu.Emax;
50  Wall = 1.0e-9 * (getW(Emax) - getW(Emin)) * buffer.genvol.volume / buffer.genvol.numberOfEvents; // km^3
51 
52  } else if (buffer.is_valid(&JHead::cut_in) &&
53  buffer.is_valid(&JHead::livetime)) {
54 
55  Emin = buffer.cut_in.Emin;
56  Emax = buffer.cut_in.Emax;
57  Wall = 1.0 / buffer.livetime.numberOfSeconds; // Hz
58  }
59  }
JAANET::genvol genvol
Definition: JHead.hh:1408
double Wall
generation volume
Definition: JVolume.hh:221
JAANET::livetime livetime
Definition: JHead.hh:1412
Double_t getW(TAxis *axis, const Double_t E) const
Get bin width corrected energy spectrum dependent weight.
Definition: JVolume.hh:159
JAANET::spectrum spectrum
Definition: JHead.hh:1405
double alpha
spectral index
Definition: JVolume.hh:220
Monte Carlo run header.
Definition: JHead.hh:1113
JAANET::cut_in cut_in
Definition: JHead.hh:1403
bool elog
histogram option
Definition: JVolume.hh:217
JAANET::cut_nu cut_nu
Definition: JHead.hh:1404
double Emin
minimal energy
Definition: JVolume.hh:218
double Emax
maximal energy
Definition: JVolume.hh:219

Member Function Documentation

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

Get spectral index of energy distribution.

Returns
spectral index

Definition at line 67 of file JVolume.hh.

68  {
69  return alpha;
70  }
double alpha
spectral index
Definition: JVolume.hh:220
double JAANET::JVolume::getWall ( ) const
inline

Get generation dependent weight.

Returns
weight

Definition at line 78 of file JVolume.hh.

79  {
80  return Wall;
81  }
double Wall
generation volume
Definition: JVolume.hh:221
Double_t JAANET::JVolume::getXmin ( ) const
inline

Get minimal abscissa value.

Returns
abscissa value

Definition at line 89 of file JVolume.hh.

90  {
91  return getX(Emin);
92  }
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
Definition: JVolume.hh:113
double Emin
minimal energy
Definition: JVolume.hh:218
Double_t JAANET::JVolume::getXmax ( ) const
inline

Get maximal abscissa value.

Returns
abscissa value

Definition at line 100 of file JVolume.hh.

101  {
102  return getX(Emax);
103  }
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
Definition: JVolume.hh:113
double Emax
maximal energy
Definition: JVolume.hh:219
Double_t JAANET::JVolume::getX ( const Double_t  E,
double  constrain = false 
) const
inline

Get abscissa value.

Parameters
Eenergy
constrainconstrain
Returns
abscissa value

Definition at line 113 of file JVolume.hh.

114  {
115  const double x = (elog ? log10(E) : E);
116 
117  if (constrain) {
118  if (x < getXmin()) {
119  return getXmin();
120  } else if (x > getXmax()) {
121  return getXmax();
122  }
123  }
124 
125  return x;
126  }
Double_t getXmin() const
Get minimal abscissa value.
Definition: JVolume.hh:89
Double_t getXmax() const
Get maximal abscissa value.
Definition: JVolume.hh:100
then usage E
Definition: JMuonPostfit.sh:35
bool elog
histogram option
Definition: JVolume.hh:217
Double_t JAANET::JVolume::getE ( const Double_t  x,
double  constrain = false 
) const
inline

Get energy.

Parameters
xabscissa value
constrainconstrain
Returns
energy

Definition at line 136 of file JVolume.hh.

137  {
138  const double E = (elog ? pow(10.0, x) : x);
139 
140  if (constrain) {
141  if (E < Emin) {
142  return Emin;
143  } else if (E > Emax) {
144  return Emax;
145  }
146  }
147 
148  return E;
149  }
then usage E
Definition: JMuonPostfit.sh:35
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
bool elog
histogram option
Definition: JVolume.hh:217
double Emin
minimal energy
Definition: JVolume.hh:218
double Emax
maximal energy
Definition: JVolume.hh:219
Double_t JAANET::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 159 of file JVolume.hh.

160  {
161  const Int_t index = axis->FindBin(getX(E));
162 
163  const Double_t xmin = axis->GetBinLowEdge(index);
164  const Double_t xmax = axis->GetBinUpEdge (index);
165 
166  const Double_t Wmin = getW(getE(xmin));
167  const Double_t Wmax = getW(getE(xmax));
168 
169  return Wall / (Wmax - Wmin);
170  }
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
Definition: JVolume.hh:113
double Wall
generation volume
Definition: JVolume.hh:221
then usage E
Definition: JMuonPostfit.sh:35
Double_t getW(TAxis *axis, const Double_t E) const
Get bin width corrected energy spectrum dependent weight.
Definition: JVolume.hh:159
Double_t getE(const Double_t x, double constrain=false) const
Get energy.
Definition: JVolume.hh:136
double JAANET::JVolume::getW ( const double  E) const
inline

Get generation dependent integral value of given energy.

Parameters
Eenergy
Returns
integral value

Definition at line 179 of file JVolume.hh.

180  {
181  if (alpha != -1.0)
182  return pow(E, 1.0 + alpha) / (1.0 + alpha);
183  else
184  return log(E);
185  }
then usage E
Definition: JMuonPostfit.sh:35
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double alpha
spectral index
Definition: JVolume.hh:220
JVolume& JAANET::JVolume::mul ( const double  factor)
inline

Multiply weight.

Parameters
factorfactor
Returns
this volume

Definition at line 194 of file JVolume.hh.

195  {
196  Wall *= factor;
197 
198  return *this;
199  }
double Wall
generation volume
Definition: JVolume.hh:221
JVolume& JAANET::JVolume::div ( const double  factor)
inline

Divide weight.

Parameters
factorfactor
Returns
this volume

Definition at line 208 of file JVolume.hh.

209  {
210  Wall /= factor;
211 
212  return *this;
213  }
double Wall
generation volume
Definition: JVolume.hh:221

Member Data Documentation

bool JAANET::JVolume::elog
protected

histogram option

Definition at line 217 of file JVolume.hh.

double JAANET::JVolume::Emin
protected

minimal energy

Definition at line 218 of file JVolume.hh.

double JAANET::JVolume::Emax
protected

maximal energy

Definition at line 219 of file JVolume.hh.

double JAANET::JVolume::alpha
protected

spectral index

Definition at line 220 of file JVolume.hh.

double JAANET::JVolume::Wall
protected

generation volume

Definition at line 221 of file JVolume.hh.


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