Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:10:52

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 #Primary vertex selection
0004 PVCut = "abs(z) < 24. & position.rho < 2. & ndof > 4 & !isFake"
0005 
0006 #Jet selection
0007 looseJetCut = "(chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && neutralHadronEnergyFraction()<0.99 && neutralEmEnergyFraction()<0.99 && (chargedMultiplicity()+neutralMultiplicity())>1) && abs(eta)<=2.4 "
0008 
0009 tightJetCut = "(chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && neutralHadronEnergyFraction()<0.90 && neutralEmEnergyFraction()<0.90 && (chargedMultiplicity()+neutralMultiplicity())>1) && abs(eta)<=2.4 "
0010 
0011 #Loose muon selection
0012 looseMuonCut  = "(muonRef.isNonnull && (muonRef.isGlobalMuon || muonRef.isTrackerMuon) && muonRef.isPFMuon)"
0013 looseIsoCut   = "((muonRef.pfIsolationR04.sumChargedHadronPt + max(0., muonRef.pfIsolationR04.sumNeutralHadronEt + muonRef.pfIsolationR04.sumPhotonEt - 0.5 * muonRef.pfIsolationR04.sumPUPt) ) / muonRef.pt < 0.25)"
0014 
0015 #Medium muon selection. Also requires either good global muon or tight segment compatibility
0016 mediumMuonCut = looseMuonCut + " muonRef.innerTrack.validFraction > 0.8"
0017 
0018 #Tight muon selection. Lacks distance to primary vertex variables, dz<0.5, dxy < 0.2. Now done at .cc
0019 tightMuonCut  = "muonRef.isNonnull && muonRef.isGlobalMuon && muonRef.isPFMuon && muonRef.globalTrack.normalizedChi2 < 10. && muonRef.globalTrack.hitPattern.numberOfValidMuonHits > 0 && " + \
0020                "muonRef.numberOfMatchedStations > 1 && muonRef.innerTrack.hitPattern.numberOfValidPixelHits > 0 && muonRef.innerTrack.hitPattern.trackerLayersWithMeasurement > 5 "
0021 tightIsoCut   = "(muonRef.pfIsolationR04.sumChargedHadronPt + max(0., muonRef.pfIsolationR04.sumNeutralHadronEt + muonRef.pfIsolationR04.sumPhotonEt - 0.5 * muonRef.pfIsolationR04.sumPUPt) ) / muonRef.pt < 0.15"
0022 
0023 #Electron selections
0024 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))"
0025 
0026 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))"
0027 
0028 
0029 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0030 
0031 topSingleMuonMediumDQM = DQMEDAnalyzer('TopSingleLeptonDQM',
0032   ## ------------------------------------------------------
0033   ## SETUP
0034   ##
0035   ## configuration of the MonitoringEnsemble(s)
0036   ## [mandatory] : optional PSets may be omitted
0037   ##
0038   setup = cms.PSet(
0039     directory = cms.string("Physics/Top/TopSingleMuonMediumDQM/"),
0040     sources = cms.PSet(
0041       muons = cms.InputTag("pfIsolatedMuonsEI"),
0042       elecs = cms.InputTag("pfIsolatedElectronsEI"),
0043       jets  = cms.InputTag("ak4PFJetsCHS"),
0044       mets  = cms.VInputTag("pfMet"),
0045       pvs   = cms.InputTag("offlinePrimaryVertices")
0046 
0047     ),
0048     monitoring = cms.PSet(
0049       verbosity = cms.string("DEBUG")
0050     ),
0051     pvExtras = cms.PSet(
0052       select = cms.string(PVCut)
0053     ),
0054     elecExtras = cms.PSet(
0055       select     = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
0056             rho = cms.InputTag("fixedGridRhoFastjetAll"),
0057     ),                                     
0058     muonExtras = cms.PSet(
0059       select    = cms.string(tightMuonCut + " && pt>20 & abs(eta)<2.4"),                                               
0060       #select    = cms.string(looseMuonCut + " && pt>20 & abs(eta)<2.4"),                                              
0061       isolation = cms.string(looseIsoCut)
0062     ),
0063     jetExtras = cms.PSet(
0064       jetCorrector = cms.InputTag("dqmAk4PFCHSL1FastL2L3Corrector"),  #Use pak4PFCHSL1FastL2L3Residual for data!!!                                            
0065       select = cms.string("pt>30 & abs(eta)< 2.4"),                                                                                               
0066       jetBTaggers  = cms.PSet(
0067                 cvsVertex = cms.PSet(
0068           label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
0069               workingPoint = cms.double(0.890)
0070               # CSV Medium from https://twiki.cern.ch/twiki/bin/viewauth/CMS/BtagRecommendation74X
0071         )
0072       ),                                                                                                
0073     ),
0074     massExtras = cms.PSet(
0075       lowerEdge = cms.double( 70.),
0076       upperEdge = cms.double(110.)
0077     ),
0078   ),
0079 
0080   preselection = cms.PSet(
0081     vertex = cms.PSet(
0082       src    = cms.InputTag("offlinePrimaryVertices"),
0083       select = cms.string(PVCut)
0084     )
0085   ),
0086 
0087   selection = cms.VPSet(
0088     cms.PSet(
0089       label  = cms.string("muons:step0"),
0090       src    = cms.InputTag("pfIsolatedMuonsEI"),
0091       select = cms.string(tightMuonCut + " && pt>20 & abs(eta)<2.4"),     
0092       min    = cms.int32(1),
0093     ),
0094     cms.PSet(
0095       label  = cms.string("jets/pf:step1"),
0096       src    = cms.InputTag("ak4PFJetsCHS"),
0097       select = cms.string("pt>30 & abs(eta)<2.4"),
0098       min = cms.int32(4),
0099     ), 
0100     cms.PSet(
0101       label  = cms.string("met:step2"),
0102       src    = cms.InputTag("pfMet"),
0103       select = cms.string("pt>30"),                                             
0104     ),
0105   )
0106 )
0107 
0108 
0109 topSingleElectronMediumDQM = DQMEDAnalyzer('TopSingleLeptonDQM',
0110   ## ------------------------------------------------------
0111   ## SETUP
0112   ##
0113   ## configuration of the MonitoringEnsemble(s)
0114   ## [mandatory] : optional PSets may be omitted
0115   ##
0116   setup = cms.PSet(
0117     directory = cms.string("Physics/Top/TopSingleElectronMediumDQM/"),
0118     sources = cms.PSet(
0119       muons = cms.InputTag("pfIsolatedMuonsEI"),
0120       elecs = cms.InputTag("pfIsolatedElectronsEI"),
0121       jets  = cms.InputTag("ak4PFJetsCHS"),
0122       mets  = cms.VInputTag("pfMet"),
0123       pvs   = cms.InputTag("offlinePrimaryVertices")
0124 
0125     ),
0126     monitoring = cms.PSet(
0127       verbosity = cms.string("DEBUG")
0128     ),
0129     pvExtras = cms.PSet(                                                                                           
0130       select   = cms.string(PVCut)
0131     ),
0132     elecExtras = cms.PSet(
0133       select     = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
0134             rho = cms.InputTag("fixedGridRhoFastjetAll"),
0135     ),
0136     muonExtras = cms.PSet(
0137       select     = cms.string(tightMuonCut + " & pt>20 & abs(eta)<2.4"),
0138       isolation  = cms.string(looseIsoCut),
0139     ),
0140     jetExtras = cms.PSet(
0141             jetCorrector = cms.InputTag("dqmAk4PFCHSL1FastL2L3Corrector"), #Use pak4PFCHSL1FastL2L3Residual for data!!!
0142       select = cms.string("pt>30 & abs(eta)<2.4"),
0143       jetBTaggers  = cms.PSet(
0144             cvsVertex = cms.PSet(
0145           label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
0146               workingPoint = cms.double(0.890)
0147               # CSV Medium from https://twiki.cern.ch/twiki/bin/viewauth/CMS/BtagRecommendation74X
0148         )
0149       ),                                                
0150     ),
0151     massExtras = cms.PSet(
0152       lowerEdge = cms.double( 70.),
0153       upperEdge = cms.double(110.)
0154     ),
0155   ),
0156   preselection = cms.PSet(
0157     vertex = cms.PSet(
0158       src    = cms.InputTag("offlinePrimaryVertices"),
0159       select = cms.string(PVCut)
0160     )
0161   ),
0162   selection = cms.VPSet(
0163     cms.PSet(
0164       label = cms.string("elecs:step0"),
0165       src   = cms.InputTag("pfIsolatedElectronsEI"),
0166       select = cms.string("pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660) &&" + tightEleCut),
0167  #     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),
0168       min = cms.int32(1),
0169     ),
0170     cms.PSet(
0171       label = cms.string("jets/pf:step1"),
0172       src   = cms.InputTag("ak4PFJetsCHS"),
0173       select = cms.string("pt>30 & abs(eta)<2.4"),
0174       min = cms.int32(4),
0175     ), 
0176     cms.PSet(
0177       label  = cms.string("met:step2"),
0178       src    = cms.InputTag("pfMet"),
0179       select = cms.string("pt>30"),
0180     ),
0181   )
0182 )
0183