Jpp test-rotations-old-533-g2bdbdb559
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JResolution_t Struct Reference

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

#include <JResolution.hh>

Inheritance diagram for JASTRONOMY::JResolution_t:
JLANG::JTitle

Public Types

typedef std::map< std::string, resolution_typedictionary_type
 

Public Member Functions

 JResolution_t ()
 Default constructor.
 
const dictionary_typegetDictionary () const
 Get dictionary.
 
const std::string & getTitle () const
 Get title.
 
void setTitle (const std::string &title)
 Set title.
 

Protected Attributes

dictionary_type dictionary
 
std::string title
 

Friends

std::istream & operator>> (std::istream &in, JResolution_t &object)
 Read detector resolution from input stream.
 
std::ostream & operator<< (std::ostream &out, const JResolution_t &object)
 Write detector resolution to output stream.
 

Detailed Description

Helper for detector resolution I/O.

Definition at line 361 of file JResolution.hh.

Member Typedef Documentation

◆ dictionary_type

Constructor & Destructor Documentation

◆ JResolution_t()

JASTRONOMY::JResolution_t::JResolution_t ( )
inline

Default constructor.

Definition at line 370 of file JResolution.hh.

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

Member Function Documentation

◆ getDictionary()

const dictionary_type & JASTRONOMY::JResolution_t::getDictionary ( ) const
inline

Get dictionary.

Returns
dictionary

Definition at line 384 of file JResolution.hh.

385 {
386 return dictionary;
387 }

◆ getTitle()

const std::string & JLANG::JTitle::getTitle ( ) const
inlineinherited

Get title.

Returns
title

Definition at line 55 of file JTitle.hh.

56 {
57 return this->title;
58 }
std::string title
Definition JTitle.hh:73

◆ setTitle()

void JLANG::JTitle::setTitle ( const std::string & title)
inlineinherited

Set title.

Parameters
titletitle

Definition at line 66 of file JTitle.hh.

67 {
68 this->title = title;
69 }

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JResolution_t & object )
friend

Read detector resolution from input stream.

Parameters
ininput stream
objectdetector resolution
Returns
input stream

Definition at line 397 of file JResolution.hh.

398 {
399 using namespace std;
400
401 string key;
402
403 if (in >> key) {
404
405 if (object.dictionary.count(key)) {
406
407 static_cast<shared_ptr<JResolution>&>(object) = object.dictionary[key];
408
409 object.setTitle(key);
410
411 object->read(in);
412
413 } else {
414
415 THROW(JParseError, "Invalid key " << key);
416 }
417 }
418
419 return in;
420 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JResolution_t & object )
friend

Write detector resolution to output stream.

Parameters
outoutput stream
objectdetector resolution
Returns
output stream

Definition at line 430 of file JResolution.hh.

431 {
432 out << object.getTitle() << ' ';
433
434 if (static_cast<const std::shared_ptr<JResolution>&>(object)) {
435 object->write(out);
436 }
437
438 return out;
439 }

Member Data Documentation

◆ dictionary

dictionary_type JASTRONOMY::JResolution_t::dictionary
protected

Definition at line 442 of file JResolution.hh.

◆ title

std::string JLANG::JTitle::title
protectedinherited

Definition at line 73 of file JTitle.hh.


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