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
recoTuple_trkEff_cfg.py
Go to the documentation of this file.
1import HpstrConf
2import sys
3
4import baseConfig as base
5from baseConfig import bfield
6
7base.parser.add_argument("-w", "--tracking", type=str, dest="tracking",
8 help="Which tracking to use to make plots", metavar="tracking", default="KF")
9base.parser.add_argument("-s", "--truthHits", type=int, dest="truthHits",
10 help="Get svt truth hits: 1=yes", metavar="truthHits", default=1)
11base.parser.add_argument("-z", "--rawHits", type=int, dest="rawHits",
12 help="Keep raw svt hits: 1=yes", metavar="rawHits", default=1)
13
14
15
16options = base.parser.parse_args()
17
18# Use the input file to set the output file name
19lcio_file = options.inFilename
20root_file = options.outFilename
21
22print('LCIO file: %s' % lcio_file)
23print('Root file: %s' % root_file)
24
26
27# p.max_events = 1000
28p.run_mode = 0
29p.skip_events = options.skip_events
30p.max_events = options.nevents
31
32# Library containing processors
33p.add_library("libprocessors")
34
35
38header = HpstrConf.Processor('header', 'EventProcessor')
39track = HpstrConf.Processor('track', 'TrackingProcessor')
40#trackgbl = HpstrConf.Processor('trackgbl', 'TrackingProcessor')
41#trackrefitgbl = HpstrConf.Processor('trackrefitgbl', 'TrackingProcessor')
42#svthits = HpstrConf.Processor('svthitskf', 'Tracker2DHitProcessor')
43#svthitsgbl = HpstrConf.Processor('svthitsgbl', 'Tracker3DHitProcessor')
44rawsvt = HpstrConf.Processor('rawsvt', 'SvtRawDataProcessor')
45ecal = HpstrConf.Processor('ecal', 'ECalDataProcessor')
46vtx = HpstrConf.Processor('vtx', 'VertexProcessor')
47#cvtx = HpstrConf.Processor('cvtx', 'VertexProcessor')
48#vtxgbl = HpstrConf.Processor('vtxgbl', 'VertexProcessor')
49#cvtxgbl = HpstrConf.Processor('cvtxgbl', 'VertexProcessor')
50mcpart = HpstrConf.Processor('mcpart', 'MCParticleProcessor')
51fsp = HpstrConf.Processor('fps', 'FinalStateParticleProcessor')
52
53
57header.parameters["debug"] = 0
58header.parameters["headCollRoot"] = "EventHeader"
59header.parameters["trigCollLcio"] = "TriggerBank"
60header.parameters["rfCollLcio"] = "RFHits"
61header.parameters["vtpCollLcio"] = "VTPBank"
62header.parameters["vtpCollRoot"] = "VTPBank"
63header.parameters["tsCollLcio"] = "TSBank"
64header.parameters["tsCollRoot"] = "TSBank"
65
66# SvtRawData
67rawsvt.parameters["debug"] = 0
68rawsvt.parameters["hitCollLcio"] = 'SVTRawTrackerHits'
69rawsvt.parameters["hitfitCollLcio"] = 'SVTFittedRawTrackerHits'
70rawsvt.parameters["hitCollRoot"] = 'SVTRawTrackerHits'
71
72# Tracker3DHits
73#svthits.parameters["debug"] = 0
74#svthits.parameters["hitCollLcio"] = 'RotatedHelicalTrackHits'
75#svthits.parameters["hitCollRoot"] = 'RotatedHelicalTrackHits'
76
77
78# Tracking
79track.parameters["debug"] = 0
80track.parameters["trkCollLcio"] = 'KalmanFullTracks'
81track.parameters["trkCollRoot"] = 'KalmanFullTracks'
82track.parameters["kinkRelCollLcio"] = ''
83track.parameters["trkRelCollLcio"] = 'KFTrackDataRelations'
84track.parameters["trackStateLocation"] = 'AtTarget'
85track.parameters["trkhitCollRoot"] = 'SiClustersOnTrack'
86track.parameters["hitFitsCollLcio"] = 'SVTFittedRawTrackerHits'
87track.parameters["rawhitCollRoot"] = 'SVTRawHitsOnTrack_KF'
88
89track.parameters["bfield"] = bfield[str(options.year)]
90
91#trackgbl.parameters["debug"] = 0
92#trackgbl.parameters["trkCollLcio"] = 'GBLTracks'
93#trackgbl.parameters["trkCollRoot"] = 'GBLTracks'
94#trackgbl.parameters["kinkRelCollLcio"] = 'GBLKinkDataRelations'
95#trackgbl.parameters["trkRelCollLcio"] = 'TrackDataRelations'
96#trackgbl.parameters["trkhitCollRoot"] = 'RotatedHelicalOnTrackHits'
97#trackgbl.parameters["hitFitsCollLcio"] = 'SVTFittedRawTrackerHits'
98#trackgbl.parameters["rawhitCollRoot"] = 'SVTRawHitsOnTrack'
99#trackgbl.parameters["bfield"] = bfield[str(options.year)]
100
101# if (not options.isData):
102# trackgbl.parameters["truthTrackCollLcio"] = 'GBLTracksToTruthTrackRelations'
103# trackgbl.parameters["truthTrackCollRoot"] = 'Truth_GBLTracks'
104
105# ECalData
106ecal.parameters["debug"] = 0
107#ecal.parameters["hitCollLcio"] = 'EcalCalHits'
108ecal.parameters["hitCollRoot"] = 'RecoEcalHits'
109ecal.parameters["clusCollLcio"] = "EcalClustersCorr"
110ecal.parameters["clusCollRoot"] = "RecoEcalClusters"
111
112# Vertex
113vtx.parameters["debug"] = 1
114vtx.parameters["vtxCollLcio"] = 'UnconstrainedV0Vertices_KF'
115vtx.parameters["vtxCollRoot"] = 'UnconstrainedV0Vertices_KF'
116vtx.parameters["partCollRoot"] = 'ParticlesOnUVertices_KF'
117vtx.parameters["kinkRelCollLcio"] = ''
118vtx.parameters["trkRelCollLcio"] = 'KFTrackDataRelations'
119vtx.parameters["trackStateLocation"] = 'AtTarget'
120
121#cvtx.parameters["debug"] = 0
122#cvtx.parameters["vtxCollLcio"] = 'TargetConstrainedV0Vertices_KF'
123#cvtx.parameters["vtxCollRoot"] = 'TargetConstrainedV0Vertices_KF'
124#cvtx.parameters["partCollRoot"] = 'ParticlesOnCVertices_KF'
125#cvtx.parameters["kinkRelCollLcio"] = ''
126#cvtx.parameters["trkRelCollLcio"] = 'KFTrackDataRelations'
127
128
129#vtxgbl.parameters["debug"] = 0
130#vtxgbl.parameters["vtxCollLcio"] = 'UnconstrainedV0Vertices'
131#vtxgbl.parameters["vtxCollRoot"] = 'UnconstrainedV0Vertices'
132#vtxgbl.parameters["partCollRoot"] = 'ParticlesOnUVertices'
133#vtxgbl.parameters["kinkRelCollLcio"] = 'GBLKinkDataRelations'
134#vtxgbl.parameters["trkRelCollLcio"] = 'TrackDataRelations'
135
136#cvtxgbl.parameters["debug"] = 0
137#cvtxgbl.parameters["vtxCollLcio"] = 'TargetConstrainedV0Vertices'
138#cvtxgbl.parameters["vtxCollRoot"] = 'TargetConstrainedV0Vertices'
139#cvtxgbl.parameters["partCollRoot"] = 'ParticlesOnCVertices'
140#cvtxgbl.parameters["kinkRelCollLcio"] = 'GBLKinkDataRelations'
141#cvtxgbl.parameters["trkRelCollLcio"] = 'TrackDataRelations'
142
143# MCParticle
144mcpart.parameters["debug"] = 0
145mcpart.parameters["mcPartCollLcio"] = 'MCParticle'
146mcpart.parameters["mcPartCollRoot"] = 'MCParticle'
147
148#FinalStateParticleProcessor
149fsp.parameters["debug"] = 0
150fsp.parameters["fspCollLcio"] = "FinalStateParticles"
151fsp.parameters["fspCollRoot"] = "FinalStateParticles"
152fsp.parameters["kinkRelCollLcio"] = ""
153fsp.parameters["trkRelCollLcio"] = "KFTrackDataRelations"
154fsp.parameters["trackStateLocation"] = "AtTarget"
155
156if(options.rawHits==1):
157 fsp.parameters["trkhitCollRoot"] = "fspOnTrackHits"
158 fsp.parameters["rawhitCollRoot"] = "fspOnTrackRawHits"
159 fsp.parameters["hitFitsCollLcio"] = "SVTFittedRawTrackerHits"
160else:
161 fsp.parameters["trkhitCollRoot"] = "fspOnTrackHits"
162 fsp.parameters["rawhitCollRoot"] = ""
163 fsp.parameters["hitFitsCollLcio"] = ""
164
165# Sequence which the processors will run.
166
167if (options.tracking == "KF"):
168 print("KF")
169 sequence = [header, vtx, ecal, track]
170# sequence = [header, vtx, ecal]
171# sequence = [ecal, track]
172 # Get KF svt truth hits
173# if (options.truthHits > 0):
174# sequence.append(svthits)
175elif (options.tracking == "GBL"):
176 print("GBL")
177 sequence = [header, vtxgbl, cvtxgbl, ecal, trackgbl]
178 # Get GBL svt truth hits
179 if (options.truthHits > 0):
180 sequence.append(svthitsgbl)
181elif (options.tracking == "BOTH"):
182 sequence = [header, vtxgbl, cvtxgbl, trackgbl, vtx, cvtx, ecal, track]
183 # Get KF and GBL svt truth hits
184 if (options.truthHits > 0):
185 sequence.append(svthits)
186 sequence.append(svthitsgbl)
187else:
188 print("ERROR::Need to specify which tracks KF, GBL, or BOTH")
189
190if options.isData == -1:
191 print("Please specficy if this is Data or not via option -t")
192if (not options.isData):
193 sequence.append(mcpart)
194sequence.append(fsp)
195
196p.sequence = sequence
197
198p.input_files = lcio_file
199p.output_files = [root_file]
200
201p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4