Jpp
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
JFIT::JModel< JEnergy > Struct Template Reference

Template specialisation of class JModel to match hit with muon energy. More...

#include <JModel.hh>

Inheritance diagram for JFIT::JModel< JEnergy >:
JFIT::JEnergy JMATH::JMath< JEnergy > JLANG::JComparable< JEnergy >

Public Types

typedef double JEnergy::* parameter_type
 

Public Member Functions

 JModel (const JEnergy &X)
 Constructor. More...
 
bool operator() (const JNPE &npe) const
 Test compatibility of given light yields with muon energy. More...
 
bool less (const JEnergy &X) const
 Less than method. More...
 
JEnergynegate ()
 Prefix unary minus. More...
 
JEnergyadd (const JEnergy &value)
 Addition operator. More...
 
JEnergysub (const JEnergy &value)
 Subtraction operator. More...
 
JEnergymul (const double value)
 Multiplication operator. More...
 
JEnergymul (const JSecond_t &object)
 Multiply with object. More...
 
JEnergydiv (const double value)
 Division operator. More...
 
double getX () const
 Get energy. More...
 
double getE () const
 Get energy. More...
 
void putE (const double E)
 Put energy. More...
 
double getDE () const
 Get derivative of energy. More...
 

Static Public Member Functions

static JEnergy min ()
 Get minimum possible value. More...
 
static JEnergy max ()
 Get maximum possible value. More...
 
static parameter_type pE ()
 

Protected Attributes

double __X
 

Detailed Description

template<>
struct JFIT::JModel< JEnergy >

Template specialisation of class JModel to match hit with muon energy.

Definition at line 91 of file JModel.hh.

Member Typedef Documentation

◆ parameter_type

typedef double JEnergy::* JFIT::JEnergy::parameter_type
inherited

Definition at line 235 of file JEnergy.hh.

Constructor & Destructor Documentation

◆ JModel()

JFIT::JModel< JEnergy >::JModel ( const JEnergy X)
inline

Constructor.

Parameters
Xx-value [log(E)]

Definition at line 99 of file JModel.hh.

99  :
100  JEnergy(X)
101  {}

Member Function Documentation

◆ operator()()

bool JFIT::JModel< JEnergy >::operator() ( const JNPE npe) const
inline

Test compatibility of given light yields with muon energy.

Parameters
npenpe
Returns
true if total light yield due to muon is larger than that due to random background; else false

Definition at line 110 of file JModel.hh.

111  {
112  return npe.getYA() + this->getE() * npe.getYB() > npe.getY0();
113  }

◆ less()

bool JFIT::JEnergy::less ( const JEnergy X) const
inlineinherited

Less than method.

Parameters
XEnergy [log(E/GeV)]
Returns
true if this energy less than given energy; else false

Definition at line 53 of file JEnergy.hh.

54  {
55  return __X < X.__X;
56  }

◆ negate()

JEnergy& JFIT::JEnergy::negate ( )
inlineinherited

Prefix unary minus.

Returns
Energy

Definition at line 64 of file JEnergy.hh.

65  {
66  __X = -__X;
67 
68  return *this;
69  }

◆ add()

JEnergy& JFIT::JEnergy::add ( const JEnergy value)
inlineinherited

Addition operator.

Parameters
valueEnergy
Returns
Energy

Definition at line 78 of file JEnergy.hh.

79  {
80  __X += value.__X;
81 
82  return *this;
83  }

◆ sub()

JEnergy& JFIT::JEnergy::sub ( const JEnergy value)
inlineinherited

Subtraction operator.

Parameters
valueEnergy
Returns
Energy

Definition at line 92 of file JEnergy.hh.

93  {
94  __X -= value.__X;
95 
96  return *this;
97  }

◆ mul() [1/2]

JEnergy& JFIT::JEnergy::mul ( const double  value)
inlineinherited

Multiplication operator.

Parameters
valuemultiplication factor
Returns
Energy

Definition at line 106 of file JEnergy.hh.

107  {
108  __X *= value;
109 
110  return *this;
111  }

◆ mul() [2/2]

JEnergy & JMATH::JMath< JEnergy , JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }

◆ div()

JEnergy& JFIT::JEnergy::div ( const double  value)
inlineinherited

Division operator.

Parameters
valuemultiplication factor
Returns
Energy

Definition at line 120 of file JEnergy.hh.

121  {
122  __X /= value;
123 
124  return *this;
125  }

◆ getX()

double JFIT::JEnergy::getX ( ) const
inlineinherited

Get energy.

Returns
Energy [log(E/GeV)]

Definition at line 133 of file JEnergy.hh.

134  {
135  return __X;
136  }

◆ getE()

double JFIT::JEnergy::getE ( ) const
inlineinherited

Get energy.

Returns
Energy [GeV]

Definition at line 144 of file JEnergy.hh.

145  {
146  return pow(10.0, __X);
147  }

◆ putE()

void JFIT::JEnergy::putE ( const double  E)
inlineinherited

Put energy.

Parameters
EEnergy [GeV]

Definition at line 155 of file JEnergy.hh.

156  {
157  __X = log10(E);
158  }

◆ getDE()

double JFIT::JEnergy::getDE ( ) const
inlineinherited

Get derivative of energy.

Returns
dE/dx [GeV]

Definition at line 166 of file JEnergy.hh.

167  {
168  return getE() * log(10.0);
169  }

◆ min()

static JEnergy JFIT::JEnergy::min ( )
inlinestaticinherited

Get minimum possible value.

Returns
minimum possible value

Definition at line 188 of file JEnergy.hh.

189  {
190  return JEnergy(-std::numeric_limits<double>::max());
191  }

◆ max()

static JEnergy JFIT::JEnergy::max ( )
inlinestaticinherited

Get maximum possible value.

Returns
maximum possible value

Definition at line 199 of file JEnergy.hh.

200  {
201  return JEnergy(+std::numeric_limits<double>::max());
202  }

◆ pE()

static parameter_type JFIT::JEnergy::pE ( )
inlinestaticinherited

Definition at line 237 of file JEnergy.hh.

237 { return &JEnergy::__X; }

Member Data Documentation

◆ __X

double JFIT::JEnergy::__X
protectedinherited

Definition at line 240 of file JEnergy.hh.


The documentation for this struct was generated from the following file:
JFIT::JEnergy::JEnergy
JEnergy()
Default constructor.
Definition: JEnergy.hh:32
JFIT::JEnergy::getE
double getE() const
Get energy.
Definition: JEnergy.hh:144
JFIT::JNPE::getYB
double getYB() const
Get light yield due to bremsstrahlung.
Definition: JNPE.hh:80
JFIT::JK40::getY0
double getY0() const
Get expectation value for number of single hits.
Definition: JK40.hh:101
JMATH::JCalculator
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JFIT::JNPE::getYA
double getYA() const
Get light yield due to muon itself.
Definition: JNPE.hh:69
JFIT::JEnergy::__X
double __X
Definition: JEnergy.hh:240