1 import FWCore.ParameterSet.Config
as cms
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"),
13 (run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(finalIsolatedTracks, cut =
"((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 && ((pfIsolationDR03().chargedHadronIso < 5 && pt < 25) || pfIsolationDR03().chargedHadronIso/pt < 0.2)")
16 isoForIsoTk = cms.EDProducer(
"IsoTrackIsoValueMapProducer",
17 src = cms.InputTag(
"finalIsolatedTracks"),
18 relative = cms.bool(
True),
19 rho_MiniIso = cms.InputTag(
"fixedGridRhoFastjetAll"),
20 EAFile_MiniIso = cms.FileInPath(
"PhysicsTools/NanoAOD/data/effAreaMuons_cone03_pfNeuHadronsAndPhotons_80X.txt"),
23 isFromLostTrackForIsoTk = cms.EDProducer(
"IsFromLostTrackMapProducer",
24 srcIsoTracks = cms.InputTag(
"finalIsolatedTracks"),
25 packedPFCandidates = cms.InputTag(
"packedPFCandidates"),
26 lostTracks = cms.InputTag(
"lostTracks"),
29 isoTrackTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
30 src = cms.InputTag(
"finalIsolatedTracks"),
32 name = cms.string(
"IsoTrack"),
33 doc = cms.string(
"isolated tracks after basic selection (" + finalIsolatedTracks.cut.value() +
") and lepton veto"),
34 singleton = cms.bool(
False),
35 extension = cms.bool(
False),
36 variables = cms.PSet(P3Vars,
37 dz =
Var(
"dz",float,doc=
"dz (with sign) wrt first PV, in cm",precision=10),
38 dxy =
Var(
"dxy",float,doc=
"dxy (with sign) wrt first PV, in cm",precision=10),
39 pfRelIso03_chg =
Var(
"pfIsolationDR03().chargedHadronIso/pt",float,doc=
"PF relative isolation dR=0.3, charged component",precision=10),
40 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),
41 isPFcand =
Var(
"packedCandRef().isNonnull()",bool,doc=
"if isolated track is a PF candidate"),
42 fromPV =
Var(
"fromPV", int, doc=
"isolated track comes from PV"),
43 pdgId =
Var(
"pdgId",int,doc=
"PDG id of PF cand"),
44 isHighPurityTrack =
Var(
"isHighPurityTrack",bool,doc=
"track is high purity"),
45 charge =
Var(
"charge", int, doc=
"electric charge"),
47 externalVariables = cms.PSet(
48 miniPFRelIso_chg =
ExtVar(
"isoForIsoTk:miniIsoChg",float,doc=
"mini PF relative isolation, charged component",precision=10),
49 miniPFRelIso_all =
ExtVar(
"isoForIsoTk:miniIsoAll",float,doc=
"mini PF relative isolation, total (with scaled rho*EA PU corrections)",precision=10),
50 isFromLostTrack =
ExtVar(
"isFromLostTrackForIsoTk:isFromLostTrack",bool,doc=
"if isolated track comes from a lost track"),
54 (run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(isoTrackTable.variables, charge =
None)
56 isoTrackSequence = cms.Sequence(finalIsolatedTracks + isoForIsoTk + isFromLostTrackForIsoTk)
57 isoTrackTables = cms.Sequence(isoTrackTable)
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)