65 zap[
'F'] =
make_field(formula,
"Reweighting formula, e.g.: \"[0] + [1]*x[0]\"") =
"";
71 catch(
const exception& error) {
72 FATAL(error.what() << endl);
83 FATAL(
"MC-header is incompatible with MUPAGE.");
91 if (reweighter.GetNdim() > JEvtWeightFactorMupage::NUMBER_OF_VARIABLES) {
93 FATAL(
"Invalid formula " << formula <<
" (number of dimensions must be < " <<
94 JEvtWeightFactorMupage::NUMBER_OF_VARIABLES <<
"; see `JAANET::JEvtWeightFactorMupage`).");
97 if (
size_t(reweighter.GetNpar()) !=
parameters.size()) {
99 FATAL(
"Not all parameters have been specified.");
111 reweighter.SetParameter(index,
getValue(*i, 0));
115 FATAL(error << endl);
122 FATAL(
"Setting of reweighting factor was unsuccessful.");
136 out.put(
JMeta(argc, argv));
144 while (scanner.hasNext()) {
146 Evt*
event = scanner.next();
150 double weight = scanner.getWeight(*event);
155 if (!isfinite(weight)) {
157 WARNING(
"Non-finite reweighting factor " << weight <<
158 " for event " << scanner.getCounter() <<
"!");
171 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
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
JEvtWeightFactorFunction< JFunction_t, JEvtWeightFactor_t > make_weightFactor(const JFunction_t &function)
Auxiliary method for creating an interface to an event-weight factor.
#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 ...
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.
virtual void open(const char *file_name) override
Open file.
Template event-weighter-associated file scanner.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
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.