1 #ifndef __JFIT__JSHOWERENERGYCORRECTION__
2 #define __JFIT__JSHOWERENERGYCORRECTION__
26 namespace JPP {
using namespace JFIT; }
79 return get()->GetExpFormula();
99 TString buffer(formula.c_str());
101 if (buffer.EndsWith(
".root") ||
102 buffer.EndsWith(
".txt")) {
124 const double y =
get()->Eval(E);
140 return "energy_correction";
156 void load(
const char* file_name)
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])) {
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);
271 object.setFormula(buffer);
286 return out <<
object.getFormula();
Exception for opening of file.
JShowerEnergyCorrection(const TFormula *fcn)
Constructor.
JShowerEnergyCorrection(const std::string &formula)
Constructor.
static const char *const LD_LIBRARY_PATH
Nick names of environment variables.
TString getFormula() const
Get formula.
Auxiliary class for correction of energy determined by JShowerEnergy.cc.
JClass_t *const & getReference() const
Get rereference to internal pointer.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JShowerEnergyCorrection()
Default constructor.
bool is_valid() const
Check validity of pointer.
void load(const char *file_name)
Load formula from file.
friend std::istream & operator>>(std::istream &in, JShowerEnergyCorrection &object)
Read energy correction from input.
static const char * getName()
Get name of energy correction formula.
Template implementation of class that holds pointer to object(s).
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
double operator()(const double E) const
Get corrected energy.
void setFormula(const std::string &formula)
Set formula.
void store(const char *file_name)
Store formula to file.
std::string getFullFilename(const std::string &variable, const std::string &file_name)
Get full file name (see JEEP::getPath).
friend std::ostream & operator<<(std::ostream &out, const JShowerEnergyCorrection &object)
Write energy correction to output.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
virtual void reset() override
Reset pointer.