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
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["trkhitCollRoot"] = 'SiClustersOnTrack'
85track.parameters["hitFitsCollLcio"] = 'SVTFittedRawTrackerHits'
86track.parameters["rawhitCollRoot"] = 'SVTRawHitsOnTrack_KF'
87
88track.parameters["bfield"] = bfield[str(options.year)]
89
90#trackgbl.parameters["debug"] = 0
91#trackgbl.parameters["trkCollLcio"] = 'GBLTracks'
92#trackgbl.parameters["trkCollRoot"] = 'GBLTracks'
93#trackgbl.parameters["kinkRelCollLcio"] = 'GBLKinkDataRelations'
94#trackgbl.parameters["trkRelCollLcio"] = 'TrackDataRelations'
95#trackgbl.parameters["trkhitCollRoot"] = 'RotatedHelicalOnTrackHits'
96#trackgbl.parameters["hitFitsCollLcio"] = 'SVTFittedRawTrackerHits'
97#trackgbl.parameters["rawhitCollRoot"] = 'SVTRawHitsOnTrack'
98#trackgbl.parameters["bfield"] = bfield[str(options.year)]
99
100# if (not options.isData):
101# trackgbl.parameters["truthTrackCollLcio"] = 'GBLTracksToTruthTrackRelations'
102# trackgbl.parameters["truthTrackCollRoot"] = 'Truth_GBLTracks'
103
104# ECalData
105ecal.parameters["debug"] = 0
106#ecal.parameters["hitCollLcio"] = 'EcalCalHits'
107ecal.parameters["hitCollRoot"] = 'RecoEcalHits'
108ecal.parameters["clusCollLcio"] = "EcalClustersCorr"
109ecal.parameters["clusCollRoot"] = "RecoEcalClusters"
110
111# Vertex
112vtx.parameters["debug"] = 1
113vtx.parameters["vtxCollLcio"] = 'UnconstrainedV0Vertices_KF'
114vtx.parameters["vtxCollRoot"] = 'UnconstrainedV0Vertices_KF'
115vtx.parameters["partCollRoot"] = 'ParticlesOnUVertices_KF'
116vtx.parameters["kinkRelCollLcio"] = ''
117vtx.parameters["trkRelCollLcio"] = 'KFTrackDataRelations'
118
119#cvtx.parameters["debug"] = 0
120#cvtx.parameters["vtxCollLcio"] = 'TargetConstrainedV0Vertices_KF'
121#cvtx.parameters["vtxCollRoot"] = 'TargetConstrainedV0Vertices_KF'
122#cvtx.parameters["partCollRoot"] = 'ParticlesOnCVertices_KF'
123#cvtx.parameters["kinkRelCollLcio"] = ''
124#cvtx.parameters["trkRelCollLcio"] = 'KFTrackDataRelations'
125
126
127#vtxgbl.parameters["debug"] = 0
128#vtxgbl.parameters["vtxCollLcio"] = 'UnconstrainedV0Vertices'
129#vtxgbl.parameters["vtxCollRoot"] = 'UnconstrainedV0Vertices'
130#vtxgbl.parameters["partCollRoot"] = 'ParticlesOnUVertices'
131#vtxgbl.parameters["kinkRelCollLcio"] = 'GBLKinkDataRelations'
132#vtxgbl.parameters["trkRelCollLcio"] = 'TrackDataRelations'
133
134#cvtxgbl.parameters["debug"] = 0
135#cvtxgbl.parameters["vtxCollLcio"] = 'TargetConstrainedV0Vertices'
136#cvtxgbl.parameters["vtxCollRoot"] = 'TargetConstrainedV0Vertices'
137#cvtxgbl.parameters["partCollRoot"] = 'ParticlesOnCVertices'
138#cvtxgbl.parameters["kinkRelCollLcio"] = 'GBLKinkDataRelations'
139#cvtxgbl.parameters["trkRelCollLcio"] = 'TrackDataRelations'
140
141# MCParticle
142mcpart.parameters["debug"] = 0
143mcpart.parameters["mcPartCollLcio"] = 'MCParticle'
144mcpart.parameters["mcPartCollRoot"] = 'MCParticle'
145
146#FinalStateParticleProcessor
147fsp.parameters["debug"] = 0
148fsp.parameters["fspCollLcio"] = "FinalStateParticles"
149fsp.parameters["fspCollRoot"] = "FinalStateParticles"
150fsp.parameters["kinkRelCollLcio"] = ""
151fsp.parameters["trkRelCollLcio"] = "KFTrackDataRelations"
152
153if(options.rawHits==1):
154 fsp.parameters["trkhitCollRoot"] = "fspOnTrackHits"
155 fsp.parameters["rawhitCollRoot"] = "fspOnTrackRawHits"
156 fsp.parameters["hitFitsCollLcio"] = "SVTFittedRawTrackerHits"
157else:
158 fsp.parameters["trkhitCollRoot"] = "fspOnTrackHits"
159 fsp.parameters["rawhitCollRoot"] = ""
160 fsp.parameters["hitFitsCollLcio"] = ""
161
162# Sequence which the processors will run.
163
164if (options.tracking == "KF"):
165 print("KF")
166 sequence = [header, vtx, ecal, track]
167# sequence = [header, vtx, ecal]
168# sequence = [ecal, track]
169 # Get KF svt truth hits
170# if (options.truthHits > 0):
171# sequence.append(svthits)
172elif (options.tracking == "GBL"):
173 print("GBL")
174 sequence = [header, vtxgbl, cvtxgbl, ecal, trackgbl]
175 # Get GBL svt truth hits
176 if (options.truthHits > 0):
177 sequence.append(svthitsgbl)
178elif (options.tracking == "BOTH"):
179 sequence = [header, vtxgbl, cvtxgbl, trackgbl, vtx, cvtx, ecal, track]
180 # Get KF and GBL svt truth hits
181 if (options.truthHits > 0):
182 sequence.append(svthits)
183 sequence.append(svthitsgbl)
184else:
185 print("ERROR::Need to specify which tracks KF, GBL, or BOTH")
186
187if options.isData == -1:
188 print("Please specficy if this is Data or not via option -t")
189if (not options.isData):
190 sequence.append(mcpart)
191sequence.append(fsp)
192
193p.sequence = sequence
194
195p.input_files = lcio_file
196p.output_files = [root_file]
197
198p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4