1 #ifndef __JSUPPORT_JEVTWEIGHTFILESCANNERSET__
2 #define __JSUPPORT_JEVTWEIGHTFILESCANNERSET__
57 template<
class JFileScanner_t = JMultipleFileScanner<Evt>,
58 class JComparator_t = std::less<JHead> >
60 public std::vector< JEvtWeightFileScanner<JFileScanner_t> >
106 for (
typename input_type::const_iterator i = input.begin(); i != input.end(); ++i) {
107 n += size_t(this->
put(*i));
120 bool put(
const std::string& input)
127 iterator i = lower_bound(this->begin(), this->end(), head,
130 if (i == this->end() || !i->getHeader().match(head)) {
134 return i->put(input);
149 static const char SEPARATOR =
'.';
151 string name = p->getProgramName();
154 for (
const_iterator i = this->cbegin(); i != this->cend() && i != p; ++i) {
155 if (i->getProgramName() == name) {
175 if (i->match(head)) {
180 THROW(
JValueOutOfRange,
"JEvtWeightFileScannerSet::get(): No corresponding scanner found for given header.");
199 for (
iterator i = this->begin(); i != this->end(); ++i) {
200 n += (size_t) i->setEvtWeightFactor(category, factor);
221 const bool requireAll =
false)
230 for (
iterator i = this->begin(); i != this->end(); ++i) {
231 n += (size_t) i->setEvtWeightFactor(categories, factor);
236 for (
iterator i = this->begin(); i != this->end(); ++i) {
240 for (JEvtCategorySet::const_iterator
j = categories.cbegin();
j != categories.cend() && !isSet; ++
j) {
241 isSet = i->setEvtWeightFactor(*
j, factor);
265 template<
class JEvtWeightFactorHelper_t>
267 const bool requireAll =
false)
276 for (
iterator i = this->begin(); i != this->end(); ++i) {
277 n += (size_t) i->template setEvtWeightFactor<JEvtWeightFactorHelper_t>(
object);
282 for (
iterator i = this->begin(); i != this->end(); ++i) {
287 isSet = i->setEvtWeightFactor(
j->first,
j->second);
326 const bool requireAll =
false)
344 const bool requireAll =
false)
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
#define MAKE_STRING(A)
Make string.
ROOT TTree parameter settings of various packages.
Template specialisation for a map between event categories and flux factors.
Auxiliary class for reading a map of event categories.
map_type::const_iterator const_iterator
const JHead & getHeader() const
Get header.
Exception for accessing a value in a collection that is outside of its range.
JEvtWeighter getEventWeighter
Function object for mapping header to event weighter.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
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.
Helper class for event categories.
Container for a set of event categories.
Helper class for event-weight factor.
Helper class for flux function.
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
size_t setEvtWeightFactor(const JEvtCategoryHelper &category, const JEvtWeightFactorHelper &factor)
Set event-weighting factor for all MC-files corresponding to a given PDG code.
const_reference find(const JHead &head) const
Find file scanner compatible with a given header.
size_t setFlux(const JEvtCategoryMap< JFluxHelper > &object, const bool requireAll=false)
Set event-weight factor of all MC-files according to a given map between event categories and event-w...
size_t setFlux(const JEvtCategoryHelper &category, const JFluxHelper &flux)
Set flux function for all MC-files corresponding to a given event category.
std::vector< filescanner_type >::iterator iterator
filescanner_type::input_type input_type
JEvtWeightFileScannerSet(const input_type &input)
Constructor.
size_t setEvtWeightFactor(const JEvtCategorySet &categories, const JEvtWeightFactorHelper &factor, const bool requireAll=false)
Set event-weight factor of all MC-files corresponding to a given set of event categories.
std::vector< filescanner_type >::const_iterator const_iterator
std::vector< filescanner_type >::reverse_iterator reverse_iterator
JEvtWeightFileScannerSet< JFileScanner_t, JComparator_t > filescannerset_type
JEvtWeightFileScanner< JFileScanner_t > filescanner_type
std::vector< filescanner_type >::const_reverse_iterator const_reverse_iterator
std::vector< filescanner_type >::const_reference const_reference
size_t setEvtWeightFactor(const JEvtCategoryMap< JEvtWeightFactorHelper_t > &object, const bool requireAll=false)
Set event-weight factor of all MC-files according to a given map between event categories and event-w...
bool put(const std::string &input)
Put file.
size_t put(const input_type &input)
Put files.
JEvtWeightFileScannerSet()
Default constructor.
std::vector< filescanner_type >::value_type value_type
JComparator_t compare
Function object for comparison of headers.
size_t setFlux(const JEvtCategorySet &categories, const JFluxHelper &flux, const bool requireAll=false)
Set flux function of all MC-files corresponding to a given set of event categories.
std::string getUniqueIdentifier(const_iterator p) const
Get unique identifier for a file-scanner contained within this set of event-weighter-associated file-...
std::vector< filescanner_type >::reference reference
Template event-weighter-associated file scanner.
JFileScanner_t::input_type input_type