66 zap[
'F'] =
make_field(formula,
"Reweighting formula, e.g.: \"[0] + [1]*x[0]\"") =
"";
72 catch(
const exception& error) {
73 FATAL(error.what() << endl);
85 FATAL(
"MC-header is incompatible with MUPAGE.");
93 if (reweighter.GetNdim() > JEvtWeightFactorMupage::NUMBER_OF_VARIABLES) {
95 FATAL(
"Invalid formula " << formula <<
" (number of dimensions must be < " <<
96 JEvtWeightFactorMupage::NUMBER_OF_VARIABLES <<
"; see `JAANET::JEvtWeightFactorMupage`).");
99 if (
size_t(reweighter.GetNpar()) !=
parameters.size()) {
101 FATAL(
"Not all parameters have been specified.");
113 reweighter.SetParameter(index,
getValue(*
i, 0));
117 FATAL(error << endl);
125 FATAL(
"Setting of reweighting factor was unsuccessful.");
141 while (scanner.hasNext()) {
143 const Evt*
event = scanner.next();
147 const double weight = scanner.getWeight(*event);
152 if (!isfinite(weight)) {
154 WARNING(
"Non-finite reweighting factor " << weight <<
155 " for event " << scanner.getCounter() <<
"!");
173 WARNING(
"Event " << scanner.getCounter() <<
" is empty; skip.");
bool is_mupage(const JHead &header)
Check for generator.
Utility class to parse command line options.
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
int getParameter(const std::string &text)
Get parameter number from text string.
static const int WEIGHTLIST_RESCALED_EVENT_RATE
Rescaled event rate [s-1].
const JHead & getHeader() const
Get header.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions) ...
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
void createUUID()
Create UUID if not already set.
JEvtWeightFactorFunction< JFunction_t, JEvtWeightFactor_t > make_weightFactor(const JFunction_t &function)
Auxiliary method for creating an interface to an event-weight factor.
uuid_t header_uuid
UUID of header containing the event-weight information.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Implementation of reweighting factor for mupage events according to a specifiable ROOT TFormula...
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Auxiliary base class for list of file names.
General purpose class for object reading from a list of file names.
Wrapper class around string.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Exception for parsing value.
static const int WEIGHTLIST_NORMALISATION
Event rate normalisation.
Template event-weighter-associated file scanner.
Auxiliary data structure for floating point format specification.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.