CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/ElectroWeakAnalysis/Skimming/python/patCandidatesForZMuMuSubskim_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 from SimGeneral.HepPDTESSource.pythiapdt_cfi import *
00004 #####################################################
00005 # PAT muons and tracks for ZMuMu subskim: no MC match
00006 #####################################################
00007 
00008 # PAT TRACKS 
00009 
00010 # before pat: conversion to track candidates for pat; isolation 
00011 from ElectroWeakAnalysis.Skimming.patAODTrackCandSequence_cff import *
00012 patAODTrackCands.cut = 'pt > 15.'
00013 
00014 # pat tracks
00015 from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import patGenericParticles
00016 
00017 allPatTracks = patGenericParticles.clone(
00018     src = cms.InputTag("patAODTrackCands"),
00019     embedTrack = cms.bool(True),
00020     # isolation configurables
00021     userIsolation = cms.PSet(
00022       tracker = cms.PSet(
00023         veto = cms.double(0.015),
00024         src = cms.InputTag("patAODTrackIsoDepositCtfTk"),
00025         deltaR = cms.double(0.3),
00026         threshold = cms.double(1.5)
00027       ),
00028       ecal = cms.PSet(
00029         src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
00030         deltaR = cms.double(0.3)
00031       ),
00032       hcal = cms.PSet(
00033         src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal"),
00034         deltaR = cms.double(0.3)
00035       ),
00036     ),
00037     isoDeposits = cms.PSet(
00038       tracker = cms.InputTag("patAODTrackIsoDepositCtfTk"),
00039       ecal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
00040       hcal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal")
00041     ),
00042     addGenMatch = cms.bool(False)
00043 )
00044 
00045 from PhysicsTools.PatAlgos.selectionLayer1.trackSelector_cfi import *
00046 selectedPatTracks.cut = 'pt > 15. & track.dxy()<1.0'
00047 
00048 # PAT muons
00049 
00050 # before pat: Merge calomuons into the collection of reco::muons
00051 # Starting from 3_4_X a special recipe is needed for calomuons merging
00052 # Uncomment the following lines and follow the recipe in:
00053 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideMuonIsolation#To_remake_IsoDeposits_in_CMSSW_3
00054 
00055 #from RecoMuon.MuonIdentification.calomuons_cfi import calomuons;
00056 #muons = cms.EDProducer("CaloMuonMerger",
00057 #    muons = cms.InputTag("muons"), # half-dirty thing. it works aslong as we're the first module using muons in the path
00058 #    calomuons = cms.InputTag("calomuons"),
00059 #    minCaloCompatibility = calomuons.minCaloCompatibility)
00060 
00061 ## And re-make isolation, as we can't use the one in AOD because our collection is different
00062 #import RecoMuon.MuonIsolationProducers.muIsolation_cff
00063 
00064 # pat muons
00065 # needed starting from 3_6_1
00066 from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import *
00067 #
00068 from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import *
00069 patMuons.isoDeposits = cms.PSet(
00070         tracker = cms.InputTag("muIsoDepositTk"),
00071         ecal    = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
00072         hcal    = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
00073 )
00074 patMuons.userIsolation = cms.PSet(
00075         hcal = cms.PSet(
00076             src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
00077             deltaR = cms.double(0.3)
00078         ),
00079         tracker = cms.PSet(
00080             veto = cms.double(0.015),
00081             src = cms.InputTag("muIsoDepositTk"),
00082             deltaR = cms.double(0.3),
00083             threshold = cms.double(1.5)
00084             ),
00085         ecal = cms.PSet(
00086             src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
00087             deltaR = cms.double(0.3)
00088         )
00089     )
00090 
00091 patMuons.addGenMatch = cms.bool(False)
00092 patMuons.embedTrack = cms.bool(True)
00093 patMuons.embedCombinedMuon = cms.bool(True)
00094 patMuons.embedStandAloneMuon = cms.bool(True)
00095 patMuons.embedPickyMuon = cms.bool(False)
00096 patMuons.embedTpfmsMuon = cms.bool(False)
00097 patMuons.embedPFCandidate = cms.bool(False)
00098 
00099 from PhysicsTools.PatAlgos.selectionLayer1.muonSelector_cfi import *
00100 selectedPatMuons.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) ))'
00101 
00102 # trigger info
00103 from PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cfi import *
00104 # to access 8E29 menus
00105 #patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT8E29" )
00106 #patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT8E29" )
00107 # to access 1E31 menus
00108 patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT" )
00109 patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT" )
00110 
00111 muonTriggerMatchHLTMuons = cms.EDProducer( "PATTriggerMatcherDRDPtLessByR",
00112     src     = cms.InputTag( "selectedPatMuons" ),
00113     matched = cms.InputTag( "patTrigger" ),
00114     andOr          = cms.bool( False ),
00115     filterIdsEnum  = cms.vstring( 'TriggerMuon' ), # 'TriggerMuon' is the enum from trigger::TriggerObjectType for HLT muons
00116     filterIds      = cms.vint32( 0 ),
00117     filterLabels   = cms.vstring( '*' ),
00118     pathNames      = cms.vstring( 'HLT_Mu9' ),
00119     collectionTags = cms.vstring( '*' ),
00120     maxDPtRel = cms.double( 1.0 ),
00121     maxDeltaR = cms.double( 0.2 ),
00122     resolveAmbiguities    = cms.bool( True ),
00123     resolveByMatchQuality = cms.bool( False )
00124 )
00125 
00126 from PhysicsTools.PatAlgos.triggerLayer1.triggerEventProducer_cfi import *
00127 patTriggerEvent.patTriggerMatches  = cms.VInputTag( "muonTriggerMatchHLTMuons" )
00128 
00129 patTriggerSequence = cms.Sequence(
00130     patTrigger *
00131     muonTriggerMatchHLTMuons *
00132     patTriggerEvent
00133 )
00134 
00135 selectedPatMuonsTriggerMatch = cms.EDProducer( "PATTriggerMatchMuonEmbedder",
00136     src     = cms.InputTag( "selectedPatMuons" ),
00137     matches = cms.VInputTag( "muonTriggerMatchHLTMuons" )
00138 )
00139 
00140 muonTriggerMatchEmbedder = cms.Sequence(
00141     selectedPatMuonsTriggerMatch
00142 )
00143 
00144 # uncomment in case of calomuons merging
00145 #beforePatMuons = cms.Sequence(
00146 #    muons *
00147 #    muIsolation
00148 #)
00149 
00150 beforePatTracks = cms.Sequence(
00151     patAODTrackCandSequence 
00152 )
00153 
00154 beforePat = cms.Sequence(
00155 # uncomment in case of calomuons merging
00156 #    beforePatMuons *
00157     beforePatTracks
00158 )
00159 
00160 patCandsSequence = cms.Sequence(
00161     patMuons *
00162     selectedPatMuons *
00163     allPatTracks *
00164     selectedPatTracks
00165 )
00166 
00167 goodMuonRecoForDimuon = cms.Sequence(
00168     beforePat *
00169     patCandsSequence *
00170     patTriggerSequence *
00171     muonTriggerMatchEmbedder
00172 )
00173