PageRenderTime 25ms CodeModel.GetById 11ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/ElectroWeakAnalysis/Skimming/python/patCandidatesForDimuonsSequences_cff.py

https://github.com/aivanov-cern/cmssw
Python | 167 lines | 122 code | 24 blank | 21 comment | 0 complexity | 56322884301e3867204d7cadfe311b43 MD5 | raw file
  1import FWCore.ParameterSet.Config as cms
  2
  3from SimGeneral.HepPDTESSource.pythiapdt_cfi import *
  4
  5# PAT TRACKS
  6
  7# before pat: conversion to track candidates for pat; isolation 
  8#from PhysicsTools.PatAlgos.recoLayer0.genericTrackCandidates_cff import *
  9from ElectroWeakAnalysis.Skimming.patAODTrackCandSequence_cff import *
 10patAODTrackCands.cut = 'pt > 10.'
 11
 12# before pat: MC match
 13#from PhysicsTools.PatAlgos.mcMatchLayer0.trackMuMatch_cfi import *
 14from ElectroWeakAnalysis.Skimming.trackMuMatch_cfi import *
 15trackMuMatch.maxDeltaR = 0.15
 16trackMuMatch.maxDPtRel = 1.0
 17trackMuMatch.resolveAmbiguities = True
 18trackMuMatch.resolveByMatchQuality = True
 19
 20# pat tracks
 21from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import patGenericParticles
 22
 23allPatTracks = patGenericParticles.clone(
 24    src = cms.InputTag("patAODTrackCands"),
 25    # isolation configurables
 26    userIsolation = cms.PSet(
 27      tracker = cms.PSet(
 28        veto = cms.double(0.015),
 29        src = cms.InputTag("patAODTrackIsoDepositCtfTk"),
 30        deltaR = cms.double(0.3),
 31        threshold = cms.double(1.5)
 32      ),
 33      ecal = cms.PSet(
 34        src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
 35        deltaR = cms.double(0.3)
 36      ),
 37      hcal = cms.PSet(
 38        src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal"),
 39        deltaR = cms.double(0.3)
 40      ),
 41    ),
 42    isoDeposits = cms.PSet(
 43      tracker = cms.InputTag("patAODTrackIsoDepositCtfTk"),
 44      ecal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
 45      hcal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal")
 46    ),
 47    addGenMatch = cms.bool(True),
 48    genParticleMatch = cms.InputTag("trackMuMatch")
 49)
 50
 51from PhysicsTools.PatAlgos.selectionLayer1.trackSelector_cfi import *
 52selectedPatTracks.cut = 'pt > 10.'
 53
 54# PAT MUONS
 55
 56# before pat: MC match
 57from PhysicsTools.PatAlgos.mcMatchLayer0.muonMatch_cfi import *
 58muonMatch.maxDeltaR = 0.15
 59muonMatch.maxDPtRel = 1.0
 60muonMatch.resolveAmbiguities = True
 61muonMatch.resolveByMatchQuality = True
 62
 63# pat muons
 64# needed starting from 3_6_1
 65from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import *
 66#
 67from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import *
 68patMuons.isoDeposits = cms.PSet(
 69        tracker = cms.InputTag("muIsoDepositTk"),
 70        ecal    = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
 71        hcal    = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
 72)
 73patMuons.userIsolation = cms.PSet(
 74        hcal = cms.PSet(
 75            src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
 76            deltaR = cms.double(0.3)
 77        ),
 78        tracker = cms.PSet(
 79            veto = cms.double(0.015),
 80            src = cms.InputTag("muIsoDepositTk"),
 81            deltaR = cms.double(0.3),
 82            threshold = cms.double(1.5)
 83            ),
 84        ecal = cms.PSet(
 85            src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
 86            deltaR = cms.double(0.3)
 87        )
 88    )
 89
 90from PhysicsTools.PatAlgos.selectionLayer1.muonSelector_cfi import *
 91selectedPatMuons.cut = 'pt > 0. & abs(eta) < 100.0'
 92
 93# trigger info
 94from PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cfi import *
 95# to access 8E29 menus
 96#patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT8E29" )
 97#patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT8E29" )
 98# to access 1E31 menus
 99patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT" )
100patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT" )
101
102muonTriggerMatchHLTMuons = cms.EDFilter( "PATTriggerMatcherDRDPtLessByR",
103    src     = cms.InputTag( "selectedPatMuons" ),
104    matched = cms.InputTag( "patTrigger" ),
105    andOr          = cms.bool( False ),
106    filterIdsEnum  = cms.vstring( 'TriggerMuon' ), # 'TriggerMuon' is the enum from trigger::TriggerObjectType for HLT muons
107    filterIds      = cms.vint32( 0 ),
108    filterLabels   = cms.vstring( '*' ),
109    pathNames      = cms.vstring( 'HLT_Mu9' ),
110    collectionTags = cms.vstring( '*' ),
111    maxDPtRel = cms.double( 1.0 ),
112    maxDeltaR = cms.double( 0.2 ),
113    resolveAmbiguities    = cms.bool( True ),
114    resolveByMatchQuality = cms.bool( True )
115)
116
117from PhysicsTools.PatAlgos.triggerLayer1.triggerEventProducer_cfi import *
118#patTriggerEvent.patTriggerMatches  = [ "muonTriggerMatchHLTMu9" ]
119patTriggerEvent.patTriggerMatches  = cms.VInputTag( "muonTriggerMatchHLTMuons" )
120#patTriggerEvent.patTriggerMatches  = cms.VInputTag( "muonTriggerMatchHLTMu9" )
121
122patTriggerSequence = cms.Sequence(
123    patTrigger *
124    muonTriggerMatchHLTMuons *
125#    muonTriggerMatchHLTMu9 *
126    patTriggerEvent
127)
128
129selectedPatMuonsTriggerMatch = cms.EDProducer( "PATTriggerMatchMuonEmbedder",
130    src     = cms.InputTag( "selectedPatMuons" ),
131    matches = cms.VInputTag( "muonTriggerMatchHLTMuons" )
132)
133
134muonTriggerMatchEmbedder = cms.Sequence(
135    selectedPatMuonsTriggerMatch
136)
137
138# pat sequences
139
140beforePatTracks = cms.Sequence(
141    patAODTrackCandSequence *
142    trackMuMatch
143)
144
145beforePatMuons = cms.Sequence(
146    muonMatch
147)
148
149beforePat = cms.Sequence(
150    beforePatTracks +
151    beforePatMuons
152)
153
154patCandsSequence = cms.Sequence(
155    patMuons *
156    selectedPatMuons *
157    allPatTracks *
158    selectedPatTracks
159)
160
161goodMuonRecoForDimuon = cms.Sequence(
162    beforePat *
163    patCandsSequence *
164    patTriggerSequence *
165    muonTriggerMatchEmbedder
166)
167