1 #ifndef __JSUPPORT_JEVTWEIGHTFILESCANNERSET__
2 #define __JSUPPORT_JEVTWEIGHTFILESCANNERSET__
47 template<
class JFileScanner_t = JMultipleFileScanner<Evt>,
48 class JComparator_t = std::less<JHead> >
50 std::vector< JEvtWeightFileScanner<JFileScanner_t> >
91 for (JMultipleFileScanner_t::const_iterator i = input.begin(); i != input.end(); ++i) {
92 n += size_t(this->
put(*i));
105 bool put(
const std::string& input)
112 iterator i = lower_bound(this->begin(), this->end(), head,
115 if (i == this->end() || !i->getHeader().match(head)) {
119 return i->put(input);
134 static const char SEPARATOR =
'.';
136 string name = p->getProgramName();
140 if (i->getProgramName() ==
name) {
158 if (i->match(head)) {
163 THROW(
JValueOutOfRange,
"JEvtWeightFileScannerSet::get(): No corresponding scanner found for given header.");
180 template<
class JEvtWeightFactor_t = JEvtWeightFactor>
182 const JEvtWeightFactor_t& factor)
189 for (
iterator i = this->begin(); i != this->end(); ++i) {
190 n += (size_t) i->template setEvtWeightFactor<JEvtWeightFactor_t>(type, factor);
210 template<
class JEvtWeightFactor_t = JEvtWeightFactor>
212 const JEvtWeightFactor_t& factor)
219 for (
iterator i = this->begin(); i != this->end(); ++i) {
220 n += (size_t) i->template setEvtWeightFactor<JEvtWeightFactor_t>(types, factor);
239 template<
class JEvtWeightFactor_t = JEvtWeightFactor>
247 for (
iterator i = this->begin(); i != this->end(); ++i) {
248 n += (size_t) i->template setEvtWeightFactor<JEvtWeightFactor_t>(multiParticleFactor);
268 return setEvtWeightFactor<JFlux>(type, flux);
285 return setEvtWeightFactor<JFlux>(types, flux);
300 return setEvtWeightFactor<JFlux>(multiParticleFlux);
JEvtWeighter getEventWeighter
Function object for mapping header to event weighter.
bool put(const std::string &input)
Put file.
std::vector< value_type >::const_reverse_iterator const_reverse_iterator
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
std::string getUniqueIdentifier(const_iterator p) const
Get unique identifier for a file-scanner contained within this set of event-weighter-associated file-...
size_t setFlux(const std::set< int > &types, const JFlux &flux)
Set flux function of all MC-files corresponding to a given set of PDG codes.
size_t setEvtWeightFactor(const std::set< int > &types, const JEvtWeightFactor_t &factor)
Set event-weight factor of all MC-files corresponding to a given set of PDG codes.
const JEvtWeightFileScanner< JFileScanner_t > & find(const JHead &head) const
Find file scanner compatible with a given header.
const JHead & getHeader() const
Get header.
JEvtWeightFileScanner< JFileScanner_t > value_type
JEvtWeightFileScannerSet(const JMultipleFileScanner_t &input)
Constructor.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
then echo Enter input within $TIMEOUT_S seconds echo n User name
size_t put(const JMultipleFileScanner_t &input)
Put file.
size_t setEvtWeightFactor(const int type, const JEvtWeightFactor_t &factor)
Set event-weighting factor for all MC-files corresponding to a given PDG code.
std::vector< value_type >::reverse_iterator reverse_iterator
std::vector< value_type >::iterator iterator
#define MAKE_STRING(A)
Make string.
size_t setEvtWeightFactor(const JEvtWeightFactorMultiParticle< JEvtWeightFactor_t > &multiParticleFactor)
Set event-weight factor of all MC-files corresponding to a given multi-particle flux.
JEvtWeightFileScannerSet()
Default constructor.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Implementation of event-weight factor for multiple particle types.
std::vector< value_type >::reference reference
Helper class for event-weight factor.
Low-level interface for retrieving the flux corresponding to a given event.
std::vector< value_type >::const_reference const_reference
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Auxiliary base class for list of file names.
size_t setFlux(const JEvtWeightFactorMultiParticle< JFlux > &multiParticleFlux)
Set flux function of all MC-files corresponding to a given multi-particle flux interface.
size_t setFlux(const int type, const JFlux &flux)
Set flux function for all MC-files corresponding to a given PDG code.
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
Exception for accessing a value in a collection that is outside of its range.
Template event-weighter-associated file scanner.
std::vector< value_type >::const_iterator const_iterator
Low-level interface for retrieving a specifiable multiplication factor corresponding to a given event...
JComparator_t compare
Function object for comparison of headers.