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
anaBhTuple_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: {}'.format(infile))
16print('Output file: {}'.format(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
33bhana = HpstrConf.Processor('bhana', 'VertexAnaProcessor')
34
35
39bhana.parameters["debug"] = 1
40bhana.parameters["anaName"] = "bhana"
41bhana.parameters["trkColl"] = "GBLTracks"
42bhana.parameters["hitColl"] = "RotatedHelicalTrackHits"
43bhana.parameters["vtxColl"] = "TargetConstrainedV0Vertices"
44bhana.parameters["mcColl"] = "MCParticle"
45bhana.parameters["vtxSelectionjson"] = os.environ['HPSTR_BASE']+'/analysis/selections/bhSelection.json'
46bhana.parameters["histoCfg"] = os.environ['HPSTR_BASE']+"/analysis/plotconfigs/tracking/vtxAnalysis.json"
47bhana.parameters["beamE"] = 2.3
48bhana.parameters["isData"] = options.isData
49bhana.parameters["makeFlatTuple"] = options.makeFlatTuple
50CalTimeOffset = -999
51
52if (options.isData == 1):
53 CalTimeOffset = 56.
54 print("Running on data file: Setting CalTimeOffset %d" % CalTimeOffset)
55
56elif (options.isData == 0):
57 CalTimeOffset = 43.
58 print("Running on MC file: Setting CalTimeOffset %d" % CalTimeOffset)
59else:
60 print("Specify which type of ntuple you are running on: -t 1 [for Data] / -t 0 [for MC]")
61
62
63bhana.parameters["CalTimeOffset"] = CalTimeOffset
64
65#Region definitions
66
67RegionPath = os.environ['HPSTR_BASE']+"/analysis/selections/"
68bhana.parameters["regionDefinitions"] = [RegionPath+'bhTight.json',
69 RegionPath+'bhRadFracRad.json',
70 RegionPath+'bhRadFracRadRafo.json',
71 RegionPath+'bhRadFracRecoil.json'
72 ]
73
74# Sequence which the processors will run.
75p.sequence = [bhana]
76
77p.input_files = infile
78p.output_files = [outfile]
79
80p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4