CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
isotracks_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
4 
5 finalIsolatedTracks = cms.EDProducer("IsolatedTrackCleaner",
6  tracks = cms.InputTag("isolatedTracks"),
7  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)"),
8  finalLeptons = cms.VInputTag(
9  cms.InputTag("finalElectrons"),
10  cms.InputTag("finalLooseMuons"),
11  ),
12 )
13 
14 isoForIsoTk = cms.EDProducer("IsoTrackIsoValueMapProducer",
15  src = cms.InputTag("finalIsolatedTracks"),
16  relative = cms.bool(True),
17  rho_MiniIso = cms.InputTag("fixedGridRhoFastjetAll"),
18  EAFile_MiniIso = cms.FileInPath("PhysicsTools/NanoAOD/data/effAreaMuons_cone03_pfNeuHadronsAndPhotons_80X.txt"),
19 )
20 
21 isFromLostTrackForIsoTk = cms.EDProducer("IsFromLostTrackMapProducer",
22  srcIsoTracks = cms.InputTag("finalIsolatedTracks"),
23  packedPFCandidates = cms.InputTag("packedPFCandidates"),
24  lostTracks = cms.InputTag("lostTracks"),
25 )
26 
27 isoTrackTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
28  src = cms.InputTag("finalIsolatedTracks"),
29  cut = cms.string(""), # filtered already above
30  name = cms.string("IsoTrack"),
31  doc = cms.string("isolated tracks after basic selection (" + finalIsolatedTracks.cut.value() + ") and lepton veto"),
32  singleton = cms.bool(False), # the number of entries is variable
33  extension = cms.bool(False), # this is the main table for the muons
34  variables = cms.PSet(P3Vars,
35  dz = Var("dz",float,doc="dz (with sign) wrt first PV, in cm",precision=10),
36  dxy = Var("dxy",float,doc="dxy (with sign) wrt first PV, in cm",precision=10),
37  pfRelIso03_chg = Var("pfIsolationDR03().chargedHadronIso/pt",float,doc="PF relative isolation dR=0.3, charged component",precision=10),
38  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),
39  isPFcand = Var("packedCandRef().isNonnull()",bool,doc="if isolated track is a PF candidate"),
40  fromPV = Var("fromPV", int, doc="isolated track comes from PV"),
41  pdgId = Var("pdgId",int,doc="PDG id of PF cand"),
42  isHighPurityTrack = Var("isHighPurityTrack",bool,doc="track is high purity"),
43  charge = Var("charge", int, doc="electric charge"),
44  ),
45  externalVariables = cms.PSet(
46  miniPFRelIso_chg = ExtVar("isoForIsoTk:miniIsoChg",float,doc="mini PF relative isolation, charged component",precision=10),
47  miniPFRelIso_all = ExtVar("isoForIsoTk:miniIsoAll",float,doc="mini PF relative isolation, total (with scaled rho*EA PU corrections)",precision=10),
48  isFromLostTrack = ExtVar("isFromLostTrackForIsoTk:isFromLostTrack",bool,doc="if isolated track comes from a lost track"),
49  ),
50 )
51 
52 isoTrackTask = cms.Task(finalIsolatedTracks,isoForIsoTk,isFromLostTrackForIsoTk)
53 isoTrackTablesTask = cms.Task(isoTrackTable)
54 
55 run2_miniAOD_80XLegacy.toReplaceWith(isoTrackTask, cms.Task())
56 run2_miniAOD_80XLegacy.toReplaceWith(isoTrackTablesTask,cms.Task())
def ExtVar
Definition: common_cff.py:31