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 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0029 
0030 singleTopMuonMediumDQM = DQMEDAnalyzer('SingleTopTChannelLeptonDQM',
0031   ## ------------------------------------------------------
0032   ## SETUP
0033   ##
0034   ## configuration of the MonitoringEnsemble(s)
0035   ## [mandatory] : optional PSets may be omitted
0036   ##
0037     setup = cms.PSet(
0038     directory = cms.string("Physics/Top/SingleTopMuonMediumDQM/"),
0039     sources = cms.PSet(
0040     muons = cms.InputTag("pfIsolatedMuonsEI"),
0041     elecs = cms.InputTag("pfIsolatedElectronsEI"),
0042     jets  = cms.InputTag("ak4PFJetsCHS"),
0043     mets  = cms.VInputTag("pfMet"),
0044     pvs   = cms.InputTag("offlinePrimaryVertices")
0045     ),
0046     monitoring = cms.PSet(
0047       verbosity = cms.string("DEBUG")
0048     ),
0049     pvExtras = cms.PSet(
0050       select = cms.string(PVCut)
0051     ),
0052     elecExtras = cms.PSet(
0053       select     = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
0054       rho = cms.InputTag("fixedGridRhoFastjetAll"),
0055     ),                                     
0056     muonExtras = cms.PSet(                                               
0057       select    = cms.string(tightMuonCut + " && pt>20 & abs(eta)<2.4"),
0058       isolation = cms.string(looseIsoCut)
0059     ),
0060     jetExtras = cms.PSet(
0061       jetCorrector = cms.InputTag("dqmAk4PFCHSL1FastL2L3Corrector"),  #Use pak4PFCHSL1FastL2L3Residual for data!!!                                            
0062       select = cms.string("pt>30 & abs(eta)< 2.4"),
0063       jetBTaggers  = cms.PSet(
0064         cvsVertex = cms.PSet(
0065         label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
0066             workingPoint = cms.double(0.890)
0067         )
0068       ),
0069     ),
0070     massExtras = cms.PSet(
0071         lowerEdge = cms.double( 70.),
0072         upperEdge = cms.double(110.)
0073     ),
0074   ),
0075   ## ------------------------------------------------------
0076   ## PRESELECTION
0077   ##
0078   preselection = cms.PSet(
0079     vertex = cms.PSet(
0080       src    = cms.InputTag("offlinePrimaryVertices"),
0081       select = cms.string(PVCut)
0082     )
0083   ),
0084   ## ------------------------------------------------------
0085   ## SELECTION
0086   ##
0087   selection = cms.VPSet(
0088     cms.PSet(
0089       label  = cms.string("muons/pf: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(2),
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 singleTopElectronMediumDQM = DQMEDAnalyzer('SingleTopTChannelLeptonDQM',
0109   ## ------------------------------------------------------
0110   ## SETUP
0111   ##
0112   ## configuration of the MonitoringEnsemble(s)
0113   ## [mandatory] : optional PSets may be omitted
0114   ##
0115   setup = cms.PSet(
0116     ## sub-directory to write the monitor histograms to
0117     ## [mandatory] : should not be changed w/o explicit
0118     ## communication to TopCom!
0119     directory = cms.string("Physics/Top/SingleTopElectronMediumDQM/"),
0120     sources = cms.PSet(
0121     muons = cms.InputTag("pfIsolatedMuonsEI"),
0122     elecs = cms.InputTag("pfIsolatedElectronsEI"),
0123     jets  = cms.InputTag("ak4PFJetsCHS"),
0124     mets  = cms.VInputTag("pfMet"),
0125     pvs   = cms.InputTag("offlinePrimaryVertices")
0126     ),
0127     monitoring = cms.PSet(
0128       verbosity = cms.string("DEBUG")
0129     ),
0130     pvExtras = cms.PSet(
0131       select = cms.string(PVCut)
0132     ),
0133     elecExtras = cms.PSet(
0134       select     = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
0135       rho = cms.InputTag("fixedGridRhoFastjetAll"),
0136     ),                                     
0137     muonExtras = cms.PSet(                                               
0138       select    = cms.string(tightMuonCut + " && pt>20 & abs(eta)<2.4"),                                              
0139       isolation = cms.string(looseIsoCut)
0140     ),
0141     jetExtras = cms.PSet(
0142       jetCorrector = cms.InputTag("dqmAk4PFCHSL1FastL2L3Corrector"),  #Use pak4PFCHSL1FastL2L3Residual for data!!!                                            
0143       select = cms.string("pt>30 & abs(eta)< 2.4"),
0144       jetBTaggers  = cms.PSet(
0145         cvsVertex = cms.PSet(
0146         label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
0147             workingPoint = cms.double(0.890)
0148         )
0149       ),
0150     ),
0151     massExtras = cms.PSet(
0152         lowerEdge = cms.double( 70.),
0153         upperEdge = cms.double(110.)
0154     ),
0155   ),
0156   ## ------------------------------------------------------
0157   ## PRESELECTION
0158   ##
0159   preselection = cms.PSet(
0160     vertex = cms.PSet(
0161       src    = cms.InputTag("offlinePrimaryVertices"),
0162       select = cms.string(PVCut)
0163     )
0164   ),
0165   ## ------------------------------------------------------
0166   ## SELECTION
0167   ##
0168   selection = cms.VPSet(
0169 #   cms.PSet(
0170 #      label  = cms.string("presel"),
0171 #      src    = cms.InputTag("offlinePrimaryVertices"),
0172 #      select = cms.string('!isFake && ndof >= 4 && abs(z)<24. && position.Rho <= 2.0'),
0173 #   ),
0174 #   cms.PSet(
0175 #      label = cms.string("elecs/pf:step0"),
0176 #      src   = cms.InputTag("pfIsolatedElectronsEI"),
0177 #      electronId = cms.PSet( src = cms.InputTag("mvaTrigV0"), cutValue = cms.double(0.5) ),  
0178 #      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),
0179 #      min = cms.int32(1),
0180 #      max = cms.int32(1),
0181 #    ),*/
0182     cms.PSet(
0183       label  = cms.string("elecs/pf:step0"),
0184       src    = cms.InputTag("pfIsolatedElectronsEI"),
0185       select = cms.string("pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660) &&" + tightEleCut),  
0186       min    = cms.int32(1),
0187     ),
0188     cms.PSet(
0189       label  = cms.string("jets/pf:step1"),
0190       src    = cms.InputTag("ak4PFJetsCHS"),
0191       select = cms.string("pt>30 & abs(eta)<2.4"),
0192       min = cms.int32(2),
0193     ), 
0194     cms.PSet(
0195       label  = cms.string("met:step2"),
0196       src    = cms.InputTag("pfMet"),
0197       select = cms.string("pt>30"),                                             
0198     ),
0199   )
0200 )