4import baseConfig
as base
6base.parser.add_argument(
7 '--sample', choices=[
'data',
'sim_bkgd',
'ap_signal',
'simp_signal',
'rad'],
8 help=
'Which type of sample this is', required=
True
10base.parser.add_argument(
11 '--apPDG', type=int, default=622,
12 help=
"PDG of the A' (622 displaced, 623 prompt). Ignored for SIMP."
14base.parser.add_argument(
15 '--massSelect', type=float, default=-1.0,
16 help=
"Target truth e+e- invariant mass [GeV] to select (e.g. 0.120). <0 disables."
18base.parser.add_argument(
19 '--massWindow', type=float, default=0.002,
20 help=
"Half-width of the truth-mass window [GeV] (default 0.002)."
22base.parser.add_argument(
23 '--vtxZMin', type=float, default=-1.0e9,
24 help=
"Min truth decay-vertex z [mm] to consider (default disabled)."
26base.parser.add_argument(
27 '--vtxZMax', type=float, default=1.0e9,
28 help=
"Max truth decay-vertex z [mm] to consider, e.g. 50 = before first tracking layer."
30base.parser.add_argument(
31 '--eleMomCut', type=float, default=0.5,
32 help=
"Truth e- momentum threshold [GeV] for the secondary category (default 0.5)."
34base.parser.add_argument(
35 '--eleClusEMin', type=float, default=0.2,
36 help=
"Sanity floor [GeV] on the electron leg's ECal cluster energy for has_ele_clus "
40options = base.parser.parse_args()
42infile = options.inFilename
43outfile = options.outFilename
45print(
'Input file: %s' % infile)
46print(
'Output file: %s' % outfile)
51p.skip_events = options.skip_events
52p.max_events = options.nevents
54p.add_library(
"libprocessors")
56if options.isData
and not options.sample ==
'data':
57 raise ValueError(
'If running on data, sample must be "data"')
58if not options.isData
and options.sample ==
'data':
59 raise ValueError(
'If running on MC, sample cannot be "data", use "sim_bkgd", "ap_signal" or "simp_signal"')
63is_rad = (options.sample ==
'rad')
66tvm.parameters[
"isData"] = options.isData
67tvm.parameters[
"isApSignal"] = 1
if ((
'ap' in options.sample)
or is_rad)
else 0
68tvm.parameters[
"isSimpSignal"] = 1
if (
'simp' in options.sample)
else 0
69tvm.parameters[
"apPDG"] = 623
if is_rad
else options.apPDG
70tvm.parameters[
"vtxCollection"] =
"UnconstrainedV0Vertices_KF"
71tvm.parameters[
"calTimeOffset"] = 37.3
72tvm.parameters[
"massSelect"] = options.massSelect
73tvm.parameters[
"massWindow"] = options.massWindow
74tvm.parameters[
"vtxZMin"] = options.vtxZMin
75tvm.parameters[
"vtxZMax"] = options.vtxZMax
76tvm.parameters[
"eleMomCut"] = options.eleMomCut
77tvm.parameters[
"eleClusEMin"] = options.eleClusEMin
83p.output_files = [outfile]