CMS 3D CMS Logo

singleTopDQM_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 #Primary vertex selection
4 PVCut = "abs(z) < 24. & position.rho < 2. & ndof > 4 & !isFake"
5 
6 #Jet selection
7 looseJetCut = "(chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && neutralHadronEnergyFraction()<0.99 && neutralEmEnergyFraction()<0.99 && (chargedMultiplicity()+neutralMultiplicity())>1) && abs(eta)<=2.4 "
8 
9 tightJetCut = "(chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && neutralHadronEnergyFraction()<0.90 && neutralEmEnergyFraction()<0.90 && (chargedMultiplicity()+neutralMultiplicity())>1) && abs(eta)<=2.4 "
10 
11 #Loose muon selection
12 looseMuonCut = "(muonRef.isNonnull && (muonRef.isGlobalMuon || muonRef.isTrackerMuon) && muonRef.isPFMuon)"
13 looseIsoCut = "((muonRef.pfIsolationR04.sumChargedHadronPt + max(0., muonRef.pfIsolationR04.sumNeutralHadronEt + muonRef.pfIsolationR04.sumPhotonEt - 0.5 * muonRef.pfIsolationR04.sumPUPt) ) / muonRef.pt < 0.25)"
14 
15 #Medium muon selection. Also requires either good global muon or tight segment compatibility
16 mediumMuonCut = looseMuonCut + " muonRef.innerTrack.validFraction > 0.8"
17 
18 #Tight muon selection. Lacks distance to primary vertex variables, dz<0.5, dxy < 0.2. Now done at .cc
19 tightMuonCut = "muonRef.isNonnull && muonRef.isGlobalMuon && muonRef.isPFMuon && muonRef.globalTrack.normalizedChi2 < 10. && muonRef.globalTrack.hitPattern.numberOfValidMuonHits > 0 && " + \
20  "muonRef.numberOfMatchedStations > 1 && muonRef.innerTrack.hitPattern.numberOfValidPixelHits > 0 && muonRef.innerTrack.hitPattern.trackerLayersWithMeasurement > 5 "
21 tightIsoCut = "(muonRef.pfIsolationR04.sumChargedHadronPt + max(0., muonRef.pfIsolationR04.sumNeutralHadronEt + muonRef.pfIsolationR04.sumPhotonEt - 0.5 * muonRef.pfIsolationR04.sumPUPt) ) / muonRef.pt < 0.15"
22 
23 #Electron selections
24 looseEleCut = "(( gsfElectronRef.full5x5_sigmaIetaIeta() < 0.011 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00477 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.222 && gsfElectronRef.hadronicOverEm() < 0.298 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.241 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) < 1.479) || (gsfElectronRef.full5x5_sigmaIetaIeta() < 0.0314 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00868 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.213 && gsfElectronRef.hadronicOverEm() < 0.101 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.14 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) > 1.479))"
25 
26 tightEleCut = "((gsfElectronRef.full5x5_sigmaIetaIeta() < 0.00998 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00308 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.0816 && gsfElectronRef.hadronicOverEm() < 0.0414 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.0129 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) < 1.479) || (gsfElectronRef.full5x5_sigmaIetaIeta() < 0.0292 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00605 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.0394 && gsfElectronRef.hadronicOverEm() < 0.0641 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.0129 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) > 1.479))"
27 
28 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
29 singleTopTChannelLeptonDQM = DQMEDAnalyzer('SingleTopTChannelLeptonDQM',
30  ## ------------------------------------------------------
31  ## SETUP
32 
36  setup = cms.PSet(
37  ## sub-directory to write the monitor histograms to
38  ## [mandatory] : should not be changed w/o explicit
39  ## communication to TopCom!
40  directory = cms.string("Physics/Top/SingleTopDQM/"),
41  ## [mandatory]
42  sources = cms.PSet(
43  muons = cms.InputTag("pfIsolatedMuonsEI"),
44  elecs = cms.InputTag("pfIsolatedElectronsEI"),
45  jets = cms.InputTag("ak4PFJetsCHS"),
46  mets = cms.VInputTag("met", "tcMet", "pfMetEI"),
47  pvs = cms.InputTag("offlinePrimaryVertices")
48  ),
49  ## [optional] : when omitted the verbosity level is set to STANDARD
50  monitoring = cms.PSet(
51  verbosity = cms.string("DEBUG")
52  ),
53  ## [optional] : when omitted all monitoring plots for primary vertices
54  ## will be filled w/o extras
55 # pvExtras = cms.PSet(
56  ## when omitted electron plots will be filled w/o additional pre-
57  ## selection of the primary vertex candidates
58 # select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake")
59 # ),
60  ## [optional] : when omitted all monitoring plots for electrons
61  ## will be filled w/o extras
62  elecExtras = cms.PSet(
63  ## when omitted electron plots will be filled w/o cut on electronId
64  ##electronId = cms.PSet( src = cms.InputTag("mvaTrigV0"), cutValue = cms.double(0.5) ),
65  ## when omitted electron plots will be filled w/o additional pre-
66  ## selection of the electron candidates
67  select = cms.string("pt>15 & abs(eta)<2.5 & abs(gsfElectronRef.gsfTrack.d0)<1 & abs(gsfElectronRef.gsfTrack.dz)<20"),
68  ## when omitted isolated electron multiplicity plot will be equi-
69  ## valent to inclusive electron multiplicity plot
70  #isolation = cms.string(ElelooseIsoCut),
71  ),
72  ## [optional] : when omitted all monitoring plots for muons
73  ## will be filled w/o extras
74  muonExtras = cms.PSet(
75  ## when omitted muon plots will be filled w/o additional pre-
76  ## selection of the muon candidates
77  select = cms.string("pt>10 & abs(eta)<2.1 & isGlobalMuon & abs(globalTrack.d0)<1 & abs(globalTrack.dz)<20"),
78  ## when omitted isolated muon multiplicity plot will be equi-
79  ## valent to inclusive muon multiplicity plot
80 # isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"),
81  ),
82  ## [optional] : when omitted all monitoring plots for jets will
83  ## be filled from uncorrected jets
84  jetExtras = cms.PSet(
85  ## when omitted monitor plots for pt will be filled from uncorrected
86  ## jets
87  jetCorrector = cms.string("ak4CaloL2L3"),
88  ## when omitted monitor plots will be filled w/o additional cut on
89  ## jetID
90 # jetID = cms.PSet(
91 # label = cms.InputTag("ak4JetID"),
92 # select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1")
93 # ),
94  ## when omitted no extra selection will be applied on jets before
95  ## filling the monitor histograms; if jetCorrector is present the
96  ## selection will be applied to corrected jets
97  select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"),
98  ),
99  ## [optional] : when omitted no mass window will be applied
100  ## for the W mass befor filling the event monitoring plots
101 # massExtras = cms.PSet(
102 # lowerEdge = cms.double( 70.),
103 # upperEdge = cms.double(110.)
104 # ),
105  ## [optional] : when omitted the monitoring plots for triggering
106  ## will be empty
107  triggerExtras = cms.PSet(
108  src = cms.InputTag("TriggerResults","","HLT"),
109  paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U',
110  'HLT_Mu5:HLT_QuadJet15U',
111  'HLT_Mu7:HLT_QuadJet15U',
112  'HLT_Mu9:HLT_QuadJet15U'])
113  )
114  ),
115  ## ------------------------------------------------------
116  ## PRESELECTION
117 
122  preselection = cms.PSet(
123  ## [optional] : when omitted no preselection is applied
124 # trigger = cms.PSet(
125 # src = cms.InputTag("TriggerResults","","HLT"),
126 # select = cms.vstring(['HLT_Mu11', 'HLT_Ele15_LW_L1R', 'HLT_QuadJet30'])
127 # ),
128  ## [optional] : when omitted no preselection is applied
129 # vertex = cms.PSet(
130 # src = cms.InputTag("offlinePrimaryVertices"),
131 # select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake')
132 # )
133  ),
134  ## ------------------------------------------------------
135  ## SELECTION
136 
143  selection = cms.VPSet(
144  cms.PSet(
145  label = cms.string("jets/calo:step0"),
146  src = cms.InputTag("ak4CaloJets"),
147  select = cms.string("pt>20 & abs(eta)<2.1 & 0.05<emEnergyFraction"),
148  jetID = cms.PSet(
149  label = cms.InputTag("ak4JetID"),
150  select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1")
151  ),
152  min = cms.int32(2),
153  )
154  )
155 )
156 
157 singleTopMuonMediumDQM = DQMEDAnalyzer('SingleTopTChannelLeptonDQM',
158  ## ------------------------------------------------------
159  ## SETUP
160 
164  setup = cms.PSet(
165  directory = cms.string("Physics/Top/SingleTopMuonMediumDQM/"),
166  sources = cms.PSet(
167  muons = cms.InputTag("pfIsolatedMuonsEI"),
168  elecs = cms.InputTag("pfIsolatedElectronsEI"),
169  jets = cms.InputTag("ak4PFJetsCHS"),
170  mets = cms.VInputTag("pfMet"),
171  pvs = cms.InputTag("offlinePrimaryVertices")
172  ),
173  monitoring = cms.PSet(
174  verbosity = cms.string("DEBUG")
175  ),
176  pvExtras = cms.PSet(
177  select = cms.string(PVCut)
178  ),
179  elecExtras = cms.PSet(
180  select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
181  rho = cms.InputTag("fixedGridRhoFastjetAll"),
182  ),
183  muonExtras = cms.PSet(
184  select = cms.string(looseMuonCut + " && pt>20 & abs(eta)<2.1"),
185  isolation = cms.string(looseIsoCut)
186  ),
187  jetExtras = cms.PSet(
188  jetCorrector = cms.InputTag("ak4PFCHSL1FastL2L3Corrector"), #Use pak4PFCHSL1FastL2L3Residual for data!!!
189  select = cms.string("pt>30 & abs(eta)< 2.4"),
190  jetBTaggers = cms.PSet(
191  cvsVertex = cms.PSet(
192  label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
193  workingPoint = cms.double(0.890)
194  )
195  ),
196  ),
197  massExtras = cms.PSet(
198  lowerEdge = cms.double( 70.),
199  upperEdge = cms.double(110.)
200  ),
201  ),
202  ## ------------------------------------------------------
203  ## PRESELECTION
204 
205  preselection = cms.PSet(
206  vertex = cms.PSet(
207  src = cms.InputTag("offlinePrimaryVertices"),
208  select = cms.string(PVCut)
209  )
210  ),
211  ## ------------------------------------------------------
212  ## SELECTION
213 
214  selection = cms.VPSet(
215  cms.PSet(
216  label = cms.string("muons/pf:step0"),
217  src = cms.InputTag("pfIsolatedMuonsEI"),
218  select = cms.string(looseMuonCut + " && pt>20 & abs(eta)<2.1"),
219  min = cms.int32(1),
220  ),
221  cms.PSet(
222  label = cms.string("jets/pf:step1"),
223  src = cms.InputTag("ak4PFJetsCHS"),
224  select = cms.string("pt>30 & abs(eta)<2.4"),
225  min = cms.int32(2),
226  ),
227  cms.PSet(
228  label = cms.string("met:step2"),
229  src = cms.InputTag("pfMet"),
230  select = cms.string("pt>30"),
231  ),
232  )
233 )
234 
235 singleTopElectronMediumDQM = DQMEDAnalyzer('SingleTopTChannelLeptonDQM',
236  ## ------------------------------------------------------
237  ## SETUP
238 
242  setup = cms.PSet(
243  ## sub-directory to write the monitor histograms to
244  ## [mandatory] : should not be changed w/o explicit
245  ## communication to TopCom!
246  directory = cms.string("Physics/Top/SingleTopElectronMediumDQM/"),
247  sources = cms.PSet(
248  muons = cms.InputTag("pfIsolatedMuonsEI"),
249  elecs = cms.InputTag("pfIsolatedElectronsEI"),
250  jets = cms.InputTag("ak4PFJetsCHS"),
251  mets = cms.VInputTag("pfMet"),
252  pvs = cms.InputTag("offlinePrimaryVertices")
253  ),
254  monitoring = cms.PSet(
255  verbosity = cms.string("DEBUG")
256  ),
257  pvExtras = cms.PSet(
258  select = cms.string(PVCut)
259  ),
260  elecExtras = cms.PSet(
261  select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
262  rho = cms.InputTag("fixedGridRhoFastjetAll"),
263  ),
264  muonExtras = cms.PSet(
265  select = cms.string(looseMuonCut + " && pt>20 & abs(eta)<2.1"),
266  isolation = cms.string(looseIsoCut)
267  ),
268  jetExtras = cms.PSet(
269  jetCorrector = cms.InputTag("ak4PFCHSL1FastL2L3Corrector"), #Use pak4PFCHSL1FastL2L3Residual for data!!!
270  select = cms.string("pt>30 & abs(eta)< 2.4"),
271  jetBTaggers = cms.PSet(
272  cvsVertex = cms.PSet(
273  label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
274  workingPoint = cms.double(0.890)
275  )
276  ),
277  ),
278  massExtras = cms.PSet(
279  lowerEdge = cms.double( 70.),
280  upperEdge = cms.double(110.)
281  ),
282  ),
283  ## ------------------------------------------------------
284  ## PRESELECTION
285 
286  preselection = cms.PSet(
287  vertex = cms.PSet(
288  src = cms.InputTag("offlinePrimaryVertices"),
289  select = cms.string(PVCut)
290  )
291  ),
292  ## ------------------------------------------------------
293  ## SELECTION
294 
295  selection = cms.VPSet(
296 # cms.PSet(
297 # label = cms.string("presel"),
298 # src = cms.InputTag("offlinePrimaryVertices"),
299 # select = cms.string('!isFake && ndof >= 4 && abs(z)<24. && position.Rho <= 2.0'),
300 # ),
301 # cms.PSet(
302 # label = cms.string("elecs/pf:step0"),
303 # src = cms.InputTag("pfIsolatedElectronsEI"),
304 # electronId = cms.PSet( src = cms.InputTag("mvaTrigV0"), cutValue = cms.double(0.5) ),
305 # select = cms.string("pt>30 & abs(eta)<2.5 & abs(gsfElectronRef.gsfTrack.d0)<0.02 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 0 && (abs(gsfElectronRef.superCluster.eta) <= 1.4442 || abs(gsfElectronRef.superCluster.eta) >= 1.5660) && " + EletightIsoCut),
306 # min = cms.int32(1),
307 # max = cms.int32(1),
308 # ),*/
309  cms.PSet(
310  label = cms.string("elecs/pf:step0"),
311  src = cms.InputTag("pfIsolatedElectronsEI"),
312  select = cms.string("pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660) &&" + tightEleCut),
313  min = cms.int32(1),
314  ),
315  cms.PSet(
316  label = cms.string("jets/pf:step1"),
317  src = cms.InputTag("ak4PFJetsCHS"),
318  select = cms.string("pt>30 & abs(eta)<2.4"),
319  min = cms.int32(2),
320  ),
321  cms.PSet(
322  label = cms.string("met:step2"),
323  src = cms.InputTag("pfMet"),
324  select = cms.string("pt>30"),
325  ),
326  )
327 )