PageRenderTime 44ms CodeModel.GetById 13ms app.highlight 22ms RepoModel.GetById 4ms app.codeStats 1ms

/ElectroWeakAnalysis/Skimming/python/patCandidatesForZMuMuSubskim_cff.py

https://github.com/aivanov-cern/cmssw
Python | 173 lines | 114 code | 25 blank | 34 comment | 0 complexity | d3716d3a9634fe6a794ece9183e1a843 MD5 | raw file
  1import FWCore.ParameterSet.Config as cms
  2
  3from SimGeneral.HepPDTESSource.pythiapdt_cfi import *
  4#####################################################
  5# PAT muons and tracks for ZMuMu subskim: no MC match
  6#####################################################
  7
  8# PAT TRACKS 
  9
 10# before pat: conversion to track candidates for pat; isolation 
 11from ElectroWeakAnalysis.Skimming.patAODTrackCandSequence_cff import *
 12patAODTrackCands.cut = 'pt > 15.'
 13
 14# pat tracks
 15from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import patGenericParticles
 16
 17allPatTracks = patGenericParticles.clone(
 18    src = cms.InputTag("patAODTrackCands"),
 19    embedTrack = cms.bool(True),
 20    # isolation configurables
 21    userIsolation = cms.PSet(
 22      tracker = cms.PSet(
 23        veto = cms.double(0.015),
 24        src = cms.InputTag("patAODTrackIsoDepositCtfTk"),
 25        deltaR = cms.double(0.3),
 26        threshold = cms.double(1.5)
 27      ),
 28      ecal = cms.PSet(
 29        src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
 30        deltaR = cms.double(0.3)
 31      ),
 32      hcal = cms.PSet(
 33        src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal"),
 34        deltaR = cms.double(0.3)
 35      ),
 36    ),
 37    isoDeposits = cms.PSet(
 38      tracker = cms.InputTag("patAODTrackIsoDepositCtfTk"),
 39      ecal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
 40      hcal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal")
 41    ),
 42    addGenMatch = cms.bool(False)
 43)
 44
 45from PhysicsTools.PatAlgos.selectionLayer1.trackSelector_cfi import *
 46selectedPatTracks.cut = 'pt > 15. & track.dxy()<1.0'
 47
 48# PAT MUONS
 49
 50# before pat: Merge CaloMuons into the collection of reco::Muons
 51# Starting from 3_4_X a special recipe is needed for CaloMuons merging
 52# Uncomment the following lines and follow the recipe in:
 53# https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideMuonIsolation#To_remake_IsoDeposits_in_CMSSW_3
 54
 55#from RecoMuon.MuonIdentification.calomuons_cfi import calomuons;
 56#muons = cms.EDProducer("CaloMuonMerger",
 57#    muons = cms.InputTag("muons"), # half-dirty thing. it works aslong as we're the first module using muons in the path
 58#    caloMuons = cms.InputTag("calomuons"),
 59#    minCaloCompatibility = calomuons.minCaloCompatibility)
 60
 61## And re-make isolation, as we can't use the one in AOD because our collection is different
 62#import RecoMuon.MuonIsolationProducers.muIsolation_cff
 63
 64# pat muons
 65# needed starting from 3_6_1
 66from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import *
 67#
 68from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import *
 69patMuons.isoDeposits = cms.PSet(
 70        tracker = cms.InputTag("muIsoDepositTk"),
 71        ecal    = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
 72        hcal    = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
 73)
 74patMuons.userIsolation = cms.PSet(
 75        hcal = cms.PSet(
 76            src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
 77            deltaR = cms.double(0.3)
 78        ),
 79        tracker = cms.PSet(
 80            veto = cms.double(0.015),
 81            src = cms.InputTag("muIsoDepositTk"),
 82            deltaR = cms.double(0.3),
 83            threshold = cms.double(1.5)
 84            ),
 85        ecal = cms.PSet(
 86            src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
 87            deltaR = cms.double(0.3)
 88        )
 89    )
 90
 91patMuons.addGenMatch = cms.bool(False)
 92patMuons.embedTrack = cms.bool(True)
 93patMuons.embedCombinedMuon = cms.bool(True)
 94patMuons.embedStandAloneMuon = cms.bool(True)
 95patMuons.embedPickyMuon = cms.bool(False)
 96patMuons.embedTpfmsMuon = cms.bool(False)
 97patMuons.embedPFCandidate = cms.bool(False)
 98
 99from PhysicsTools.PatAlgos.selectionLayer1.muonSelector_cfi import *
100selectedPatMuons.cut = 'pt > 15. & abs(eta) < 100.0 & ( (isGlobalMuon==1  & innerTrack.dxy()<1.0)  | ((isTrackerMuon==1  & innerTrack.dxy()<1.0) | (isStandAloneMuon==1  & outerTrack.dxy()<1.0) ))'
101
102# trigger info
103from PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cfi import *
104# to access 8E29 menus
105#patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT8E29" )
106#patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT8E29" )
107# to access 1E31 menus
108patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT" )
109patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT" )
110
111muonTriggerMatchHLTMuons = cms.EDProducer( "PATTriggerMatcherDRDPtLessByR",
112    src     = cms.InputTag( "selectedPatMuons" ),
113    matched = cms.InputTag( "patTrigger" ),
114    andOr          = cms.bool( False ),
115    filterIdsEnum  = cms.vstring( 'TriggerMuon' ), # 'TriggerMuon' is the enum from trigger::TriggerObjectType for HLT muons
116    filterIds      = cms.vint32( 0 ),
117    filterLabels   = cms.vstring( '*' ),
118    pathNames      = cms.vstring( 'HLT_Mu9' ),
119    collectionTags = cms.vstring( '*' ),
120    maxDPtRel = cms.double( 1.0 ),
121    maxDeltaR = cms.double( 0.2 ),
122    resolveAmbiguities    = cms.bool( True ),
123    resolveByMatchQuality = cms.bool( False )
124)
125
126from PhysicsTools.PatAlgos.triggerLayer1.triggerEventProducer_cfi import *
127patTriggerEvent.patTriggerMatches  = cms.VInputTag( "muonTriggerMatchHLTMuons" )
128
129patTriggerSequence = cms.Sequence(
130    patTrigger *
131    muonTriggerMatchHLTMuons *
132    patTriggerEvent
133)
134
135selectedPatMuonsTriggerMatch = cms.EDProducer( "PATTriggerMatchMuonEmbedder",
136    src     = cms.InputTag( "selectedPatMuons" ),
137    matches = cms.VInputTag( "muonTriggerMatchHLTMuons" )
138)
139
140muonTriggerMatchEmbedder = cms.Sequence(
141    selectedPatMuonsTriggerMatch
142)
143
144# uncomment in case of CaloMuons merging
145#beforePatMuons = cms.Sequence(
146#    muons *
147#    muIsolation
148#)
149
150beforePatTracks = cms.Sequence(
151    patAODTrackCandSequence 
152)
153
154beforePat = cms.Sequence(
155# uncomment in case of CaloMuons merging
156#    beforePatMuons *
157    beforePatTracks
158)
159
160patCandsSequence = cms.Sequence(
161    patMuons *
162    selectedPatMuons *
163    allPatTracks *
164    selectedPatTracks
165)
166
167goodMuonRecoForDimuon = cms.Sequence(
168    beforePat *
169    patCandsSequence *
170    patTriggerSequence *
171    muonTriggerMatchEmbedder
172)
173