1 #ifndef __JAANET__JEVTWEIGHTFACTORMULTIPARTICLE__
2 #define __JAANET__JEVTWEIGHTFACTORMULTIPARTICLE__
25 namespace JPP {
using namespace JAANET; }
40 template<
class JEvtWeightFactor_t>
42 public JClonable<JEvtWeightFactor_t, JEvtWeightFactorMultiParticle<JEvtWeightFactor_t> >,
43 public std::map<int, JEvtWeightFactorHelper<JEvtWeightFactor_t> >
67 const JEvtWeightFactor_t& factor) :
73 if (!header.
flux.empty()) {
81 THROW(
JValueOutOfRange,
"JEvtWeightFactorMultiParticle::JEvtWeightFactorMultiParticle(): Empty flux header-field.");
93 template<
class ...Args>
95 const JEvtWeightFactor_t& factor,
96 const Args& ...
args) :
99 insert(type, factor, args...);
110 const JEvtWeightFactor_t& factor)
123 template<
class ...Args>
125 const JEvtWeightFactor_t& factor,
156 return this->at(neutrino.
type).getFactor(evt);
160 THROW(
JValueOutOfRange,
"JEvtWeightFactorMultiParticle::getFactor(): No primary track found for event " << evt.
id <<
".");
void insert(const int type, const JEvtWeightFactor_t &factor)
Insert pair of particle code and event-weight factor.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
JEvtWeightFactorMultiParticle(const int type, const JEvtWeightFactor_t &factor, const Args &...args)
Constructor.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
virtual double getFactor(const Evt &evt) const override
Get weight factor of given event.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JEvtWeightFactorMultiParticle< JFlux > JFluxMultiParticle
Type-definition of multi-particle event-weight factor for fluxes.
bool is_primary() const
Check if this is a primary particle.
JEvtWeightFactorMultiParticle()
Default constructor.
std::vector< JAANET::flux > flux
Implementation of event-weight factor for multiple particle types.
std::map< int, JEvtWeightFactorHelper_t > map_type
Template class for object cloning.
Helper class for event-weight factor.
JEvtWeightFactorMultiParticle(const JHead &header, const JEvtWeightFactor_t &factor)
Constructor.
int type
MC: particle type in PDG encoding.
void insert(const int type, const JEvtWeightFactor_t &factor, const Args &...args)
Insert pairs of particle codes and event-weight factors.
JEvtWeightFactorHelper< JEvtWeightFactor_t > JEvtWeightFactorHelper_t
int id
offline event identifier
Exception for accessing a value in a collection that is outside of its range.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.