CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationForChargedHiggs_cfi.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 import copy
00003 
00004 from RecoTauTag.RecoTau.PFRecoTauQualityCuts_cfi import *
00005 hplusTrackQualityCuts = PFTauQualityCuts.clone()
00006 hplusTrackQualityCuts.maxTrackChi2 = cms.double(10.)
00007 hplusTrackQualityCuts.minTrackHits = cms.uint32(8)
00008 
00009 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByLeadingTrackFinding_cfi import *
00010 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByLeadingTrackPtCut_cfi import *
00011 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByCharge_cfi import *
00012 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByECALIsolation_cfi import *
00013 from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstElectron_cfi import *
00014 from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuon_cfi import *
00015 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByTauPolarization_cfi import *
00016 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByDeltaE_cfi import *
00017 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByInvMass_cfi import *
00018 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByFlightPathSignificance_cfi import *
00019 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByNProngs_cfi import *
00020 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByTrackIsolation_cfi import *
00021 
00022 def addDiscriminator(process, tau, name, module):
00023     producerPostfix = ""
00024     if tau != "hpsTancTaus":
00025         producerPostfix = "Producer"
00026     module.PFTauProducer = cms.InputTag(tau+producerPostfix)
00027     process.__setattr__(tau+name, module)
00028     return module
00029 
00030 def addDiscriminatorSequence(process, tau):
00031     leadingTrackFinding = tau+"DiscriminationByLeadingTrackFinding"
00032     if tau == "hpsPFTau":
00033         leadingTrackFinding = tau+"DiscriminationByDecayModeFinding"
00034     
00035     lst = []
00036 
00037     lst.append(addDiscriminator(process, tau, "DiscriminationForChargedHiggsByLeadingTrackPtCut",
00038                                 pfRecoTauDiscriminationByLeadingTrackPtCut.clone(
00039                                    MinPtLeadingObject = cms.double(20.0),
00040                                    qualityCuts = hplusTrackQualityCuts
00041                                    )))
00042 
00043     lst.append(addDiscriminator(process, tau, "DiscriminationByCharge", 
00044                                 pfRecoTauDiscriminationByCharge.clone()))
00045 
00046     # index -1 points to the last element in the list
00047     lst.append(addDiscriminator(process, tau, "DiscriminationForChargedHiggsByECALIsolation", 
00048                                 pfRecoTauDiscriminationByECALIsolation.clone()))
00049     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00050 
00051     lst.append(addDiscriminator(process, tau, "DiscriminationForChargedHiggsAgainstElectron",
00052                                 pfRecoTauDiscriminationAgainstElectron.clone()))
00053     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00054 
00055     lst.append(addDiscriminator(process, tau, "DiscriminationForChargedHiggsAgainstMuon",
00056                                 pfRecoTauDiscriminationAgainstMuon.clone()))
00057     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00058 
00059     lst.append(addDiscriminator(process, tau, "DiscriminationByTauPolarization",
00060                                 pfRecoTauDiscriminationByTauPolarization.clone()))
00061     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00062 
00063     lst.append(addDiscriminator(process, tau, "DiscriminationByDeltaE",
00064                                 pfRecoTauDiscriminationByDeltaE.clone()))
00065     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00066     
00067     lst.append(addDiscriminator(process, tau, "DiscriminationByInvMass",
00068                                 pfRecoTauDiscriminationByInvMass.clone()))
00069     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00070 
00071     lst.append(addDiscriminator(process, tau, "DiscriminationByFlightPathSignificance",
00072                                 pfRecoTauDiscriminationByFlightPathSignificance.clone()))
00073     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00074 
00075     lst.append(addDiscriminator(process, tau, "DiscriminationBy1Prong",
00076                                 pfRecoTauDiscriminationByNProngs.clone(
00077                                   nProngs = cms.uint32(1)
00078                                   )))
00079     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00080 
00081     lst.append(addDiscriminator(process, tau, "DiscriminationBy3Prongs",
00082                                 pfRecoTauDiscriminationByNProngs.clone(
00083                                   nProngs = cms.uint32(3)
00084                                   )))
00085     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00086 
00087     lst.append(addDiscriminator(process, tau, "DiscriminationForChargedHiggsBy3ProngCombined",
00088                                 pfRecoTauDiscriminationByNProngs.clone(
00089                                   nProngs = cms.uint32(3),
00090                                   Prediscriminants = cms.PSet(
00091                                        BooleanOperator = cms.string("and"),
00092                                        leadTrack = cms.PSet(
00093                                            Producer = cms.InputTag(leadingTrackFinding),
00094                                            cut = cms.double(0.5)
00095                                        ),
00096                                        deltaE = cms.PSet(
00097                                            Producer = cms.InputTag(tau+'DiscriminationByDeltaE'),
00098                                            cut = cms.double(0.5)
00099                                        ),
00100                                        invMass = cms.PSet(
00101                                            Producer = cms.InputTag(tau+'DiscriminationByInvMass'),
00102                                            cut = cms.double(0.5)
00103                                        ),
00104                                        flightPathSig = cms.PSet(
00105                                            Producer = cms.InputTag(tau+'DiscriminationByFlightPathSignificance'),
00106                                            cut = cms.double(0.5)
00107                                        )
00108                                   )
00109                                 )))
00110     lst[-1].Prediscriminants.leadTrack.Producer = cms.InputTag(leadingTrackFinding)
00111 
00112     lst.append(addDiscriminator(process, tau, "DiscriminationForChargedHiggsBy1or3Prongs",
00113                                 pfRecoTauDiscriminationByLeadingTrackFinding.clone(
00114                                     Prediscriminants = cms.PSet(
00115                                         BooleanOperator = cms.string("or"),
00116                                         oneProng = cms.PSet(
00117                                             Producer = cms.InputTag(tau+'DiscriminationBy1Prong'),
00118                                             cut = cms.double(0.5)
00119                                         ),
00120                                         threeProng = cms.PSet(
00121                                             Producer = cms.InputTag(tau+'DiscriminationForChargedHiggsBy3ProngCombined'),
00122                                             cut = cms.double(0.5)
00123                                         )
00124                                     )
00125                                 )))
00126     lst.append(addDiscriminator(process, tau, "DiscriminationForChargedHiggs",
00127                                 pfRecoTauDiscriminationByTrackIsolation.clone(
00128                                      Prediscriminants = cms.PSet(
00129                                         BooleanOperator = cms.string("and"),
00130                                         leadingTrack = cms.PSet(
00131                                             Producer = cms.InputTag(tau+'DiscriminationForChargedHiggsByLeadingTrackPtCut'),
00132                                             cut = cms.double(0.5)
00133                                         ),
00134                                         charge = cms.PSet(
00135                                             Producer = cms.InputTag(tau+'DiscriminationByCharge'),
00136                                             cut = cms.double(0.5)
00137                                         ),
00138                                         ecalIsolation = cms.PSet(
00139                                             Producer = cms.InputTag(tau+'DiscriminationForChargedHiggsByECALIsolation'),
00140                                             cut = cms.double(0.5)
00141                                         ),
00142                                         electronVeto = cms.PSet(
00143                                             Producer = cms.InputTag(tau+'DiscriminationForChargedHiggsAgainstElectron'),
00144                                             cut = cms.double(0.5)
00145                                         ),
00146                                         polarization = cms.PSet(
00147                                             Producer = cms.InputTag(tau+'DiscriminationByTauPolarization'),
00148                                             cut = cms.double(0.5)
00149                                         ),
00150                                         prongs = cms.PSet(
00151                                             Producer = cms.InputTag(tau+'DiscriminationForChargedHiggsBy1or3Prongs'),
00152                                             cut = cms.double(0.5)
00153                                         )
00154                                     )
00155                                 )))
00156 
00157     sequence = cms.Sequence()
00158     for m in lst:
00159         sequence *= m
00160 
00161     process.__setattr__(tau+"HplusDiscriminationSequence", sequence)
00162     return sequence
00163 
00164 def addPFTauDiscriminationSequenceForChargedHiggs(process, tauAlgos=["shrinkingConePFTau"]):
00165     process.PFTauDiscriminationSequenceForChargedHiggs = cms.Sequence()
00166     for algo in tauAlgos:
00167         process.PFTauDiscriminationSequenceForChargedHiggs *= addDiscriminatorSequence(process, algo)
00168 
00169     return process.PFTauDiscriminationSequenceForChargedHiggs