CMS 3D CMS Logo

mvaPFMET_leptons_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Single muon for Wjets
4 isomuons = cms.EDFilter(
5  "MuonSelector",
6  src = cms.InputTag('muons'),
7  cut = cms.string("(isTrackerMuon) && std::abs(eta) < 2.5 && pt > 9.5"+#17. "+
8  "&& isPFMuon"+
9  "&& globalTrack.isNonnull"+
10  "&& innerTrack.hitPattern.numberOfValidPixelHits > 0"+
11  "&& innerTrack.normalizedChi2 < 10"+
12  "&& numberOfMatches > 0"+
13  "&& innerTrack.hitPattern.numberOfValidTrackerHits>5"+
14  "&& globalTrack.hitPattern.numberOfValidHits>0"+
15  "&& (pfIsolationR03.sumChargedHadronPt+pfIsolationR03.sumNeutralHadronEt+pfIsolationR03.sumPhotonEt)/pt < 0.3"+
16  "&& std::abs(innerTrack().dxy)<2.0"
17  ),
18  filter = cms.bool(False)
19 )
20 
21 
22 isoelectrons = cms.EDFilter(
23  "GsfElectronSelector",
24  src = cms.InputTag('gsfElectrons'),
25  cut = cms.string("std::abs(eta) < 2.5 && pt > 9.5" +
26  "&& gsfTrack.trackerExpectedHitsInner.numberOfHits == 0" +
27 # "&& (pfIsolationVariables.chargedHadronIso+pfIsolationVariables.neutralHadronIso)/et < 0.3" +
28  "&& (isolationVariables03.tkSumPt)/et < 0.2" +
29  "&& ((std::abs(eta) < 1.4442 " +
30  "&& std::abs(deltaEtaSuperClusterTrackAtVtx) < 0.007"+
31  "&& std::abs(deltaPhiSuperClusterTrackAtVtx) < 0.8" +
32  "&& sigmaIetaIeta < 0.01" +
33  "&& hcalOverEcal < 0.15" +
34  "&& std::abs(1./superCluster.energy - 1./p) < 0.05)"+
35  "|| (std::abs(eta) > 1.566 "+
36  "&& std::abs(deltaEtaSuperClusterTrackAtVtx) < 0.009"+
37  "&& std::abs(deltaPhiSuperClusterTrackAtVtx) < 0.10" +
38  "&& sigmaIetaIeta < 0.03" +
39  "&& hcalOverEcal < 0.10" +
40  "&& std::abs(1./superCluster.energy - 1./p) < 0.05))"
41  ),
42  filter = cms.bool(False)
43 )
44 
45 from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets as dummy
46 kt6PFJetsForRhoComputationVoronoiMet = dummy.clone(
47  doRhoFastjet = True,
48  voronoiRfact = 0.9
49 )
50 
51 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByHPSSelection_cfi import hpsSelectionDiscriminator
52 hpsPFTauDiscriminationByDecayModeFinding = hpsSelectionDiscriminator.clone(
53  PFTauProducer = 'hpsPFTauProducer'
54 )
55 
56 from RecoTauTag.RecoTau.TauDiscriminatorTools import requireLeadTrack
57 # Define decay mode prediscriminant
58 requireDecayMode = cms.PSet(
59  BooleanOperator = cms.string("and"),
60  decayMode = cms.PSet(
61  Producer = cms.InputTag('hpsPFTauDiscriminationByDecayModeFinding'),
62  cut = cms.double(0.5)
63  )
64 )
65 
66 from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits
67 import RecoTauTag.RecoTau.pfRecoTauDiscriminationAgainstMuon2_cfi as _mod
68 
69 hpsPFTauDiscriminationAgainstMuon2 = _mod.pfRecoTauDiscriminationAgainstMuon2.clone(
70  PFTauProducer = 'hpsPFTauProducer',
71  Prediscriminants = requireDecayMode.clone(),
72  discriminatorOption = 'loose', # available options are: 'loose', 'medium', 'tight'
73 )
74 
75 hpsPFTauDiscriminationByMVAIsolation = cms.EDProducer(
76  "PFRecoTauDiscriminationByMVAIsolation",
77  PFTauProducer = cms.InputTag('hpsPFTauProducer'),
78  rhoProducer = cms.InputTag('kt6PFJetsForRhoComputationVoronoiMet','rho'),
79  Prediscriminants = requireDecayMode.clone(),
80  gbrfFilePath = cms.FileInPath('RecoTauTag/RecoTau/data/gbrfTauIso_v2.root'),
81  returnMVA = cms.bool(False),
82  mvaMin = cms.double(0.8),
83 )
84 
85 isotaus = cms.EDFilter(
86  "PFTauSelector",
87  src = cms.InputTag('hpsPFTauProducer'),
88  BooleanOperator = cms.string("and"),
89  discriminators = cms.VPSet(
90  cms.PSet( discriminator=cms.InputTag("hpsPFTauDiscriminationByDecayModeFinding"), selectionCut=cms.double(0.5)),
91  #cms.PSet( discriminator=cms.InputTag("hpsPFTauDiscriminationByMVAIsolation"), selectionCut=cms.double(0.5)),
92  cms.PSet( discriminator=cms.InputTag("hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"), selectionCut=cms.double(0.5)),
93  cms.PSet( discriminator=cms.InputTag("hpsPFTauDiscriminationByLooseElectronRejection"), selectionCut=cms.double(0.5)),
94  cms.PSet( discriminator=cms.InputTag("hpsPFTauDiscriminationAgainstMuon2"), selectionCut=cms.double(0.5))
95  ),
96  cut = cms.string("std::abs(eta) < 2.3 && pt > 19.0 "),
97  filter = cms.bool(False)
98 )
99 
100 isomuonTask = cms.Task(isomuons)
101 isomuonseq = cms.Sequence(isomuonsTask)
102 isoelectronTask = cms.Task(isoelectrons)
103 isoelectronseq = cms.Sequence(isoelectronsTask)
104 isotauTask = cms.Task(
105  hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits,
106  #kt6PFJetsForRhoComputationVoronoiMet,
107  #hpsPFTauDiscriminationByMVAIsolation,
108  hpsPFTauDiscriminationAgainstMuon2,
109  isotaus
110  )
111 isotauseq = cms.Sequence(isotauTask)
112 
113 leptonSelection = cms.PSet(
114  SelectEvents = cms.PSet(
115  SelectEvents = cms.vstring(
116  'isomuonseq',
117  'isoelectronseq',
118  'isotauseq')
119  )
120 )