hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
truthVertexMatch_cfg.py
Go to the documentation of this file.
1import HpstrConf
2import sys
3import os
4import baseConfig as base
5
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
9)
10base.parser.add_argument(
11 '--apPDG', type=int, default=622,
12 help="PDG of the A' (622 displaced, 623 prompt). Ignored for SIMP."
13)
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."
17)
18base.parser.add_argument(
19 '--massWindow', type=float, default=0.002,
20 help="Half-width of the truth-mass window [GeV] (default 0.002)."
21)
22base.parser.add_argument(
23 '--vtxZMin', type=float, default=-1.0e9,
24 help="Min truth decay-vertex z [mm] to consider (default disabled)."
25)
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."
29)
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)."
33)
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 "
37 "(default 0.2)."
38)
39
40options = base.parser.parse_args()
41
42infile = options.inFilename
43outfile = options.outFilename
44
45print('Input file: %s' % infile)
46print('Output file: %s' % outfile)
47
49
50p.run_mode = 1
51p.skip_events = options.skip_events
52p.max_events = options.nevents
53
54p.add_library("libprocessors")
55
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"')
60
61# rad (radiative trident) MC tags its hard e+e- pair with a prompt PDG=623 mother at the
62# target, so it is handled by the A' code path with apPDG=623 (truth vertex = mother endpoint).
63is_rad = (options.sample == 'rad')
64
65tvm = HpstrConf.Processor('tvm', 'TruthVertexMatch2021')
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
78#tvm.parameters["debug"] = 1
79
80p.sequence = [tvm]
81
82p.input_files = infile
83p.output_files = [outfile]
84
85p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4