hpsPFTauDiscriminationByLooseIsolationMVA2 = hpsPFTauDiscriminationByDecayModeFinding.clone(
    Prediscriminants=cms.PSet(BooleanOperator=cms.string("and"),
                              mva=cms.PSet(Producer=cms.InputTag(
                                  'hpsPFTauDiscriminationByIsolationMVA2raw'),
                                           cut=cms.double(0.85))))
hpsPFTauDiscriminationByMediumIsolationMVA2 = copy.deepcopy(
    hpsPFTauDiscriminationByLooseIsolationMVA2)
hpsPFTauDiscriminationByMediumIsolationMVA2.Prediscriminants.mva.cut = cms.double(
    0.90)
hpsPFTauDiscriminationByTightIsolationMVA2 = copy.deepcopy(
    hpsPFTauDiscriminationByLooseIsolationMVA2)
hpsPFTauDiscriminationByTightIsolationMVA2.Prediscriminants.mva.cut = cms.double(
    0.94)

from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets as _dummy
kt6PFJetsForRhoComputationVoronoi = _dummy.clone(doRhoFastjet=True,
                                                 voronoiRfact=0.9)

hpsPFTauDiscriminationByMVAIsolationSeq = cms.Sequence(
    kt6PFJetsForRhoComputationVoronoi *
    hpsPFTauDiscriminationByIsolationMVAraw *
    hpsPFTauDiscriminationByLooseIsolationMVA *
    hpsPFTauDiscriminationByMediumIsolationMVA *
    hpsPFTauDiscriminationByTightIsolationMVA *
    hpsPFTauDiscriminationByIsolationMVA2raw *
    hpsPFTauDiscriminationByLooseIsolationMVA2 *
    hpsPFTauDiscriminationByMediumIsolationMVA2 *
    hpsPFTauDiscriminationByTightIsolationMVA2)

#copying discriminator against electrons and muons
hpsPFTauDiscriminationByLooseElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone(
    PFTauProducer=cms.InputTag('hpsPFTauProducer'),
            "&& sigmaIetaIeta                                  < 0.01" +
            "&& hcalOverEcal                                   < 0.15" +
            "&& abs(1./superCluster.energy - 1./p)             < 0.05)"+
            "|| (abs(eta)  > 1.566 "+
            "&& abs(deltaEtaSuperClusterTrackAtVtx)            < 0.009"+
            "&& abs(deltaPhiSuperClusterTrackAtVtx)            < 0.10" +
            "&& sigmaIetaIeta                                  < 0.03" +
            "&& hcalOverEcal                                   < 0.10" +
            "&& abs(1./superCluster.energy - 1./p)             < 0.05))" 
            ),
        filter = cms.bool(False)
        )

from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets as dummy
kt6PFJetsForRhoComputationVoronoiMet = dummy.clone(
        doRhoFastjet = True,
        voronoiRfact = 0.9
        )

from RecoTauTag.RecoTau.PFRecoTauDiscriminationByHPSSelection_cfi import hpsSelectionDiscriminator
hpsPFTauDiscriminationByDecayModeFindingMVAMET = hpsSelectionDiscriminator.clone(
        PFTauProducer = cms.InputTag('hpsPFTauProducer')
            )

