CMS 3D CMS Logo

PATTauDiscriminationByMVAIsolationRun2_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from RecoTauTag.RecoTau.TauDiscriminatorTools import noPrediscriminants
5 
6 # make sure to load the database containing the mva inputs before using the producers below
7 # e.g. process.load('RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi') as in
8 # RecoTauTag.Configuration.HPSPFTaus_cff
9 
10 patDiscriminationByIsolationMVArun2v1raw = cms.EDProducer("PATTauDiscriminationByMVAIsolationRun2",
11 
12  # tau collection to discriminate
13  PATTauProducer = cms.InputTag('replaceMeByTauCollectionToBeUsed'), # in MiniAOD: slimmedTaus
14  Prediscriminants = noPrediscriminants,
15  loadMVAfromDB = cms.bool(True),
16  mvaName = cms.string("replaceMeByNameOfMVATraining"), # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1
17  mvaOpt = cms.string("replaceMeByMVAOption"), # e.g. DBoldDMwLT
18  requireDecayMode = cms.bool(True),
19 
20  # change these only if input isolation sums changed for the MVA training you want to use
21  srcChargedIsoPtSum = cms.string('chargedIsoPtSum'),
22  srcNeutralIsoPtSum = cms.string('neutralIsoPtSum'),
23  srcPUcorrPtSum = cms.string('puCorrPtSum'),
24  srcPhotonPtSumOutsideSignalCone = cms.string('photonPtSumOutsideSignalCone'),
25  srcFootprintCorrection = cms.string('footprintCorrection')
26 )
27 
28 patDiscriminationByIsolationMVArun2v1VLoose = patTauDiscriminantCutMultiplexer.clone(
29  PATTauProducer = cms.InputTag('replaceMeByTauCollectionToBeUsed'), # in MiniAOD: slimmedTaus
30  Prediscriminants = noPrediscriminants,
31  toMultiplex = cms.InputTag('patDiscriminationByIsolationMVArun2v1raw'),
32  key = cms.InputTag('patDiscriminationByIsolationMVArun2v1raw:category'),
33  loadMVAfromDB = cms.bool(True),
34  mvaOutput_normalization = cms.string("replaceMeByNormalizationToBeUsedIfAny"), # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_mvaOutput_normalization
35  mapping = cms.VPSet(
36  cms.PSet(
37  category = cms.uint32(0),
38  cut = cms.string("replaceMeByCut"), # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff90
39  variable = cms.string("pt"),
40  )
41  )
42 )
43 patDiscriminationByIsolationMVArun2v1Loose = patDiscriminationByIsolationMVArun2v1VLoose.clone()
44 patDiscriminationByIsolationMVArun2v1Loose.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff80
45 patDiscriminationByIsolationMVArun2v1Medium = patDiscriminationByIsolationMVArun2v1VLoose.clone()
46 patDiscriminationByIsolationMVArun2v1Medium.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff70
47 patDiscriminationByIsolationMVArun2v1Tight = patDiscriminationByIsolationMVArun2v1VLoose.clone()
48 patDiscriminationByIsolationMVArun2v1Tight.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff60
49 patDiscriminationByIsolationMVArun2v1VTight = patDiscriminationByIsolationMVArun2v1VLoose.clone()
50 patDiscriminationByIsolationMVArun2v1VTight.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff50
51 patDiscriminationByIsolationMVArun2v1VVTight = patDiscriminationByIsolationMVArun2v1VLoose.clone()
52 patDiscriminationByIsolationMVArun2v1VVTight.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff40
53 
54 mvaIsolation2SeqRun2 = cms.Sequence(
55  patDiscriminationByIsolationMVArun2v1raw
56  + patDiscriminationByIsolationMVArun2v1VLoose
57  + patDiscriminationByIsolationMVArun2v1Loose
58  + patDiscriminationByIsolationMVArun2v1Medium
59  + patDiscriminationByIsolationMVArun2v1Tight
60  + patDiscriminationByIsolationMVArun2v1VTight
61  + patDiscriminationByIsolationMVArun2v1VVTight
62 )