Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
More...
template<class JFileScanner_t = JMultipleFileScanner<Evt>, class JComparator_t = std::less<JHead>>
struct JSUPPORT::JEvtWeightFileScannerSet< JFileScanner_t, JComparator_t >
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
Note: The template class JFileScanner_t
must be derived from JMultipleFileScanner<Evt>.
Definition at line 59 of file JEvtWeightFileScannerSet.hh.
template<class JFileScanner_t = JMultipleFileScanner<Evt>, class JComparator_t = std::less<JHead>>
Set event-weight factor of all MC-files corresponding to a given set of event categories.
If the boolean requireAll
argument is set to true
,
the given event-weighting factor will only be assigned to those files
whose header matches < b>all< /b> of the specified event categories.
- Parameters
-
categories | set of event categories |
factor | event-weight factor |
requireAll | toggle requirement that the file headers match all given event categories |
- Returns
- number of modified event weighters
Definition at line 219 of file JEvtWeightFileScannerSet.hh.
222 {
225
227
228 if (requireAll) {
229
230 for (
iterator i = this->begin(); i != this->end(); ++i) {
231 n += (size_t) i->setEvtWeightFactor(categories, factor);
232 }
233
234 } else {
235
236 for (
iterator i = this->begin(); i != this->end(); ++i) {
237
238 bool isSet = false;
239
240 for (JEvtCategorySet::const_iterator
j = categories.cbegin();
j != categories.cend() && !isSet; ++
j) {
241 isSet = i->setEvtWeightFactor(*
j, factor);
242 }
243
245 }
246 }
247
249 }
template<class JFileScanner_t = JMultipleFileScanner<Evt>, class JComparator_t = std::less<JHead>>
template<class JEvtWeightFactorHelper_t >
Set event-weight factor of all MC-files according to a given map between event categories and event-weight factors.
The template argument refers either to the class JAANET::JEvtWeightFactorHelper
or JAANET::JFluxHelper
.
If the boolean requireAll
argument is set to true
,
the given event-weighting factor will only be assigned to those files
whose header matches < b>all< /b> of the specified event categories.
- Parameters
-
object | map between event categories and event-weight factors |
requireAll | toggle requirement that the file headers match all given event categories |
- Returns
- number of modified event weighters
Definition at line 266 of file JEvtWeightFileScannerSet.hh.
268 {
271
273
274 if (requireAll) {
275
276 for (
iterator i = this->begin(); i != this->end(); ++i) {
278 }
279
280 } else {
281
282 for (
iterator i = this->begin(); i != this->end(); ++i) {
283
284 bool isSet = false;
285
287 isSet = i->setEvtWeightFactor(
j->first,
j->second);
288 }
289
291 }
292 }
293
295 }
map_type::const_iterator const_iterator
size_t setEvtWeightFactor(const JEvtCategoryHelper &category, const JEvtWeightFactorHelper &factor)
Set event-weighting factor for all MC-files corresponding to a given PDG code.
template<class JFileScanner_t = JMultipleFileScanner<Evt>, class JComparator_t = std::less<JHead>>
Set flux function of all MC-files corresponding to a given set of event categories.
If the boolean requireAll
argument is set to true
, the given flux function will only be assigned to those files
whose header lists < b>all< /b> of the specified PDG codes as primaries.
- Parameters
-
categories | set of event categories |
flux | flux function |
requireAll | toggle requirement that each file header must contain every given PDG code. |
- Returns
- number of modified event weighters
Definition at line 324 of file JEvtWeightFileScannerSet.hh.
template<class JFileScanner_t = JMultipleFileScanner<Evt>, class JComparator_t = std::less<JHead>>
Set event-weight factor of all MC-files according to a given map between event categories and event-weight factors.
If the boolean requireAll
argument is set to true
, the given flux function will only be assigned to those files
whose header matches < b>all< /b> of the specified event categories.
- Parameters
-
object | map between event categories and flux functions |
requireAll | toggle requirement that the file headers match all given event categories |
- Returns
- number of modified event weighters
Definition at line 343 of file JEvtWeightFileScannerSet.hh.