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
anaFee_cfg.py
Go to the documentation of this file.
2# anaFee_cfg.py
3#
4# Configuration for the FeeAnaProcessor: selects Full Energy Electron (FEE) events
5# off the FinalStateParticle collection, where each track is already associated to
6# its ECal cluster at the LCIO stage (no manual track-cluster matching).
7#
8# Example:
9# hpstr anaFee_cfg.py -i <ntuple.root> -o fee.root -t 1 -s <fileNumber>
10#
11import HpstrConf
12import os
13import sys
14import baseConfig as base
15
16options = base.parser.parse_args()
17
18# Use the input file to set the output file name
19inFilename = options.inFilename
20outFilename = options.outFilename
21
22# The seed is the file number (used by the smearing tool).
23smearingSeed = options.seed
24
25print('Input file: %s' % inFilename)
26print('Output file: %s' % outFilename)
27
29
30p.run_mode = 1
31p.skip_events = options.skip_events
32p.max_events = options.nevents
33
34p.add_library("libprocessors")
35
36
39anaFee = HpstrConf.Processor('anaFee', 'FeeAnaProcessor')
40
41anaFee.parameters["debug"] = options.debug
42anaFee.parameters["seed"] = smearingSeed
43anaFee.parameters["isData"] = options.isData
44
45# Track collection name -- used only for histogram-directory and smearing-tool naming.
46anaFee.parameters["trkCollName"] = 'KalmanFullTracks'
47# FinalStateParticle collection that the FEE selection actually loops over. Each
48# particle carries its track and (when matched) its ECal cluster.
49anaFee.parameters["fspCollName"] = 'FinalStateParticles_KF'
50
51# Histogram + track-selection configuration
52anaFee.parameters["histCfg"] = os.environ['HPSTR_BASE']+'/analysis/plotconfigs/fee_smearing/feeSmearing_2021.json'
53anaFee.parameters["selectionjson"] = os.environ['HPSTR_BASE']+'/analysis/selections/trackHit/trackHitAna.json'
54
55
58anaFee.parameters["requireElectron"] = 1 # require track charge < 0 (electron)
59anaFee.parameters["requireCluster"] = 1 # require an associated full-energy cluster
60anaFee.parameters["feeClusterEnergyMin"] = 2.5 # GeV; ~0.68 * 3.7 GeV beam
61
62# Cluster-time offset: the raw ECal cluster time has a fixed offset relative to the
63# (already-calibrated) track time. Measured from the prompt FEE peak in pass5_v9 data:
64# mean 38.6 ns, sigma 1.5 ns. The window below is applied to the OFFSET-CORRECTED
65# time (cluster.getTime() - CalTimeOffset), which is centered near 0.
66# NOTE: CalTimeOffsetMC must be re-measured on MC (placeholder below).
67if options.isData:
68 anaFee.parameters["CalTimeOffset"] = 38.6
69else:
70 anaFee.parameters["CalTimeOffsetMC"] = 38.6 # TODO: measure on MC
71
72# Corrected cluster-time window (~ +/-4 sigma around the prompt peak)
73anaFee.parameters["clusterTimeMin"] = -6.0
74anaFee.parameters["clusterTimeMax"] = 6.0
75anaFee.parameters["clusterTimeMinMC"] = -6.0
76anaFee.parameters["clusterTimeMaxMC"] = 6.0
77anaFee.parameters["mcTimeOffset"] = 5.0
78# E/p window (off by default: [0, 99]); tighten once the ECal energy scale is calibrated.
79anaFee.parameters["eopMin"] = 0.0
80anaFee.parameters["eopMax"] = 99.0
81
82
87anaFee.parameters["trackCorrectionsCfg"] = os.environ['HPSTR_BASE']+"/analysis/data/corrections/fee_2021_meancorr.json"
88anaFee.parameters["doSmearing"] = 1
89
90# Scale correction: "" = use omega-space means (default); "tanLambda" = p-space means
91
92# Optional per-region selections (empty = none)
93anaFee.parameters["regionDefinitions"] = []
94
95p.sequence = [anaFee]
96
97p.input_files = inFilename
98p.output_files = [outFilename]
99
100p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4