Jpp test-rotations-old-533-g2bdbdb559
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:
JASTRONOMY::JNuisance

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.
 

Public Attributes

std::shared_ptr< TF1 > f1
 

Static Public Attributes

static constexpr double FACTOR = 1.0
 Central value.
 

Detailed Description

Implementation of nuisance based on a formula.

Definition at line 197 of file JNuisance.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

Implements JASTRONOMY::JNuisance.

Definition at line 206 of file JNuisance.hh.

207 {
208 TString buffer;
209
210 if (buffer.ReadLine(in)) {
211
212 f1.reset(new TF1("f1", buffer));
213
214 if (!f1->IsValid()) {
215 THROW(JParseError, "Invalid function " << buffer);
216 }
217 }
218
219 return in;
220 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::shared_ptr< TF1 > f1
Definition JNuisance.hh:249

◆ write()

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

Write nuisance to output stream.

Parameters
outoutput stream
Returns
output stream

Implements JASTRONOMY::JNuisance.

Definition at line 229 of file JNuisance.hh.

230 {
231 if (f1)
232 return out << f1->GetExpFormula();
233 else
234 return out;
235 }

◆ get()

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

Get value.

Returns
value

Implements JASTRONOMY::JNuisance.

Definition at line 243 of file JNuisance.hh.

244 {
245 return f1->GetRandom(gRandom);
246 }

Member Data Documentation

◆ f1

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

Definition at line 249 of file JNuisance.hh.

◆ FACTOR

double JASTRONOMY::JNuisance::FACTOR = 1.0
staticconstexprinherited

Central value.

Definition at line 45 of file JNuisance.hh.


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