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.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
anaSimpVtxTuple_cfg.py
Go to the documentation of this file.
1import HpstrConf
2import sys
3import os
4import baseConfig as base
5
6base.parser.add_argument("-f", "--makeFlatTuple", type=int, dest="makeFlatTuple", help="Make True to make vertex ana flat tuple", metavar="makeFlatTuple", default=0)
7
8options = base.parser.parse_args()
9
10
11# Use the input file to set the output file name
12infile = options.inFilename
13outfile = options.outFilename
14
15print('Input file: %s' % infile)
16print('Output file: %s' % outfile)
17
19
20p.run_mode = 1
21p.skip_events = options.skip_events
22p.max_events = options.nevents
23
24#p.max_events = 1000
25
26# Library containing processors
27p.add_library("libprocessors")
28
29
32
33vtxana = HpstrConf.Processor('vtxana', 'VertexAnaProcessor')
34
35
39vtxana.parameters["debug"] = 0
40vtxana.parameters["anaName"] = "vtxana"
41vtxana.parameters["trkColl"] = "GBLTracks"
42vtxana.parameters["hitColl"] = "RotatedHelicalOnTrackHits"
43vtxana.parameters["vtxColl"] = "UnconstrainedV0Vertices"
44vtxana.parameters["mcColl"] = "MCParticle"
45vtxana.parameters["ecalColl"] = "RecoEcalClusters"
46vtxana.parameters["vtxSelectionjson"] = os.environ['HPSTR_BASE']+'/analysis/selections/empty.json'
47vtxana.parameters["histoCfg"] = os.environ['HPSTR_BASE']+"/analysis/plotconfigs/tracking/vtxAnalysis.json"
48vtxana.parameters["beamE"] = base.beamE[str(options.year)]
49vtxana.parameters["isData"] = options.isData
50vtxana.parameters["makeFlatTuple"] = options.makeFlatTuple
51
52CalTimeOffset = -999
53
54if (options.isData == 1):
55 CalTimeOffset = 56.
56 print("Running on data file: Setting CalTimeOffset %d" % CalTimeOffset)
57
58elif (options.isData == 0):
59 CalTimeOffset = 43.
60 print("Running on MC file: Setting CalTimeOffset %d" % CalTimeOffset)
61else:
62 print("Specify which type of ntuple you are running on: -t 1 [for Data] / -t 0 [for MC]")
63
64
65vtxana.parameters["CalTimeOffset"] = CalTimeOffset
66
67#Region definitions
68
69RegionPath = os.environ['HPSTR_BASE']+"/analysis/selections/"
70
71vtxana.parameters["regionDefinitions"] = [RegionPath+'vertexSelection.json',
72 RegionPath+'simpTight.json',
73 RegionPath+'simpTightL1L1.json',
74 RegionPath+'simpTightL1L1NoSharedL0.json',
75 RegionPath+'simpTightVtxY.json']
76
77# Sequence which the processors will run.
78p.sequence = [vtxana]
79
80p.input_files = infile
81p.output_files = [outfile]
82
83p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4