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  inputFileName = cms.FileInPath("RecoTauTag/RecoTau/data/emptyMVAinputFile"), # the filename for MVA if it is not loaded from DB
17  mvaName = cms.string("replaceMeByNameOfMVATraining"), # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1
18  mvaOpt = cms.string("replaceMeByMVAOption"), # e.g. DBoldDMwLT
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  verbosity = cms.int32(0)
28 )
29 
30 patDiscriminationByIsolationMVArun2v1VLoose = patTauDiscriminantCutMultiplexer.clone(
31  PATTauProducer = cms.InputTag('replaceMeByTauCollectionToBeUsed'), # in MiniAOD: slimmedTaus
32  Prediscriminants = noPrediscriminants,
33  toMultiplex = cms.InputTag('patDiscriminationByIsolationMVArun2v1raw'),
34  key = cms.InputTag('patDiscriminationByIsolationMVArun2v1raw:category'),
35  loadMVAfromDB = cms.bool(True),
36  mvaOutput_normalization = cms.string("replaceMeByNormalizationToBeUsedIfAny"), # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_mvaOutput_normalization
37  mapping = cms.VPSet(
38  cms.PSet(
39  category = cms.uint32(0),
40  cut = cms.string("replaceMeByCut"), # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff90
41  variable = cms.string("pt"),
42  )
43  )
44 )
45 patDiscriminationByIsolationMVArun2v1Loose = patDiscriminationByIsolationMVArun2v1VLoose.clone()
46 patDiscriminationByIsolationMVArun2v1Loose.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff80
47 patDiscriminationByIsolationMVArun2v1Medium = patDiscriminationByIsolationMVArun2v1VLoose.clone()
48 patDiscriminationByIsolationMVArun2v1Medium.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff70
49 patDiscriminationByIsolationMVArun2v1Tight = patDiscriminationByIsolationMVArun2v1VLoose.clone()
50 patDiscriminationByIsolationMVArun2v1Tight.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff60
51 patDiscriminationByIsolationMVArun2v1VTight = patDiscriminationByIsolationMVArun2v1VLoose.clone()
52 patDiscriminationByIsolationMVArun2v1VTight.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff50
53 patDiscriminationByIsolationMVArun2v1VVTight = patDiscriminationByIsolationMVArun2v1VLoose.clone()
54 patDiscriminationByIsolationMVArun2v1VVTight.mapping[0].cut = cms.string("replaceMeByCut") # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff40
55 
56 mvaIsolation2SeqRun2 = cms.Sequence(
57  patDiscriminationByIsolationMVArun2v1raw
58  + patDiscriminationByIsolationMVArun2v1VLoose
59  + patDiscriminationByIsolationMVArun2v1Loose
60  + patDiscriminationByIsolationMVArun2v1Medium
61  + patDiscriminationByIsolationMVArun2v1Tight
62  + patDiscriminationByIsolationMVArun2v1VTight
63  + patDiscriminationByIsolationMVArun2v1VVTight
64 )