CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ShrinkingConePFTaus_cff.py
Go to the documentation of this file.
2 import copy
3 
4 """
5  Defines producers and discriminants for the "shrinkingCone" PFTau
6 
7  The sequence provided @ the end of the file,
8 
9  produceAndDiscriminateShrinkingConePFTaus
10 
11  produces the shrinking cone PFTau and all its associated discriminants
12 
13  Signal/Iso cone parameters:
14  SignalCone for tracks - 5/ET in DR from lead object, min 0.07, max 0.15
15  SignalCone for ECAL/HCAL - 0.15 in DR from lead object
16  Isolation cone (all types0 - 0.50 in DR from lead object
17 """
18 
19 # Backwards compatability
20 # Get the decay mode reconstruction producer
22 shrinkingConePFTauDecayModeProducer = copy.deepcopy(pfTauDecayMode)
23 shrinkingConePFTauDecayModeProducer.PFTauProducer = 'shrinkingConePFTauProducer'
24 
25 # Store the reco'd decay modes in a simple container
27 shrinkingConePFTauDecayModeIndexProducer = copy.deepcopy(pfTauDecayModeIndexProducer)
28 shrinkingConePFTauDecayModeIndexProducer.PFTauProducer = cms.InputTag("shrinkingConePFTauProducer")
29 shrinkingConePFTauDecayModeIndexProducer.PFTauDecayModeProducer = cms.InputTag("shrinkingConePFTauDecayModeProducer")
30 # End backwards compatability
31 
33 
34 from RecoTauTag.RecoTau.RecoTauShrinkingConeProducer_cfi import \
35  shrinkingConeRecoTaus as shrinkingConePFTauProducerSansRefs
36 
37 shrinkingConePFTauProducer = cms.EDProducer(
38  "RecoTauPiZeroUnembedder",
39  src = cms.InputTag("shrinkingConePFTauProducerSansRefs")
40 )
41 shrinkingConePFTauProducer.builders = shrinkingConePFTauProducerSansRefs.builders
42 shrinkingConePFTauProducer.modifiers = shrinkingConePFTauProducerSansRefs.modifiers
43 
44 # Define the discriminators for this tau
52 #Discriminators using leading Pion
57 
58 # Load helper functions to change the source of the discriminants
60 
61 #copying Discriminator ByLeadingTrack(finding and pt_cut)
62 shrinkingConePFTauDiscriminationByLeadingTrackFinding = \
63  copy.deepcopy(pfRecoTauDiscriminationByLeadingTrackFinding)
64 setTauSource(shrinkingConePFTauDiscriminationByLeadingTrackFinding,
65  'shrinkingConePFTauProducer')
66 
67 shrinkingConePFTauDiscriminationByLeadingTrackPtCut = \
68  copy.deepcopy(pfRecoTauDiscriminationByLeadingTrackPtCut)
69 setTauSource(shrinkingConePFTauDiscriminationByLeadingTrackPtCut,
70  'shrinkingConePFTauProducer')
71 
72 #copying Discriminator ByPionTrackPtCut
73 shrinkingConePFTauDiscriminationByLeadingPionPtCut = \
74  copy.deepcopy(pfRecoTauDiscriminationByLeadingPionPtCut)
75 setTauSource(shrinkingConePFTauDiscriminationByLeadingPionPtCut,
76  'shrinkingConePFTauProducer')
77 
78 #copying the Discriminator by Isolation
79 shrinkingConePFTauDiscriminationByIsolation = \
80  copy.deepcopy(pfRecoTauDiscriminationByIsolation)
81 setTauSource(shrinkingConePFTauDiscriminationByIsolation,
82  'shrinkingConePFTauProducer')
83 
84 shrinkingConePFTauDiscriminationByTrackIsolation = \
85  copy.deepcopy(pfRecoTauDiscriminationByTrackIsolation)
86 setTauSource(shrinkingConePFTauDiscriminationByTrackIsolation,
87  'shrinkingConePFTauProducer')
88 
89 shrinkingConePFTauDiscriminationByECALIsolation = \
90  copy.deepcopy(pfRecoTauDiscriminationByECALIsolation)
91 setTauSource(shrinkingConePFTauDiscriminationByECALIsolation,
92  'shrinkingConePFTauProducer')
93 
94 #copying the Discriminator by Isolation for leadingPion
95 shrinkingConePFTauDiscriminationByIsolationUsingLeadingPion = \
96  copy.deepcopy(pfRecoTauDiscriminationByIsolationUsingLeadingPion)
97 setTauSource(shrinkingConePFTauDiscriminationByIsolationUsingLeadingPion,
98  'shrinkingConePFTauProducer')
99 
100 shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion = \
101  copy.deepcopy(pfRecoTauDiscriminationByTrackIsolationUsingLeadingPion)
102 setTauSource(shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion,
103  'shrinkingConePFTauProducer')
104 
105 shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion = \
106  copy.deepcopy(pfRecoTauDiscriminationByECALIsolationUsingLeadingPion)
107 setTauSource(shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion,
108  'shrinkingConePFTauProducer')
109 
110 #copying discriminator against electrons and muons
111 shrinkingConePFTauDiscriminationAgainstElectron = \
112  copy.deepcopy(pfRecoTauDiscriminationAgainstElectron)
113 setTauSource(shrinkingConePFTauDiscriminationAgainstElectron,
114  'shrinkingConePFTauProducer')
115 
116 shrinkingConePFTauDiscriminationAgainstMuon = \
117  copy.deepcopy(pfRecoTauDiscriminationAgainstMuon)
118 setTauSource(shrinkingConePFTauDiscriminationAgainstMuon,
119  'shrinkingConePFTauProducer')
120 
121 produceAndDiscriminateShrinkingConePFTaus = cms.Sequence(
122  shrinkingConePFTauProducerSansRefs*
123  shrinkingConePFTauProducer*
124  shrinkingConePFTauDiscriminationByLeadingTrackFinding*
125  shrinkingConePFTauDiscriminationByLeadingTrackPtCut*
126  shrinkingConePFTauDiscriminationByLeadingPionPtCut*
127  shrinkingConePFTauDiscriminationByIsolation*
128  shrinkingConePFTauDiscriminationByTrackIsolation*
129  shrinkingConePFTauDiscriminationByECALIsolation*
130  shrinkingConePFTauDiscriminationByIsolationUsingLeadingPion*
131  shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion*
132  shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion*
133  shrinkingConePFTauDiscriminationAgainstElectron*
134  shrinkingConePFTauDiscriminationAgainstMuon
135  )
136 
137 produceShrinkingConeDiscriminationByTauNeuralClassifier = cms.Sequence(
138  shrinkingConePFTauDiscriminationByTaNC*
139  shrinkingConePFTauDiscriminationByTaNCfrOnePercent*
140  shrinkingConePFTauDiscriminationByTaNCfrHalfPercent*
141  shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent*
142  shrinkingConePFTauDiscriminationByTaNCfrTenthPercent
143 )
144 
145