1#ifndef __JAANET__JEVTWEIGHTFACTORPRODUCT__
2#define __JAANET__JEVTWEIGHTFACTORPRODUCT__
19#include "JAAnet/JEvtWeightFactorDictionary.hh"
63 public JClonable<JEvtWeightFactor, JEvtWeightFactorProduct>
104 template<
class ...Args>
107 const Args& ...args) :
133 template<
class ...Args>
135 const Args& ...args) :
152 this->insert(this->end(), p->begin(), p->end());
165 template<
class ...Args>
182 this->insert(this->end(), product.begin(), product.end());
215 for (
iterator i = this->begin(); i != this->end(); ++i) {
219 if (!factor) {
continue; }
260 for (vector<JEvtWeightFactorHelper>::const_iterator i = this->cbegin(); i != this->cend(); ++i) {
261 factor *= i->getFactor(evt);
275 for (const_iterator i = this->cbegin(); i != this->cend(); ++i) {
276 if (!(i->is_valid())) {
return false; }
311 std::istream&
read(std::istream& in)
override final
316 static const JEvtWeightFactorDictionary dictionary(
oscProb);
318 streampos pos = in.tellg();
325 if (getFileStatus(buffer.c_str())) {
327 ifstream ifs(buffer.c_str());
353 for (
JToken<
'&'> token; in >> token; ) {
357 istringstream iss(token);
359 if (!(iss >> factorID)) {
continue; }
380 std::ostream&
write(std::ostream& out)
const override final
400 template<
class JEvtWeightFactorProduct_t>
412 for (
typename JEvtWeightFactorProduct_t::const_iterator i = product.cbegin(); i != product.cend(); ++i) {
414 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.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
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 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.