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 193 of file JEvtWeightFileScannerSet.hh.
196 {
199
201
202 if (requireAll) {
203
204 for (
iterator i = this->begin(); i != this->end(); ++i) {
205 n += (size_t) i->setEvtWeightFactor(categories, factor);
206 }
207
208 } else {
209
210 for (
iterator i = this->begin(); i != this->end(); ++i) {
211
212 bool isSet = false;
213
214 for (JEvtCategorySet::const_iterator
j = categories.cbegin();
j != categories.cend() && !isSet; ++
j) {
215 isSet = i->setEvtWeightFactor(*
j, factor);
216 }
217
219 }
220 }
221
223 }
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 240 of file JEvtWeightFileScannerSet.hh.
242 {
245
247
248 if (requireAll) {
249
250 for (
iterator i = this->begin(); i != this->end(); ++i) {
252 }
253
254 } else {
255
256 for (
iterator i = this->begin(); i != this->end(); ++i) {
257
258 bool isSet = false;
259
261 isSet = i->setEvtWeightFactor(
j->first,
j->second);
262 }
263
265 }
266 }
267
269 }
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 298 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 317 of file JEvtWeightFileScannerSet.hh.