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

Data structure for fit of energy. More...

#include <JEnergy.hh>

Inheritance diagram for JFIT::JEnergy:
JMATH::JMath< JFirst_t, JSecond_t > JLANG::JComparable< JFirst_t, JSecond_t > JFIT::JLine3EZ JFIT::JModel< JEnergy > JFIT::JShowerEH

Public Types

typedef double JEnergy::* parameter_type
 

Public Member Functions

 JEnergy ()
 Default constructor. More...
 
 JEnergy (const double X)
 Constructor. More...
 
const JEnergygetEnergy () const
 Get Energy. More...
 
void setEnergy (const JEnergy &energy)
 Set 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...
 
JEnergydiv (const double value)
 Division operator. More...
 
double getlog10E () 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...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. 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
 

Friends

double fabs (const JEnergy &energy)
 Get absolute value. More...
 
std::istream & operator>> (std::istream &in, JEnergy &object)
 Read object from input. More...
 
std::ostream & operator<< (std::ostream &out, const JEnergy &object)
 Write object to output. More...
 

Detailed Description

Data structure for fit of energy.

The internal value is equal to the logarithm of the energy.

Definition at line 28 of file JEnergy.hh.

Member Typedef Documentation

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

Definition at line 261 of file JEnergy.hh.

Constructor & Destructor Documentation

JFIT::JEnergy::JEnergy ( )
inline

Default constructor.

Definition at line 36 of file JEnergy.hh.

36  :
37  __X(0.0)
38  {}
double __X
Definition: JEnergy.hh:266
JFIT::JEnergy::JEnergy ( const double  X)
inline

Constructor.

Parameters
Xx-value [log(E/GeV)]

Definition at line 46 of file JEnergy.hh.

46  :
47  __X(X)
48  {}
double __X
Definition: JEnergy.hh:266
no fit printf nominal n $STRING awk v X

Member Function Documentation

const JEnergy& JFIT::JEnergy::getEnergy ( ) const
inline

Get Energy.

Returns
Energy

Definition at line 56 of file JEnergy.hh.

57  {
58  return static_cast<const JEnergy&>(*this);
59  }
Data structure for fit of energy.
Definition: JEnergy.hh:28
void JFIT::JEnergy::setEnergy ( const JEnergy energy)
inline

Set Energy.

Parameters
energyEnergy

Definition at line 67 of file JEnergy.hh.

68  {
69  static_cast<JEnergy&>(*this) = energy;
70  }
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
Data structure for fit of energy.
Definition: JEnergy.hh:28
bool JFIT::JEnergy::less ( const JEnergy X) const
inline

Less than method.

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

Definition at line 79 of file JEnergy.hh.

80  {
81  return __X < X.__X;
82  }
double __X
Definition: JEnergy.hh:266
JEnergy& JFIT::JEnergy::negate ( )
inline

Prefix unary minus.

Returns
Energy

Definition at line 90 of file JEnergy.hh.

91  {
92  __X = -__X;
93 
94  return *this;
95  }
double __X
Definition: JEnergy.hh:266
JEnergy& JFIT::JEnergy::add ( const JEnergy value)
inline

Addition operator.

Parameters
valueEnergy
Returns
Energy

Definition at line 104 of file JEnergy.hh.

105  {
106  __X += value.__X;
107 
108  return *this;
109  }
double __X
Definition: JEnergy.hh:266
JEnergy& JFIT::JEnergy::sub ( const JEnergy value)
inline

Subtraction operator.

Parameters
valueEnergy
Returns
Energy

Definition at line 118 of file JEnergy.hh.

119  {
120  __X -= value.__X;
121 
122  return *this;
123  }
double __X
Definition: JEnergy.hh:266
JEnergy& JFIT::JEnergy::mul ( const double  value)
inline

Multiplication operator.

Parameters
valuemultiplication factor
Returns
Energy

Definition at line 132 of file JEnergy.hh.

133  {
134  __X *= value;
135 
136  return *this;
137  }
double __X
Definition: JEnergy.hh:266
JEnergy& JFIT::JEnergy::div ( const double  value)
inline

Division operator.

Parameters
valuemultiplication factor
Returns
Energy

Definition at line 146 of file JEnergy.hh.

147  {
148  __X /= value;
149 
150  return *this;
151  }
double __X
Definition: JEnergy.hh:266
double JFIT::JEnergy::getlog10E ( ) const
inline

Get energy.

Returns
Energy [log(E/GeV)]

Definition at line 159 of file JEnergy.hh.

160  {
161  return __X;
162  }
double __X
Definition: JEnergy.hh:266
double JFIT::JEnergy::getE ( ) const
inline

Get energy.

Returns
Energy [GeV]

Definition at line 170 of file JEnergy.hh.

171  {
172  return pow(10.0, __X);
173  }
double __X
Definition: JEnergy.hh:266
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
void JFIT::JEnergy::putE ( const double  E)
inline

Put energy.

Parameters
EEnergy [GeV]

Definition at line 181 of file JEnergy.hh.

182  {
183  __X = log10(E);
184  }
double __X
Definition: JEnergy.hh:266
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
set_variable E_E log10(E_{fit}/E_{#mu})"
double JFIT::JEnergy::getDE ( ) const
inline

Get derivative of energy.

Returns
dE/dx [GeV]

Definition at line 192 of file JEnergy.hh.

193  {
194  return getE() * log(10.0);
195  }
double getE() const
Get energy.
Definition: JEnergy.hh:170
static JEnergy JFIT::JEnergy::min ( )
inlinestatic

Get minimum possible value.

Returns
minimum possible value

Definition at line 214 of file JEnergy.hh.

215  {
216  return JEnergy(std::numeric_limits<double>::lowest());
217  }
JEnergy()
Default constructor.
Definition: JEnergy.hh:36
static JEnergy JFIT::JEnergy::max ( )
inlinestatic

Get maximum possible value.

Returns
maximum possible value

Definition at line 225 of file JEnergy.hh.

226  {
227  return JEnergy(std::numeric_limits<double>::max());
228  }
JEnergy()
Default constructor.
Definition: JEnergy.hh:36
static parameter_type JFIT::JEnergy::pE ( )
inlinestatic

Definition at line 263 of file JEnergy.hh.

263 { return &JEnergy::__X; }
double __X
Definition: JEnergy.hh:266
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 354 of file JMath.hh.

355  {
356  return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357  }

Friends And Related Function Documentation

double fabs ( const JEnergy energy)
friend

Get absolute value.

Parameters
energyenergy

Definition at line 203 of file JEnergy.hh.

204  {
205  return std::fabs(energy.__X);
206  }
double __X
Definition: JEnergy.hh:266
std::istream& operator>> ( std::istream &  in,
JEnergy object 
)
friend

Read object from input.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 238 of file JEnergy.hh.

239  {
240  in >> object.__X;
241 
242  return in;
243  }
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
std::ostream& operator<< ( std::ostream &  out,
const JEnergy object 
)
friend

Write object to output.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 253 of file JEnergy.hh.

254  {
255  out << object.__X;
256 
257  return out;
258  }

Member Data Documentation

double JFIT::JEnergy::__X
protected

Definition at line 266 of file JEnergy.hh.


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