CMS 3D CMS Logo

pixelTracksMonitoring_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 import DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi
4 pixelTracksMonitor = DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi.TrackerCollisionTrackMon.clone()
5 pixelTracksMonitor.FolderName = 'Tracking/PixelTrackParameters/pixelTracks'
6 pixelTracksMonitor.TrackProducer = 'pixelTracks'
7 pixelTracksMonitor.allTrackProducer = 'pixelTracks'
8 pixelTracksMonitor.beamSpot = 'offlineBeamSpot'
9 pixelTracksMonitor.primaryVertex = 'pixelVertices'
10 pixelTracksMonitor.pvNDOF = 1
11 pixelTracksMonitor.doAllPlots = False
12 pixelTracksMonitor.doLumiAnalysis = True
13 pixelTracksMonitor.doProfilesVsLS = True
14 pixelTracksMonitor.doDCAPlots = True
15 pixelTracksMonitor.doProfilesVsLS = True
16 pixelTracksMonitor.doPlotsVsGoodPVtx = True
17 pixelTracksMonitor.doEffFromHitPatternVsPU = False
18 pixelTracksMonitor.doEffFromHitPatternVsBX = False
19 pixelTracksMonitor.doEffFromHitPatternVsLUMI = False
20 pixelTracksMonitor.doPlotsVsGoodPVtx = True
21 pixelTracksMonitor.doPlotsVsLUMI = True
22 pixelTracksMonitor.doPlotsVsBX = True
23 
24 _trackSelector = cms.EDFilter('TrackSelector',
25  src = cms.InputTag('pixelTracks'),
26  cut = cms.string("")
27 )
28 
29 quality = {
30  "L" : "loose",
31  "T" : "tight",
32  "HP" : "highPurity",
33 }
34 
35 for key,value in quality.items():
36  label = "pixelTrks"+key
37 # print label
38  cutstring = "quality('" + value + "')"
39 # print cutstring
40  if label not in globals():
41  locals()[label] = _trackSelector.clone( cut = cutstring )
42  locals()[label].setLabel(label)
43  else :
44  print(label,"already configured")
45 
46 for key,value in quality.items():
47  label = "pixelTrksMonitor"+key
48  locals()[label] = pixelTracksMonitor.clone(
49  TrackProducer = "pixelTrks"+key,
50  FolderName = "Tracking/PixelTrackParameters/"+value
51  )
52  locals()[label].setLabel(label)
53 
54 ntuplet = {
55  '3' : "3Hits", # ==3
56  '4' : "4Hits" # >=4
57 }
58 for kN,vN in ntuplet.items():
59  for key,value in quality.items():
60  label = "pixelTrks" + vN + key
61 # print label
62 
63  cutstring = "numberOfValidHits == " + kN + " & quality('" + value + "')"
64 # print cutstring
65  locals()[label] = _trackSelector.clone( cut = cutstring )
66  locals()[label].setLabel(label)
67 
68 for kN,vN in ntuplet.items():
69  for key,value in quality.items():
70  label = "pixelTrks" + vN + "Monitor" + key
71 # print label
72  locals()[label] = pixelTracksMonitor.clone(
73  TrackProducer = "pixelTrks" + vN + key,
74  FolderName = "Tracking/PixelTrackParameters/" + vN + "/" + value
75  )
76  locals()[label].setLabel(label)
77 
78 
79 from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import goodOfflinePrimaryVertices as _goodOfflinePrimaryVertices
80 goodPixelVertices = _goodOfflinePrimaryVertices.clone(
81  src = "pixelVertices",
82 )
83 
84 from DQM.TrackingMonitor.primaryVertexResolution_cfi import primaryVertexResolution as _primaryVertexResolution
85 pixelVertexResolution = _primaryVertexResolution.clone(
86  vertexSrc = "goodPixelVertices",
87  rootFolder = "OfflinePixelPV/Resolution",
88 )
89 
90 pixelTracksMonitoringTask = cms.Task(
91  goodPixelVertices,
92 )
93 
94 for category in ["pixelTrks", "pixelTrks3Hits", "pixelTrks4Hits"]:
95  for key in quality:
96  label = category+key
97 # print label
98  pixelTracksMonitoringTask.add(locals()[label])
99 
100 allPixelTracksMonitoring = cms.Sequence()
101 for category in ["pixelTrksMonitor", "pixelTrks3HitsMonitor", "pixelTrks4HitsMonitor" ]:
102  for key in quality:
103  label = category+key
104 # print label
105  allPixelTracksMonitoring += locals()[label]
106 
107 pixelTracksMonitoring = cms.Sequence(
108  allPixelTracksMonitoring +
109  pixelVertexResolution,
110  pixelTracksMonitoringTask
111 )
112 
113 
114 
115 
primaryVertexResolution_cfi
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
goodOfflinePrimaryVertices_cfi