Cuts should be specified declaratively
Created by: Zaharid
The current code in #181 (which mimics the previous c++ filter
) is enourmoulsy convoluted.
It would be a lot better if:
- Cuts were specified declaratively, so they are actually easy to read by humans and machines (e.g. for plotting them).
- Filters were commutative so that one doesn't have to have the whole information (and the information on in which order things are done) in mind to understand what is going to happen. This can b done if all the rules either always select or always cut away points.
The declarative format could look something like this:
- process_type: DIS
#W2 is an "extra label" in the vp plotting notation
#w2min is loaded from input::datacuts.
reason: "Non perturbative effects at low W²"
filter: "W2 < w2min"
- process_type: DIS
reason: "Non perturbative effects at low Q²"
filter: "Q2 < q2min"
- dataset: EMCF2P
reason: "????"
filter: "x<=0.1"
- dataset: EMCF2D
reason: "?????"
filter: "x<=0.1"
- process_type: "DIS_NCP_CH"
VFNS: "FONLL-A"
reason: "?????"
#Q2cut1_f2c loaded from constants.yaml
filter: "Q2 < Q2cut1_f2c"
- process_type: "DIS_NCP_CH"
reason: "?????"
VFNS: "FONLL-A"
filter: " Q2 <= Q2cut2_f2c && x <= xcut_f2c "
- process_type: "DIS_NCP_CH"
reason: "????"
VFNS: "FONLL-C"
IC: True
filter: "Q2 <=
Q2cut1_f2c_WITH_A_DIFFERENT_NAME_BECAUSE_IT_HAS_A_DIFFERENT_VALUE_EXCALAMATION_MARK_EXCLAMATION_MARK"
We would need to make available the relevant information on theory and kinematics to the rules, and we could use sympy to parse the math expressions with the comparisons.