Implementation of event weighing for GSeaGen data.
More...
#include <JWeightGSeaGen.hh>
Implementation of event weighing for GSeaGen data.
Definition at line 28 of file JWeightGSeaGen.hh.
template<class JClonable_t, class JDerived_t = JNullType>
JAANET::JWeightGSeaGen::JWeightGSeaGen |
( |
| ) |
|
|
inline |
JAANET::JWeightGSeaGen::JWeightGSeaGen |
( |
const JHead & |
header | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 43 of file JWeightGSeaGen.hh.
virtual void configure(const JHead &header) override
Configuration.
virtual void JAANET::JWeightGSeaGen::configure |
( |
const JHead & |
header | ) |
|
|
inlineoverridevirtual |
Configuration.
- Parameters
-
Definition at line 54 of file JWeightGSeaGen.hh.
56 if (
check(header) && (header.tgen.numberOfSeconds > 0.0 &&
57 header.genvol.numberOfEvents > 0.0)) {
59 W = 1.0 / header.genvol.numberOfEvents / header.tgen.numberOfSeconds;
63 THROW(JValueOutOfRange,
"JWeightGSeaGen::configure(): Provided header is inconsistent with GSeaGen.");
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
virtual bool check(const JHead &header) const override
Check whether header is consistent with this event weighter.
virtual bool JAANET::JWeightGSeaGen::check |
( |
const JHead & |
header | ) |
const |
|
inlineoverridevirtual |
Check whether header is consistent with this event weighter.
- Parameters
-
- Returns
- true if consistent; else false
Definition at line 74 of file JWeightGSeaGen.hh.
bool is_gseagen(const JHead &header)
Check for generator.
virtual double JAANET::JWeightGSeaGen::getWeight |
( |
const Evt & |
evt | ) |
const |
|
inlineoverridevirtual |
Get weight of given event.
- Parameters
-
- Returns
- weight [Hz]
Definition at line 86 of file JWeightGSeaGen.hh.
88 if (evt.
w.size() > 2 && !(evt.
w[2] < 0.0)) {
94 if (evt.
w.size() < 3) {
95 THROW(JIndexOutOfRange,
"JWeightGSeaGen::getWeight(): w3-weight is empty.");
97 THROW(JValueOutOfRange,
"JWeightGSeaGen::getWeight(): w3-weight is negative.");
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]]=w3 (see e.g. Tag list)
virtual double JAANET::JWeightGSeaGen::getWeight |
( |
const Evt & |
evt, |
|
|
const double |
flux |
|
) |
| const |
|
inlineoverridevirtual |
Get weight of given event.
- Parameters
-
evt | event |
flux | neutrino flux [m^-2 s^-1 sr^-1 GeV^-1] |
- Returns
- weight [Hz]
Definition at line 110 of file JWeightGSeaGen.hh.
113 if (evt.
w.size() > 1 && !(evt.
w[1] < 0.0 || flux < 0.0)) {
115 return W * evt.
w[1] * flux;
119 if (evt.
w.size() < 2) {
120 THROW(JIndexOutOfRange,
"JWeightGSeaGen::getWeight(): w2-weight is empty.");
122 THROW(JValueOutOfRange,
"JWeightGSeaGen::getWeight(): w2-weight or flux is negative");
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]]=w3 (see e.g. Tag list)
template<class JClonable_t, class JDerived_t = JNullType>
|
inlineoverridevirtualinherited |
Get clone of this object.
- Returns
- pointer to newly created object
Reimplemented in JPHYSICS::JPDFTransformer< 5, JArgument_t >, JPHYSICS::JPDFTransformer< 4, JArgument_t >, JPHYSICS::JPDFTransformer< 3, JArgument_t >, JPHYSICS::JPDFTransformer< 2, JArgument_t >, JPHYSICS::JPDGTransformer_t< JArgument_t >, JPHYSICS::JPD0Transformer_t< JArgument_t >, JTOOLS::JMultiMapTransformer< N, JArgument_t >::JMultiMapDefaultTransformer, JPHYSICS::JPDFTransformer_t< JArgument_t >, JLANG::JClonable< JMatch< JTRIGGER::JHitR1 > >, and JLANG::JClonable< JMatch< JTRIGGER::JHitR1 >, JMatch3G< JTRIGGER::JHitR1 > >.
Definition at line 69 of file JClonable.hh.
71 return new JDerived_t(static_cast<const JDerived_t&>(*
this));
double JAANET::JWeightGSeaGen::W |
|
private |
The documentation for this struct was generated from the following file: