1#ifndef __JSUPPORT__JEVTWEIGHTFILESCANNER__
2#define __JSUPPORT__JEVTWEIGHTFILESCANNER__
61 template<
class JFileScanner_t = JMultipleFileScanner<Evt> >
118 JFileScanner_t ::clear();
132 for (
typename input_type::const_iterator i = input.begin(); i != input.end(); ++i) {
133 n += size_t(this->
put(*i));
146 bool put(
const std::string& input)
152 if (this->
check(head)) {
155 JFileScanner_t ::push_back(input);
175 template<
class JEvtWeightFactorHelper_t>
178 JEvtWeightFactorHelper_t* helper =
dynamic_cast<JEvtWeightFactorHelper_t*
>(this->get());
180 if (helper != NULL) {
182 helper->configure(factor);
225 bool matching = (!categories.empty());
231 for (JEvtCategorySet::const_iterator i = categories.cbegin(); i != categories.cend() && matching; ++i) {
233 JEvtCategorySet::const_iterator
j = std::find(cats.cbegin(), cats.cend(), *i);
235 matching = (
j != cats.cend());
253 template<
class JEvtWeightFactorHelper_t>
262 bool matching = (!
object.empty());
268 for (
typename JEvtCategoryMap_t::const_iterator i =
object.cbegin(); i !=
object.cend() && matching; ++i) {
270 JEvtCategorySet::const_iterator
j = std::find(cats.cbegin(), cats.cend(), i->first);
272 matching = (
j != cats.cend());
337 using JEvtWeightHelper::reset;
Scanning of objects from multiple files according a format that follows from the extension of each fi...
ROOT TTree parameter settings of various packages.
Auxiliary class for reading a map of event categories.
const JHead & getHeader() const
Get header.
JEvtWeighter getEventWeighter
Function object for mapping header to event weighter.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Support classes and methods for experiment specific I/O.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
JAANET::JEvtCategorySet getCategories(const JMultipleFileScanner_t &file_list)
Get the unique event categories corresponding to a given list of MC files.
Helper class for event categories.
bool match(const JHead &header) const
Check whether given MC header matches with this event category.
Container for a set of event categories.
Helper class for event-weight factor.
Helper class for event weighing.
void configure(const JEvtWeight &weighter)
Configuration.
void add(const JHead &header)
Add header.
bool check(const JHead &header) const
Check if a given header is consistent with this event weighter.
Abstract base class for event weighing.
Helper class for flux function.
Template event-weighter-associated file scanner.
bool setFlux(const JEvtCategoryHelper &category, const JFluxHelper &flux)
Set flux function corresponding to a given event category.
bool setEvtWeightFactor(const JEvtCategoryHelper &category, const JEvtWeightFactorHelper &factor)
Set event-weight factor corresponding to a given event category.
JEvtWeightFileScanner()
Default constructor.
bool put(const std::string &input)
Put file.
JFileScanner_t::input_type input_type
size_t put(const input_type &input)
Put files.
bool setEvtWeightFactor(const JEvtWeightFactorHelper_t &factor)
Set event-weight factor for the event-weighter associated with this file scanner.
JEvtWeightFileScanner(const JEvtWeight &weighter)
Constructor.
bool setEvtWeightFactor(const JEvtCategorySet &categories, const JEvtWeightFactorHelper &factor)
Set event-weight factor corresponding to a given set of event categories.
bool setEvtWeightFactor(const JEvtCategoryMap< JEvtWeightFactorHelper_t > &object)
Set event-weight factor according to a given map between event categories and event-weight factors.
void reset(const JEvtWeight &weighter)
Reset file scanner and event weighter.
bool setFlux(const JEvtCategoryMap< JFluxHelper > &object)
Set flux function according to a given map between event categories and flux functions.
bool setFlux(const JEvtCategorySet &categories, const JFluxHelper &flux)
Set flux function corresponding to a given set of event categories.
bool setFlux(const JFluxHelper &flux)
Set flux function for the event-weighter associated with this file scanner.
JEvtWeightFileScanner(const input_type &input)
Constructor.