NOPID configuration flags for selection
Related to #512. See talk at WP3 meeting, 6 Feb 2023
NOPIDx configuration flags with x = HADRONS, MUONS or ELECTRONS allowing to ignore all PID requirements (like cuts on PIDx and ProbNNx) in further selections. Will likely be useful in case one needs to run MC without any PID requirements and apply PIDCalib/PIDGen-like tool.
Currently affecting only B&Q and B2CC (only muons via common charmonium_to_dimuon.py selections). Can (should?) be extended to lines of all WGs. See example on how to use below.
In order for the nopid switch to be available you need to write your hadron selections as follows:
...
from Hlt2Conf.lines.config_pid import nopid_hadrons
...
def make_detached_kaons_tightpid(name="bandq_detached_kaons_tightpid", pid=(F.PID_K > 5)):
if nopid_hadrons():
cut_pid = None
else:
cut_pid = F.FILTER(pid)
return ParticleFilter(make_detached_kaons(), name=name, Cut=cut_pid)
In order to switch on/off this option you need to set ignore_pid=True|False
as follows in your options file:
...
from Hlt2Conf.lines.config_pid import *
...
with reconstruction.bind(from_file=False),\
reconstruction_from_reco.bind(make_reconstruction=make_fastest_reconstruction),\
make_fastest_reconstruction.bind(skipUT=True),\
nopid_hadrons.bind(ignore_pid=True),\ # <--------!!! True for ignoring PID cuts for hadrons, or just remove the line for default PID cuts
get_global_ut_hits_tool.bind(enable=False) :
config = run_moore(options, make_lines, public_tools)
thus all lines built on top of make_detached_kaons_tightpid
and passing whatever cuts with argument pid
will not apply this cut.
Same use for nopid_muons
and nopid_electrons
.
Note that this works only if nopid_xxx()
is used inside a function (should it also be @configurable?). Otherwise nopid_xxx()
always returns False
ignoring the bind value.