Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-29 01:21:39

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.common_cff import *
0003 from PhysicsTools.NanoAOD.nano_eras_cff import *
0004 
0005 finalIsolatedTracks = cms.EDProducer("IsolatedTrackCleaner",
0006     tracks = cms.InputTag("isolatedTracks"),
0007     cut = cms.string("((pt>5 && (abs(pdgId) == 11 || abs(pdgId) == 13)) || pt > 10) && (abs(pdgId) < 15 || abs(eta) < 2.5) && ((abs(dxy) < 0.2 && abs(dz) < 0.1) || pt>15) && ((pfIsolationDR03().chargedHadronIso < 5 && pt < 25) || pfIsolationDR03().chargedHadronIso/pt < 0.2)"),
0008     finalLeptons = cms.VInputTag(
0009         cms.InputTag("finalElectrons"),
0010         cms.InputTag("finalLooseMuons"),
0011     ),
0012 )
0013 
0014 isoForIsoTk = cms.EDProducer("IsoTrackIsoValueMapProducer",
0015     src = cms.InputTag("finalIsolatedTracks"),
0016     relative = cms.bool(True),
0017     rho_MiniIso = cms.InputTag("fixedGridRhoFastjetAll"),
0018     EAFile_MiniIso = cms.FileInPath("PhysicsTools/NanoAOD/data/effAreaMuons_cone03_pfNeuHadronsAndPhotons_80X.txt"),
0019 )
0020 
0021 isFromLostTrackForIsoTk = cms.EDProducer("IsFromLostTrackMapProducer",
0022     srcIsoTracks = cms.InputTag("finalIsolatedTracks"),
0023     packedPFCandidates = cms.InputTag("packedPFCandidates"),
0024     lostTracks = cms.InputTag("lostTracks"),
0025 )
0026 
0027 isoTrackTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
0028     src = cms.InputTag("finalIsolatedTracks"),
0029     cut = cms.string(""), # filtered already above
0030     name = cms.string("IsoTrack"),
0031     doc  = cms.string("isolated tracks after basic selection (" + finalIsolatedTracks.cut.value() + ") and lepton veto"),
0032     singleton = cms.bool(False), # the number of entries is variable
0033     extension = cms.bool(False), # this is the main table for the muons
0034     variables = cms.PSet(P3Vars,
0035         dz = Var("dz",float,doc="dz (with sign) wrt first PV, in cm",precision=10),
0036         dxy = Var("dxy",float,doc="dxy (with sign) wrt first PV, in cm",precision=10),
0037         pfRelIso03_chg = Var("pfIsolationDR03().chargedHadronIso/pt",float,doc="PF relative isolation dR=0.3, charged component",precision=10),
0038         pfRelIso03_all = Var("(pfIsolationDR03().chargedHadronIso + max(pfIsolationDR03().neutralHadronIso + pfIsolationDR03().photonIso - pfIsolationDR03().puChargedHadronIso/2,0.0))/pt",float,doc="PF relative isolation dR=0.3, total (deltaBeta corrections)",precision=10),
0039         isPFcand = Var("packedCandRef().isNonnull()",bool,doc="if isolated track is a PF candidate"),
0040         fromPV = Var("fromPV", int, doc="isolated track comes from PV"),
0041         pdgId = Var("pdgId",int,doc="PDG id of PF cand"),
0042         isHighPurityTrack = Var("isHighPurityTrack",bool,doc="track is high purity"),
0043         charge = Var("charge", int, doc="electric charge"),
0044     ),
0045     externalVariables = cms.PSet(
0046         miniPFRelIso_chg = ExtVar("isoForIsoTk:miniIsoChg",float,doc="mini PF relative isolation, charged component",precision=10),
0047         miniPFRelIso_all = ExtVar("isoForIsoTk:miniIsoAll",float,doc="mini PF relative isolation, total (with scaled rho*EA PU corrections)",precision=10),
0048         isFromLostTrack = ExtVar("isFromLostTrackForIsoTk:isFromLostTrack",bool,doc="if isolated track comes from a lost track"),
0049     ),
0050 )
0051 
0052 isoTrackTask = cms.Task(finalIsolatedTracks,isoForIsoTk,isFromLostTrackForIsoTk)
0053 isoTrackTablesTask = cms.Task(isoTrackTable)
0054 
0055 run2_miniAOD_80XLegacy.toReplaceWith(isoTrackTask, cms.Task())
0056 run2_miniAOD_80XLegacy.toReplaceWith(isoTrackTablesTask,cms.Task())