1#ifndef __JAANET__JEVTWEIGHTFACTORPRODUCT__
2#define __JAANET__JEVTWEIGHTFACTORPRODUCT__
20#include "JAAnet/JEvtWeightFactorDictionary.hh"
66 public JClonable<JEvtWeightFactor, JEvtWeightFactorProduct>
107 template<
class ...Args>
110 const Args& ...args) :
136 template<
class ...Args>
138 const Args& ...args) :
155 this->insert(this->end(), p->begin(), p->end());
168 template<
class ...Args>
185 this->insert(this->end(), product.begin(), product.end());
218 for (
iterator i = this->begin(); i != this->end(); ++i) {
222 if (!factor) {
continue; }
263 for (vector<JEvtWeightFactorHelper>::const_iterator i = this->cbegin(); i != this->cend(); ++i) {
264 factor *= i->getFactor(evt);
278 for (const_iterator i = this->cbegin(); i != this->cend(); ++i) {
279 if (!(i->is_valid())) {
return false; }
314 std::istream&
read(std::istream& in)
override final
319 static const JEvtWeightFactorDictionary dictionary(
oscProb);
323 if (getFileStatus(is.str().c_str())) {
329 for (
JToken<
'&'> token; is >> token; ) {
333 istringstream iss(token);
335 const streampos poss = iss.tellg();
337 if (!(iss >> factorID)) {
368 std::ostream&
write(std::ostream& out)
const override final
388 template<
class JEvtWeightFactorProduct_t>
400 for (
typename JEvtWeightFactorProduct_t::const_iterator i = product.cbegin(); i != product.cend(); ++i) {
402 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 STL stringstream class to facilitate optional loading of data from file.
void load()
Load data from file with name corresponding to current contents.
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.