# select QCD background enriched event sample
#--------------------------------------------------------------------------------

#--------------------------------------------------------------------------------  
# produce collection of pat::Muons
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.patMuonSelection_cfi import *

muonsBgEstQCDenrichedPFRelIso = copy.deepcopy(selectedPatMuonsPFRelIso)
muonsBgEstQCDenrichedPFRelIso.sumPtMin = cms.double(0.10)
muonsBgEstQCDenrichedPFRelIso.sumPtMax = cms.double(0.30)

muonSelConfiguratorBgEstQCDenriched = objSelConfigurator(
    [ muonsBgEstQCDenrichedPFRelIso ],
    src = "selectedPatMuonsPt15Cumulative",
    pyModuleName = __name__,
    doSelIndividual = False
)

selectMuonsBgEstQCDenriched = muonSelConfiguratorBgEstQCDenriched.configure(pyNameSpace = locals())

#--------------------------------------------------------------------------------  
# produce collection of pat::Taus
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.patPFTauSelection_cfi import *
from TauAnalysis.RecoTools.patPFTauSelectionForMuTau_cfi import *
#
# Note: probability for quark/gluon jets to pass tau track and ECAL isolation criteria
#       is higher for low Pt than for high Pt jets; the consequence is that muon + tau-jet visible invariant mass distribution
#       gets shifted towards higher values in case tau track and ECAL isolation criteria are not applied.
#--------------------------------------------------------------------------------
# produce collection of pat::Muons
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.patMuonSelection_cfi import *

muonsBgEstTTplusJetsEnrichedVbTfId = copy.deepcopy(selectedPatMuonsVbTfId)

muonsBgEstTTplusJetsEnrichedPFRelIso = copy.deepcopy(selectedPatMuonsPFRelIso)
muonsBgEstTTplusJetsEnrichedPFRelIso.sumPtMax = cms.double(0.10)

muonSelConfiguratorBgEstTTplusJetsEnriched = objSelConfigurator(
    [ muonsBgEstTTplusJetsEnrichedVbTfId,
      muonsBgEstTTplusJetsEnrichedPFRelIso ],
    src = "selectedPatMuonsPt15Cumulative",
    pyModuleName = __name__,
    doSelIndividual = False
)

selectMuonsBgEstTTplusJetsEnriched = muonSelConfiguratorBgEstTTplusJetsEnriched.configure(pyNameSpace = locals())

#--------------------------------------------------------------------------------  
# produce collection of vertices compatible with background-enriched lepton collections
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.recoVertexSelectionForMuTau_cff import *

