Auxiliary class for correction of energy determined by JEnergy.cc.
More...
#include <JEnergyCorrection.hh>
|
static const char * | getName () |
| Get name of energy correction formula. More...
|
|
Auxiliary class for correction of energy determined by JEnergy.cc.
Note that the correction is applied to 10log(E)
with E
in GeV.
Definition at line 39 of file JEnergyCorrection.hh.
◆ JEnergyCorrection() [1/3]
JFIT::JEnergyCorrection::JEnergyCorrection |
( |
| ) |
|
|
inline |
Default constructor.
No correction is applied to the energy.
Definition at line 47 of file JEnergyCorrection.hh.
◆ JEnergyCorrection() [2/3]
JFIT::JEnergyCorrection::JEnergyCorrection |
( |
const std::string & |
formula | ) |
|
|
inline |
◆ JEnergyCorrection() [3/3]
JFIT::JEnergyCorrection::JEnergyCorrection |
( |
const TFormula * |
fcn | ) |
|
|
inline |
◆ getFormula()
TString JFIT::JEnergyCorrection::getFormula |
( |
| ) |
const |
|
inline |
◆ setFormula()
void JFIT::JEnergyCorrection::setFormula |
( |
const std::string & |
formula | ) |
|
|
inline |
Set formula.
The input can be:
- TFormula compatible expression;
- name of ROOT file (extension
.root
);
- name of ASCII file (extension
.txt
);
- Parameters
-
Definition at line 96 of file JEnergyCorrection.hh.
100 TString buffer(formula.c_str());
102 if (buffer.EndsWith(
".root") ||
103 buffer.EndsWith(
".txt")) {
◆ operator()()
double JFIT::JEnergyCorrection::operator() |
( |
const double |
E | ) |
const |
|
inline |
Get corrected energy.
- Parameters
-
- Returns
- corrected energy [GeV]
Definition at line 121 of file JEnergyCorrection.hh.
125 const double y =
get()->Eval(log10(E));
◆ getName()
static const char* JFIT::JEnergyCorrection::getName |
( |
| ) |
|
|
inlinestatic |
Get name of energy correction formula.
- Returns
- name of formula
Definition at line 139 of file JEnergyCorrection.hh.
141 return "energy_correction";
◆ load()
void JFIT::JEnergyCorrection::load |
( |
const char * |
file_name | ) |
|
|
inline |
Load formula from file.
Supported file formats:
- ROOT file (extension
.root
) containing TFormula object with name JEnergyCorrection::getName();
- ASCII file (extension
.txt
) containing TFormula compatible expression;
Note that the method JEEP::getFullFilename() is used to search for a possible location of a file with the given name in the LD_LIBRARY_PATH environment variable.
- Parameters
-
Definition at line 157 of file JEnergyCorrection.hh.
160 using namespace JLANG;
161 using namespace JEEP;
165 if (buffer.EndsWith(
".root")) {
167 TFile in(buffer,
"READ");
180 }
else if (buffer.EndsWith(
".txt")) {
190 for (Ssiz_t i = 0; i != buffer.Length(); ++i) {
191 if (iscntrl(buffer[i])) {
◆ store()
void JFIT::JEnergyCorrection::store |
( |
const char * |
file_name | ) |
|
|
inline |
Store formula to file.
Supported file formats:
- ROOT file (extension
.root
) containing TFormula object with name JEnergyCorrection::getName;
- ASCII file (extension
.txt
) containing TFormula compatible expression;
- Parameters
-
Definition at line 221 of file JEnergyCorrection.hh.
224 using namespace JLANG;
225 using namespace JEEP;
229 const TString buffer(file_name);
231 if (buffer.EndsWith(
".root")) {
233 TFile out(file_name,
"RECREATE");
240 }
else if (buffer.EndsWith(
".txt")) {
242 ofstream out(file_name);
◆ get()
◆ set() [1/2]
◆ set() [2/2]
Set pointer.
- Parameters
-
Definition at line 96 of file JPointer.hh.
98 this->
set(pointer.
get());
◆ reset() [1/3]
◆ reset() [2/3]
◆ reset() [3/3]
◆ getReference() [1/2]
const TFormula * const& JLANG::JPointer< const TFormula >::getReference |
( |
| ) |
const |
|
inlineinherited |
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 119 of file JPointer.hh.
◆ getReference() [2/2]
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 130 of file JPointer.hh.
◆ equals()
Equals.
The equality is evaluated by comparison of the internal pointers.
- Parameters
-
- Returns
- true if equals; else false
Definition at line 50 of file JAbstractPointer.hh.
52 return this->
get() ==
object.
get();
◆ is_valid()
Check validity of pointer.
- Returns
- true if pointer not null; else false
Definition at line 83 of file JAbstractPointer.hh.
85 return this->
get() != NULL;
◆ operator->()
◆ operator const TFormula *()
◆ operator>>
Read energy correction from input.
In case a file name is specified, the method load() is used to read the energy correction from the corresponding file.
- Parameters
-
in | input stream |
object | energy correction |
- Returns
- input stream
Definition at line 266 of file JEnergyCorrection.hh.
272 object.setFormula(buffer);
◆ operator<<
Write energy correction to output.
- Parameters
-
out | output stream |
object | energy correction |
- Returns
- output stream
Definition at line 285 of file JEnergyCorrection.hh.
287 return out <<
object.getFormula();
◆ __p
The documentation for this class was generated from the following file: