1 #ifndef __JFIT__JENERGYCORRECTION__ 
    2 #define __JFIT__JENERGYCORRECTION__ 
   26 namespace JPP { 
using namespace JFIT; }
 
   80         return get()->GetExpFormula();
 
  100         TString buffer(formula.c_str());
 
  102         if (buffer.EndsWith(
".root") ||
 
  103             buffer.EndsWith(
".txt")) {
 
  125         const double y = 
get()->Eval(log10(E));
 
  141       return "energy_correction";
 
  157     void load(
const char* file_name)
 
  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])) {
 
  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);
 
  272       object.setFormula(buffer);
 
  287       return out << 
object.getFormula();
 
Exception for opening of file. 
 
friend std::istream & operator>>(std::istream &in, JEnergyCorrection &object)
Read energy correction from input. 
 
friend std::ostream & operator<<(std::ostream &out, const JEnergyCorrection &object)
Write energy correction to output. 
 
JEnergyCorrection(const TFormula *fcn)
Constructor. 
 
static const char *const LD_LIBRARY_PATH
Nick names of environment variables. 
 
JClass_t *const & getReference() const 
Get rereference to internal pointer. 
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
bool is_valid() const 
Check validity of pointer. 
 
void setFormula(const std::string &formula)
Set formula. 
 
virtual void reset()
Reset pointer. 
 
Auxiliary class for correction of energy determined by JEnergy.cc. 
 
Template implementation of class that holds pointer to object(s). 
 
JEnergyCorrection()
Default constructor. 
 
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line. 
 
void load(const char *file_name)
Load formula from file. 
 
static const char * getName()
Get name of energy correction formula. 
 
void store(const char *file_name)
Store formula to file. 
 
TString getFormula() const 
Get formula. 
 
std::string getFullFilename(const std::string &variable, const std::string &file_name)
Get full file name (see JEEP::getPath). 
 
double operator()(const double E) const 
Get corrected energy. 
 
JEnergyCorrection(const std::string &formula)
Constructor.