1 #ifndef __JAANET__JEVTWEIGHTGENHEN__
2 #define __JAANET__JEVTWEIGHTGENHEN__
24 namespace JPP {
using namespace JAANET; }
36 public JClonable<JEvtWeight, JEvtWeightGenhen>
80 setNormalisation(
object.getNormalisation());
82 if (static_cast<const JFluxHelper&>(
object)) {
93 virtual const char*
const getName()
const override
112 setNormalisation(1.0 / Nevents / (60*60*24*365));
116 THROW(
JValueOutOfRange,
"JEvtWeightGenhen::configure(): Provided header is inconsistent with Genhen.");
143 if (static_cast<const JFluxHelper&>(*
this) &&
158 if (!static_cast<const JFluxHelper&>(*
this)) {
159 THROW(JNullPointerException,
"JEvtWeightGenhen::getWeight(): Unspecified flux function.");
161 THROW(
JIndexOutOfRange,
"JEvtWeightGenhen::getWeight(): Empty " << (evt.
w.size() < 3 ?
"w2-" :
"w3-") <<
"weight.");
void configure(const JHead &header) override
Weight normalisation configuration.
static const int WEIGHTLIST_RESCALED_EVENT_RATE
Rescaled event rate [s-1].
Implementation of event weighting for Genhen data.
virtual const char *const getName() const override
Get name.
double numberOfEvents
Number of events.
#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 or km3net-dataformat/definitions) ...
static const int WEIGHTLIST_EVENT_RATE
Event rate [s-1].
JEvtWeightGenhen()
Default Constructor.
JEvtWeightGenhen(const JHead &header)
Constructor.
bool check(const JHead &header) const override
Check whether header is consistent with this event weighter.
double getFactor(const Evt &evt) const
Get weight-factor of given event.
double getWeight(const Evt &evt) const override
Get weight of given event.
Template class for object cloning.
Helper class for event-weight factor.
void configure(const JEvtWeightFactor_t &factor)
Configure event-weight factor.
Low-level interface for retrieving the flux corresponding to a given event.
bool is_genhen(const JHead &header)
Check for generator.
JEvtWeightGenhen(const JHead &header, const JFlux &flux)
Constructor.
static const int WEIGHTLIST_DIFFERENTIAL_EVENT_RATE
Event rate per unit of flux (c.f. taglist document) [GeV m2 sr].
JEvtWeightGenhen(const JEvtWeightGenhen &object)
Copy constructor.
Exception for accessing a value in a collection that is outside of its range.
Exception for accessing an index in a collection that is outside of its range.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.