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

Helper data structure for nuisance I/O. More...

#include <JNuisance.hh>

Inheritance diagram for JASTRONOMY::JNuisanceHelper:
std::map< std::string, nuisance_type >

Public Member Functions

 JNuisanceHelper ()
 Default constructor.
 
std::istream & operator() (std::istream &in, nuisance_type &object) const
 Parse nuisance from input stream.
 

Detailed Description

Helper data structure for nuisance I/O.

Definition at line 353 of file JNuisance.hh.

Constructor & Destructor Documentation

◆ JNuisanceHelper()

JASTRONOMY::JNuisanceHelper::JNuisanceHelper ( )
inline

Default constructor.

Definition at line 359 of file JNuisance.hh.

360 {
361 (*this)["fixed"] .reset(new JNuisanceFixed());
362 (*this)["Gauss"] .reset(new JNuisanceGauss());
363 (*this)["Formula"] .reset(new JNuisanceTF1());
364 (*this)["Histogram"].reset(new JNuisanceTH1());
365 }

Member Function Documentation

◆ operator()()

std::istream & JASTRONOMY::JNuisanceHelper::operator() ( std::istream & in,
nuisance_type & object ) const
inline

Parse nuisance from input stream.

Parameters
ininput stream
objectnuisance
Returns
input stream

Definition at line 375 of file JNuisance.hh.

376 {
377 std::string key;
378
379 if (in >> key) {
380
381 const_iterator p = this->find(key);
382
383 if (p != this->end()) {
384
385 object.reset(p->second->clone());
386
387 object->setTitle(key);
388 object->read(in);
389
390 } else {
391
392 THROW(JParseError, "Invalid key " << key);
393 }
394 }
395
396 return in;
397 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

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