1#ifndef __JAANET__JEVTWEIGHTFACTORPRODUCT__
2#define __JAANET__JEVTWEIGHTFACTORPRODUCT__
64 public JClonable<JEvtWeightFactor, JEvtWeightFactorProduct>
105 template<
class ...Args>
108 const Args& ...args) :
134 template<
class ...Args>
136 const Args& ...args) :
153 this->insert(this->end(), p->begin(), p->end());
166 template<
class ...Args>
183 this->insert(this->end(), product.begin(), product.end());
216 for (
iterator i = this->begin(); i != this->end(); ++i) {
220 if (!factor) {
continue; }
261 for (vector<JEvtWeightFactorHelper>::const_iterator i = this->cbegin(); i != this->cend(); ++i) {
262 factor *= i->getFactor(evt);
276 for (const_iterator i = this->cbegin(); i != this->cend(); ++i) {
277 if (!(i->is_valid())) {
return false; }
312 std::istream&
read(std::istream& in)
override final
323 for (
JToken<
'&'> token; is >> token; ) {
327 istringstream iss(token);
329 const streampos poss = iss.tellg();
331 if (!(iss >> factorID)) {
362 std::ostream&
write(std::ostream& out)
const override final
382 template<
class JEvtWeightFactorProduct_t>
394 for (
typename JEvtWeightFactorProduct_t::const_iterator i = product.cbegin(); i != product.cend(); ++i) {
396 const int index = 1 +
distance(product.cbegin(), i);
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
I/O formatting auxiliaries.
#define MAKE_STRING(A)
Make string.
Utility class to parse parameter values.
Dictionary to map distinct event-weight factors to unique identifiers.
Utility class to parse parameter values.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Exception for null pointer operation.
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
Wrapper class around string.
Extensions to Evt data format.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Helper class for event-weight factor.
JEvtWeightFactor & getFactor() const
Get reference to event-weight factor.
Auxiliary class for I/O of product of event-weight factors.
JEvtWeightFactorProductHelper(JEvtWeightFactorProduct_t &product, const JEquationParameters &eqpars)
Constructor.
Class for product of event-weight factors.
void push_back(const JEvtWeightFactorHelper &factor)
Put event-weight factor.
std::istream & read(std::istream &in) override final
Read event-weight factor product from stream.
JEvtWeightFactorProduct(const JOscProbHelper &oscProb, const JEvtWeightFactorHelper &factor, const Args &...args)
Constructor.
const JOscProbHelper & getOscProb() const
Get oscillation probability calculator.
JEvtWeightFactorProduct()
Default constructor.
JEvtWeightFactorProduct(const JEvtWeightFactorHelper &factor)
Constructor.
JEvtWeightFactorProduct(const JOscProbHelper &oscProb)
Constructor.
size_t setOscProb(const JOscProbHelper &oscProb)
Set oscillation probability calculator for all compatible event weight factors.
bool is_valid() const override final
Check whether this event-weight factor is valid.
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const override final
Get properties of this class.
JEvtWeightFactorProduct(const JOscProbHelper &oscProb, const JEvtWeightFactorHelper &factor)
Constructor.
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
Get properties of this class.
JOscProbHelper oscProb
Oscillation probability calculator.
double getFactor(const Evt &evt) const override final
Get multiplication factor of given event.
JEvtWeightFactorProduct(const JEvtWeightFactorHelper &factor, const Args &...args)
Constructor.
void push_back(const JEvtWeightFactorHelper &factor, const Args &...args)
Put event-weight factor.
JEvtWeightFactorProduct & join(const JEvtWeightFactorProduct &product)
Join this product of event-weight factors with a given product of event-weight factors.
std::ostream & write(std::ostream &out) const override final
Write event-weight factor to output.
Abstract base class for specifiable event-weight factors.
static const char *const getTypeKey()
Get type keyword.
static JEquationParameters & getEquationParameters()
Get equation parameters.
Implementation of oscillated neutrino flux.
void setOscProb(const JOscProbHelper oscProb)
Set oscillation probability calculator.
Template class for object cloning.
Helper class for oscillation probability calculators.