CMS 3D CMS Logo

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