CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
topSingleLeptonDQM_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 
29 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
30 
31 topSingleMuonMediumDQM = DQMEDAnalyzer('TopSingleLeptonDQM',
32  ## ------------------------------------------------------
33  ## SETUP
34  ##
35  ## configuration of the MonitoringEnsemble(s)
36  ## [mandatory] : optional PSets may be omitted
37  ##
38  setup = cms.PSet(
39  directory = cms.string("Physics/Top/TopSingleMuonMediumDQM/"),
40  sources = cms.PSet(
41  muons = cms.InputTag("pfIsolatedMuonsEI"),
42  elecs = cms.InputTag("pfIsolatedElectronsEI"),
43  jets = cms.InputTag("ak4PFJetsCHS"),
44  mets = cms.VInputTag("pfMet"),
45  pvs = cms.InputTag("offlinePrimaryVertices")
46 
47  ),
48  monitoring = cms.PSet(
49  verbosity = cms.string("DEBUG")
50  ),
51  pvExtras = cms.PSet(
52  select = cms.string(PVCut)
53  ),
54  elecExtras = cms.PSet(
55  select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
56  rho = cms.InputTag("fixedGridRhoFastjetAll"),
57  ),
58  muonExtras = cms.PSet(
59  select = cms.string(tightMuonCut + " && pt>20 & abs(eta)<2.4"),
60  #select = cms.string(looseMuonCut + " && pt>20 & abs(eta)<2.4"),
61  isolation = cms.string(looseIsoCut)
62  ),
63  jetExtras = cms.PSet(
64  jetCorrector = cms.InputTag("dqmAk4PFCHSL1FastL2L3Corrector"), #Use pak4PFCHSL1FastL2L3Residual for data!!!
65  select = cms.string("pt>30 & abs(eta)< 2.4"),
66  jetBTaggers = cms.PSet(
67  cvsVertex = cms.PSet(
68  label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
69  workingPoint = cms.double(0.890)
70  # CSV Medium from https://twiki.cern.ch/twiki/bin/viewauth/CMS/BtagRecommendation74X
71  )
72  ),
73  ),
74  massExtras = cms.PSet(
75  lowerEdge = cms.double( 70.),
76  upperEdge = cms.double(110.)
77  ),
78  ),
79 
80  preselection = cms.PSet(
81  vertex = cms.PSet(
82  src = cms.InputTag("offlinePrimaryVertices"),
83  select = cms.string(PVCut)
84  )
85  ),
86 
87  selection = cms.VPSet(
88  cms.PSet(
89  label = cms.string("muons:step0"),
90  src = cms.InputTag("pfIsolatedMuonsEI"),
91  select = cms.string(tightMuonCut + " && pt>20 & abs(eta)<2.4"),
92  min = cms.int32(1),
93  ),
94  cms.PSet(
95  label = cms.string("jets/pf:step1"),
96  src = cms.InputTag("ak4PFJetsCHS"),
97  select = cms.string("pt>30 & abs(eta)<2.4"),
98  min = cms.int32(4),
99  ),
100  cms.PSet(
101  label = cms.string("met:step2"),
102  src = cms.InputTag("pfMet"),
103  select = cms.string("pt>30"),
104  ),
105  )
106 )
107 
108 
109 topSingleElectronMediumDQM = DQMEDAnalyzer('TopSingleLeptonDQM',
110  ## ------------------------------------------------------
111  ## SETUP
112  ##
113  ## configuration of the MonitoringEnsemble(s)
114  ## [mandatory] : optional PSets may be omitted
115  ##
116  setup = cms.PSet(
117  directory = cms.string("Physics/Top/TopSingleElectronMediumDQM/"),
118  sources = cms.PSet(
119  muons = cms.InputTag("pfIsolatedMuonsEI"),
120  elecs = cms.InputTag("pfIsolatedElectronsEI"),
121  jets = cms.InputTag("ak4PFJetsCHS"),
122  mets = cms.VInputTag("pfMet"),
123  pvs = cms.InputTag("offlinePrimaryVertices")
124 
125  ),
126  monitoring = cms.PSet(
127  verbosity = cms.string("DEBUG")
128  ),
129  pvExtras = cms.PSet(
130  select = cms.string(PVCut)
131  ),
132  elecExtras = cms.PSet(
133  select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
134  rho = cms.InputTag("fixedGridRhoFastjetAll"),
135  ),
136  muonExtras = cms.PSet(
137  select = cms.string(tightMuonCut + " & pt>20 & abs(eta)<2.4"),
138  isolation = cms.string(looseIsoCut),
139  ),
140  jetExtras = cms.PSet(
141  jetCorrector = cms.InputTag("dqmAk4PFCHSL1FastL2L3Corrector"), #Use pak4PFCHSL1FastL2L3Residual for data!!!
142  select = cms.string("pt>30 & abs(eta)<2.4"),
143  jetBTaggers = cms.PSet(
144  cvsVertex = cms.PSet(
145  label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
146  workingPoint = cms.double(0.890)
147  # CSV Medium from https://twiki.cern.ch/twiki/bin/viewauth/CMS/BtagRecommendation74X
148  )
149  ),
150  ),
151  massExtras = cms.PSet(
152  lowerEdge = cms.double( 70.),
153  upperEdge = cms.double(110.)
154  ),
155  ),
156  preselection = cms.PSet(
157  vertex = cms.PSet(
158  src = cms.InputTag("offlinePrimaryVertices"),
159  select = cms.string(PVCut)
160  )
161  ),
162  selection = cms.VPSet(
163  cms.PSet(
164  label = cms.string("elecs:step0"),
165  src = cms.InputTag("pfIsolatedElectronsEI"),
166  select = cms.string("pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660) &&" + tightEleCut),
167  # 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),
168  min = cms.int32(1),
169  ),
170  cms.PSet(
171  label = cms.string("jets/pf:step1"),
172  src = cms.InputTag("ak4PFJetsCHS"),
173  select = cms.string("pt>30 & abs(eta)<2.4"),
174  min = cms.int32(4),
175  ),
176  cms.PSet(
177  label = cms.string("met:step2"),
178  src = cms.InputTag("pfMet"),
179  select = cms.string("pt>30"),
180  ),
181  )
182 )
183