Jpp 20.0.0-rc.9
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JNuisanceTF1 Struct Reference

Implementation of nuisance based on a formula. More...

#include <JNuisance.hh>

Inheritance diagram for JASTRONOMY::JNuisanceTF1:
JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

virtual std::istream & read (std::istream &in) override
 Read nuisance from input stream.
 
virtual std::ostream & write (std::ostream &out) const override
 Write nuisance to output stream.
 
double get () const override
 Get value.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Public Attributes

std::shared_ptr< TF1 > f1
 

Detailed Description

Implementation of nuisance based on a formula.

Definition at line 203 of file JNuisance.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Member Function Documentation

◆ read()

virtual std::istream & JASTRONOMY::JNuisanceTF1::read ( std::istream & in)
inlineoverridevirtual

Read nuisance from input stream.

Parameters
ininput stream
Returns
input stream

Definition at line 212 of file JNuisance.hh.

213 {
214 TString buffer;
215
216 if (buffer.ReadLine(in)) {
217
218 f1.reset(new TF1("f1", buffer));
219
220 if (!f1->IsValid()) {
221 THROW(JParseError, "Invalid function " << buffer);
222 }
223 }
224
225 return in;
226 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::shared_ptr< TF1 > f1
Definition JNuisance.hh:255

◆ write()

virtual std::ostream & JASTRONOMY::JNuisanceTF1::write ( std::ostream & out) const
inlineoverridevirtual

Write nuisance to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 235 of file JNuisance.hh.

236 {
237 if (f1)
238 return out << f1->GetExpFormula();
239 else
240 return out;
241 }

◆ get()

double JASTRONOMY::JNuisanceTF1::get ( ) const
inlineoverride

Get value.

Returns
value

Definition at line 249 of file JNuisance.hh.

250 {
251 return f1->GetRandom(gRandom);
252 }

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

◆ f1

std::shared_ptr<TF1> JASTRONOMY::JNuisanceTF1::f1

Definition at line 255 of file JNuisance.hh.


The documentation for this struct was generated from the following file: