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

Helper data structure for detector resolution I/O. More...

#include <JResolution.hh>

Inheritance diagram for JASTRONOMY::JResolutionHelper:
std::map< std::string, resolution_type >

Public Member Functions

 JResolutionHelper ()
 Default constructor.
 
std::istream & operator() (std::istream &in, resolution_type &object) const
 Parse detector resolution from input stream.
 

Detailed Description

Helper data structure for detector resolution I/O.

Definition at line 365 of file JResolution.hh.

Constructor & Destructor Documentation

◆ JResolutionHelper()

JASTRONOMY::JResolutionHelper::JResolutionHelper ( )
inline

Default constructor.

Definition at line 371 of file JResolution.hh.

372 {
373 (*this)["Gauss"] .reset(new JResolutionGauss());
374 (*this)["Formula"] .reset(new JResolutionTF1());
375 (*this)["Histogram"] .reset(new JResolutionTH1());
376 (*this)["Logarithmic"].reset(new JResolutionLog());
377 }

Member Function Documentation

◆ operator()()

std::istream & JASTRONOMY::JResolutionHelper::operator() ( std::istream & in,
resolution_type & object ) const
inline

Parse detector resolution from input stream.

Parameters
ininput stream
objectdetector resolution
Returns
input stream

Definition at line 387 of file JResolution.hh.

388 {
389 std::string key;
390
391 if (in >> key) {
392
393 const_iterator p = this->find(key);
394
395 if (p != this->end()) {
396
397 object.reset(p->second->clone());
398
399 object->setTitle(key);
400 object->read(in);
401
402 } else {
403
404 THROW(JParseError, "Invalid key " << key);
405 }
406 }
407
408 return in;
409 }
#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: