1#ifndef __JSUPPORT__JEVTWEIGHTFILESCANNER__
2#define __JSUPPORT__JEVTWEIGHTFILESCANNER__
114 JEvtWeightHelper ::configure(weighter);
115 JMultipleFileScanner_t::clear();
129 for (
typename input_type::const_iterator i = input.begin(); i != input.end(); ++i) {
130 n += size_t(this->
put(*i));
143 bool put(
const std::string& input)
151 if (this->
check(head)) {
153 JEvtWeightHelper ::add(head);
154 JMultipleFileScanner_t::push_back(input);
174 template<
class JEvtWeightFactorHelper_t>
177 JEvtWeightFactorHelper_t* helper =
dynamic_cast<JEvtWeightFactorHelper_t*
>(this->get());
179 if (helper != NULL) {
181 helper->configure(factor);
224 bool matching = (!categories.empty());
230 for (JEvtCategorySet::const_iterator i = categories.cbegin(); i != categories.cend() && matching; ++i) {
232 JEvtCategorySet::const_iterator
j = std::find(cats.cbegin(), cats.cend(), *i);
234 matching = (
j != cats.cend());
252 template<
class JEvtWeightFactorHelper_t>
261 bool matching = (!
object.empty());
267 for (
typename JEvtCategoryMap_t::const_iterator i =
object.cbegin(); i !=
object.cend() && matching; ++i) {
269 JEvtCategorySet::const_iterator
j = std::find(cats.cbegin(), cats.cend(), i->first);
271 matching = (
j != cats.cend());
336 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.
void createUUID()
Create UUID if not already set.
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.
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.
Event-weighter-associated file organiser.
void reset(const JEvtWeight &weighter)
Reset file scanner and event weighter.
JEvtWeightFileScanner()
Default constructor.
bool setEvtWeightFactor(const JEvtCategoryMap< JEvtWeightFactorHelper_t > &object)
Set event-weight factor according to a given map between event categories and event-weight factors.
bool put(const std::string &input)
Put file.
bool setEvtWeightFactor(const JEvtCategorySet &categories, const JEvtWeightFactorHelper &factor)
Set event-weight factor corresponding to a given set of event categories.
bool setEvtWeightFactor(const JEvtCategoryHelper &category, const JEvtWeightFactorHelper &factor)
Set event-weight factor corresponding to a given event category.
JEvtWeightFileScanner(const JEvtWeight &weighter)
Constructor.
size_t put(const input_type &input)
Put files.
JMultipleFileScanner_t input_type
bool setFlux(const JEvtCategorySet &categories, const JFluxHelper &flux)
Set flux function corresponding to a given set of event categories.
bool setFlux(const JEvtCategoryHelper &category, const JFluxHelper &flux)
Set flux function corresponding to a given event category.
bool setEvtWeightFactor(const JEvtWeightFactorHelper_t &factor)
Set event-weight factor for the event-weighter associated with this file scanner.
bool setFlux(const JFluxHelper &flux)
Set flux function for the event-weighter associated with this file scanner.
bool setFlux(const JEvtCategoryMap< JFluxHelper > &object)
Set flux function according to a given map between event categories and flux functions.
JEvtWeightFileScanner(const input_type &input)
Constructor.
Auxiliary base class for list of file names.