CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # HGCal electron stuff
4 from RecoEgamma.EgammaTools.cleanedEcalDrivenGsfElectronsHGC_cfi import cleanedEcalDrivenGsfElectronsHGC
5 from RecoEgamma.EgammaTools.hgcalElectronIDValueMap_cff import hgcalElectronIDValueMap
6 # HGCal electrons cleaned against duplicates and electrons in barrel (pt>10GeV)
7 # TauValElectronSelector defined Validation/RecoTau/plugins/Selectors.cc;
8 # is there a more intuitive place where such a selector is defined?
9 cleanedEcalDrivenGsfElectronsHGCnoEB = cms.EDFilter('TauValElectronSelector',
10  cut = cms.string('!isEB && pt >= 10.'),
11  src = cms.InputTag('cleanedEcalDrivenGsfElectronsHGC')
12 )
13 # Electron collection merger
14 mergedGsfElectronsForTauId = cms.EDProducer('GsfElectronCollectionMerger',
15  src = cms.VInputTag('gedGsfElectrons', 'cleanedEcalDrivenGsfElectronsHGCnoEB')
16 )
17 # HGCal EleID with merged electron collection
18 hgcElectronIdForTauId = hgcalElectronIDValueMap.clone(
19  electrons = "mergedGsfElectronsForTauId"
20 )
21 # anti-e phase-2 tauID (raw)
22 from RecoTauTag.RecoTau.tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff import mvaNames_phase2, mapping_phase2, workingPoints_phase2
24 pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw = pfRecoTauDiscriminationAgainstElectronMVA6.clone(
25  #Note: PFTauProducer and Prediscriminants have to be set in the final cfg
26  srcElectrons = "mergedGsfElectronsForTauId",
27  isPhase2 = True,
28  vetoEcalCracks = False,
29  hgcalElectronIDs = [cms.InputTag("hgcElectronIdForTauId", key) for key in hgcElectronIdForTauId.variables],
30  **mvaNames_phase2
31 )
32 # anti-e phase-2 tauID (WPs)
33 from RecoTauTag.RecoTau.recoTauDiscriminantCutMultiplexerDefault_cfi import recoTauDiscriminantCutMultiplexerDefault
34 pfRecoTauDiscriminationAgainstElectronMVA6Phase2 = recoTauDiscriminantCutMultiplexerDefault.clone(
35  #Note: PFTauProducer and Prediscriminants have to be set in the final cfg
36  toMultiplex = "pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw",
37  mapping = mapping_phase2,
38  rawValues = ["discriminator", "category"],
39  workingPoints = workingPoints_phase2
40 )
41 
42 electronsForTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task(
43  cleanedEcalDrivenGsfElectronsHGC,
44  cleanedEcalDrivenGsfElectronsHGCnoEB,
45  mergedGsfElectronsForTauId,
46  hgcElectronIdForTauId
47 )
48 
49 pfRecoTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task(
50  electronsForTauDiscriminationAgainstElectronMVA6Phase2Task,
51  pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw,
52  pfRecoTauDiscriminationAgainstElectronMVA6Phase2
53 )
54 
55 pfRecoTauDiscriminationAgainstElectronMVA6Phase2Seq = cms.Sequence(
56  pfRecoTauDiscriminationAgainstElectronMVA6Phase2Task
57 )