Jpp
 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< JEnergy > JLANG::JComparable< JEnergy > JFIT::JLine3EZ JFIT::JModel< JEnergy > JFIT::JShower3EZ

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 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...
 
JEnergymul (const JNullType &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 24 of file JEnergy.hh.

Member Typedef Documentation

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

Definition at line 257 of file JEnergy.hh.

Constructor & Destructor Documentation

JFIT::JEnergy::JEnergy ( )
inline

Default constructor.

Definition at line 32 of file JEnergy.hh.

32  :
33  __X(0.0)
34  {}
double __X
Definition: JEnergy.hh:262
JFIT::JEnergy::JEnergy ( const double  X)
inline

Constructor.

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

Definition at line 42 of file JEnergy.hh.

42  :
43  __X(X)
44  {}
double __X
Definition: JEnergy.hh:262

Member Function Documentation

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

Get Energy.

Returns
Energy

Definition at line 52 of file JEnergy.hh.

53  {
54  return static_cast<const JEnergy&>(*this);
55  }
Data structure for fit of energy.
Definition: JEnergy.hh:24
void JFIT::JEnergy::setEnergy ( const JEnergy energy)
inline

Set Energy.

Parameters
energyEnergy

Definition at line 63 of file JEnergy.hh.

64  {
65  static_cast<JEnergy&>(*this) = energy;
66  }
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:42
Data structure for fit of energy.
Definition: JEnergy.hh:24
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 75 of file JEnergy.hh.

76  {
77  return __X < X.__X;
78  }
double __X
Definition: JEnergy.hh:262
JEnergy& JFIT::JEnergy::negate ( )
inline

Prefix unary minus.

Returns
Energy

Definition at line 86 of file JEnergy.hh.

87  {
88  __X = -__X;
89 
90  return *this;
91  }
double __X
Definition: JEnergy.hh:262
JEnergy& JFIT::JEnergy::add ( const JEnergy value)
inline

Addition operator.

Parameters
valueEnergy
Returns
Energy

Definition at line 100 of file JEnergy.hh.

101  {
102  __X += value.__X;
103 
104  return *this;
105  }
double __X
Definition: JEnergy.hh:262
JEnergy& JFIT::JEnergy::sub ( const JEnergy value)
inline

Subtraction operator.

Parameters
valueEnergy
Returns
Energy

Definition at line 114 of file JEnergy.hh.

115  {
116  __X -= value.__X;
117 
118  return *this;
119  }
double __X
Definition: JEnergy.hh:262
JEnergy& JFIT::JEnergy::mul ( const double  value)
inline

Multiplication operator.

Parameters
valuemultiplication factor
Returns
Energy

Definition at line 128 of file JEnergy.hh.

129  {
130  __X *= value;
131 
132  return *this;
133  }
double __X
Definition: JEnergy.hh:262
JEnergy& JFIT::JEnergy::div ( const double  value)
inline

Division operator.

Parameters
valuemultiplication factor
Returns
Energy

Definition at line 142 of file JEnergy.hh.

143  {
144  __X /= value;
145 
146  return *this;
147  }
double __X
Definition: JEnergy.hh:262
double JFIT::JEnergy::getX ( ) const
inline

Get energy.

Returns
Energy [log(E/GeV)]

Definition at line 155 of file JEnergy.hh.

156  {
157  return __X;
158  }
double __X
Definition: JEnergy.hh:262
double JFIT::JEnergy::getE ( ) const
inline

Get energy.

Returns
Energy [GeV]

Definition at line 166 of file JEnergy.hh.

167  {
168  return pow(10.0, __X);
169  }
double __X
Definition: JEnergy.hh:262
void JFIT::JEnergy::putE ( const double  E)
inline

Put energy.

Parameters
EEnergy [GeV]

Definition at line 177 of file JEnergy.hh.

178  {
179  __X = log10(E);
180  }
double __X
Definition: JEnergy.hh:262
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
double JFIT::JEnergy::getDE ( ) const
inline

Get derivative of energy.

Returns
dE/dx [GeV]

Definition at line 188 of file JEnergy.hh.

189  {
190  return getE() * log(10.0);
191  }
double getE() const
Get energy.
Definition: JEnergy.hh:166
static JEnergy JFIT::JEnergy::min ( )
inlinestatic

Get minimum possible value.

Returns
minimum possible value

Definition at line 210 of file JEnergy.hh.

211  {
212  return JEnergy(-std::numeric_limits<double>::max());
213  }
JEnergy()
Default constructor.
Definition: JEnergy.hh:32
static JEnergy JFIT::JEnergy::max ( )
inlinestatic

Get maximum possible value.

Returns
maximum possible value

Definition at line 221 of file JEnergy.hh.

222  {
223  return JEnergy(+std::numeric_limits<double>::max());
224  }
JEnergy()
Default constructor.
Definition: JEnergy.hh:32
static parameter_type JFIT::JEnergy::pE ( )
inlinestatic

Definition at line 259 of file JEnergy.hh.

259 { return &JEnergy::__X; }
double __X
Definition: JEnergy.hh:262
JEnergy & JMATH::JMath< JEnergy , JNullType >::mul ( const JNullType 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  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18

Friends And Related Function Documentation

double fabs ( const JEnergy energy)
friend

Get absolute value.

Parameters
energyenergy

Definition at line 199 of file JEnergy.hh.

200  {
201  return std::fabs(energy.__X);
202  }
double __X
Definition: JEnergy.hh:262
std::istream& operator>> ( std::istream &  in,
JEnergy object 
)
friend

Read object from input.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 234 of file JEnergy.hh.

235  {
236  in >> object.__X;
237 
238  return in;
239  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
std::ostream& operator<< ( std::ostream &  out,
const JEnergy object 
)
friend

Write object to output.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 249 of file JEnergy.hh.

250  {
251  out << object.__X;
252 
253  return out;
254  }

Member Data Documentation

double JFIT::JEnergy::__X
protected

Definition at line 262 of file JEnergy.hh.


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