CMS 3D CMS Logo

TrackCollections2monitor_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 mainfolderName = {}
4 vertexfolderName = {}
5 sequenceName = {}
6 trackPtN = {}
7 trackPtMin = {}
8 trackPtMax = {}
9 doPlotsPCA = {}
10 numCutString = {}
11 denCutString = {}
12 doGoodTracksPlots = {}
13 doTrackerSpecific = {}
14 doHitPropertiesPlots = {}
15 doGeneralPropertiesPlots = {}
16 doBeamSpotPlots = {}
17 doSeedParameterHistos = {}
18 doRecHitVsPhiVsEtaPerTrack = {}
19 doRecHitVsPtVsEtaPerTrack = {}
20 doGoodTrackRecHitVsPhiVsEtaPerTrack = {}
21 doLayersVsPhiVsEtaPerTrack = {}
22 doGoodTrackLayersVsPhiVsEtaPerTrack = {}
23 doPUmonitoring = {}
24 doPlotsVsBXlumi = {}
25 doPlotsVsGoodPVtx = {}
26 doEffFromHitPatternVsPU = {}
27 doEffFromHitPatternVsBX = {}
28 doStopSource = {}
29 
30 selectedTracks = []
31 
32 mainfolderName ['generalTracks'] = 'Tracking/TrackParameters/generalTracks'
33 vertexfolderName['generalTracks'] = 'Tracking/PrimaryVertices/generalTracks'
34 trackPtN ['generalTracks'] = cms.int32(100)
35 trackPtMin ['generalTracks'] = cms.double(0.)
36 trackPtMax ['generalTracks'] = cms.double(100.)
37 doPlotsPCA ['generalTracks'] = cms.bool(False)
38 numCutString ['generalTracks'] = cms.string("")
39 denCutString ['generalTracks'] = cms.string("")
40 doGoodTracksPlots ['generalTracks'] = cms.bool(True)
41 doTrackerSpecific ['generalTracks'] = cms.bool(True)
42 doHitPropertiesPlots ['generalTracks'] = cms.bool(True)
43 doGeneralPropertiesPlots ['generalTracks'] = cms.bool(True)
44 doBeamSpotPlots ['generalTracks'] = cms.bool(True)
45 doSeedParameterHistos ['generalTracks'] = cms.bool(False)
46 doRecHitVsPhiVsEtaPerTrack ['generalTracks'] = cms.bool(True)
47 doRecHitVsPtVsEtaPerTrack ['generalTracks'] = cms.bool(True)
48 doGoodTrackRecHitVsPhiVsEtaPerTrack ['generalTracks'] = cms.bool(True)
49 doLayersVsPhiVsEtaPerTrack ['generalTracks'] = cms.bool(True)
50 doGoodTrackLayersVsPhiVsEtaPerTrack ['generalTracks'] = cms.bool(True)
51 doPUmonitoring ['generalTracks'] = cms.bool(False)
52 doPlotsVsBXlumi ['generalTracks'] = cms.bool(False)
53 doPlotsVsGoodPVtx ['generalTracks'] = cms.bool(True)
54 doEffFromHitPatternVsPU ['generalTracks'] = cms.bool(True)
55 doEffFromHitPatternVsBX ['generalTracks'] = cms.bool(True)
56 doStopSource ['generalTracks'] = cms.bool(True)
57 
58 trackSelector = cms.EDFilter('TrackSelector',
59  src = cms.InputTag('generalTracks'),
60  cut = cms.string("")
61 )
62 
63 ### highpurity definition: https://cmssdt.cern.ch/SDT/lxr/source/RecoTracker/FinalTrackSelectors/python/selectHighPurity_cfi.py
64 highPurityPtRange0to1 = trackSelector.clone()
65 highPurityPtRange0to1.cut = cms.string("quality('highPurity') & pt >= 0 & pt < 1 ")
66 
67 sequenceName ['highPurityPtRange0to1'] = highPurityPtRange0to1
68 mainfolderName ['highPurityPtRange0to1'] = 'Tracking/TrackParameters/highPurityTracks/pt_0to1'
69 vertexfolderName['highPurityPtRange0to1'] = 'Tracking/PrimaryVertices/highPurityTracks/pt_0to1'
70 trackPtN ['highPurityPtRange0to1'] = cms.int32(10)
71 trackPtMin ['highPurityPtRange0to1'] = cms.double(0.)
72 trackPtMax ['highPurityPtRange0to1'] = cms.double(1.)
73 numCutString ['highPurityPtRange0to1'] = cms.string("") # default: " pt >= 1 & quality('highPurity') "
74 denCutString ['highPurityPtRange0to1'] = cms.string(" pt >= 0 & pt < 1 ") # it is as in the default config (just be sure)
75 doPlotsPCA ['highPurityPtRange0to1'] = cms.bool(False)
76 doGoodTracksPlots ['highPurityPtRange0to1'] = cms.bool(False)
77 doTrackerSpecific ['highPurityPtRange0to1'] = cms.bool(False)
78 doHitPropertiesPlots ['highPurityPtRange0to1'] = cms.bool(True)
79 doGeneralPropertiesPlots ['highPurityPtRange0to1'] = cms.bool(True)
80 doBeamSpotPlots ['highPurityPtRange0to1'] = cms.bool(True)
81 doSeedParameterHistos ['highPurityPtRange0to1'] = cms.bool(False)
82 doRecHitVsPhiVsEtaPerTrack ['highPurityPtRange0to1'] = cms.bool(True)
83 doRecHitVsPtVsEtaPerTrack ['highPurityPtRange0to1'] = cms.bool(True)
84 doGoodTrackRecHitVsPhiVsEtaPerTrack ['highPurityPtRange0to1'] = cms.bool(False)
85 doLayersVsPhiVsEtaPerTrack ['highPurityPtRange0to1'] = cms.bool(True)
86 doGoodTrackLayersVsPhiVsEtaPerTrack ['highPurityPtRange0to1'] = cms.bool(False)
87 doPUmonitoring ['highPurityPtRange0to1'] = cms.bool(True)
88 doPlotsVsBXlumi ['highPurityPtRange0to1'] = cms.bool(False)
89 doPlotsVsGoodPVtx ['highPurityPtRange0to1'] = cms.bool(True)
90 doEffFromHitPatternVsPU ['highPurityPtRange0to1'] = cms.bool(False)
91 doEffFromHitPatternVsBX ['highPurityPtRange0to1'] = cms.bool(False)
92 doStopSource ['highPurityPtRange0to1'] = cms.bool(True)
93 
94 highPurityPtRange1to10 = trackSelector.clone()
95 highPurityPtRange1to10.cut = cms.string("quality('highPurity') & pt >= 1 & pt < 10 ")
96 
97 sequenceName ['highPurityPtRange1to10'] = highPurityPtRange1to10
98 mainfolderName ['highPurityPtRange1to10'] = 'Tracking/TrackParameters/highPurityTracks/pt_1to10'
99 vertexfolderName['highPurityPtRange1to10'] = 'Tracking/PrimaryVertices/highPurityTracks/pt_1to10'
100 trackPtN ['highPurityPtRange1to10'] = cms.int32(10)
101 trackPtMin ['highPurityPtRange1to10'] = cms.double(1.)
102 trackPtMax ['highPurityPtRange1to10'] = cms.double(10.)
103 numCutString ['highPurityPtRange1to10'] = cms.string("") # default: " pt >= 1 & quality('highPurity') "
104 denCutString ['highPurityPtRange1to10'] = cms.string(" pt >= 1 & pt < 10 ") # it is as in the default config (just be sure)
105 doGoodTracksPlots ['highPurityPtRange1to10'] = cms.bool(True)
106 doTrackerSpecific ['highPurityPtRange1to10'] = cms.bool(True)
107 doHitPropertiesPlots ['highPurityPtRange1to10'] = cms.bool(True)
108 doGeneralPropertiesPlots ['highPurityPtRange1to10'] = cms.bool(True)
109 doBeamSpotPlots ['highPurityPtRange1to10'] = cms.bool(True)
110 doSeedParameterHistos ['highPurityPtRange1to10'] = cms.bool(False)
111 doRecHitVsPhiVsEtaPerTrack ['highPurityPtRange1to10'] = cms.bool(True)
112 doRecHitVsPtVsEtaPerTrack ['highPurityPtRange1to10'] = cms.bool(True)
113 doGoodTrackRecHitVsPhiVsEtaPerTrack ['highPurityPtRange1to10'] = cms.bool(True)
114 doLayersVsPhiVsEtaPerTrack ['highPurityPtRange1to10'] = cms.bool(True)
115 doGoodTrackLayersVsPhiVsEtaPerTrack ['highPurityPtRange1to10'] = cms.bool(True)
116 doPUmonitoring ['highPurityPtRange1to10'] = cms.bool(False)
117 doPlotsVsBXlumi ['highPurityPtRange1to10'] = cms.bool(False)
118 doPlotsVsGoodPVtx ['highPurityPtRange1to10'] = cms.bool(True)
119 doEffFromHitPatternVsPU ['highPurityPtRange1to10'] = cms.bool(True)
120 doEffFromHitPatternVsBX ['highPurityPtRange1to10'] = cms.bool(True)
121 doStopSource ['highPurityPtRange1to10'] = cms.bool(True)
122 
123 highPurityPt10 = trackSelector.clone()
124 highPurityPt10.cut = cms.string("quality('highPurity') & pt >= 10")
125 
126 sequenceName ['highPurityPt10'] = highPurityPt10
127 mainfolderName ['highPurityPt10'] = 'Tracking/TrackParameters/highPurityTracks/pt_10'
128 vertexfolderName['highPurityPt10'] = 'Tracking/PrimaryVertices/highPurityTracks/pt_10'
129 trackPtN ['highPurityPt10'] = cms.int32(100)
130 trackPtMin ['highPurityPt10'] = cms.double(10.)
131 trackPtMax ['highPurityPt10'] = cms.double(110.)
132 numCutString ['highPurityPt10'] = cms.string("") # default: " pt >= 1 & quality('highPurity') "
133 denCutString ['highPurityPt10'] = cms.string(" pt >= 10 ") # it is as in the default config (just be sure)
134 doGoodTracksPlots ['highPurityPt10'] = cms.bool(True)
135 doTrackerSpecific ['highPurityPt10'] = cms.bool(True)
136 doHitPropertiesPlots ['highPurityPt10'] = cms.bool(True)
137 doGeneralPropertiesPlots ['highPurityPt10'] = cms.bool(True)
138 doBeamSpotPlots ['highPurityPt10'] = cms.bool(True)
139 doSeedParameterHistos ['highPurityPt10'] = cms.bool(False)
140 doRecHitVsPhiVsEtaPerTrack ['highPurityPt10'] = cms.bool(True)
141 doRecHitVsPtVsEtaPerTrack ['highPurityPt10'] = cms.bool(True)
142 doGoodTrackRecHitVsPhiVsEtaPerTrack ['highPurityPt10'] = cms.bool(True)
143 doLayersVsPhiVsEtaPerTrack ['highPurityPt10'] = cms.bool(True)
144 doGoodTrackLayersVsPhiVsEtaPerTrack ['highPurityPt10'] = cms.bool(True)
145 doPUmonitoring ['highPurityPt10'] = cms.bool(False)
146 doPlotsVsBXlumi ['highPurityPt10'] = cms.bool(False)
147 doPlotsVsGoodPVtx ['highPurityPt10'] = cms.bool(True)
148 doEffFromHitPatternVsPU ['highPurityPt10'] = cms.bool(True)
149 doEffFromHitPatternVsBX ['highPurityPt10'] = cms.bool(True)
150 doStopSource ['highPurityPt10'] = cms.bool(True)
151 
152 ###### old monitored track collections
153 highPurityPt1 = trackSelector.clone()
154 highPurityPt1.cut = cms.string("quality('highPurity') & pt >= 1")
155 
156 sequenceName ['highPurityPt1'] = highPurityPt1
157 mainfolderName ['highPurityPt1'] = 'Tracking/TrackParameters/highPurityTracks/pt_1'
158 vertexfolderName['highPurityPt1'] = 'Tracking/PrimaryVertices/highPurityTracks/pt_1'
159 trackPtN ['highPurityPt1'] = cms.int32(100)
160 trackPtMin ['highPurityPt1'] = cms.double(0.)
161 trackPtMax ['highPurityPt1'] = cms.double(100.)
162 doPlotsPCA ['highPurityPt1'] = cms.bool(True)
163 numCutString ['highPurityPt1'] = cms.string("") # default: " pt >= 1 & quality('highPurity') "
164 denCutString ['highPurityPt1'] = cms.string(" pt >= 1 ") # it is as in the default config (just be sure)
165 doGoodTracksPlots ['highPurityPt1'] = cms.bool(True)
166 doTrackerSpecific ['highPurityPt1'] = cms.bool(True)
167 doHitPropertiesPlots ['highPurityPt1'] = cms.bool(True)
168 doGeneralPropertiesPlots ['highPurityPt1'] = cms.bool(True)
169 doBeamSpotPlots ['highPurityPt1'] = cms.bool(True)
170 doSeedParameterHistos ['highPurityPt1'] = cms.bool(False)
171 doRecHitVsPhiVsEtaPerTrack ['highPurityPt1'] = cms.bool(True)
172 doRecHitVsPtVsEtaPerTrack ['highPurityPt1'] = cms.bool(True)
173 doGoodTrackRecHitVsPhiVsEtaPerTrack ['highPurityPt1'] = cms.bool(True)
174 doLayersVsPhiVsEtaPerTrack ['highPurityPt1'] = cms.bool(True)
175 doGoodTrackLayersVsPhiVsEtaPerTrack ['highPurityPt1'] = cms.bool(True)
176 doPUmonitoring ['highPurityPt1'] = cms.bool(False)
177 doPlotsVsBXlumi ['highPurityPt1'] = cms.bool(False)
178 doPlotsVsGoodPVtx ['highPurityPt1'] = cms.bool(True)
179 doEffFromHitPatternVsPU ['highPurityPt1'] = cms.bool(True)
180 doEffFromHitPatternVsBX ['highPurityPt1'] = cms.bool(True)
181 doStopSource ['highPurityPt1'] = cms.bool(True)
182 
183 ###### all tracks (no pt cut) associated to the PV
184 ###### association is dz<1mm
186 
187 trackAssociated2pvSelector = trackWithVertexSelector.clone()
188 trackAssociated2pvSelector.trackWithVertexSelectorParams = cms.PSet(
189  # the track collection
190  src = cms.InputTag('generalTracks'),
191  # kinematic cuts (pT in GeV)
192  etaMin = cms.double(0.0),
193  etaMax = cms.double(5.0),
194  ptMin = cms.double(0.0),
195  ptMax = cms.double(100000.0),
196  # impact parameter cut (in cm)
197  d0Max = cms.double(999.),
198  dzMax = cms.double(999.),
199  # quality cuts (valid hits, normalized chi2)
200  normalizedChi2 = cms.double(999999.),
201  numberOfValidHits = cms.uint32(0),
202  numberOfLostHits = cms.uint32(999), ## at most 999 lost hits
203  numberOfValidPixelHits = cms.uint32(0), ## at least <n> hits in the pixels
204  ptErrorCut = cms.double(9999999.), ## [pTError/pT]*max(1,normChi2) <= ptErrorCut
205  quality = cms.string("highPurity"), # quality cut as defined in reco::TrackBase
206  # compatibility with a vertex ?
207  useVtx = cms.bool(True),
208  vertexTag = cms.InputTag('trackingDQMgoodOfflinePrimaryVertices'),
209  timesTag = cms.InputTag(''),
210  timeResosTag = cms.InputTag(''),
211  nVertices = cms.uint32(1), ## how many vertices to look at before dropping the track
212  vtxFallback = cms.bool(True), ## falback to beam spot if there are no vertices
213  # uses vtx=(0,0,0) with deltaZeta=15.9, deltaRho = 0.2
214  zetaVtx = cms.double(0.1),
215 # rhoVtx = cms.double(0.2), ## tags used by b-tagging folks
216  rhoVtx = cms.double(999.), ## tags used by b-tagging folks
217  nSigmaDtVertex = cms.double(0),
218  # should _not_ be used for the TrackWithVertexRefSelector
219  copyExtras = cms.untracked.bool(False), ## copies also extras and rechits on RECO
220  copyTrajectories = cms.untracked.bool(False), # don't set this to true on AOD!
221 )
222 
223 highPurityPV0p1 = trackAssociated2pvSelector.clone()
224 highPurityPV0p1.trackWithVertexSelectorParams.zetaVtx = cms.double(0.1)
225 
226 sequenceName ['highPurityPV0p1'] = highPurityPV0p1
227 mainfolderName ['highPurityPV0p1'] = 'Tracking/TrackParameters/highPurityTracks/dzPV0p1'
228 vertexfolderName['highPurityPV0p1'] = 'Tracking/PrimaryVertices/highPurityTracks/dzPV0p1'
229 trackPtN ['highPurityPV0p1'] = cms.int32(100)
230 trackPtMin ['highPurityPV0p1'] = cms.double(0.)
231 trackPtMax ['highPurityPV0p1'] = cms.double(100.)
232 doPlotsPCA ['highPurityPV0p1'] = cms.bool(True)
233 numCutString ['highPurityPV0p1'] = cms.string("") # default: " pt >= 1 & quality('highPurity') "
234 denCutString ['highPurityPV0p1'] = cms.string(" pt >= 1 ") # it is as in the default config (just be sure)
235 doGoodTracksPlots ['highPurityPV0p1'] = cms.bool(True)
236 doTrackerSpecific ['highPurityPV0p1'] = cms.bool(True)
237 doHitPropertiesPlots ['highPurityPV0p1'] = cms.bool(True)
238 doGeneralPropertiesPlots ['highPurityPV0p1'] = cms.bool(True)
239 doBeamSpotPlots ['highPurityPV0p1'] = cms.bool(True)
240 doSeedParameterHistos ['highPurityPV0p1'] = cms.bool(False)
241 doRecHitVsPhiVsEtaPerTrack ['highPurityPV0p1'] = cms.bool(True)
242 doRecHitVsPtVsEtaPerTrack ['highPurityPV0p1'] = cms.bool(True)
243 doGoodTrackRecHitVsPhiVsEtaPerTrack ['highPurityPV0p1'] = cms.bool(True)
244 doLayersVsPhiVsEtaPerTrack ['highPurityPV0p1'] = cms.bool(True)
245 doGoodTrackLayersVsPhiVsEtaPerTrack ['highPurityPV0p1'] = cms.bool(True)
246 doPUmonitoring ['highPurityPV0p1'] = cms.bool(False)
247 doPlotsVsBXlumi ['highPurityPV0p1'] = cms.bool(False)
248 doPlotsVsGoodPVtx ['highPurityPV0p1'] = cms.bool(True)
249 doEffFromHitPatternVsPU ['highPurityPV0p1'] = cms.bool(True)
250 doEffFromHitPatternVsBX ['highPurityPV0p1'] = cms.bool(True)
251 doStopSource ['highPurityPV0p1'] = cms.bool(True)
252 
253 selectedTracks.extend( ['generalTracks'] )
254 #selectedTracks.extend( ['highPurityPtRange0to1'] )
255 #selectedTracks.extend( ['highPurityPtRange1to10'] )
256 #selectedTracks.extend( ['highPurityPt10'] )
257 
258 selectedTracks.extend( ['highPurityPt1'] )
259 selectedTracks.extend( ['highPurityPtRange0to1'] )
260 selectedTracks.extend( ['highPurityPV0p1'] )
261 
262 #selectedTracks2runSequence=cms.Sequence()
263 #for tracks in selectedTracks :
264 # if tracks != 'generalTracks':
265 # selectedTracks2runSequence+=sequenceName[tracks]
266 
highpurity definition: https://cmssdt.cern.ch/SDT/lxr/source/RecoTracker/FinalTrackSelectors/python/s...