Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:08

0001 from __future__ import print_function
0002 # As of 1 Feb 2017:
0003 # This configuration appears to be already broken in more
0004 # than one way. It fails to even run only under python.
0005 # For this reason, it was not converted to use Tasks.
0006 # If it is ever fixed, it will also need to be migrated
0007 # to use Tasks.
0008 
0009 #
0010 # This file contains the Top PAG reference selection work-flow for mu + jets analysis.
0011 # as defined in
0012 # https://twiki.cern.ch/twiki/bin/view/CMS/TWikiTopRefEventSel#mu_jets_Channel
0013 #
0014 # Command line arguments:
0015 # - standard command line arguments as defined in FWCore.ParameterSet.VarParsing.VarParsing( 'standard' )
0016 #   + 'maxEvent' (int , default: -1)
0017 # - 'runOnMC'          (bool, default: True ): decide if run on MC or real data
0018 # - 'runOnMiniAOD'     (bool, default: True ): decide if run on miniAOD or AOD input
0019 # - 'useElecEAIsoCorr' (bool, default: True ): decide, if EA (rho) or Delta beta corrections are used for electron isolation
0020 # - 'useCalibElec'     (bool, default: False): decide, if electron re-calibration using regression energies is used
0021 # - 'addTriggerMatch'  (bool, default: True ): decide, if trigger objects are matched to signal muons
0022 #
0023 
0024 
0025 import sys
0026 
0027 import FWCore.ParameterSet.Config as cms
0028 
0029 
0030 # Command line parsing
0031 
0032 import FWCore.ParameterSet.VarParsing as VarParsing
0033 options = VarParsing.VarParsing ( 'standard' )
0034 options.register( 'runOnMC'         , True , VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, 'decide, if run on MC or real data' )
0035 options.register( 'runOnMiniAOD'    , True , VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, 'decide, if run on miniAOD or AOD input' )
0036 options.register( 'useElecEAIsoCorr', True , VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, 'decide, if EA (rho) or Delta beta corrections are used for electron isolation is used' )
0037 options.register( 'useCalibElec'    , False, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, 'decide, if electron re-calibration using regression energies is used' )
0038 options.register( 'addTriggerMatch' , True , VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, 'decide, if trigger objects are matched to signal muons' )
0039 # parsing command line arguments
0040 if( hasattr( sys, 'argv' ) ):
0041   if( len( sys.argv ) > 2 ):
0042     print('Parsing command line arguments:')
0043   for args in sys.argv :
0044     arg = args.split(',')
0045     for val in arg:
0046       val = val.split( '=' )
0047       if( len( val ) == 2 ):
0048         print('Setting "', val[0], '" to:', val[1])
0049         setattr( options, val[0], val[1] )
0050 
0051 
0052 process = cms.Process( 'USER' )
0053 #process.Tracer = cms.Service( "Tracer" )
0054 
0055 
0056 ### ======================================================================== ###
0057 ###                                                                          ###
0058 ###                                 Constants                                ###
0059 ###                            (user job steering)                           ###
0060 ###                                                                          ###
0061 ### ======================================================================== ###
0062 
0063 
0064 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets import *
0065 
0066 inputFiles = []
0067 
0068 
0069 ### Selection steps
0070 # If a step is switched off here, its results will still be available in the coreespondinng TriggerResults of this process.
0071 
0072 # Event filter
0073 # This parameter defines the level, at which events will be filtered for output.
0074 # The available levels (paths) are (ordered!):
0075 # 0a. pTrigger
0076 # 0b. pEventCleaning
0077 # 0c. pGoodVertex
0078 # 1.  pSignalMuon
0079 # 2.  pLooseMuonVeto
0080 # 3.  pElectronVeto
0081 # 4a. p1Jet
0082 # 4b. p2Jets
0083 # 4c. p3Jets
0084 # 5.  p4Jets
0085 # 6.  pBTags
0086 # Each level includes the former ones, but also the corresponding stand-alone selection steps are available, adding a
0087 # 'StandAlone' after the prefix 'p' (e.g. 'pLooseMuonVeto' --> 'pStandAloneLooseMuonVeto').
0088 # All corresponding flags are available in the TriggerResults collection produced by this process later.
0089 selectEvents = 'pGoodVertex'
0090 
0091 # Step 0
0092 #triggerSelectionData = ''
0093 #triggerSelectionMC   = ''
0094 
0095 # Step 1
0096 #muonCut       = ''
0097 #signalMuonCut = ''
0098 #muonVertexMaxDZ = 0.5
0099 
0100 # Step 2
0101 
0102 # Step 3
0103 useElecEAIsoCorr = options.useElecEAIsoCorr
0104 useCalibElec     = options.useCalibElec
0105 #electronGsfCut   = ''
0106 #electronCalibCut = ''
0107 electronCut = electronGsfCut
0108 
0109 # Step 4
0110 
0111 #jetCut = ''
0112 # Step4a
0113 #veryTightJetCut = ''
0114 # Step4b
0115 #tightJetCut     = ''
0116 # Step4c
0117 #looseJetCut     = ''
0118 
0119 # Step 5
0120 #veryLooseJetCut = ''
0121 
0122 # Step 6
0123 bTagSrc = 'selectedJets'
0124 #bTagCut = ''
0125 minBTags = 2
0126 
0127 # TriggerMatching
0128 addTriggerMatch = options.addTriggerMatch
0129 #triggerObjectSelectionData = 'type("TriggerMuon") && ( path("%s") )'%( triggerSelectionData )
0130 #triggerObjectSelectionMC   = 'type("TriggerMuon") && ( path("%s") )'%( triggerSelectionMC )
0131 
0132 
0133 ### Input
0134 
0135 runOnMC      = options.runOnMC
0136 runOnMiniAOD = options.runOnMiniAOD
0137 
0138 # maximum number of events
0139 maxEvents = options.maxEvents
0140 
0141 ### Conditions
0142 
0143 # GlobalTags
0144 globalTagMC   = 'DEFAULT'
0145 globalTagData = 'DEFAULT'
0146 
0147 ### Output
0148 
0149 # output file
0150 outputFile = 'patRefSel_muJets.root'
0151 
0152 # event frequency of Fwk report
0153 fwkReportEvery = max( 1, int( maxEvents / 100 ) )
0154 
0155 # switch for 'TrigReport'/'TimeReport' at job end
0156 wantSummary = True
0157 
0158 
0159 ### ======================================================================== ###
0160 ###                                                                          ###
0161 ###                              End of constants                            ###
0162 ###                            (user job steering)                           ###
0163 ###                                                                          ###
0164 ### ======================================================================== ###
0165 
0166 
0167 triggerSelection       = triggerSelectionData
0168 triggerObjectSelection = triggerObjectSelectionData
0169 if runOnMC:
0170   triggerSelection       = triggerSelectionMC
0171   triggerObjectSelection = triggerObjectSelectionMC
0172 
0173 
0174 ###
0175 ### Basic configuration
0176 ###
0177 
0178 process.load( "TopQuarkAnalysis.Configuration.patRefSel_basics_cff" )
0179 process.MessageLogger.cerr.FwkReport.reportEvery = fwkReportEvery
0180 process.options.wantSummary = wantSummary
0181 from Configuration.AlCa.GlobalTag import GlobalTag
0182 if runOnMC:
0183   if globalTagMC == 'DEFAULT':
0184     process.GlobalTag = GlobalTag( process.GlobalTag, 'auto:run2_mc' )
0185   else:
0186     process.GlobalTag.globaltag = globalTagMC
0187 else:
0188   if globalTagData == 'DEFAULT':
0189     process.GlobalTag = GlobalTag( process.GlobalTag, 'auto:run2_data' )
0190   else:
0191     process.GlobalTag.globaltag = globalTagData
0192 
0193 
0194 ###
0195 ### Input configuration
0196 ###
0197 
0198 if len( inputFiles ) == 0:
0199   if runOnMiniAOD:
0200     if runOnMC:
0201       from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM
0202       inputFiles = filesRelValTTbarPileUpMINIAODSIM
0203     else:
0204       from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValSingleMuMINIAOD
0205       inputFiles = filesRelValSingleMuMINIAOD
0206   else:
0207     if runOnMC:
0208       from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM
0209       inputFiles = filesRelValProdTTbarAODSIM
0210     else:
0211       from PhysicsTools.PatAlgos.patInputFiles_cff import filesSingleMuRECO # not available at CERN
0212       inputFiles = filesSingleMuRECO
0213 process.load( "TopQuarkAnalysis.Configuration.patRefSel_inputModule_cfi" )
0214 process.source.fileNames = inputFiles
0215 process.maxEvents.input  = maxEvents
0216 
0217 
0218 ###
0219 ### PAT configuration
0220 ###
0221 
0222 if not runOnMiniAOD:
0223   process.load( "PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff" )
0224 
0225 
0226 
0227 ###
0228 ### Output configuration
0229 ###
0230 
0231 process.load( "TopQuarkAnalysis.Configuration.patRefSel_outputModule_cff" )
0232 # output file name
0233 process.out.fileName = outputFile
0234 from TopQuarkAnalysis.Configuration.patRefSel_eventContent_cff import refMuJets_eventContent
0235 process.out.outputCommands += refMuJets_eventContent
0236 if runOnMiniAOD:
0237   from TopQuarkAnalysis.Configuration.patRefSel_eventContent_cff import miniAod_eventContent
0238   process.out.outputCommands += miniAod_eventContent
0239 else:
0240   from TopQuarkAnalysis.Configuration.patRefSel_eventContent_cff import aod_eventContent
0241   process.out.outputCommands += aod_eventContent
0242 # clear event selection
0243 process.out.SelectEvents.SelectEvents = cms.vstring( selectEvents )
0244 
0245 
0246 ###
0247 ### Selection configuration
0248 ###
0249 
0250 # Individual steps
0251 
0252 # Step 0
0253 
0254 from TopQuarkAnalysis.Configuration.patRefSel_triggerSelection_cff import triggerResults
0255 process.triggerSelection = triggerResults.clone( triggerConditions = [ triggerSelection ] )
0256 process.sStandAloneTrigger = cms.Sequence( process.triggerSelection
0257                                          )
0258 process.pStandAloneTrigger = cms.Path( process.sStandAloneTrigger )
0259 
0260 process.load( 'TopQuarkAnalysis.Configuration.patRefSel_eventCleaning_cff' )
0261 process.sStandAloneEventCleaning = cms.Sequence()
0262 if runOnMiniAOD:
0263   process.sStandAloneEventCleaning += process.eventCleaningMiniAOD
0264   if runOnMC:
0265     process.sStandAloneEventCleaning += process.eventCleaningMiniAODMC
0266   else:
0267     process.sStandAloneEventCleaning += process.eventCleaningMiniAODData
0268 else:
0269   process.sStandAloneEventCleaning += process.eventCleaning
0270   if runOnMC:
0271     process.sStandAloneEventCleaning += process.eventCleaningMC
0272   else:
0273     process.sStandAloneEventCleaning += process.eventCleaningData
0274 process.pStandAloneEventCleaning = cms.Path( process.sStandAloneEventCleaning )
0275 
0276 from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import goodOfflinePrimaryVertices
0277 process.goodOfflinePrimaryVertices = goodOfflinePrimaryVertices.clone( filter = True )
0278 if runOnMiniAOD:
0279   process.goodOfflinePrimaryVertices.src = 'offlineSlimmedPrimaryVertices'
0280 process.sStandAloneGoodVertex = cms.Sequence( process.goodOfflinePrimaryVertices
0281                                             )
0282 process.pStandAloneGoodVertex = cms.Path( process.sStandAloneGoodVertex )
0283 
0284 # Step 1
0285 
0286 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import selectedMuons, preSignalMuons, signalMuons, standAloneSignalMuonFilter
0287 process.selectedMuons = selectedMuons.clone( cut = muonCut )
0288 if runOnMiniAOD:
0289   process.selectedMuons.src = 'slimmedMuons'
0290 process.preSignalMuons = preSignalMuons.clone( cut = signalMuonCut )
0291 process.signalMuons = signalMuons.clone( maxDZ = muonVertexMaxDZ )
0292 if runOnMiniAOD:
0293   process.signalMuons.vertexSource = 'offlineSlimmedPrimaryVertices'
0294 process.standAloneSignalMuonFilter = standAloneSignalMuonFilter.clone()
0295 process.sStandAloneSignalMuon = cms.Sequence( process.standAloneSignalMuonFilter )
0296 process.pStandAloneSignalMuon = cms.Path( process.sStandAloneSignalMuon )
0297 
0298 # Step 2
0299 
0300 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import standAloneLooseMuonVetoFilter
0301 process.standAloneLooseMuonVetoFilter = standAloneLooseMuonVetoFilter.clone()
0302 process.sStandAloneLooseMuonVeto = cms.Sequence( process.standAloneLooseMuonVetoFilter )
0303 process.pStandAloneLooseMuonVeto = cms.Path( process.sStandAloneLooseMuonVeto )
0304 
0305 # Step 3
0306 
0307 if not runOnMiniAOD:
0308   from PhysicsTools.SelectorUtils.tools.vid_id_tools import switchOnVIDElectronIdProducer, setupAllVIDIdsInModule, setupVIDElectronSelection
0309   electron_ids = [ 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_CSA14_50ns_V1_cff'
0310                  , 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_CSA14_PU20bx25_V0_cff'
0311                   ]
0312   switchOnVIDElectronIdProducer( process )
0313   process.electronIDValueMapProducer.ebReducedRecHitCollection = cms.InputTag( 'reducedEcalRecHitsEB' )
0314   process.electronIDValueMapProducer.eeReducedRecHitCollection = cms.InputTag( 'reducedEcalRecHitsEE' )
0315   process.electronIDValueMapProducer.esReducedRecHitCollection = cms.InputTag( 'reducedEcalRecHitsES' )
0316   for idmod in electron_ids:
0317     setupAllVIDIdsInModule( process, idmod, setupVIDElectronSelection )
0318 
0319 if useElecEAIsoCorr:
0320   from EgammaAnalysis.ElectronTools.electronIsolatorFromEffectiveArea_cfi import elPFIsoValueEA03
0321   if runOnMiniAOD:
0322     process.patElPFIsoValueEA03 = elPFIsoValueEA03.clone( gsfElectrons = ''
0323                                                         , pfElectrons  = ''
0324                                                         , patElectrons = cms.InputTag( 'slimmedElectrons' )
0325                                                         , rhoIso       = cms.InputTag( 'fixedGridRhoFastjetAll' )
0326                                                         )
0327     from EgammaAnalysis.ElectronTools.patElectronEAIsoCorrectionProducer_cfi import patElectronEAIso03CorrectionProducer
0328     process.electronsWithEA03Iso = patElectronEAIso03CorrectionProducer.clone( patElectrons  = 'slimmedElectrons'
0329                                                                              , eaIsolator    = 'patElPFIsoValueEA03'
0330                                                                              )
0331   else:
0332     process.elPFIsoValueEA03 = elPFIsoValueEA03.clone( gsfElectrons = 'gedGsfElectrons'
0333                                                      , pfElectrons  = ''
0334                                                      , rhoIso       = cms.InputTag( 'fixedGridRhoFastjetAll' )
0335                                                      )
0336     process.patElectrons.isolationValues.user = cms.VInputTag( cms.InputTag( 'elPFIsoValueEA03' ) )
0337 else:
0338   electronGsfCut.replace( '-1.0*userIsolation("User1Iso")', '-0.5*puChargedHadronIso' )
0339   electronCalibCut.replace( '-1.0*userIsolation("User1Iso")', '-0.5*puChargedHadronIso' )
0340   electronCut.replace( '-1.0*userIsolation("User1Iso")', '-0.5*puChargedHadronIso' )
0341 
0342 if useCalibElec:
0343   from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import electronsWithRegression, calibratedElectrons
0344   process.electronsWithRegression = electronsWithRegression.clone()
0345   if runOnMiniAOD:
0346     if useElecEAIsoCorr:
0347       process.electronsWithRegression.inputElectronsTag = 'electronsWithEA03Iso'
0348     else:
0349       process.electronsWithRegression.inputElectronsTag = 'slimmedElectrons'
0350     process.electronsWithRegression.vertexCollection  = 'offlineSlimmedPrimaryVertices'
0351   process.calibratedElectrons = calibratedElectrons.clone( isMC = runOnMC )
0352   if runOnMC:
0353     process.calibratedElectrons.inputDataset = 'Summer12_LegacyPaper' # FIXME: Update as soon as available
0354   else:
0355     process.calibratedElectrons.inputDataset = '22Jan2013ReReco' # FIXME: Update as soon as available
0356   process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService"
0357                                                     , calibratedElectrons = cms.PSet( initialSeed = cms.untracked.uint32( 1 )
0358                                                                                     , engineName  = cms.untracked.string('TRandom3')
0359                                                                                     )
0360                                                     )
0361   electronCut = electronCalibCut
0362 
0363 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import selectedElectrons, standAloneElectronVetoFilter
0364 process.selectedElectrons = selectedElectrons.clone( cut = electronCut )
0365 if useCalibElec:
0366   process.selectedElectrons.src = 'calibratedElectrons'
0367 elif useElecEAIsoCorr and runOnMiniAOD:
0368   process.selectedElectrons.src = 'electronsWithEA03Iso'
0369 elif runOnMiniAOD:
0370   process.selectedElectrons.src = 'slimmedElectrons'
0371 
0372 process.standAloneElectronVetoFilter = standAloneElectronVetoFilter.clone()
0373 process.sStandAloneElectronVeto = cms.Sequence( process.standAloneElectronVetoFilter )
0374 process.pStandAloneElectronVeto = cms.Path( process.sStandAloneElectronVeto )
0375 
0376 # Step 4
0377 
0378 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import selectedJets
0379 process.selectedJets = selectedJets.clone( cut = jetCut )
0380 if runOnMiniAOD:
0381   process.selectedJets.src = 'slimmedJets'
0382 
0383 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import signalVeryTightJets, standAloneSignalVeryTightJetsFilter
0384 process.signalVeryTightJets = signalVeryTightJets.clone( cut = veryTightJetCut )
0385 process.standAloneSignalVeryTightJetsFilter = standAloneSignalVeryTightJetsFilter.clone()
0386 process.sStandAlone1Jet = cms.Sequence( process.standAloneSignalVeryTightJetsFilter )
0387 process.pStandAlone1Jet = cms.Path( process.sStandAlone1Jet )
0388 
0389 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import signalTightJets, standAloneSignalTightJetsFilter
0390 process.signalTightJets = signalTightJets.clone( cut = tightJetCut )
0391 process.standAloneSignalTightJetsFilter = standAloneSignalTightJetsFilter.clone()
0392 process.sStandAlone2Jets = cms.Sequence( process.standAloneSignalTightJetsFilter )
0393 process.pStandAlone2Jets = cms.Path( process.sStandAlone2Jets )
0394 
0395 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import signalLooseJets, standAloneSignalLooseJetsFilter
0396 process.signalLooseJets = signalLooseJets.clone( cut = looseJetCut )
0397 process.standAloneSignalLooseJetsFilter = standAloneSignalLooseJetsFilter.clone()
0398 process.sStandAlone3Jets = cms.Sequence( process.standAloneSignalLooseJetsFilter )
0399 process.pStandAlone3Jets = cms.Path( process.sStandAlone3Jets )
0400 
0401 # Step 5
0402 
0403 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import signalVeryLooseJets, standAloneSignalVeryLooseJetsFilter
0404 process.signalVeryLooseJets = signalVeryLooseJets.clone( cut = veryLooseJetCut )
0405 process.standAloneSignalVeryLooseJetsFilter = standAloneSignalVeryLooseJetsFilter.clone()
0406 process.sStandAlone4Jets = cms.Sequence( process.standAloneSignalVeryLooseJetsFilter )
0407 process.pStandAlone4Jets = cms.Path( process.sStandAlone4Jets )
0408 
0409 # Step 6
0410 
0411 from TopQuarkAnalysis.Configuration.patRefSel_refMuJets_cfi import selectedBTagJets, standAloneSignalBTagsFilter
0412 process.selectedBTagJets = selectedBTagJets.clone( src = bTagSrc
0413                                                  , cut = bTagCut
0414                                                  )
0415 process.standAloneSignalBTagsFilter = standAloneSignalBTagsFilter.clone( minNumber = minBTags )
0416 process.sStandAloneBTags = cms.Sequence( process.standAloneSignalBTagsFilter )
0417 process.pStandAloneBTags = cms.Path( process.sStandAloneBTags )
0418 
0419 # Consecutive steps
0420 
0421 process.sTrigger       = cms.Sequence( process.sStandAloneTrigger
0422                                      )
0423 process.sEventCleaning = cms.Sequence( process.sTrigger
0424                                      + process.sStandAloneEventCleaning
0425                                      )
0426 process.sGoodVertex    = cms.Sequence( process.sEventCleaning
0427                                      + process.sStandAloneGoodVertex
0428                                      )
0429 process.sSignalMuon    = cms.Sequence( process.sGoodVertex
0430                                      + process.sStandAloneSignalMuon
0431                                      )
0432 process.sLooseMuonVeto = cms.Sequence( process.sSignalMuon
0433                                      + process.sStandAloneLooseMuonVeto
0434                                      )
0435 process.sElectronVeto  = cms.Sequence( process.sLooseMuonVeto
0436                                      + process.sStandAloneElectronVeto
0437                                      )
0438 process.s1Jet          = cms.Sequence( process.sElectronVeto
0439                                      + process.sStandAlone1Jet
0440                                      )
0441 process.s2Jets         = cms.Sequence( process.s1Jet
0442                                      + process.sStandAlone2Jets
0443                                      )
0444 process.s3Jets         = cms.Sequence( process.s2Jets
0445                                      + process.sStandAlone2Jets
0446                                      )
0447 process.s4Jets         = cms.Sequence( process.s3Jets
0448                                      + process.sStandAlone4Jets
0449                                      )
0450 process.sBTags         = cms.Sequence( process.s4Jets
0451                                      + process.sStandAloneBTags
0452                                      )
0453 
0454 process.pTrigger       = cms.Path( process.sTrigger )
0455 process.pEventCleaning = cms.Path( process.sEventCleaning )
0456 process.pGoodVertex    = cms.Path( process.sGoodVertex )
0457 process.pSignalMuon    = cms.Path( process.sSignalMuon )
0458 process.pLooseMuonVeto = cms.Path( process.sLooseMuonVeto )
0459 process.pElectronVeto  = cms.Path( process.sElectronVeto )
0460 process.p1Jet          = cms.Path( process.s1Jet )
0461 process.p2Jets         = cms.Path( process.s2Jets )
0462 process.p3Jets         = cms.Path( process.s2Jets )
0463 process.p4Jets         = cms.Path( process.s4Jets )
0464 process.pBTags         = cms.Path( process.sBTags )
0465 
0466 # Trigger matching
0467 
0468 if addTriggerMatch:
0469   from TopQuarkAnalysis.Configuration.patRefSel_triggerMatching_cff import muonTriggerMatch
0470   process.muonTriggerMatch = muonTriggerMatch.clone( matchedCuts = triggerObjectSelection )
0471   if not runOnMiniAOD:
0472     from PhysicsTools.PatAlgos.tools.trigTools import switchOnTriggerMatchEmbedding
0473     switchOnTriggerMatchEmbedding( process, triggerMatchers = [ 'muonTriggerMatch' ] )
0474   else:
0475     from TopQuarkAnalysis.Configuration.patRefSel_triggerMatching_cff import unpackedPatTrigger
0476     process.selectedTriggerUnpacked = unpackedPatTrigger.clone()
0477     process.muonTriggerMatch.matched = 'selectedTriggerUnpacked'
0478     from TopQuarkAnalysis.Configuration.patRefSel_triggerMatching_cff import signalMuonsTriggerMatch
0479     process.signalMuonsTriggerMatch = signalMuonsTriggerMatch.clone()
0480     process.out.outputCommands += [ 'drop *_signalMuons_*_*'
0481                                   , 'keep *_signalMuonsTriggerMatch_*_*'
0482                                   ]
0483