from RecoTauTag.RecoTau.TauDiscriminatorTools import requireLeadTrack
# Define decay mode prediscriminant
requireDecayMode = cms.PSet(
        BooleanOperator = cms.string("and"),
            decayMode = cms.PSet(
            Producer = cms.InputTag('hpsPFTauDiscriminationByDecayModeFindingMVAMET'),
                    cut = cms.double(0.5)
                )
#                                    minNumber = cms.uint32(0),
#                                    maxNumber = cms.uint32(0),
#                                    src = cms.InputTag("trackerDrivenOnlyElectrons")
#                                    )
#trackerDrivenRemoverSeq = cms.Sequence( trackerDrivenOnlyElectrons * trackerDrivenRemover )
#trackerDrivenRemoverSeq = cms.Sequence( trackerDrivenOnlyElectrons)


from Calibration.EcalAlCaRecoProducers.alCaIsolatedElectrons_cfi import *
from Calibration.EcalAlCaRecoProducers.AlCaElectronTracksReducer_cfi import *
from Calibration.EcalAlCaRecoProducers.eleIsoSequence_cff import *

from Calibration.EcalAlCaRecoProducers.WZElectronSkims_cff import *

from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
kt6PFJetsForRhoCorrection = kt6PFJets.clone(doRhoFastjet = True)
kt6PFJetsForRhoCorrection.Rho_EtaMax = cms.double(2.5)

#list of SCs to be used for the recHit reduction
#GsfMatchedPhotonCands = cms.EDProducer("ElectronMatchedCandidateProducer",
#   src     = cms.InputTag("goodPhotons"),
#   ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
#   deltaR =  cms.untracked.double(0.3)
#)

alcarecoEcalRecHitReducerSeq = cms.Sequence(alCaIsolatedElectrons)
alcarecoElectronTracksReducerSeq = cms.Sequence(alcaElectronTracksReducer)

# sequence that reduces the RECO format (only ECAL part) into ALCARECO
ALCARECOEcalCalElectronECALSeq = cms.Sequence( alCaIsolatedElectrons)
applyPostfix( process, 'pfElectronsFromVertex'    , postfix ).vertices = cms.InputTag( pfVertices )
applyPostfix( process, 'pfElectronsFromVertex'    , postfix ).d0Cut    = pfD0Cut
applyPostfix( process, 'pfElectronsFromVertex'    , postfix ).dzCut    = pfDzCut
applyPostfix( process, 'pfSelectedElectrons'      , postfix ).cut = pfElectronSelectionCut
#applyPostfix( process, 'isoValElectronWithCharged', postfix ).deposits[0].deltaR = pfElectronIsoConeR
#applyPostfix( process, 'isoValElectronWithNeutral', postfix ).deposits[0].deltaR = pfElectronIsoConeR
#applyPostfix( process, 'isoValElectronWithPhotons', postfix ).deposits[0].deltaR = pfElectronIsoConeR
#applyPostfix( process, 'pfIsolatedElectrons'      , postfix ).combinedIsolationCut = pfElectronCombIsoCut
applyPostfix( process, 'pfIsolatedElectrons'      , postfix ).isolationCut = pfElectronCombIsoCut
applyPostfix( process, 'patElectrons', postfix ).pvSrc = cms.InputTag( pfVertices )
applyPostfix( process, 'patMuons', postfix ).pvSrc = cms.InputTag( pfVertices )
from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
kt6PFJetsChs = kt6PFJets.clone(
    rParam        = cms.double( 0.6 )
  , src           = cms.InputTag( 'pfNoElectron' )
  , doAreaFastjet = cms.bool( True )
  , doRhoFastjet  = cms.bool( True )
  , voronoiRfact  = cms.double( -0.9 )
  )
applyPostfix( process, 'patJetCorrFactors', postfix ).primaryVertices = cms.InputTag( pfVertices )
kt6PFJetsPFChs = kt6PFJetsChs.clone( src = cms.InputTag( 'pfNoElectron' + postfix ) )
setattr( process, 'kt6PFJetsChs' + postfix, kt6PFJetsPFChs )
getattr( process, 'patPF2PATSequence' + postfix).replace( getattr( process, 'patJetCorrFactors' + postfix )
                                                        , getattr( process, 'kt6PFJetsChs' + postfix ) * getattr( process, 'patJetCorrFactors' + postfix )
                                                          )
applyPostfix( process, 'patJetCorrFactors', postfix ).rho = cms.InputTag( 'kt6PFJetsChs' + postfix, 'rho' )

# In order to have a coherent semileptonic channel also, add
# some "loose" leptons to do QCD estimates.
process.pfIsolatedMuonsLoosePFlow = process.pfIsolatedMuonsPFlow.clone(
    combinedIsolationCut = cms.double(999.0) 
Exemple #5
0
process.pfPileUpPFlow.Vertices = cms.InputTag('goodOfflinePrimaryVertices')
process.pfPileUpPFlow.verbose = True
process.pfJetsPFlow.doAreaFastjet = True
process.pfJetsPFlow.doRhoFastjet = False

from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector
process.goodOfflinePrimaryVertices = cms.EDFilter(
    "PrimaryVertexObjectFilter",
    filterParams=pvSelector.clone(minNdof=cms.double(4.0),
                                  maxZ=cms.double(24.0)),
    src=cms.InputTag('offlinePrimaryVertices'))

# Compute the mean pt per unit area (rho) from the PFCHS inputs
from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets, ak5PFJets
process.kt6PFJetsPFlow = kt6PFJets.clone(src=cms.InputTag('pfNoElectron' +
                                                          postfix),
                                         doAreaFastjet=cms.bool(True),
                                         doRhoFastjet=cms.bool(True))
process.patJetCorrFactorsPFlow.rho = cms.InputTag("kt6PFJetsPFlow", "rho")

process.ak5PFJetsPileUp = ak5PFJets.clone(src=cms.InputTag('pfPileUp' +
                                                           postfix))
"""
process.pileUpN1PrimaryVertices = cms.EDFilter("RecoTauPileUpVertexSelector",
    filter = cms.bool(False),
    src = cms.InputTag('goodOfflinePrimaryVertices'),
    minTrackSumPt = cms.double(0.)
    #minTrackSumPt = cms.double(5.)
    )

process.pileUpN2PrimaryVertices = process.pileUpN1PrimaryVertices.clone(
    src = cms.InputTag('pileUpN1PrimaryVertices')
Exemple #6
0
def rhoFor2012Aeff(process,postfix):
 from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
 process.kt6PFJetsForIsolation = kt6PFJets.clone(doRhoFastjet = True,Rho_EtaMax = 2.5)
 process.p += process.kt6PFJetsForIsolation
process.pfJetsPFlow.doAreaFastjet = True
process.pfJetsPFlow.doRhoFastjet = False

from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector

process.goodOfflinePrimaryVertices = cms.EDFilter(
    "PrimaryVertexObjectFilter",
    filterParams=pvSelector.clone(minNdof=cms.double(4.0), maxZ=cms.double(24.0)),
    src=cms.InputTag("offlinePrimaryVertices"),
)

# Compute the mean pt per unit area (rho) from the PFCHS inputs
from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets, ak5PFJets

process.kt6PFJetsPFlow = kt6PFJets.clone(
    src=cms.InputTag("pfNoElectron" + postfix), doAreaFastjet=cms.bool(True), doRhoFastjet=cms.bool(True)
)
process.patJetCorrFactorsPFlow.rho = cms.InputTag("kt6PFJetsPFlow", "rho")

process.ak5PFJetsPileUp = ak5PFJets.clone(src=cms.InputTag("pfPileUp" + postfix))

"""
process.pileUpN1PrimaryVertices = cms.EDFilter("RecoTauPileUpVertexSelector",
    filter = cms.bool(False),
    src = cms.InputTag('goodOfflinePrimaryVertices'),
    minTrackSumPt = cms.double(0.)
    #minTrackSumPt = cms.double(5.)
    )

process.pileUpN2PrimaryVertices = process.pileUpN1PrimaryVertices.clone(
    src = cms.InputTag('pileUpN1PrimaryVertices')
Exemple #8
0
import FWCore.ParameterSet.Config as cms

from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
kt6PFJets = kt6PFJets.clone( rParam = 0.6, doRhoFastjet = True )                                                                                                                                   
Exemple #9
0
#trackerDrivenRemover = cms.EDFilter("PATCandViewCountFilter",
#                                    minNumber = cms.uint32(0),
#                                    maxNumber = cms.uint32(0),
#                                    src = cms.InputTag("trackerDrivenOnlyElectrons")
#                                    )
#trackerDrivenRemoverSeq = cms.Sequence( trackerDrivenOnlyElectrons * trackerDrivenRemover )
#trackerDrivenRemoverSeq = cms.Sequence( trackerDrivenOnlyElectrons)

from Calibration.EcalAlCaRecoProducers.alCaIsolatedElectrons_cfi import *
from Calibration.EcalAlCaRecoProducers.AlCaElectronTracksReducer_cfi import *
from Calibration.EcalAlCaRecoProducers.eleIsoSequence_cff import *

from Calibration.EcalAlCaRecoProducers.WZElectronSkims_cff import *

from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
kt6PFJetsForRhoCorrection = kt6PFJets.clone(doRhoFastjet=True)
kt6PFJetsForRhoCorrection.Rho_EtaMax = cms.double(2.5)

#list of SCs to be used for the recHit reduction
#GsfMatchedPhotonCands = cms.EDProducer("ElectronMatchedCandidateProducer",
#   src     = cms.InputTag("goodPhotons"),
#   ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
#   deltaR =  cms.untracked.double(0.3)
#)

alcarecoEcalRecHitReducerSeq = cms.Sequence(alCaIsolatedElectrons)
alcarecoElectronTracksReducerSeq = cms.Sequence(alcaElectronTracksReducer)

# sequence that reduces the RECO format (only ECAL part) into ALCARECO
ALCARECOEcalCalElectronECALSeq = cms.Sequence(alCaIsolatedElectrons)
import FWCore.ParameterSet.Config as cms

#needed for MLP tagger
from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector
goodOfflinePrimaryVerticesQG = cms.EDFilter(
    "PrimaryVertexObjectFilter",
    filterParams=pvSelector.clone(minNdof=cms.double(4.0),
                                  maxZ=cms.double(24.0)),
    src=cms.InputTag('offlinePrimaryVertices'))

from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
kt6PFJetsQG = kt6PFJets.clone()
#kt6PFJetsQG = kt6PFJetsPFlow.clone()
#kt6PFJetsQG = kt6PFJets.clone( src          = cms.InputTag( 'particleFlow' )
#                                     , doRhoFastjet = True
#                                     )

#needed for Likelihood tagger
from RecoJets.JetProducers.kt4PFJets_cfi import *
#from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
kt6PFJetsIsoQG = kt4PFJets.clone(rParam=0.6, doRhoFastjet=True)
kt6PFJetsIsoQG.Rho_EtaMax = cms.double(2.5)

QGTagger = cms.EDProducer(
    'QGTagger',
    #  srcRho          = cms.InputTag('kt6PFJetsQG','rho'),
    srcRho=cms.InputTag('kt6PFJetsIsoQG', 'rho'),
    srcRhoIso=cms.InputTag('kt6PFJetsIsoQG', 'rho'),
)

QuarkGluonTagger = cms.Sequence(kt6PFJetsQG + kt6PFJetsIsoQG + QGTagger)
import FWCore.ParameterSet.Config as cms

#needed for MLP tagger
from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector
goodOfflinePrimaryVerticesQG = cms.EDFilter("PrimaryVertexObjectFilter",
    filterParams = pvSelector.clone( minNdof = cms.double(4.0), maxZ = cms.double(24.0) ),
    src          = cms.InputTag('offlinePrimaryVertices')
)

from RecoJets.Configuration.RecoPFJets_cff import kt6PFJets
kt6PFJetsQG = kt6PFJets.clone()

#needed for Likelihood tagger
from RecoJets.JetProducers.kt4PFJets_cfi import *
kt6PFJetsIsoQG = kt4PFJets.clone( rParam = 0.6, doRhoFastjet = True )
kt6PFJetsIsoQG.Rho_EtaMax = cms.double(2.5)


QGTagger = cms.EDProducer('QGTagger',
  srcRho          = cms.InputTag('kt6PFJetsQG','rho'),
  srcRhoIso       = cms.InputTag('kt6PFJetsIsoQG','rho'),
)

QuarkGluonTagger = cms.Sequence(goodOfflinePrimaryVerticesQG + kt6PFJetsQG + kt6PFJetsIsoQG + QGTagger)