1 #ifndef __JSUPPORT_JEVTWEIGHTFILESCANNERSET__
2 #define __JSUPPORT_JEVTWEIGHTFILESCANNERSET__
49 template<
class JFileScanner_t = JMultipleFileScanner<Evt>,
50 class JComparator_t = std::less<JHead> >
52 public std::vector< JEvtWeightFileScanner<JFileScanner_t> >
98 for (
typename input_type::const_iterator i = input.begin(); i != input.end(); ++i) {
99 n += size_t(this->
put(*i));
119 iterator i = lower_bound(this->begin(), this->end(), head,
122 if (i == this->end() || !i->getHeader().match(head)) {
126 return i->put(input);
141 static const char SEPARATOR =
'.';
143 string name = p->getProgramName();
146 for (
const_iterator i = this->cbegin(); i != this->cend() && i != p; ++i) {
147 if (i->getProgramName() ==
name) {
165 if (i->match(head)) {
170 THROW(
JValueOutOfRange,
"JEvtWeightFileScannerSet::get(): No corresponding scanner found for given header.");
187 template<
class JEvtWeightFactor_t = JEvtWeightFactor>
189 const JEvtWeightFactor_t& factor)
196 for (
iterator i = this->begin(); i != this->end(); ++i) {
197 n += (size_t) i->template setEvtWeightFactor<JEvtWeightFactor_t>(type, factor);
217 template<
class JEvtWeightFactor_t = JEvtWeightFactor>
219 const JEvtWeightFactor_t& factor)
226 for (
iterator i = this->begin(); i != this->end(); ++i) {
227 n += (size_t) i->template setEvtWeightFactor<JEvtWeightFactor_t>(types, factor);
246 template<
class JEvtWeightFactor_t = JEvtWeightFactor>
254 for (
iterator i = this->begin(); i != this->end(); ++i) {
255 n += (size_t) i->template setEvtWeightFactor<JEvtWeightFactor_t>(multiParticleFactor);
275 return setEvtWeightFactor<JFlux>(type, flux);
292 return setEvtWeightFactor<JFlux>(types, flux);
307 return setEvtWeightFactor<JFlux>(multiParticleFlux);
JEvtWeighter getEventWeighter
Function object for mapping header to event weighter.
bool put(const std::string &input)
Put file.
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 JHead & getHeader() const
Get header.
std::vector< filescanner_type >::reverse_iterator reverse_iterator
#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 setEvtWeightFactor(const int type, const JEvtWeightFactor_t &factor)
Set event-weighting factor for all MC-files corresponding to a given PDG code.
size_t put(const input_type &input)
Put files.
std::vector< filescanner_type >::const_reverse_iterator const_reverse_iterator
#define MAKE_STRING(A)
Make string.
JEvtWeightFileScannerSet(const input_type &input)
Constructor.
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.
JEvtWeightFileScannerSet< JFileScanner_t, JComparator_t > filescannerset_type
Helper class for event-weight factor.
std::vector< filescanner_type >::reference reference
JEvtWeightFileScanner< JFileScanner_t > filescanner_type
Low-level interface for retrieving the flux corresponding to a given event.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
std::vector< filescanner_type >::const_reference const_reference
JFileScanner_t::input_type input_type
std::vector< filescanner_type >::iterator iterator
size_t setFlux(const JEvtWeightFactorMultiParticle< JFlux > &multiParticleFlux)
Set flux function of all MC-files corresponding to a given multi-particle flux interface.
filescanner_type::input_type input_type
std::vector< filescanner_type >::value_type value_type
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.
Low-level interface for retrieving a specifiable multiplication factor corresponding to a given event...
const_reference find(const JHead &head) const
Find file scanner compatible with a given header.
std::vector< filescanner_type >::const_iterator const_iterator
JComparator_t compare
Function object for comparison of headers.