Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JEvtWeighter Struct Reference

Look-up table for event weighters. More...

#include <JEvtWeightToolkit.hh>

Inheritance diagram for JAANET::JEvtWeighter:
std::vector< std::shared_ptr< JEvtWeight > >

Public Member Functions

 JEvtWeighter ()
 Constructor.
 
const JEvtWeightoperator() (const JHead &header) const
 Get event weighter corresponding to given header.
 

Detailed Description

Look-up table for event weighters.

Definition at line 51 of file JEvtWeightToolkit.hh.

Constructor & Destructor Documentation

◆ JEvtWeighter()

JAANET::JEvtWeighter::JEvtWeighter ( )
inline

Constructor.

Definition at line 57 of file JEvtWeightToolkit.hh.

58 {
59 this->emplace_back(new JEvtWeightGSeaGen());
60 this->emplace_back(new JEvtWeightKM3BUU());
61 this->emplace_back(new JEvtWeightCorsika());
62 this->emplace_back(new JEvtWeightMupage());
63 this->emplace_back(new JEvtWeightGenhen());
64 this->emplace_back(new JEvtWeightDAQ()); // must be after Monte Carlo weighters
65 this->emplace_back(new JEvtWeightMiscellaneous());
66 }

Member Function Documentation

◆ operator()()

const JEvtWeight & JAANET::JEvtWeighter::operator() ( const JHead & header) const
inline

Get event weighter corresponding to given header.

Parameters
headerheader
Returns
event weighter

Definition at line 75 of file JEvtWeightToolkit.hh.

76 {
77 using namespace std;
78 using namespace JPP;
79
80 for (const_iterator i = this->begin(); i != this->end(); ++i) {
81
82 if ((*i)->check(header)) {
83 return *(*i);
84 }
85 }
86
87 THROW(JValueOutOfRange, "JEvtWeighter::operator(): No event weighter found for given header:" << endl << header);
88 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).

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