selectedPrimaryVertexForMuTauBgEstTTplusJetsEnriched = selectedPrimaryVertexForMuTau.clone(
    srcParticles = cms.VInputTag(
        'muonsBgEstTTplusJetsEnrichedPFRelIsoCumulative',
)

# select jets not identified as tau-jets
selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVeto = cms.EDFilter("PATJetAntiOverlapSelector",
    srcNotToBeFiltered = cms.VInputTag(
        "selectedPatTausForDiTau1stElectronVetoCumulative",
        "selectedPatTausForDiTau2ndElectronVetoCumulative"
    ),                                                           
    dRmin = cms.double(0.7),
    filter = cms.bool(False)                                           
)

patJetSelConfiguratorForZtoDiTau = objSelConfigurator(
    [ selectedPatJetsForZtoDiTauEta21,
      selectedPatJetsForZtoDiTauEt20,
      selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVeto ],
    src = "cleanPatJets",
    pyModuleName = __name__,
    doSelIndividual = True
)

selectPatJetsForZtoDiTau = patJetSelConfiguratorForZtoDiTau.configure(pyNameSpace = locals())

# define additional collections of jets
# not overlapping with "loosely" selected tau-jets
# (NOTE: to be used for the purpose of factorizing efficiencies
#        of muon isolation from other event selection criteria,
#        in order to avoid problems with limited Monte Carlo statistics)

selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVetoLoose2ndTau = selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVeto.clone(
    srcNotToBeFiltered = cms.VInputTag(
        "selectedPatTausForDiTau1stElectronVetoCumulative",
Exemple #4
0
    filter = cms.bool(False)
)

selectedVBFEventHypothesesForAHtoElecTauTagJetDEta35 = cms.EDFilter("PATElecTauPairVBFEventSelector",
    cut = cms.string('dEta > 4.0'),
    filter = cms.bool(False)
)

selectedVBFEventHypothesesForAHtoElecTauTagJetMass350 = cms.EDFilter("PATElecTauPairVBFEventSelector",
    cut = cms.string('mjj > 400'),
    filter = cms.bool(False)
)

selectedVBFEventHypothesesForAHtoElecTau3rdJetVeto = cms.EDFilter("PATElecTauPairVBFEventSelector",
    cut = cms.string('centralJets.size < 1'),
    filter = cms.bool(False)
)

vbfEventHypothesesSelConfiguratorForAHtoElecTau = objSelConfigurator(
    [ selectedVBFEventHypothesesForAHtoElecTauTagJetEt30,
      selectedVBFEventHypothesesForAHtoElecTauTagJetOpposHemisphere,
      selectedVBFEventHypothesesForAHtoElecTauTagJetDEta35,
      selectedVBFEventHypothesesForAHtoElecTauTagJetMass350,
      selectedVBFEventHypothesesForAHtoElecTau3rdJetVeto ],
    src = "allVBFEventHypothesesForAHtoElecTau",
    pyModuleName = __name__,
    doSelIndividual = True
)

selectVBFEventHypothesesForAHtoElecTau = vbfEventHypothesesSelConfiguratorForAHtoElecTau.configure(pyNameSpace = locals())
#electronsBgEstPhotonPlusJetsEnrichedConversionVeto.dRElecTrackMax = cms.double(0.1)
#electronsBgEstPhotonPlusJetsEnrichedConversionVeto.doPixCut = cms.bool(False)
electronsBgEstPhotonPlusJetsEnrichedConversionVeto.doMissingHitsCut = cms.bool(True)
electronsBgEstPhotonPlusJetsEnrichedConversionVeto.nConvPairMax = cms.double(10)
#electronsBgEstPhotonPlusJetsEnrichedConversionVeto.useConversionColl = cms.bool(False)

produceNonConversionElectronsBgEstPhotonPlusJetsEnriched =  cms.Sequence(electronsBgEstPhotonPlusJetsEnrichedConversionVeto)

electronsBgEstPhotonPlusJetsEnrichedTrkIP = copy.deepcopy(electronsBgEstZtautauEnrichedTrkIP)

electronSelConfiguratorBgEstPhotonPlusJetsEnriched = objSelConfigurator(
    [ electronsBgEstPhotonPlusJetsEnrichedId,
##      electronsBgEstPhotonPlusJetsEnrichedAntiCrackCut,
      electronsBgEstPhotonPlusJetsEnrichedEta,
      electronsBgEstPhotonPlusJetsEnrichedPt,
      electronsBgEstPhotonPlusJetsEnrichedIso,
      electronsBgEstPhotonPlusJetsEnrichedTrkIP
      ],
    src = "cleanPatElectrons",
    pyModuleName = __name__,
    doSelIndividual = False
)


selectElectronsBgEstPhotonPlusJetsEnriched = electronSelConfiguratorBgEstPhotonPlusJetsEnriched.configure(pyNameSpace = locals())

   
#--------------------------------------------------------------------------------  
# produce collection of pat::Taus
#--------------------------------------------------------------------------------

# require tau candidate not to overlap with selected electrons
# on how to use the cut-string parser
selectedPatPFMETsPt25 = cms.EDFilter("PATMETSelector",
                                     src = cms.InputTag("patPFMETs"),
                                     cut = cms.string('pt > 25.'),
                                     filter = cms.bool(False)
                                     )
selectedPatPFMETsPt30 = cms.EDFilter("PATMETSelector",
                                        src = cms.InputTag("patPFMETs"),
                                        cut = cms.string('pt > 35.'),
#                                     cut = cms.string('pt > 0.'),
                                        filter = cms.bool(False)
                                        )
selectedPatPFMETsPt45 = cms.EDFilter("PATMETSelector",
                                        src = cms.InputTag("patPFMETs"),
                                        cut = cms.string('pt > 45'),
                                        filter = cms.bool(False)
                                        )


patPFMETSelConfigurator = objSelConfigurator(
    [ selectedPatPFMETsPt25,
      selectedPatPFMETsPt30,
      selectedPatPFMETsPt45 ],
    src = 'patPFMETs',
    pyModuleName = __name__,
    doSelIndividual = False
    )

selectPatPFMETs = patPFMETSelConfigurator.configure(pyNameSpace = locals())

#--------------------------------------------------------------------------------

#--------------------------------------------------------------------------------
# produce collection of pat::Muons
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.patMuonSelection_cfi import *

muonsBgEstTTplusJetsEnrichedVbTfId = copy.deepcopy(selectedPatMuonsVbTfId)

muonsBgEstTTplusJetsEnrichedPFRelIso = copy.deepcopy(selectedPatMuonsPFRelIso)
muonsBgEstTTplusJetsEnrichedPFRelIso.sumPtMax = cms.double(0.10)

muonSelConfiguratorBgEstTTplusJetsEnriched = objSelConfigurator(
    [muonsBgEstTTplusJetsEnrichedVbTfId, muonsBgEstTTplusJetsEnrichedPFRelIso],
    src="selectedPatMuonsPt15Cumulative",
    pyModuleName=__name__,
    doSelIndividual=False)

selectMuonsBgEstTTplusJetsEnriched = muonSelConfiguratorBgEstTTplusJetsEnriched.configure(
    pyNameSpace=locals())

#--------------------------------------------------------------------------------
# produce collection of vertices compatible with background-enriched lepton collections
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.recoVertexSelectionForMuTau_cff import *

selectedPrimaryVertexForMuTauBgEstTTplusJetsEnriched = selectedPrimaryVertexForMuTau.clone(
    srcParticles=cms.VInputTag(
        'muonsBgEstTTplusJetsEnrichedPFRelIsoCumulative',
    cut = cms.string("isValid & ndof >= 7 & chi2 > 0 & tracksSize > 0")
)
process.selectedPrimaryVertexPositionForElectronId = selectedPrimaryVertexPosition.clone(
    src = cms.InputTag('selectedPrimaryVertexQualityForElectronId')
)
process.selectedPrimaryVertexHighestPtTrackSumForElectronId = selectedPrimaryVertexHighestPtTrackSum.clone(
    vertices = cms.InputTag('selectedPrimaryVertexPositionForElectronId')
)
process.load("TauAnalysis/RecoTools/patLeptonSelection_cff")
process.selectedPatElectronsForElecTauId.srcVertex = cms.InputTag('selectedPrimaryVertexHighestPtTrackSumForElectronId')
from TauAnalysis.CandidateTools.tools.objSelConfigurator import *
patElectronSelConfiguratorForSVfitTrackLikelihood = objSelConfigurator(
    [ process.selectedPatElectronsForElecTauId,
      process.selectedPatElectronsForElecTauAntiCrackCut,
      process.selectedPatElectronsForElecTauEta,
      process.selectedPatElectronsForElecTauIso,
      process.selectedPatElectronsForElecTauConversionVeto ],
    src = 'patElectronsForSVfitTrackLikelihood',
    doSelIndividual = False
)
process.selectPatElectronsForSVfitTrackLikelihood = patElectronSelConfiguratorForSVfitTrackLikelihood.configure(process = process)
process.electronSelectionSequence = cms.Sequence(
    process.patElectronsForSVfitTrackLikelihood
   + process.selectedPrimaryVertexQualityForElectronId + process.selectedPrimaryVertexPositionForElectronId + process.selectedPrimaryVertexHighestPtTrackSumForElectronId
   + process.selectPatElectronsForSVfitTrackLikelihood
)
process.testSVfitTrackLikelihoodProductionSequence += process.electronSelectionSequence

process.genMatchedPatElectrons = cms.EDFilter("PATElectronAntiOverlapSelector",
    src = cms.InputTag('selectedPatElectronsForElecTauConversionVetoCumulative'),                  
    srcNotToBeFiltered = cms.VInputTag(genElectronsFromTauDecays),
#       could extract W + jets template shape from difference in muon + tau-jet visible invariant mass distributions
#       of opposite sign - same sign muon and tau-jet combinations.
#      (SS/OS ratio is close to one for QCD background; significant charge asymmetry expected for W + jets background)
#    
muonsBgEstWplusJetsEnrichedPt = copy.deepcopy(selectedPatMuonsPt15)
muonsBgEstWplusJetsEnrichedPt.cut = cms.string('pt > 15.')

muonsBgEstWplusJetsEnrichedVbTfId = copy.deepcopy(selectedPatMuonsVbTfId)

muonsBgEstWplusJetsEnrichedPFRelIso = copy.deepcopy(selectedPatMuonsPFRelIso)
muonsBgEstWplusJetsEnrichedPFRelIso.sumPtMax = cms.double(0.10)

muonSelConfiguratorBgEstWplusJetsEnriched = objSelConfigurator(
    [ muonsBgEstWplusJetsEnrichedPt,
      muonsBgEstWplusJetsEnrichedVbTfId,
      muonsBgEstWplusJetsEnrichedPFRelIso ],
    src = "selectedPatMuonsEta21Cumulative",
    pyModuleName = __name__,
    doSelIndividual = False
)

selectMuonsBgEstWplusJetsEnriched = muonSelConfiguratorBgEstWplusJetsEnriched.configure(pyNameSpace = locals())

#--------------------------------------------------------------------------------  
# produce collection of pat::Taus
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.patPFTauSelection_cfi import *
from TauAnalysis.RecoTools.patPFTauSelectionForMuTau_cfi import *
#
# Note: probability for quark/gluon jets to pass tau track and ECAL isolation criteria
#       is higher for low Pt than for high Pt jets; the consequence is that muon + tau-jet visible invariant mass distribution
import FWCore.ParameterSet.Config as cms
import copy

from TauAnalysis.CandidateTools.tools.objSelConfigurator import *

#--------------------------------------------------------------------------------
# produce collections of tau-jet + MET pairs passing selection criteria
#--------------------------------------------------------------------------------

selectedTauNuPairsDPhiMetTau = cms.EDFilter("PATTauNuPairSelector",
                                            cut=cms.string('dPhi() > 0.3'),
                                            filter=cms.bool(False))

selectedTauNuPairsMt40 = cms.EDFilter("PATTauNuPairSelector",
                                      cut=cms.string('mt() > 40'),
                                      filter=cms.bool(False))

patTauNuPairSelConfigurator = objSelConfigurator(
    [
        #selectedTauNuPairsDPhiMetTau
        selectedTauNuPairsMt40
    ],
    src="allTauNuPairs",
    pyModuleName=__name__,
    doSelIndividual=False)

selectTauNuPairs = patTauNuPairSelConfigurator.configure(pyNameSpace=locals())
selectedElecTauPairsZeroCharge = cms.EDFilter(
    "PATElecTauPairSelector", cut=cms.string("charge = 0"), filter=cms.bool(False)
)

# require electron and tau to form a non-zero-charge pair
selectedElecTauPairsNonZeroCharge = cms.EDFilter(
    "PATElecTauPairSelector", cut=cms.string("charge != 0"), filter=cms.bool(False)
)

# configure production sequence
patElecTauPairSelConfiguratorOS = objSelConfigurator(
    [
        selectedElecTauPairsAntiOverlapVeto,
        selectedElecTauPairsMt1MET,
        selectedElecTauPairsPzetaDiff,
        selectedElecTauPairsZeroCharge,
    ],
    src="allElecTauPairs",
    pyModuleName=__name__,
    doSelIndividual=True,
)

selectElecTauPairsOS = patElecTauPairSelConfiguratorOS.configure(pyNameSpace=locals())

patElecTauPairSelConfiguratorSS = objSelConfigurator(
    [selectedElecTauPairsNonZeroCharge],
    src="selectedElecTauPairsPzetaDiffCumulative",
    pyModuleName=__name__,
    doSelIndividual=True,
)
    dRmin=cms.double(0.7),
    filter=cms.bool(False),
)

# select jets passing b-tagging discriminator
# (>= 3 tracks with impact parameter significance > 2.0)
selectedPatJetsForAHtoMuTauBtag = cms.EDFilter(
    "PATJetSelector", cut=cms.string('bDiscriminator("trackCountingHighEffBJetTags") > 2.5'), filter=cms.bool(False)
)

patJetSelConfiguratorForAHtoMuTau = objSelConfigurator(
    [
        selectedPatJetsForAHtoMuTauEta21,
        selectedPatJetsForAHtoMuTauEt20,
        selectedPatJetsForAHtoMuTauAntiOverlapWithLeptonsVeto,
        selectedPatJetsForAHtoMuTauBtag,
    ],
    src="cleanPatJets",
    pyModuleName=__name__,
    doSelIndividual=True,
)

selectPatJetsForAHtoMuTau = patJetSelConfiguratorForAHtoMuTau.configure(pyNameSpace=locals())

# define additional collections of jets
# not overlapping with "loosely" isolated muons
# (NOTE: to be used for the purpose of factorizing efficiencies
#        of muon isolation from other event selection criteria,
#        in order to avoid problems with limited Monte Carlo statistics)

selectedPatJetsForAHtoMuTauAntiOverlapWithLeptonsVetoLooseMuonIsolation = selectedPatJetsForAHtoMuTauAntiOverlapWithLeptonsVeto.clone(
        "selectedPatElectronsTrkIPcumulative",
        "selectedPatMuonsTrkIPcumulative",
        "selectedPatTausProngCumulative"
    ),                                                           
    dRmin = cms.double(0.7),
    filter = cms.bool(False)                                           
)

# select central jets
selectedPatJetsEta21 = cms.EDFilter("PATJetSelector",
    cut = cms.string('abs(eta) < 2.1'),
    filter = cms.bool(False)
)

# select jets with Et > 20 GeV
selectedPatJetsEt20 = cms.EDFilter("PATJetSelector",
    cut = cms.string('et > 20.'), 
    filter = cms.bool(False)
)

patJetSelConfigurator = objSelConfigurator(
    [ selectedPatJetsAntiOverlapWithLeptonsVeto,
      selectedPatJetsEta21,
      selectedPatJetsEt20 ],
    src = "patJets",
    pyModuleName = __name__,
    doSelIndividual = False
)

selectPatJets = patJetSelConfigurator.configure(pyNameSpace = locals())
Exemple #14
0
    selectedElecTauPairsMt1MET)
selectedElecTauPairsForAHtoElecTauMt1MET.cut = cms.string('mt1MET < 4000.')

selectedElecTauPairsForAHtoElecTauPzetaDiff = copy.deepcopy(
    selectedElecTauPairsPzetaDiff)
selectedElecTauPairsForAHtoElecTauPzetaDiff.cut = cms.string(
    '(pZeta - 1.5*pZetaVis) > -20.')

selectedElecTauPairsForAHtoElecTauZeroCharge = copy.deepcopy(
    selectedElecTauPairsZeroCharge)

patElecTauPairSelConfiguratorForAHtoElecTauOS = objSelConfigurator(
    [
        selectedElecTauPairsForAHtoElecTauAntiOverlapVeto,
        selectedElecTauPairsForAHtoElecTauMt1MET,
        selectedElecTauPairsForAHtoElecTauPzetaDiff,
        selectedElecTauPairsForAHtoElecTauZeroCharge
    ],
    src="allElecTauPairs",
    pyModuleName=__name__,
    doSelIndividual=True)

selectElecTauPairsForAHtoElecTauOS = patElecTauPairSelConfiguratorForAHtoElecTauOS.configure(
    pyNameSpace=locals())

selectedElecTauPairsForAHtoElecTauNonZeroCharge = copy.deepcopy(
    selectedElecTauPairsNonZeroCharge)

patElecTauPairSelConfiguratorForAHtoElecTauSS = objSelConfigurator(
    [selectedElecTauPairsForAHtoElecTauNonZeroCharge],
    src="selectedElecTauPairsForAHtoElecTauPzetaDiffCumulative",
    pyModuleName=__name__,
Exemple #15
0
# select forward/backward jets jets with Et > 20 GeV
selectedPatTagJetsForVBFEt20 = cms.EDFilter("PATJetSelector",
                                            cut=cms.string('et > 20.'),
                                            filter=cms.bool(False))

# select forward/backward jets jets with Et > 30 GeV
# (used for 3rd jet veto)
selectedPatTagJetsForVBFEt30 = cms.EDFilter("PATJetSelector",
                                            cut=cms.string('et > 30.'),
                                            filter=cms.bool(False))

patTagJetSelConfiguratorForVBF = objSelConfigurator([
    selectedPatTagJetsForVBFEta99, selectedPatTagJetsForVBFEt20,
    selectedPatTagJetsForVBFEt30
],
                                                    src="patJets",
                                                    pyModuleName=__name__,
                                                    doSelIndividual=False)

selectPatTagJetsForVBF = patTagJetSelConfiguratorForVBF.configure(
    pyNameSpace=locals())

# select central jets
selectedPatCentralJetsForVBFEta25 = cms.EDFilter(
    "PATJetSelector", cut=cms.string('abs(eta) < 2.5'), filter=cms.bool(False))

# select central jets with Et > 15 GeV
selectedPatCentralJetsForVBFEt15 = cms.EDFilter("PATJetSelector",
                                                cut=cms.string('et > 15.'),
                                                filter=cms.bool(False))
selectedPatElectronsAntiCrackCut.cut = cms.string('abs(superCluster.eta) < 1.444 | abs(superCluster.eta) > 1.566')
selectedPatElectronsEta21.cut = cms.string('abs(eta) < 2.1')
selectedPatElectronsPt15.cut = cms.string('pt > 15.')
selectedPatElectronsTrkIso.cut = cms.string('userIsolation("pat::TrackIso") < 1.')
selectedPatElectronsEcalIso.cut = cms.string('(abs(superCluster.eta) < 1.479 & userIsolation("pat::EcalIso") < 2.5) | (abs(superCluster.eta) > 1.479 & userIsolation("pat::EcalIso") < 3.5)')
selectedPatElectronsTrk.cut = cms.string('gsfTrack.isNonnull')
selectedPatElectronsTrkIP.vertexSource = cms.InputTag("selectedPrimaryVertexHighestPtTrackSum")
selectedPatElectronsTrkIP.IpMax = cms.double(0.05)

patElectronSelConfigurator = objSelConfigurator(
    [ selectedPatElectronsTightId,
      selectedPatElectronsAntiCrackCut,
      selectedPatElectronsEta21,
      selectedPatElectronsPt15,
      selectedPatElectronsTrkIso,
      selectedPatElectronsEcalIso,
      selectedPatElectronsTrk,
      selectedPatElectronsTrkIP ],
    src = "cleanPatElectrons",
    pyModuleName = __name__,
    doSelIndividual = True
)

selectPatElectrons = patElectronSelConfigurator.configure(pyNameSpace = locals())

selectedPatElectronsTrkIsoLooseIsolation.cut = cms.string('userIsolation("pat::TrackIso") < 8.')
selectedPatElectronsEcalIsoLooseIsolation.cut = cms.string('userIsolation("pat::EcalIso") < 8.')
selectedPatElectronsTrkLooseIsolation.cut = selectedPatElectronsTrk.cut
selectedPatElectronsTrkIPlooseIsolation.vertexSource = selectedPatElectronsTrkIP.vertexSource
selectedPatElectronsTrkIPlooseIsolation.IpMax = selectedPatElectronsTrkIP.IpMax
                                              cut=cms.string('et > 20.'),
                                              filter=cms.bool(False))

# select jets not identified as tau-jets
selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVeto = cms.EDFilter(
    "PATJetAntiOverlapSelector",
    srcNotToBeFiltered=cms.VInputTag(
        "selectedPatTausForDiTau1stElectronVetoCumulative",
        "selectedPatTausForDiTau2ndElectronVetoCumulative"),
    dRmin=cms.double(0.7),
    filter=cms.bool(False))

patJetSelConfiguratorForZtoDiTau = objSelConfigurator([
    selectedPatJetsForZtoDiTauEta21, selectedPatJetsForZtoDiTauEt20,
    selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVeto
],
                                                      src="cleanPatJets",
                                                      pyModuleName=__name__,
                                                      doSelIndividual=True)

selectPatJetsForZtoDiTau = patJetSelConfiguratorForZtoDiTau.configure(
    pyNameSpace=locals())

# define additional collections of jets
# not overlapping with "loosely" selected tau-jets
# (NOTE: to be used for the purpose of factorizing efficiencies
#        of muon isolation from other event selection criteria,
#        in order to avoid problems with limited Monte Carlo statistics)

selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVetoLoose2ndTau = selectedPatJetsForZtoDiTauAntiOverlapWithLeptonsVeto.clone(
    srcNotToBeFiltered=cms.VInputTag(
    cut = cms.string('et > 150.'), 
    filter = cms.bool(False)
)

# select jets passing b-tagging discriminator
# (>= 3 tracks with impact parameter significance > 2.0)
selectedPatJetsForAHtoElecTauBtag = cms.EDFilter("PATJetSelector",
    cut = cms.string('bDiscriminator("trackCountingHighEffBJetTags") > 3.3'), 
    filter = cms.bool(False)
)

patJetSelConfiguratorForAHtoElecTauBtag = objSelConfigurator(
    [ selectedPatJetsForAHtoElecTauEta,
      selectedPatJetsForAHtoElecTauEt,
      selectedPatJetsForAHtoElecTauAntiOverlapWithLeptonsVeto,
      selectedPatJetsForAHtoElecTauBtag ],
    src = "patJets",
    pyModuleName = __name__,
    doSelIndividual = True
)

selectPatJetsForAHtoElecTauBtag = patJetSelConfiguratorForAHtoElecTauBtag.configure(pyNameSpace = locals())

patJetSelConfiguratorForAHtoElecTauJetTag = objSelConfigurator(
    [ selectedPatJetsForAHtoElecTauJetTag,
      selectedPatJetsForAHtoElecTauBoostedJetTag],
    src = 'selectedPatJetsForAHtoElecTauAntiOverlapWithLeptonsVetoCumulative',
    pyModuleName = __name__,
    doSelIndividual = True
)
Exemple #19
0
# (settings made here overwrite values defined in elecMuPairSelector_cfi)
#--------------------------------------------------------------------------------

selectedElecMuPairsAntiOverlapVeto.cut = cms.string('dR12 > 1.57')
selectedElecMuPairsZeroCharge.cut = cms.string('charge = 0')
selectedElecMuPairsAcoplanarity12.cut = cms.string('cos(dPhi12) > -1.01')
selectedElecMuPairsMt1MET.cut = cms.string('mt1MET < 50.')
selectedElecMuPairsMt2MET.cut = cms.string('mt2MET < 50.')
selectedElecMuPairsPzetaDiff.cut = cms.string('(pZeta - 1.5*pZetaVis) > -20.')

patElecMuPairSelConfigurator = objSelConfigurator(
    [ selectedElecMuPairsAntiOverlapVeto,
      selectedElecMuPairsZeroCharge,
      selectedElecMuPairsAcoplanarity12,
      selectedElecMuPairsMt1MET,
      selectedElecMuPairsMt2MET,
      selectedElecMuPairsPzetaDiff ],
    src = "allElecMuPairs",
    pyModuleName = __name__,
    doSelIndividual = True
)

selectElecMuPairs = patElecMuPairSelConfigurator.configure(pyNameSpace = locals())

selectedElecMuPairsAntiOverlapVetoLooseElectronIsolation.cut = selectedElecMuPairsAntiOverlapVeto.cut
selectedElecMuPairsZeroChargeLooseElectronIsolation.cut = selectedElecMuPairsZeroCharge.cut
selectedElecMuPairsAcoplanarity12LooseElectronIsolation.cut = selectedElecMuPairsAcoplanarity12.cut
selectedElecMuPairsMt1METlooseElectronIsolation.cut = selectedElecMuPairsMt1MET.cut
selectedElecMuPairsMt2METlooseElectronIsolation.cut = selectedElecMuPairsMt2MET.cut
selectedElecMuPairsPzetaDiffLooseElectronIsolation.cut = selectedElecMuPairsPzetaDiff.cut
selectedPatTagJetsForVBFEt20 = cms.EDFilter("PATJetSelector",
    cut = cms.string('et > 20.'), 
    filter = cms.bool(False)
)

# select forward/backward jets jets with Et > 30 GeV
# (used for 3rd jet veto)
selectedPatTagJetsForVBFEt30 = cms.EDFilter("PATJetSelector",
    cut = cms.string('et > 30.'), 
    filter = cms.bool(False)
)

patTagJetSelConfiguratorForVBF = objSelConfigurator(
    [ selectedPatTagJetsForVBFEta99,
      selectedPatTagJetsForVBFEt20,
      selectedPatTagJetsForVBFEt30 ],
    src = "patJets",
    pyModuleName = __name__,
    doSelIndividual = False
)

selectPatTagJetsForVBF = patTagJetSelConfiguratorForVBF.configure(pyNameSpace = locals())

# select central jets
selectedPatCentralJetsForVBFEta25 = cms.EDFilter("PATJetSelector",
    cut = cms.string('abs(eta) < 2.5'),
    filter = cms.bool(False)
)

# select central jets with Et > 15 GeV
selectedPatCentralJetsForVBFEt15 = cms.EDFilter("PATJetSelector",
    cut = cms.string('et > 15.'),
# select jets with Et > 150 GeV (for SM boosted category)
selectedPatJetsForAHtoElecTauBoostedJetTag = cms.EDFilter(
    "PATJetSelector", cut=cms.string('et > 150.'), filter=cms.bool(False))

# select jets passing b-tagging discriminator
# (>= 3 tracks with impact parameter significance > 2.0)
selectedPatJetsForAHtoElecTauBtag = cms.EDFilter(
    "PATJetSelector",
    cut=cms.string('bDiscriminator("trackCountingHighEffBJetTags") > 3.3'),
    filter=cms.bool(False))

patJetSelConfiguratorForAHtoElecTauBtag = objSelConfigurator(
    [
        selectedPatJetsForAHtoElecTauEta, selectedPatJetsForAHtoElecTauEt,
        selectedPatJetsForAHtoElecTauAntiOverlapWithLeptonsVeto,
        selectedPatJetsForAHtoElecTauBtag
    ],
    src="patJets",
    pyModuleName=__name__,
    doSelIndividual=True)

selectPatJetsForAHtoElecTauBtag = patJetSelConfiguratorForAHtoElecTauBtag.configure(
    pyNameSpace=locals())

patJetSelConfiguratorForAHtoElecTauJetTag = objSelConfigurator(
    [
        selectedPatJetsForAHtoElecTauJetTag,
        selectedPatJetsForAHtoElecTauBoostedJetTag
    ],
    src='selectedPatJetsForAHtoElecTauAntiOverlapWithLeptonsVetoCumulative',
    pyModuleName=__name__,
# with respect to direction of missing Et vector
#--------------------------------------------------------------------------------

htRatios = cms.EDProducer(
    "HtRatioProducer",
    srcJet=cms.InputTag('selectedPatJetsEt15ForWTauNuCumulative'),
    srcTau=cms.InputTag('selectedPatTausForWTauNuEcalCrackVetoCumulative'),
    verbosity=cms.untracked.int32(0))

selectedHtRatio = cms.EDFilter("HtRatioSelector",
                               src=cms.InputTag('htRatios'),
                               cut=cms.string('Ratio() > 0.65'),
                               filter=cms.bool(False))

selectedHtRatioLoose = cms.EDFilter("HtRatioSelector",
                                    src=cms.InputTag('htRatios'),
                                    cut=cms.string('Ratio() > 0.3'),
                                    filter=cms.bool(False))

htRatioProdConfigurator = objProdConfigurator(htRatios, pyModuleName=__name__)

produceHtRatio = htRatioProdConfigurator.configure(pyNameSpace=locals())

htRatioSelConfigurator = objSelConfigurator(
    [selectedHtRatioLoose, selectedHtRatio],
    src="htRatios",
    pyModuleName=__name__,
    doSelIndividual=False)

selectHtRatio = htRatioSelConfigurator.configure(pyNameSpace=locals())
tausBgEstQCDEnrichedCharge = copy.deepcopy(selectedPatTausForWTauNuCharge)
tausBgEstQCDEnrichedCharge.cut = cms.string('tauID("byMediumIsolation") < 0.5')

tausBgEstQCDEnrichedMuonVeto = copy.deepcopy(selectedPatTausForWTauNuMuonVeto)
tausBgEstQCDEnrichedElectronVeto = copy.deepcopy(selectedPatTausForWTauNuElectronVeto)
tausBgEstQCDEnrichedEmFraction = copy.deepcopy(selectedPatTausForWTauNuEmFraction)
tausBgEstQCDEnrichedEcalCrackVeto = copy.deepcopy(selectedPatTausForWTauNuEcalCrackVeto)

tauSelConfiguratorBgEstQCDEnriched = objSelConfigurator(
    [
        tausBgEstQCDEnrichedLeadTrk,
        tausBgEstQCDEnrichedLeadTrkPt,
        tausBgEstQCDEnrichedMuonVeto,
        tausBgEstQCDEnrichedElectronVeto,
        tausBgEstQCDEnrichedEmFraction,
        tausBgEstQCDEnrichedIso,
        tausBgEstQCDEnrichedProng,
        tausBgEstQCDEnrichedCharge,
        tausBgEstQCDEnrichedEcalCrackVeto
        ],
    src = "selectedPatTausForWTauNuPt20Cumulative",
    pyModuleName = __name__,
    doSelIndividual = False
    )
selectTausBgEstQCDEnriched = tauSelConfiguratorBgEstQCDEnriched.configure(pyNameSpace = locals())
#------------------------------------------------------------------------------
# Produce collection of tau-nu pairs
#-----------------------------------------------------------------------------
from TauAnalysis.CandidateTools.tauNuPairProduction_cff import *

tauNuPairsBgEstQCDEnriched = copy.deepcopy(allTauNuPairs)
tauNuPairsBgEstQCDEnriched.srcVisDecayProducts = cms.InputTag('tausBgEstQCDEnrichedEcalCrackVetoCumulative')
Exemple #24
0
)

selectedMEtTopology05 = cms.EDFilter("MEtTopologySelector",
    src = cms.InputTag('metTopologies'),
    cut = cms.string('Vanti()/Vparallel() < 0.4'),
    filter = cms.bool(False)
)

selectedMEtTopology025 = cms.EDFilter("MEtTopologySelector",
    src = cms.InputTag('metTopologies'),
    cut = cms.string('Vanti()/Vparallel() < 0.25'),
    filter = cms.bool(False)
)


metTopologyProdConfigurator = objProdConfigurator(
    metTopologies,
    pyModuleName = __name__
    )
produceMEtTopology = metTopologyProdConfigurator.configure(pyNameSpace = locals())

metTopologySelConfigurator = objSelConfigurator(
    [selectedMEtTopology05,
     selectedMEtTopology025],
    src = "metTopologies",
    pyModuleName = __name__,
    doSelIndividual = False
    )

selectMEtTopology = metTopologySelConfigurator.configure(pyNameSpace = locals())
    dRmin = cms.double(0.7),
    filter = cms.bool(False)                                           
)

# select jets passing b-tagging discriminator
# (>= 3 tracks with impact parameter significance > 2.0)
selectedPatJetsForAHtoMuTauBtag = cms.EDFilter("PATJetSelector",
    cut = cms.string('bDiscriminator("trackCountingHighEffBJetTags") > 2.5'), 
    filter = cms.bool(False)
)

patJetSelConfiguratorForAHtoMuTau = objSelConfigurator(
    [ selectedPatJetsForAHtoMuTauEta21,
      selectedPatJetsForAHtoMuTauEt20,
      selectedPatJetsForAHtoMuTauAntiOverlapWithLeptonsVeto,
      selectedPatJetsForAHtoMuTauBtag ],
    src = "cleanPatJets",
    pyModuleName = __name__,
    doSelIndividual = True
)

selectPatJetsForAHtoMuTau = patJetSelConfiguratorForAHtoMuTau.configure(pyNameSpace = locals())

# define additional collections of jets
# not overlapping with "loosely" isolated muons
# (NOTE: to be used for the purpose of factorizing efficiencies
#        of muon isolation from other event selection criteria,
#        in order to avoid problems with limited Monte Carlo statistics)

selectedPatJetsForAHtoMuTauAntiOverlapWithLeptonsVetoLooseMuonIsolation = selectedPatJetsForAHtoMuTauAntiOverlapWithLeptonsVeto.clone(
    srcNotToBeFiltered = cms.VInputTag(
import copy

#--------------------------------------------------------------------------------
# produce collections of pat::MET objects passing selection criteria
#--------------------------------------------------------------------------------

# see https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePhysicsCutParser
# on how to use the cut-string parser
selectedPatPFMETsPt25 = cms.EDFilter("PATMETSelector",
                                     src=cms.InputTag("patPFMETs"),
                                     cut=cms.string('pt > 25.'),
                                     filter=cms.bool(False))
selectedPatPFMETsPt30 = cms.EDFilter(
    "PATMETSelector",
    src=cms.InputTag("patPFMETs"),
    cut=cms.string('pt > 35.'),
    #                                     cut = cms.string('pt > 0.'),
    filter=cms.bool(False))
selectedPatPFMETsPt45 = cms.EDFilter("PATMETSelector",
                                     src=cms.InputTag("patPFMETs"),
                                     cut=cms.string('pt > 45'),
                                     filter=cms.bool(False))

patPFMETSelConfigurator = objSelConfigurator(
    [selectedPatPFMETsPt25, selectedPatPFMETsPt30, selectedPatPFMETsPt45],
    src='patPFMETs',
    pyModuleName=__name__,
    doSelIndividual=False)

selectPatPFMETs = patPFMETSelConfigurator.configure(pyNameSpace=locals())
tausBgEstQCDEnrichedCharge.cut = cms.string('tauID("byMediumIsolation") < 0.5')

tausBgEstQCDEnrichedMuonVeto = copy.deepcopy(selectedPatTausForWTauNuMuonVeto)
tausBgEstQCDEnrichedElectronVeto = copy.deepcopy(
    selectedPatTausForWTauNuElectronVeto)
tausBgEstQCDEnrichedEmFraction = copy.deepcopy(
    selectedPatTausForWTauNuEmFraction)
tausBgEstQCDEnrichedEcalCrackVeto = copy.deepcopy(
    selectedPatTausForWTauNuEcalCrackVeto)

tauSelConfiguratorBgEstQCDEnriched = objSelConfigurator(
    [
        tausBgEstQCDEnrichedLeadTrk, tausBgEstQCDEnrichedLeadTrkPt,
        tausBgEstQCDEnrichedMuonVeto, tausBgEstQCDEnrichedElectronVeto,
        tausBgEstQCDEnrichedEmFraction, tausBgEstQCDEnrichedIso,
        tausBgEstQCDEnrichedProng, tausBgEstQCDEnrichedCharge,
        tausBgEstQCDEnrichedEcalCrackVeto
    ],
    src="selectedPatTausForWTauNuPt20Cumulative",
    pyModuleName=__name__,
    doSelIndividual=False)
selectTausBgEstQCDEnriched = tauSelConfiguratorBgEstQCDEnriched.configure(
    pyNameSpace=locals())
#------------------------------------------------------------------------------
# Produce collection of tau-nu pairs
#-----------------------------------------------------------------------------
from TauAnalysis.CandidateTools.tauNuPairProduction_cff import *

tauNuPairsBgEstQCDEnriched = copy.deepcopy(allTauNuPairs)
tauNuPairsBgEstQCDEnriched.srcVisDecayProducts = cms.InputTag(
    'tausBgEstQCDEnrichedEcalCrackVetoCumulative')
                                               cut = cms.string('et > 20.'),
                                               filter = cms.bool(False)
                                               )

selectedPatJetsEt20ForWTauNuE = cms.EDFilter("PATJetSelector",
                                             cut = cms.string('et > 20'),
                                             filter = cms.bool(False)
                                             )



patJetSelConfiguratorForWTauNu = objSelConfigurator(
    [ #selectedPatJetsAntiOverlapWithTausVetoForWTauNu,
      selectedPatJetsEtaForWTauNu,
      selectedPatJetsEt15ForWTauNu,
      selectedPatJetsEt20ForWTauNu ],
#    src = "cleanPatJets",
    src = "patJets",
    pyModuleName = __name__,
    doSelIndividual = False
    )

patJetSelConfiguratorForWTauNu2 = objSelConfigurator(
    [ selectedPatJetsAntiOverlapWithTausVetoForWTauNu,
      selectedPatJetsEt20ForWTauNuE ],
#    src = "cleanPatJets",
    src = "patJets",
    pyModuleName = __name__,
    doSelIndividual = False
    )

selectPatJetsForWTauNu = patJetSelConfiguratorForWTauNu.configure(pyNameSpace = locals())
# select QCD background enriched event sample
#--------------------------------------------------------------------------------

#--------------------------------------------------------------------------------
# produce collection of pat::Muons
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.patMuonSelection_cfi import *

muonsBgEstQCDenrichedPFRelIso = copy.deepcopy(selectedPatMuonsPFRelIso)
muonsBgEstQCDenrichedPFRelIso.sumPtMin = cms.double(0.10)
muonsBgEstQCDenrichedPFRelIso.sumPtMax = cms.double(0.30)

muonSelConfiguratorBgEstQCDenriched = objSelConfigurator(
    [muonsBgEstQCDenrichedPFRelIso],
    src="selectedPatMuonsPt15Cumulative",
    pyModuleName=__name__,
    doSelIndividual=False)

selectMuonsBgEstQCDenriched = muonSelConfiguratorBgEstQCDenriched.configure(
    pyNameSpace=locals())

#--------------------------------------------------------------------------------
# produce collection of pat::Taus
#--------------------------------------------------------------------------------

from TauAnalysis.RecoTools.patPFTauSelection_cfi import *
from TauAnalysis.RecoTools.patPFTauSelectionForMuTau_cfi import *
#
# Note: probability for quark/gluon jets to pass tau track and ECAL isolation criteria
#       is higher for low Pt than for high Pt jets; the consequence is that muon + tau-jet visible invariant mass distribution
# on how to use the cut-string parser

# select jets not identified as electron, muon or tau-jets
selectedPatJetsAntiOverlapWithLeptonsVeto = cms.EDFilter(
    "PATJetAntiOverlapSelector",
    srcNotToBeFiltered=cms.VInputTag("selectedPatElectronsTrkIPcumulative",
                                     "selectedPatMuonsTrkIPcumulative",
                                     "selectedPatTausProngCumulative"),
    dRmin=cms.double(0.7),
    filter=cms.bool(False))

# select central jets
selectedPatJetsEta21 = cms.EDFilter("PATJetSelector",
                                    cut=cms.string('abs(eta) < 2.1'),
                                    filter=cms.bool(False))

# select jets with Et > 20 GeV
selectedPatJetsEt20 = cms.EDFilter("PATJetSelector",
                                   cut=cms.string('et > 20.'),
                                   filter=cms.bool(False))

patJetSelConfigurator = objSelConfigurator([
    selectedPatJetsAntiOverlapWithLeptonsVeto, selectedPatJetsEta21,
    selectedPatJetsEt20
],
                                           src="patJets",
                                           pyModuleName=__name__,
                                           doSelIndividual=False)

selectPatJets = patJetSelConfigurator.configure(pyNameSpace=locals())
)

selectedHtRatio = cms.EDFilter("HtRatioSelector",
    src = cms.InputTag('htRatios'),
    cut = cms.string('Ratio() > 0.65'),
    filter = cms.bool(False)
)

selectedHtRatioLoose = cms.EDFilter("HtRatioSelector",
    src = cms.InputTag('htRatios'),
    cut = cms.string('Ratio() > 0.3'),
    filter = cms.bool(False)
)

htRatioProdConfigurator = objProdConfigurator(
    htRatios,
    pyModuleName = __name__
    )

produceHtRatio = htRatioProdConfigurator.configure(pyNameSpace = locals())

htRatioSelConfigurator = objSelConfigurator(
    [  selectedHtRatioLoose,
       selectedHtRatio ],
    src = "htRatios",
    pyModuleName = __name__,
    doSelIndividual = False
    )

selectHtRatio = htRatioSelConfigurator.configure(pyNameSpace = locals())
    cut = cms.string("isValid & ndof >= 7 & chi2 > 0 & tracksSize > 0")
)
process.selectedPrimaryVertexPositionForElectronId = selectedPrimaryVertexPosition.clone(
    src = cms.InputTag('selectedPrimaryVertexQualityForElectronId')
)
process.selectedPrimaryVertexHighestPtTrackSumForElectronId = selectedPrimaryVertexHighestPtTrackSum.clone(
    vertices = cms.InputTag('selectedPrimaryVertexPositionForElectronId')
)
process.load("TauAnalysis/RecoTools/patLeptonSelection_cff")
process.selectedPatElectronsForElecTauId.srcVertex = cms.InputTag('selectedPrimaryVertexHighestPtTrackSumForElectronId')
from TauAnalysis.CandidateTools.tools.objSelConfigurator import *
patElectronSelConfiguratorForNSVfitTrackLikelihood = objSelConfigurator(
    [ process.selectedPatElectronsForElecTauId,
      process.selectedPatElectronsForElecTauAntiCrackCut,
      process.selectedPatElectronsForElecTauEta,
      process.selectedPatElectronsForElecTauIso,
      process.selectedPatElectronsForElecTauConversionVeto ],
    src = 'patElectronsForNSVfitTrackLikelihood',
    doSelIndividual = False
)
process.selectPatElectronsForNSVfitTrackLikelihood = patElectronSelConfiguratorForNSVfitTrackLikelihood.configure(process = process)
process.electronSelectionSequence = cms.Sequence(
    process.patElectronsForNSVfitTrackLikelihood
   + process.selectedPrimaryVertexQualityForElectronId + process.selectedPrimaryVertexPositionForElectronId + process.selectedPrimaryVertexHighestPtTrackSumForElectronId
   + process.selectPatElectronsForNSVfitTrackLikelihood
)
process.testSVfitTrackLikelihoodProductionSequence += process.electronSelectionSequence

process.genMatchedPatElectrons = cms.EDFilter("PATElectronAntiOverlapSelector",
    src = cms.InputTag('selectedPatElectronsForElecTauConversionVetoCumulative'),                  
    srcNotToBeFiltered = cms.VInputTag(genElectronsFromTauDecays),
# --------------------------------------------------------------------------------

selectedElecMuPairsAntiOverlapVeto.cut = cms.string("dR12 > 1.57")
selectedElecMuPairsZeroCharge.cut = cms.string("charge = 0")
selectedElecMuPairsAcoplanarity12.cut = cms.string("cos(dPhi12) > -1.01")
selectedElecMuPairsMt1MET.cut = cms.string("mt1MET < 50.")
selectedElecMuPairsMt2MET.cut = cms.string("mt2MET < 50.")
selectedElecMuPairsPzetaDiff.cut = cms.string("(pZeta - 1.5*pZetaVis) > -20.")

patElecMuPairSelConfigurator = objSelConfigurator(
    [
        selectedElecMuPairsAntiOverlapVeto,
        selectedElecMuPairsZeroCharge,
        selectedElecMuPairsAcoplanarity12,
        selectedElecMuPairsMt1MET,
        selectedElecMuPairsMt2MET,
        selectedElecMuPairsPzetaDiff,
    ],
    src="allElecMuPairs",
    pyModuleName=__name__,
    doSelIndividual=True,
)

selectElecMuPairs = patElecMuPairSelConfigurator.configure(pyNameSpace=locals())

selectedElecMuPairsAntiOverlapVetoLooseElectronIsolation.cut = selectedElecMuPairsAntiOverlapVeto.cut
selectedElecMuPairsZeroChargeLooseElectronIsolation.cut = selectedElecMuPairsZeroCharge.cut
selectedElecMuPairsAcoplanarity12LooseElectronIsolation.cut = selectedElecMuPairsAcoplanarity12.cut
selectedElecMuPairsMt1METlooseElectronIsolation.cut = selectedElecMuPairsMt1MET.cut
selectedElecMuPairsMt2METlooseElectronIsolation.cut = selectedElecMuPairsMt2MET.cut
selectedElecMuPairsPzetaDiffLooseElectronIsolation.cut = selectedElecMuPairsPzetaDiff.cut
electronsBgEstZeeJetMisIdEnrichedIso.sumPtMaxEE = cms.double(0.05)

# require electron to not be from a photon conversion
electronsBgEstZeeJetMisIdEnrichedConversionVeto = copy.deepcopy(
    electronsBgEstZtautauEnrichedConversionVeto)

electronsBgEstZeeJetMisIdEnrichedTrkIP = copy.deepcopy(
    electronsBgEstZtautauEnrichedTrkIP)

electronSelConfiguratorBgEstZeeJetMisIdEnriched = objSelConfigurator(
    [
        electronsBgEstZeeJetMisIdEnrichedId,
        electronsBgEstZeeJetMisIdEnrichedAntiCrackCut,
        electronsBgEstZeeJetMisIdEnrichedEta,
        electronsBgEstZeeJetMisIdEnrichedPt,
        electronsBgEstZeeJetMisIdEnrichedIso,
        electronsBgEstZeeJetMisIdEnrichedConversionVeto,
        electronsBgEstZeeJetMisIdEnrichedTrkIP
    ],
    src="cleanPatElectrons",
    pyModuleName=__name__,
    doSelIndividual=False)

selectElectronsBgEstZeeJetMisIdEnriched = electronSelConfiguratorBgEstZeeJetMisIdEnriched.configure(
    pyNameSpace=locals())

#--------------------------------------------------------------------------------
# produce collection of pat::Taus
#--------------------------------------------------------------------------------

# require tau candidate not to overlap with selected electrons
import copy

from TauAnalysis.CandidateTools.tools.objSelConfigurator import *

#--------------------------------------------------------------------------------  
# produce collections of tau-jet + MET pairs passing selection criteria
#--------------------------------------------------------------------------------
 
selectedTauNuPairsDPhiMetTau = cms.EDFilter("PATTauNuPairSelector",
     cut = cms.string('dPhi() > 0.3'),
     filter = cms.bool(False)
)


selectedTauNuPairsMt40 = cms.EDFilter("PATTauNuPairSelector",
                                      cut = cms.string('mt() > 40'),
                                      filter = cms.bool(False)
                                      )

patTauNuPairSelConfigurator = objSelConfigurator(
    [
    #selectedTauNuPairsDPhiMetTau
    selectedTauNuPairsMt40
      ],
    src = "allTauNuPairs",
    pyModuleName = __name__,
    doSelIndividual = False
)

selectTauNuPairs = patTauNuPairSelConfigurator.configure(pyNameSpace = locals())
# produce opposite- and same-sign collections of electron + tau-jet pairs passing selection criteria
#---------------------------------------------------------------------------------------------------

selectedElecTauPairsForAHtoElecTauAntiOverlapVeto = copy.deepcopy(selectedElecTauPairsAntiOverlapVeto)

selectedElecTauPairsForAHtoElecTauMt1MET= copy.deepcopy(selectedElecTauPairsMt1MET)

selectedElecTauPairsForAHtoElecTauPzetaDiff = copy.deepcopy(selectedElecTauPairsPzetaDiff)

selectedElecTauPairsForAHtoElecTauZeroCharge = copy.deepcopy(selectedElecTauPairsZeroCharge)

patElecTauPairSelConfiguratorForAHtoElecTauOS = objSelConfigurator(
    [ selectedElecTauPairsForAHtoElecTauAntiOverlapVeto,
      selectedElecTauPairsForAHtoElecTauMt1MET,
      selectedElecTauPairsForAHtoElecTauPzetaDiff,
      selectedElecTauPairsForAHtoElecTauZeroCharge ],
    src = "allElecTauPairs",
    pyModuleName = __name__,
    doSelIndividual = True
)

selectElecTauPairsForAHtoElecTauOS = patElecTauPairSelConfiguratorForAHtoElecTauOS.configure(pyNameSpace = locals())

selectedElecTauPairsForAHtoElecTauNonZeroCharge = copy.deepcopy(selectedElecTauPairsNonZeroCharge)

patElecTauPairSelConfiguratorForAHtoElecTauSS = objSelConfigurator(
	[ selectedElecTauPairsForAHtoElecTauNonZeroCharge ],
    src = "selectedElecTauPairsForAHtoElecTauPzetaDiffCumulative",
    pyModuleName = __name__,
    doSelIndividual = True
)
Exemple #37
0
selectedPatElectronsPt15.cut = cms.string('pt > 15.')
selectedPatElectronsTrkIso.cut = cms.string(
    'userIsolation("pat::TrackIso") < 1.')
selectedPatElectronsEcalIso.cut = cms.string(
    '(abs(superCluster.eta) < 1.479 & userIsolation("pat::EcalIso") < 2.5) | (abs(superCluster.eta) > 1.479 & userIsolation("pat::EcalIso") < 3.5)'
)
selectedPatElectronsTrk.cut = cms.string('gsfTrack.isNonnull')
selectedPatElectronsTrkIP.vertexSource = cms.InputTag(
    "selectedPrimaryVertexHighestPtTrackSum")
selectedPatElectronsTrkIP.IpMax = cms.double(0.05)

patElectronSelConfigurator = objSelConfigurator([
    selectedPatElectronsTightId, selectedPatElectronsAntiCrackCut,
    selectedPatElectronsEta21, selectedPatElectronsPt15,
    selectedPatElectronsTrkIso, selectedPatElectronsEcalIso,
    selectedPatElectronsTrk, selectedPatElectronsTrkIP
],
                                                src="cleanPatElectrons",
                                                pyModuleName=__name__,
                                                doSelIndividual=True)

selectPatElectrons = patElectronSelConfigurator.configure(pyNameSpace=locals())

selectedPatElectronsTrkIsoLooseIsolation.cut = cms.string(
    'userIsolation("pat::TrackIso") < 8.')
selectedPatElectronsEcalIsoLooseIsolation.cut = cms.string(
    'userIsolation("pat::EcalIso") < 8.')
selectedPatElectronsTrkLooseIsolation.cut = selectedPatElectronsTrk.cut
selectedPatElectronsTrkIPlooseIsolation.vertexSource = selectedPatElectronsTrkIP.vertexSource
selectedPatElectronsTrkIPlooseIsolation.IpMax = selectedPatElectronsTrkIP.IpMax