CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoTauTag/Configuration/python/HPSPFTaus_cfi.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 import copy
00003 
00004 '''
00005 
00006 Sequences for HPS taus
00007 
00008 '''
00009 
00010 # Define the discriminators for this tau
00011 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByIsolation_cfi                      import *
00012 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByLeadingTrackFinding_cfi            import *
00013 from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstElectron_cfi                  import *
00014 from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuon_cfi                      import *
00015 
00016 # Load helper functions to change the source of the discriminants
00017 from RecoTauTag.RecoTau.TauDiscriminatorTools import *
00018 
00019 # Select those taus that pass the HPS selections
00020 #  - pt > 15, mass cuts, tauCone cut
00021 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByHPSSelection_cfi import \
00022         hpsSelectionDiscriminator
00023 hpsPFTauDiscriminationByDecayModeFinding = copy.deepcopy(
00024     hpsSelectionDiscriminator)
00025 hpsPFTauDiscriminationByDecayModeFinding.PFTauProducer \
00026         = cms.InputTag('hpsPFTauProducer')
00027 
00028 #setTauSource(hpsPFTauDiscriminationByDecayModeFinding, 'hpsPFTauProducer')
00029 # Define decay mode prediscriminant
00030 requireDecayMode = cms.PSet(
00031     BooleanOperator = cms.string("and"),
00032     decayMode = cms.PSet(
00033         Producer = cms.InputTag('hpsPFTauDiscriminationByDecayModeFinding'),
00034         cut = cms.double(0.5)
00035     )
00036 )
00037 
00038 #copying the Discriminator by Isolation
00039 hpsPFTauDiscriminationByLooseIsolation = copy.deepcopy(pfRecoTauDiscriminationByIsolation)
00040 setTauSource(hpsPFTauDiscriminationByLooseIsolation, 'hpsPFTauProducer')
00041 hpsPFTauDiscriminationByLooseIsolation.Prediscriminants = requireDecayMode
00042 
00043 #Define a discriminator By Medium Isolation!
00044 #You need to loosen qualityCuts for this
00045 mediumPFTauQualityCuts = cms.PSet(
00046       signalQualityCuts = cms.PSet(
00047          minTrackPt                   = cms.double(0.8),  # filter PFChargedHadrons below given pt
00048          maxTrackChi2                 = cms.double(100.), # require track Chi2
00049          maxTransverseImpactParameter = cms.double(0.03), # w.r.t. PV
00050          maxDeltaZ                    = cms.double(0.2),  # w.r.t. PV
00051          minTrackPixelHits            = cms.uint32(0),    # pixel-only hits (note that these cuts are turned off,
00052                                                           # the tracking cuts might be higher)
00053          minTrackHits                 = cms.uint32(3),    # total track hits
00054          minGammaEt                   = cms.double(0.5),  # filter PFgammas below given Pt
00055          useTracksInsteadOfPFHadrons  = cms.bool(False),  # if true, use generalTracks, instead of PFChargedHadrons
00056       ),
00057       isolationQualityCuts = cms.PSet(
00058          minTrackPt                   = cms.double(0.8),
00059          maxTrackChi2                 = cms.double(100.),
00060          maxTransverseImpactParameter = cms.double(0.03),
00061          maxDeltaZ                    = cms.double(0.2),
00062          minTrackPixelHits            = cms.uint32(0),
00063          minTrackHits                 = cms.uint32(3),
00064          minGammaEt                   = cms.double(0.8),
00065          useTracksInsteadOfPFHadrons  = cms.bool(False),
00066       )
00067 )
00068 
00069 hpsPFTauDiscriminationByMediumIsolation = copy.deepcopy(pfRecoTauDiscriminationByIsolation)
00070 setTauSource(hpsPFTauDiscriminationByMediumIsolation, 'hpsPFTauProducer')
00071 hpsPFTauDiscriminationByMediumIsolation.Prediscriminants = requireDecayMode
00072 hpsPFTauDiscriminationByMediumIsolation.qualityCuts = mediumPFTauQualityCuts
00073 
00074 #Define a discriminator By Tight Isolation!
00075 #You need to loosen qualityCuts for this
00076 loosePFTauQualityCuts = cms.PSet(
00077       signalQualityCuts = cms.PSet(
00078          minTrackPt                   = cms.double(0.5),  # filter PFChargedHadrons below given pt
00079          maxTrackChi2                 = cms.double(100.), # require track Chi2
00080          maxTransverseImpactParameter = cms.double(0.03), # w.r.t. PV
00081          maxDeltaZ                    = cms.double(0.2),  # w.r.t. PV
00082          minTrackPixelHits            = cms.uint32(0),    # pixel-only hits (note that these cuts are turned off,
00083                                                           # the tracking cuts might be higher)
00084          minTrackHits                 = cms.uint32(3),    # total track hits
00085          minGammaEt                   = cms.double(0.5),  # filter PFgammas below given Pt
00086          useTracksInsteadOfPFHadrons  = cms.bool(False),  # if true, use generalTracks, instead of PFChargedHadrons
00087       ),
00088       isolationQualityCuts = cms.PSet(
00089          minTrackPt                   = cms.double(0.5),
00090          maxTrackChi2                 = cms.double(100.),
00091          maxTransverseImpactParameter = cms.double(0.03),
00092          maxDeltaZ                    = cms.double(0.2),
00093          minTrackPixelHits            = cms.uint32(0),
00094          minTrackHits                 = cms.uint32(3),
00095          minGammaEt                   = cms.double(0.5),
00096          useTracksInsteadOfPFHadrons  = cms.bool(False),
00097       )
00098 )
00099 
00100 hpsPFTauDiscriminationByTightIsolation = copy.deepcopy(pfRecoTauDiscriminationByIsolation)
00101 setTauSource(hpsPFTauDiscriminationByTightIsolation, 'hpsPFTauProducer')
00102 hpsPFTauDiscriminationByTightIsolation.Prediscriminants = requireDecayMode
00103 hpsPFTauDiscriminationByTightIsolation.qualityCuts = loosePFTauQualityCuts# set the standard quality cuts
00104 
00105 #copying discriminator against electrons and muons
00106 hpsPFTauDiscriminationAgainstElectron = copy.deepcopy(pfRecoTauDiscriminationAgainstElectron)
00107 setTauSource(hpsPFTauDiscriminationAgainstElectron, 'hpsPFTauProducer')
00108 hpsPFTauDiscriminationAgainstElectron.Prediscriminants = noPrediscriminants
00109 
00110 hpsPFTauDiscriminationAgainstMuon = copy.deepcopy(pfRecoTauDiscriminationAgainstMuon)
00111 setTauSource(hpsPFTauDiscriminationAgainstMuon, 'hpsPFTauProducer')
00112 hpsPFTauDiscriminationAgainstMuon.Prediscriminants = noPrediscriminants
00113 
00114 # Define the HPS selection discriminator used in cleaning
00115 hpsSelectionDiscriminator.PFTauProducer = cms.InputTag("combinatoricRecoTaus")
00116 
00117 # Define discriminants to use for HPS cleaning
00118 hpsTightIsolationCleaner = hpsPFTauDiscriminationByTightIsolation.clone(
00119     Prediscriminants = noPrediscriminants,
00120     PFTauProducer = cms.InputTag("combinatoricRecoTaus"),
00121 )
00122 hpsMediumIsolationCleaner = hpsPFTauDiscriminationByMediumIsolation.clone(
00123     Prediscriminants = noPrediscriminants,
00124     PFTauProducer = cms.InputTag("combinatoricRecoTaus"),
00125 )
00126 hpsLooseIsolationCleaner = hpsPFTauDiscriminationByLooseIsolation.clone(
00127     Prediscriminants = noPrediscriminants,
00128     PFTauProducer = cms.InputTag("combinatoricRecoTaus"),
00129 )
00130 
00131 import RecoTauTag.RecoTau.RecoTauCleanerPlugins as cleaners
00132 
00133 hpsPFTauProducer = cms.EDProducer(
00134     "RecoTauCleaner",
00135     src = cms.InputTag("combinatoricRecoTaus"),
00136     cleaners = cms.VPSet(
00137         # Prefer taus that dont' have charge == 3
00138         cleaners.unitCharge,
00139         # Prefer taus that pass HPS selections
00140         cms.PSet(
00141             name = cms.string("HPS_Select"),
00142             plugin = cms.string("RecoTauDiscriminantCleanerPlugin"),
00143             src = cms.InputTag("hpsSelectionDiscriminator"),
00144         ),
00145         # Then prefer those that pass isolation.  Also prefer those that pass
00146         # the tighter isolations
00147         cms.PSet(
00148             name = cms.string("TightIso"),
00149             plugin = cms.string("RecoTauDiscriminantCleanerPlugin"),
00150             src = cms.InputTag("hpsTightIsolationCleaner"),
00151         ),
00152         cms.PSet(
00153             name = cms.string("MediumIso"),
00154             plugin = cms.string("RecoTauDiscriminantCleanerPlugin"),
00155             src = cms.InputTag("hpsMediumIsolationCleaner"),
00156         ),
00157         cms.PSet(
00158             name = cms.string("LooseIso"),
00159             plugin = cms.string("RecoTauDiscriminantCleanerPlugin"),
00160             src = cms.InputTag("hpsLooseIsolationCleaner"),
00161         ),
00162         # Finally, if all this passes, take the one with less stuff in the
00163         # isolation cone.
00164         cleaners.combinedIsolation
00165     )
00166 )
00167 
00168 produceHPSPFTaus = cms.Sequence(
00169     hpsSelectionDiscriminator
00170     *hpsTightIsolationCleaner
00171     *hpsMediumIsolationCleaner
00172     *hpsLooseIsolationCleaner
00173     *hpsPFTauProducer
00174 )
00175 
00176 produceAndDiscriminateHPSPFTaus = cms.Sequence(
00177     produceHPSPFTaus*
00178     hpsPFTauDiscriminationByDecayModeFinding*
00179     hpsPFTauDiscriminationByLooseIsolation*
00180     hpsPFTauDiscriminationByMediumIsolation*
00181     hpsPFTauDiscriminationByTightIsolation*
00182     hpsPFTauDiscriminationAgainstElectron*
00183     hpsPFTauDiscriminationAgainstMuon
00184 )