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();
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
Auxiliary class for correction of energy determined by JEnergy.cc.
 
void load(const char *file_name)
Load formula from file.
 
double operator()(const double E) const
Get corrected energy.
 
void store(const char *file_name)
Store formula to file.
 
friend std::istream & operator>>(std::istream &in, JEnergyCorrection &object)
Read energy correction from input.
 
JEnergyCorrection()
Default constructor.
 
static const char * getName()
Get name of energy correction formula.
 
TString getFormula() const
Get formula.
 
friend std::ostream & operator<<(std::ostream &out, const JEnergyCorrection &object)
Write energy correction to output.
 
JEnergyCorrection(const TFormula *fcn)
Constructor.
 
JEnergyCorrection(const std::string &formula)
Constructor.
 
void setFormula(const std::string &formula)
Set formula.
 
bool is_valid() const
Check validity of pointer.
 
Exception for opening of file.
 
virtual JClass_t * get() const override
Get pointer.
 
JClass_t *const  & getReference() const
Get rereference to internal pointer.
 
The template JSharedPointer class can be used to share a pointer to an object.
 
virtual void reset() override
Reset pointer.
 
General puprpose classes and methods.
 
static const char *const LD_LIBRARY_PATH
Nick names of environment variables.
 
std::string getFullFilename(const std::string &variable, const std::string &file_name)
Get full file name (see JEEP::getPath).
 
Auxiliary classes and methods for linear and iterative data regression.
 
Auxiliary classes and methods for language specific functionality.
 
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
 
T pow(const T &x, const double y)
Power .
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).