CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TauNeuralClassifiers_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import copy
3 
4 #Define the mapping of Decay mode IDs onto the names of trained MVA files
5 #Note that while one category can apply to multiple decay modes, a decay mode can not have multiple categories
6 
7 # Get MVA configuration defintions (edit MVAs here)
11 
12 # Temporary
13 dmCodeTrans = {
14  (1,0) : 'OneProngNoPiZero',
15  (1,1) : 'OneProngOnePiZero',
16  (1,2) : 'OneProngTwoPiZero',
17  (3,0) : 'ThreeProngNoPiZero',
18  (3,1) : 'ThreeProngOnePiZero',
19 }
20 
21 def UpdateCuts(producer, cut_set):
22  oldDecayModes = producer.decayModes
23  newDecayModes = cms.VPSet()
24  for dm in oldDecayModes:
25  cut = cut_set[dmCodeTrans[(dm.nCharged.value(), dm.nPiZeros.value())]]
26  cut += 1.0
27  cut /= 2.0
28  newDecayMode = copy.deepcopy(dm)
29  newDecayMode.cut = cms.double(cut)
30  newDecayModes.append(newDecayMode)
31  producer.decayModes = newDecayModes
32 
33 TauDecayModeCutMutliplexerPrototype = cms.EDProducer(
34  "RecoTauDecayModeCutMultiplexer",
35  PFTauProducer = cms.InputTag("shrinkingConePFTauProducer"),
36  toMultiplex = cms.InputTag('shrinkingConePFTauDiscriminationByTaNC'),
37  Prediscriminants = shrinkingConeLeadTrackFinding,
38  #computers = TaNC,
39  decayModes = cms.VPSet(
40  cms.PSet(
41  nCharged = cms.uint32(1),
42  nPiZeros = cms.uint32(0),
43  ),
44  cms.PSet(
45  nCharged = cms.uint32(1),
46  nPiZeros = cms.uint32(1),
47  ),
48  cms.PSet(
49  nCharged = cms.uint32(1),
50  nPiZeros = cms.uint32(2),
51  ),
52  cms.PSet(
53  nCharged = cms.uint32(3),
54  nPiZeros = cms.uint32(0),
55  ),
56  cms.PSet(
57  nCharged = cms.uint32(3),
58  nPiZeros = cms.uint32(1),
59  ),
60  )
61 )
62 
63 shrinkingConePFTauDiscriminationByTaNCfrOnePercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
64 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrOnePercent, CutSet_TaNC_OnePercent)
65 
66 shrinkingConePFTauDiscriminationByTaNCfrOnePercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
67 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrOnePercent, CutSet_TaNC_OnePercent)
68 
69 shrinkingConePFTauDiscriminationByTaNCfrHalfPercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
70 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrHalfPercent, CutSet_TaNC_HalfPercent)
71 
72 shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
73 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent, CutSet_TaNC_QuarterPercent)
74 
75 shrinkingConePFTauDiscriminationByTaNCfrTenthPercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
76 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrTenthPercent, CutSet_TaNC_TenthPercent)
77 
78 RunTanc = cms.Sequence(
79  shrinkingConePFTauDiscriminationByTaNCfrOnePercent+
80  shrinkingConePFTauDiscriminationByTaNCfrHalfPercent+
81  shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent+
82  shrinkingConePFTauDiscriminationByTaNCfrTenthPercent
83  )
84 
85