CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/RecoTauTag/TauTagTools/python/TauNeuralClassifiers_cfi.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 import copy
00003 
00004 #Define the mapping of Decay mode IDs onto the names of trained MVA files
00005 #Note that while one category can apply to multiple decay modes, a decay mode can not have multiple categories
00006 
00007 # Get MVA configuration defintions (edit MVAs here)
00008 from RecoTauTag.TauTagTools.TauMVAConfigurations_cfi import *
00009 from RecoTauTag.TauTagTools.TauMVADiscriminator_cfi import *
00010 from RecoTauTag.TauTagTools.BenchmarkPointCuts_cfi import *
00011 
00012 # Temporary
00013 dmCodeTrans = {
00014     (1,0) : 'OneProngNoPiZero',
00015     (1,1) : 'OneProngOnePiZero',
00016     (1,2) : 'OneProngTwoPiZero',
00017     (3,0) : 'ThreeProngNoPiZero',
00018     (3,1) : 'ThreeProngOnePiZero',
00019 }
00020 
00021 def UpdateCuts(producer, cut_set):
00022     oldDecayModes = producer.decayModes
00023     newDecayModes = cms.VPSet()
00024     for dm in oldDecayModes:
00025         cut = cut_set[dmCodeTrans[(dm.nCharged.value(), dm.nPiZeros.value())]]
00026         cut += 1.0
00027         cut /= 2.0
00028         newDecayMode = copy.deepcopy(dm)
00029         newDecayMode.cut = cms.double(cut)
00030         newDecayModes.append(newDecayMode)
00031     producer.decayModes = newDecayModes
00032 
00033 TauDecayModeCutMutliplexerPrototype = cms.EDProducer(
00034     "RecoTauDecayModeCutMultiplexer",
00035     PFTauProducer = cms.InputTag("shrinkingConePFTauProducer"),
00036     toMultiplex = cms.InputTag('shrinkingConePFTauDiscriminationByTaNC'),
00037     Prediscriminants = shrinkingConeLeadTrackFinding,
00038     #computers = TaNC,
00039     decayModes = cms.VPSet(
00040         cms.PSet(
00041             nCharged = cms.uint32(1),
00042             nPiZeros = cms.uint32(0),
00043         ),
00044         cms.PSet(
00045             nCharged = cms.uint32(1),
00046             nPiZeros = cms.uint32(1),
00047         ),
00048         cms.PSet(
00049             nCharged = cms.uint32(1),
00050             nPiZeros = cms.uint32(2),
00051         ),
00052         cms.PSet(
00053             nCharged = cms.uint32(3),
00054             nPiZeros = cms.uint32(0),
00055         ),
00056         cms.PSet(
00057             nCharged = cms.uint32(3),
00058             nPiZeros = cms.uint32(1),
00059         ),
00060     )
00061 )
00062 
00063 shrinkingConePFTauDiscriminationByTaNCfrOnePercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
00064 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrOnePercent, CutSet_TaNC_OnePercent)
00065 
00066 shrinkingConePFTauDiscriminationByTaNCfrOnePercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
00067 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrOnePercent, CutSet_TaNC_OnePercent)
00068 
00069 shrinkingConePFTauDiscriminationByTaNCfrHalfPercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
00070 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrHalfPercent, CutSet_TaNC_HalfPercent)
00071 
00072 shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
00073 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent, CutSet_TaNC_QuarterPercent)
00074 
00075 shrinkingConePFTauDiscriminationByTaNCfrTenthPercent = copy.deepcopy(TauDecayModeCutMutliplexerPrototype)
00076 UpdateCuts(shrinkingConePFTauDiscriminationByTaNCfrTenthPercent, CutSet_TaNC_TenthPercent)
00077 
00078 RunTanc = cms.Sequence(
00079       shrinkingConePFTauDiscriminationByTaNCfrOnePercent+
00080       shrinkingConePFTauDiscriminationByTaNCfrHalfPercent+
00081       shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent+
00082       shrinkingConePFTauDiscriminationByTaNCfrTenthPercent
00083       )
00084 
00085