Auxiliary class for correction of energy determined by JShowerEnergy.cc.  
 More...
#include <JShowerEnergyCorrection.hh>
 | 
| static const char *  | getName () | 
|   | Get name of energy correction formula.  More...
  | 
|   | 
Auxiliary class for correction of energy determined by JShowerEnergy.cc. 
Definition at line 38 of file JShowerEnergyCorrection.hh.
 
◆ JShowerEnergyCorrection() [1/3]
  
  
      
        
          | JFIT::JShowerEnergyCorrection::JShowerEnergyCorrection  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ JShowerEnergyCorrection() [2/3]
  
  
      
        
          | JFIT::JShowerEnergyCorrection::JShowerEnergyCorrection  | 
          ( | 
          const std::string &  | 
          formula | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ JShowerEnergyCorrection() [3/3]
  
  
      
        
          | JFIT::JShowerEnergyCorrection::JShowerEnergyCorrection  | 
          ( | 
          const TFormula *  | 
          fcn | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ getFormula()
  
  
      
        
          | TString JFIT::JShowerEnergyCorrection::getFormula  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get formula. 
- Returns
 - formula 
 
Definition at line 76 of file JShowerEnergyCorrection.hh.
   79         return get()->GetExpFormula();
 
bool is_valid() const
Check validity of pointer.
 
virtual JClass_t * get() const override
Get pointer.
 
 
 
 
◆ setFormula()
  
  
      
        
          | void JFIT::JShowerEnergyCorrection::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 95 of file JShowerEnergyCorrection.hh.
   99         TString buffer(formula.c_str());
 
  101         if (buffer.EndsWith(
".root") ||
 
  102             buffer.EndsWith(
".txt")) {
 
static const char * getName()
Get name of energy correction formula.
 
void load(const char *file_name)
Load formula from file.
 
virtual void reset() override
Reset pointer.
 
 
 
 
◆ operator()()
  
  
      
        
          | double JFIT::JShowerEnergyCorrection::operator()  | 
          ( | 
          const double  | 
          E | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ getName()
  
  
      
        
          | static const char* JFIT::JShowerEnergyCorrection::getName  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Get name of energy correction formula. 
- Returns
 - name of formula 
 
Definition at line 138 of file JShowerEnergyCorrection.hh.
  140       return "energy_correction";
 
 
 
 
◆ load()
  
  
      
        
          | void JFIT::JShowerEnergyCorrection::load  | 
          ( | 
          const char *  | 
          file_name | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Load formula from file. 
Supported file formats:
- ROOT file (extension 
.root) containing TFormula object with name JShowerEnergyCorrection::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 156 of file JShowerEnergyCorrection.hh.
  159       using namespace JLANG;
 
  160       using namespace JEEP;
 
  164       if        (buffer.EndsWith(
".root")) {
 
  166         TFile in(buffer, 
"READ");
 
  179       } 
else if (buffer.EndsWith(
".txt")) {
 
  189           for (Ssiz_t i = 0; i != buffer.Length(); ++i) {
 
  190             if (iscntrl(buffer[i])) {
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
Exception for opening of file.
 
JClass_t *const  & getReference() const
Get rereference to internal 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 language specific functionality.
 
 
 
 
◆ store()
  
  
      
        
          | void JFIT::JShowerEnergyCorrection::store  | 
          ( | 
          const char *  | 
          file_name | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Store formula to file. 
Supported file formats:
- ROOT file (extension 
.root) containing TFormula object with name JShowerEnergyCorrection::getName; 
- ASCII file (extension 
.txt) containing TFormula compatible expression; 
- Parameters
 - 
  
  
 
Definition at line 220 of file JShowerEnergyCorrection.hh.
  223       using namespace JLANG;
 
  224       using namespace JEEP;
 
  228         const TString buffer(file_name);
 
  230         if        (buffer.EndsWith(
".root")) {
 
  232           TFile out(file_name, 
"RECREATE");
 
  239         } 
else if (buffer.EndsWith(
".txt")) {
 
  241           ofstream out(file_name);
 
 
 
 
◆ get()
template<class JClass_t > 
  
  | 
      
   | 
  
inlineoverridevirtualinherited   | 
  
 
 
◆ set() [1/2]
template<class JClass_t > 
  
  | 
      
   | 
  
inlineoverridevirtualinherited   | 
  
 
 
◆ set() [2/2]
template<class JClass_t > 
template<class T > 
 
Set pointer. 
- Parameters
 - 
  
  
 
Definition at line 96 of file JPointer.hh.
virtual void set(JClass_t *p) override
Set pointer.
 
 
 
 
◆ reset() [1/3]
template<class JClass_t > 
  
  | 
      
   | 
  
inlineoverridevirtualinherited   | 
  
 
Reset pointer. 
Implements JLANG::JAbstractPointer< JClass_t >.
Reimplemented in JLANG::JStorage< JClass_t, JMemory_t >, JLANG::JStorage< TFile >, JLANG::JStorage< JClass_t, JNew >, JLANG::JStorage< JClass_t, JMemory_t >, JLANG::JStorage< TFile >, JLANG::JStorage< JClass_t, JNew >, JLANG::JSharedPointer< JClass_t, JMemory_t >, JLANG::JSharedPointer< JObjectIterator< T > >, JLANG::JSharedPointer< const TFormula >, JLANG::JSharedPointer< JFIT::JMEstimator >, JLANG::JSharedPointer< JAbstractAutoPointer< JBase_t > >, JLANG::JSharedPointer< JTRIGGER::JDAQHitSelector >, JLANG::JSharedPointer< match_type >, JLANG::JSharedPointer< JLOGGER::JLogger >, JLANG::JSharedPointer< JParserElementInterface >, JLANG::JSharedPointer< JAccessibleObjectIterator< T > >, JLANG::JSharedPointer< JExceptionHandler >, JLANG::JSharedPointer< JTRIGGER::JMatch >, JLANG::JSharedPointer< JBase_t >, JLANG::JSharedPointer< JObjectOutput< T > >, JLANG::JSharedPointer< JPropertiesElementInterface >, JLANG::JSharedPointer< JRewindableObjectIterator< T > >, JLANG::JSharedPointer< JAccessibleObjectOutput< T > >, JLANG::JSharedPointer< JNET::JControlHost >, JLANG::JSharedPointer< JTOOLS::JMultiMapTransformer >, and JLANG::JSharedPointer< JRadiation >.
Definition at line 84 of file JPointer.hh.
 
 
◆ reset() [2/3]
template<class JClass_t > 
template<class T > 
 
 
◆ reset() [3/3]
template<class JClass_t > 
 
Reset pointer. 
- Parameters
 - 
  
  
 
Definition at line 94 of file JAbstractPointer.hh.
   96       if (this->
get() != p) {
 
virtual void set(JClass_t *p)=0
Set pointer.
 
virtual void reset()=0
Reset pointer.
 
virtual JClass_t * get() const =0
Get pointer.
 
 
 
 
◆ getReference() [1/2]
template<class JClass_t > 
 
Get rereference to internal pointer. 
- Returns
 - reference to internal pointer 
 
Definition at line 119 of file JPointer.hh.
 
 
◆ getReference() [2/2]
template<class JClass_t > 
 
Get rereference to internal pointer. 
- Returns
 - reference to internal pointer 
 
Definition at line 130 of file JPointer.hh.
 
 
◆ equals()
template<class JClass_t > 
 
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()
template<class JClass_t > 
 
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->()
template<class JClass_t > 
 
Smart pointer operator. 
- Returns
 - pointer to object 
 
Definition at line 112 of file JAbstractPointer.hh.
Exception for null pointer operation.
 
 
 
 
◆ operator JClass_t *()
template<class JClass_t > 
 
 
◆ 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 265 of file JShowerEnergyCorrection.hh.
  271       object.setFormula(buffer);
 
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
 
 
 
 
◆ operator<<
Write energy correction to output. 
- Parameters
 - 
  
    | out | output stream  | 
    | object | energy correction  | 
  
   
- Returns
 - output stream 
 
Definition at line 284 of file JShowerEnergyCorrection.hh.
  286       return out << 
object.getFormula();
 
 
 
 
◆ __p
template<class JClass_t > 
 
 
The documentation for this class was generated from the following file: