def SUSY_pattuple_cff::addDefaultSUSYPAT | ( | process, | |
mcInfo = True , |
|||
HLTMenu = 'HLT' , |
|||
JetMETCorrections = ['L2Relative' , |
|||
L3Absolute, | |||
mcVersion = '' , |
|||
theJetNames = ['AK5PF'] , |
|||
doValidation = False , |
|||
extMatch = False , |
|||
doSusyTopProjection = False , |
|||
doType1MetCorrection = True , |
|||
doType0MetCorrection = False |
|||
) |
Definition at line 12 of file SUSY_pattuple_cff.py.
00013 : 00014 loadPF2PAT(process,mcInfo,JetMETCorrections,extMatch,doSusyTopProjection,doType1MetCorrection,doType0MetCorrection,'PF') 00015 addTagInfos(process,JetMETCorrections) 00016 if not mcInfo: 00017 removeMCDependence(process) 00018 loadPAT(process,JetMETCorrections,extMatch) 00019 addJetMET(process,theJetNames,JetMETCorrections,mcVersion) 00020 # loadType1METSequence(process) # defines process.Type1METSequence 00021 # loadPATTriggers(process,HLTMenu,theJetNames,electronMatches,muonMatches,tauMatches,jetMatches,photonMatches) 00022 00023 #-- Counter for the number of processed events -------------------------------- 00024 process.eventCountProducer = cms.EDProducer("EventCountProducer") 00025 00026 # Full path 00027 #process.load('RecoTauTag.Configuration.RecoPFTauTag_cff') 00028 process.susyPatDefaultSequence = cms.Sequence( process.eventCountProducer 00029 # * process.PFTau 00030 # * process.Type1METSequence 00031 * process.patPF2PATSequence 00032 * process.patPF2PATSequencePF 00033 ) 00034 00035 if mcInfo and extMatch: 00036 extensiveMatching(process) 00037 process.susyPatDefaultSequence.replace(process.patDefaultSequence, process.extensiveMatching+process.patDefaultSequence) 00038 00039 if doValidation: 00040 loadSusyValidation(process) 00041 process.susyPatDefaultSequence.replace(process.patPF2PATSequencePF, process.patPF2PATSequencePF * process.ak5CaloJetsL2L3 * process.metJESCorAK5CaloJet * process.RecoSusyValidation * process.PatSusyValidation*process.MEtoEDMConverter)
def SUSY_pattuple_cff::addJetMET | ( | process, | |
theJetNames, | |||
JetMETCorrections, | |||
mcVersion | |||
) |
Definition at line 479 of file SUSY_pattuple_cff.py.
00480 : 00481 #-- Extra Jet/MET collections ------------------------------------------------- 00482 # Add a few jet collections... 00483 for jetName in theJetNames: 00484 addSUSYJetCollection(process,JetMETCorrections,jetName,mcVersion) 00485 00486 #-- Tune contents of jet collections ----------------------------------------- 00487 theJetNames.append('') 00488 for jetName in theJetNames: 00489 module = getattr(process,'patJets'+jetName) 00490 module.addTagInfos = False # Remove tag infos 00491 module.embedGenJetMatch = False # Only keep reference, since we anyway keep the genJet collections 00492 #module.embedCaloTowers = True # To drop calo towers 00493 theJetNames.pop() 00494 00495 # Add tcMET 00496 from PhysicsTools.PatAlgos.tools.metTools import addTcMET #, addPfMET 00497 addTcMET(process,'TC') 00498 #addPfMET(process,'PF') #is in PF2PAT 00499 00500 # Rename default jet collection for uniformity 00501 process.cleanPatJetsAK5Calo = process.cleanPatJets 00502 process.patMETsAK5Calo = process.patMETs 00503 00504 # TODO: fix type2 MET in 52X 00505 #addTypeIIMet(process) 00506 00507 # Modify subsequent modules 00508 process.patHemispheres.patJets = process.cleanPatJetsAK5Calo.label() 00509 process.countPatJets.src = process.cleanPatJetsAK5Calo.label() 00510 00511 # Modify counters' input 00512 process.patCandidateSummary.candidates.remove(cms.InputTag('patMETs')) 00513 process.patCandidateSummary.candidates.append(cms.InputTag('patMETsAK5Calo')) 00514 process.patCandidateSummary.candidates.append(cms.InputTag('patMHTsAK5Calo')) 00515 process.cleanPatCandidateSummary.candidates.remove(cms.InputTag('cleanPatJets')) 00516 process.cleanPatCandidateSummary.candidates.append(cms.InputTag('cleanPatJetsAK5Calo')) 00517 # Add new jet collections to counters (MET done automatically) 00518 for jets in theJetNames: 00519 process.patCandidateSummary.candidates.append(cms.InputTag('patJets'+jets)) 00520 process.selectedPatCandidateSummary.candidates.append(cms.InputTag('selectedPatJets'+jets)) 00521 process.cleanPatCandidateSummary.candidates.append(cms.InputTag('cleanPatJets'+jets))
def SUSY_pattuple_cff::addSUSYJetCollection | ( | process, | |
JetMETCorrections, | |||
jets = 'IC5Calo' , |
|||
mcVersion = '' , |
|||
doJTA = True , |
|||
doType1MET = True , |
|||
doJetID = True , |
|||
jetIdLabel = None |
|||
) |
Definition at line 436 of file SUSY_pattuple_cff.py.
00437 : 00438 from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection 00439 algorithm = jets[0:3] 00440 type = jets[3:len(jets)] 00441 jetCorrLabel = (jets,cms.vstring(JetMETCorrections)) 00442 if 'IC' in algorithm: collection = algorithm.replace('IC','iterativeCone') 00443 elif 'SC' in algorithm: collection = algorithm.replace('SC','sisCone') 00444 elif 'AK' in algorithm: collection = algorithm.replace('AK','ak') 00445 elif 'KT' in algorithm: collection = algorithm.replace('KT','kt') 00446 else: raise ValueError, "Unknown jet algorithm: %s" % (jets) 00447 jetIdLabel = algorithm.lower() 00448 if type == 'Calo': 00449 jetCollection = '%(collection)sCaloJets' % locals() 00450 if not 'AK7' in algorithm: 00451 doType1MET = True 00452 elif type == 'PF': 00453 jetCollection = '%(collection)sPFJets' % locals() 00454 doJetID = False 00455 elif type == 'JPT': 00456 if 'IC' in algorithm: collectionJPT = algorithm.replace('IC','Icone') 00457 elif 'SC' in algorithm: collectionJPT = algorithm.replace('SC','sisCone') 00458 elif 'AK' in algorithm: collectionJPT = algorithm.replace('AK','AntiKt') 00459 else: raise ValueError, "Unknown jet algorithm: %s" % (jets) 00460 jetCollection = 'JetPlusTrackZSPCorJet%(collectionJPT)s' % locals() 00461 elif type == 'Track': 00462 jetCollection = '%(collection)sTrackJets' % locals() 00463 jetCorrLabel = None 00464 doJetID = False 00465 else: raise ValueError, "Unknown jet type: %s" % (jets) 00466 00467 addJetCollection(process, cms.InputTag(jetCollection), 00468 algorithm, type, 00469 doJTA = doJTA, 00470 doBTagging = True, 00471 jetCorrLabel = jetCorrLabel, 00472 doType1MET = doType1MET, 00473 doL1Cleaning = True, 00474 doL1Counters = True, 00475 doJetID = doJetID, 00476 jetIdLabel = jetIdLabel, 00477 genJetCollection = cms.InputTag('%(collection)sGenJets' % locals()) 00478 )
def SUSY_pattuple_cff::addTagInfos | ( | process, | |
JetMETCorrections | |||
) |
Definition at line 430 of file SUSY_pattuple_cff.py.
00431 : 00432 from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection 00433 switchJetCollection( process, 00434 jetCollection=cms.InputTag('ak5CaloJets'), 00435 jetCorrLabel=('AK5Calo', JetMETCorrections))
def SUSY_pattuple_cff::addTypeIIMet | ( | process | ) |
Definition at line 402 of file SUSY_pattuple_cff.py.
00403 : 00404 # Add reco::MET with Type II correction 00405 from PhysicsTools.PatAlgos.recoLayer0.jetMETCorrections_cff import metJESCorAK5CaloJet 00406 process.metJESCorAK5CaloJetTypeII = metJESCorAK5CaloJet.clone() 00407 process.metJESCorAK5CaloJetTypeII.useTypeII = True 00408 process.metJESCorAK5CaloJetTypeII.hasMuonsCorr = False 00409 # Add muon corrections for above II reco::MET 00410 process.metJESCorAK5CaloJetMuonsTypeII = process.metJESCorAK5CaloJetMuons.clone( 00411 uncorMETInputTag = cms.InputTag('metJESCorAK5CaloJetTypeII') 00412 ) 00413 # Add to recoLayer0 sequence 00414 process.patMETCorrections.replace( 00415 process.metJESCorAK5CaloJet, 00416 (process.metJESCorAK5CaloJetTypeII* 00417 process.metJESCorAK5CaloJetMuonsTypeII)+ 00418 process.metJESCorAK5CaloJet 00419 ) 00420 # Add pat::MET with Type II correction 00421 process.patMETsAK5CaloTypeII = process.patMETs.clone( 00422 metSource = cms.InputTag("metJESCorAK5CaloJetMuonsTypeII") 00423 ) 00424 # Add to producersLayer1 sequence 00425 process.patDefaultSequence.replace( 00426 process.patMETsAK5Calo, 00427 process.patMETsAK5Calo+ 00428 process.patMETsAK5CaloTypeII 00429 )
def SUSY_pattuple_cff::extensiveMatching | ( | process | ) |
Definition at line 42 of file SUSY_pattuple_cff.py.
00043 : 00044 process.load("SimGeneral.TrackingAnalysis.trackingParticlesNoSimHits_cfi") # On RECO 00045 process.load("SimMuon.MCTruth.MuonAssociatorByHits_cfi") # On RECO 00046 process.mergedTruth = cms.EDProducer("GenPlusSimParticleProducer", 00047 src = cms.InputTag("g4SimHits"), # use "famosSimHits" for FAMOS 00048 setStatus = cms.int32(5), # set status = 8 for GEANT GPs 00049 filter = cms.vstring("pt > 0.0"), # just for testing (optional) 00050 genParticles = cms.InputTag("genParticles") # original genParticle list 00051 ) 00052 process.load("MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi") 00053 00054 from MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi import addUserData as addClassByHits 00055 addClassByHits(process.patMuons,labels=['classByHitsGlb'],extraInfo=True) 00056 addClassByHits(process.patMuonsPF,labels=['classByHitsGlb'],extraInfo=True) 00057 00058 process.extensiveMatching = cms.Sequence(process.mergedTruth+process.muonClassificationByHits)
def SUSY_pattuple_cff::getSUSY_pattuple_outputCommands | ( | process | ) |
Definition at line 539 of file SUSY_pattuple_cff.py.
00540 : 00541 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContent, patExtraAodEventContent, patTriggerEventContent, patTriggerStandAloneEventContent, patEventContentTriggerMatch 00542 keepList = [] 00543 susyAddEventContent = [ # PAT Objects 00544 #'keep *_triggerMatched*_*_*', 00545 # Keep PF2PAT output 00546 'keep *_selectedPatMuonsPF_*_*', 00547 'keep *_selectedPatElectronsPF_*_*', 00548 'keep *_selectedPatTausPF_*_*', 00549 'keep *_selectedPatJetsPF_*_*', 00550 #L1 trigger info 00551 'keep L1GlobalTriggerObjectMapRecord_*_*_*', 00552 'keep L1GlobalTriggerReadoutRecord_*_*_*', 00553 # Generator information 00554 'keep recoGenJets_*GenJets*_*_*', 00555 'keep recoGenMETs_*_*_*', 00556 #Number of processed events 00557 'keep edmMergeableCounter_eventCountProducer_*_*', 00558 'keep recoRecoChargedRefCandidates_trackRefsForJets_*_*', 00559 #'keep recoTrackJets_ak5TrackJets_*_*', 00560 'keep *_electronMergedSeeds_*_*', 00561 'keep *_Conversions_*_*', 00562 'keep recoPFCandidates_particleFlow_*_*', 00563 #'keep recoSuperClusters_corrected*_*_*', 00564 #'keep recoSuperClusters_pfElectronTranslator_*_*', 00565 #'keep *_gsfElectronCores_*_*', #Keep electron core 00566 #'keep *_photonCore_*_*', #Keep electron core 00567 'keep recoConversions_conversions_*_*', 00568 'keep recoTracks_*onversions_*_*', 00569 'keep HcalNoiseSummary_*_*_*', #Keep the one in RECO 00570 'keep *BeamHaloSummary_*_*_*', 00571 # Keep Gap Vertices for comparison 00572 'keep *_offlinePrimaryVerticesGap_*_*', 00573 'keep *_offlinePrimaryVerticesGapWithBS_*_*', 00574 #DQM 00575 'keep *_MEtoEDMConverter_*_PAT', 00576 'drop recoTracks_generalTracks*_*_*', 00577 'drop *_towerMaker_*_*', 00578 'keep *_pfType1CorrectedMet*_*_*', 00579 ] 00580 keepList.extend(patEventContent) 00581 keepList.extend(patExtraAodEventContent) 00582 keepList.extend(patTriggerEventContent) 00583 keepList.extend(patEventContentTriggerMatch) 00584 keepList.extend(susyAddEventContent) 00585 return keepList 00586
def SUSY_pattuple_cff::loadPAT | ( | process, | |
JetMETCorrections, | |||
extMatch | |||
) |
Definition at line 59 of file SUSY_pattuple_cff.py.
00060 : 00061 #-- Changes for electron and photon ID ---------------------------------------- 00062 from PhysicsTools.PatAlgos.tools.pfTools import usePFIso 00063 usePFIso( process ) 00064 process.patElectrons.isolationValues = cms.PSet( 00065 pfNeutralHadrons = cms.InputTag("elPFIsoValueNeutral03PFIdPFIso"), 00066 pfChargedAll = cms.InputTag("elPFIsoValueChargedAll03PFIdPFIso"), 00067 pfPUChargedHadrons = cms.InputTag("elPFIsoValuePU03PFIdPFIso"), 00068 pfPhotons = cms.InputTag("elPFIsoValueGamma03PFIdPFIso"), 00069 pfChargedHadrons = cms.InputTag("elPFIsoValueCharged03PFIdPFIso") 00070 ) 00071 process.patElectrons.isolationValuesNoPFId = cms.PSet( 00072 pfNeutralHadrons = cms.InputTag("elPFIsoValueNeutral03NoPFIdPFIso"), 00073 pfChargedAll = cms.InputTag("elPFIsoValueChargedAll03NoPFIdPFIso"), 00074 pfPUChargedHadrons = cms.InputTag("elPFIsoValuePU03NoPFIdPFIso"), 00075 pfPhotons = cms.InputTag("elPFIsoValueGamma03NoPFIdPFIso"), 00076 pfChargedHadrons = cms.InputTag("elPFIsoValueCharged03NoPFIdPFIso") 00077 ) 00078 process.patDefaultSequence.replace(process.patElectrons,process.eleIsoSequence+process.patElectrons) 00079 process.patDefaultSequence.replace(process.patMuons,process.muIsoSequence+process.patMuons) 00080 00081 # Turn off photon-electron cleaning (i.e., flag only) 00082 process.cleanPatPhotons.checkOverlaps.electrons.requireNoOverlaps = False 00083 00084 # Embed tracks, since we drop them 00085 process.patElectrons.embedTrack = True 00086 process.patMuons.embedTrack = True 00087 00088 #include tau decay mode in pat::Taus (elese it will just be uninitialized) 00089 #decay modes are dropped and have to be redone, this is a bit dangorous since the decay modes insered are *not* the ones used in RECO 00090 #process.patTaus.addDecayMode = True 00091 #process.makePatTaus.replace( process.patTaus, process.shrinkingConePFTauDecayModeProducer + process.patTaus ) 00092 00093 #Additional electron ids as defined for VBTF 00094 process.load("ElectroWeakAnalysis.WENu.simpleEleIdSequence_cff") 00095 process.patElectrons.electronIDSources = cms.PSet( 00096 eidTight = cms.InputTag("eidTight"), 00097 eidLoose = cms.InputTag("eidLoose"), 00098 eidRobustTight = cms.InputTag("eidRobustTight"), 00099 eidRobustHighEnergy = cms.InputTag("eidRobustHighEnergy"), 00100 eidRobustLoose = cms.InputTag("eidRobustLoose"), 00101 simpleEleId95relIso= cms.InputTag("simpleEleId95relIso"), 00102 simpleEleId90relIso= cms.InputTag("simpleEleId90relIso"), 00103 simpleEleId85relIso= cms.InputTag("simpleEleId85relIso"), 00104 simpleEleId80relIso= cms.InputTag("simpleEleId80relIso"), 00105 simpleEleId70relIso= cms.InputTag("simpleEleId70relIso"), 00106 simpleEleId60relIso= cms.InputTag("simpleEleId60relIso"), 00107 simpleEleId95cIso= cms.InputTag("simpleEleId95cIso"), 00108 simpleEleId90cIso= cms.InputTag("simpleEleId90cIso"), 00109 simpleEleId85cIso= cms.InputTag("simpleEleId85cIso"), 00110 simpleEleId80cIso= cms.InputTag("simpleEleId80cIso"), 00111 simpleEleId70cIso= cms.InputTag("simpleEleId70cIso"), 00112 simpleEleId60cIso= cms.InputTag("simpleEleId60cIso")) 00113 process.patDefaultSequence.replace(process.patElectrons,process.simpleEleIdSequence+process.patElectrons) 00114 00115 #-- Tuning of Monte Carlo matching -------------------------------------------- 00116 # Also match with leptons of opposite charge 00117 process.electronMatch.checkCharge = False 00118 process.electronMatch.maxDeltaR = cms.double(0.2) 00119 process.electronMatch.maxDPtRel = cms.double(999999.) 00120 process.muonMatch.checkCharge = False 00121 process.muonMatch.maxDeltaR = cms.double(0.2) 00122 process.muonMatch.maxDPtRel = cms.double(999999.) 00123 #process.tauMatch.checkCharge = False 00124 #process.tauMatch.maxDeltaR = cms.double(0.3) 00125 process.patJetPartonMatch.maxDeltaR = cms.double(0.25) 00126 process.patJetPartonMatch.maxDPtRel = cms.double(999999.) 00127 process.patJetGenJetMatch.maxDeltaR = cms.double(0.25) 00128 process.patJetGenJetMatch.maxDPtRel = cms.double(999999.) 00129 if extMatch: 00130 process.electronMatch.mcStatus = cms.vint32(1,5) 00131 process.electronMatch.matched = "mergedTruth" 00132 process.muonMatch.mcStatus = cms.vint32(1,5) 00133 process.muonMatch.matched = "mergedTruth" 00134 process.patJetPartonMatch.matched = "mergedTruth" 00135 process.patJetPartons.src = "mergedTruth" 00136 process.photonMatch.matched = "mergedTruth" 00137 #process.tauGenJets.genParticles = "mergedTruth" 00138 #process.tauMatch.matched = "mergedTruth" 00139 00140 00141 #-- Taus ---------------------------------------------------------------------- 00142 #some tau discriminators have been switched off during development. They can be switched on again... 00143 #setattr(process.patTaus.tauIDSources, "trackIsolation", cms.InputTag("shrinkingConePFTauDiscriminationByTrackIsolation")) 00144 #setattr(process.patTaus.tauIDSources, "ecalIsolation", cms.InputTag("shrinkingConePFTauDiscriminationByECALIsolation")) 00145 #setattr(process.patTaus.tauIDSources, "byIsolation", cms.InputTag("shrinkingConePFTauDiscriminationByIsolation")) 00146 #setattr(process.patTaus.tauIDSources, "leadingPionPtCut", cms.InputTag("shrinkingConePFTauDiscriminationByLeadingPionPtCut")) 00147 #setattr(process.patTaus.tauIDSources, "trackIsolationUsingLeadingPion", cms.InputTag("shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion")) 00148 #setattr(process.patTaus.tauIDSources, "ecalIsolationUsingLeadingPion", cms.InputTag("shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion")) 00149 #setattr(process.patTaus.tauIDSources, "byIsolationUsingLeadingPion", cms.InputTag("shrinkingConePFTauDiscriminationByIsolationUsingLeadingPion")) 00150 #setattr(process.patTaus.tauIDSources, "byTaNC", cms.InputTag("shrinkingConePFTauDiscriminationByTaNC")) 00151 #setattr(process.patTaus.tauIDSources, "byTaNCfrOnePercent", cms.InputTag("shrinkingConePFTauDiscriminationByTaNCfrOnePercent")) 00152 #setattr(process.patTaus.tauIDSources, "byTaNCfrHalfPercent", cms.InputTag("shrinkingConePFTauDiscriminationByTaNCfrHalfPercent")) 00153 #setattr(process.patTaus.tauIDSources, "byTaNCfrQuarterPercent", cms.InputTag("shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent")) 00154 #setattr(process.patTaus.tauIDSources, "byTaNCfrTenthPercent", cms.InputTag("shrinkingConePFTauDiscriminationByTaNCfrTenthPercent")) 00155 00156 00157 #-- Jet corrections ----------------------------------------------------------- 00158 # L1 FastJet jet corrections 00159 # kt6PFJets for FastJet corrections are already run and placed before jetCorrection calculation 00160 # apply FastJet corrections only if demanded 00161 # TODO: Check if still necessary to switch here 00162 if ("L1FastJet" in JetMETCorrections): 00163 process.pfJets.doAreaFastjet = True 00164 process.pfJetsPF.doAreaFastjet = True
def SUSY_pattuple_cff::loadPATTriggers | ( | process, | |
HLTMenu, | |||
theJetNames, | |||
electronMatches, | |||
muonMatches, | |||
tauMatches, | |||
jetMatches, | |||
photonMatches | |||
) |
Definition at line 342 of file SUSY_pattuple_cff.py.
00343 : 00344 #-- Trigger matching ---------------------------------------------------------- 00345 def pfSwitchOnTriggerMatchEmbedding(process, matches, src, embedder, sequence='patDefaultSequencePF'): 00346 setattr(process,src.replace('PF','TriggerMatchPF'),getattr(process,embedder).clone(src=src, matches=matches)) 00347 theSequence = getattr(process,sequence) 00348 theSequence += getattr(process,src.replace('PF','TriggerMatchPF')) 00349 from PhysicsTools.PatAlgos.tools.trigTools import switchOnTrigger, switchOnTriggerMatchEmbedding 00350 switchOnTrigger(process, triggerProducer='patTrigger', triggerEventProducer='patTriggerEvent', sequence='patDefaultSequence', hltProcess=HLTMenu) 00351 process.patTriggerPF = process.patTrigger.clone() 00352 process.patTriggerEventPF = process.patTriggerEvent.clone() 00353 process.patDefaultSequencePF += process.patTriggerPF 00354 process.patDefaultSequencePF += process.patTriggerEventPF 00355 switchOnTrigger(process, triggerProducer='patTriggerPF', triggerEventProducer='patTriggerEventPF', sequence='patDefaultSequencePF', hltProcess=HLTMenu) 00356 #Electrons 00357 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanElectronTriggerMatchHLTEle20SWL1R 00358 process.patElectronMatch = cleanElectronTriggerMatchHLTEle20SWL1R.clone(matchedCuts = cms.string( electronMatches )) 00359 process.patElectronMatchPF = cleanElectronTriggerMatchHLTEle20SWL1R.clone(matchedCuts = cms.string( electronMatches ), src='selectedPatElectronsPF') 00360 process.patDefaultSequencePF += process.patElectronMatchPF 00361 switchOnTriggerMatchEmbedding( process, ['patElectronMatch'], hltProcess=HLTMenu) 00362 pfSwitchOnTriggerMatchEmbedding( process, ['patElectronMatchPF'], 'selectedPatElectronsPF', 'cleanPatElectronsTriggerMatch' ) 00363 #Muons 00364 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanMuonTriggerMatchHLTMu9 00365 process.patMuonMatch = cleanMuonTriggerMatchHLTMu9.clone(matchedCuts = cms.string( muonMatches )) 00366 process.patMuonMatchPF = cleanMuonTriggerMatchHLTMu9.clone(matchedCuts = cms.string( muonMatches ),src = 'selectedPatMuonsPF',matched='patTriggerPF') 00367 process.patDefaultSequencePF += process.patMuonMatchPF 00368 switchOnTriggerMatchEmbedding( process, ['patMuonMatch'], hltProcess=HLTMenu) 00369 pfSwitchOnTriggerMatchEmbedding( process, ['patMuonMatchPF'], 'selectedPatMuonsPF', 'cleanPatMuonsTriggerMatch' ) 00370 #Photons 00371 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanPhotonTriggerMatchHLTPhoton20CleanedL1R 00372 process.patPhotonMatch = cleanPhotonTriggerMatchHLTPhoton20CleanedL1R.clone(matchedCuts = cms.string( photonMatches )) 00373 switchOnTriggerMatchEmbedding( process, ['patPhotonMatch'], hltProcess=HLTMenu) 00374 #Jets 00375 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanJetTriggerMatchHLTJet15U 00376 process.patJetMatchAK5Calo = cleanJetTriggerMatchHLTJet15U.clone(matchedCuts = cms.string( jetMatches ),src='cleanPatJetsAK5Calo') 00377 switchOnTriggerMatchEmbedding( process, ['patJetMatchAK5Calo'], hltProcess=HLTMenu) 00378 for jetType in theJetNames: 00379 setattr(process,'patJetMatch'+jetType,cleanJetTriggerMatchHLTJet15U.clone(matchedCuts = cms.string( jetMatches ),src = 'cleanPatJets'+jetType)) 00380 process.patJetMatchPF = cleanJetTriggerMatchHLTJet15U.clone(src='selectedPatJetsPF', matchedCuts = cms.string( jetMatches )) 00381 process.patDefaultSequencePF += process.patJetMatchPF 00382 for jetType in theJetNames: 00383 switchOnTriggerMatchEmbedding( process, ['patJetMatch'+jetType], hltProcess=HLTMenu) 00384 pfSwitchOnTriggerMatchEmbedding( process, ['patJetMatchPF'], 'selectedPatJetsPF', 'cleanPatJetsAK5CaloTriggerMatch' ) 00385 #Taus 00386 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanTauTriggerMatchHLTDoubleLooseIsoTau15 00387 process.patTauMatch = cleanTauTriggerMatchHLTDoubleLooseIsoTau15.clone(matchedCuts = cms.string( tauMatches )) 00388 process.patTauMatchPF = cleanTauTriggerMatchHLTDoubleLooseIsoTau15.clone(src='selectedPatTausPF', matchedCuts = cms.string( tauMatches )) 00389 process.patDefaultSequencePF += process.patTauMatchPF 00390 switchOnTriggerMatchEmbedding( process, ['patTauMatch'], hltProcess=HLTMenu) 00391 pfSwitchOnTriggerMatchEmbedding( process, ['patTauMatchPF'], 'selectedPatTausPF', 'cleanPatTausTriggerMatch' )
def SUSY_pattuple_cff::loadPF2PAT | ( | process, | |
mcInfo, | |||
JetMETCorrections, | |||
extMatch, | |||
doSusyTopProjection, | |||
doType1MetCorrection, | |||
doType0MetCorrection, | |||
postfix | |||
) |
Definition at line 165 of file SUSY_pattuple_cff.py.
00166 : 00167 #-- PAT standard config ------------------------------------------------------- 00168 process.load("PhysicsTools.PatAlgos.patSequences_cff") 00169 #-- Jet corrections ----------------------------------------------------------- 00170 process.patJetCorrFactors.levels = JetMETCorrections 00171 #-- PF2PAT config ------------------------------------------------------------- 00172 from PhysicsTools.PatAlgos.tools.pfTools import usePF2PAT 00173 usePF2PAT(process,runPF2PAT=True, 00174 jetAlgo = 'AK5', 00175 runOnMC = (mcInfo==1), 00176 postfix = postfix, 00177 jetCorrections = ('AK5PFchs', JetMETCorrections), 00178 typeIMetCorrections = doType1MetCorrection) 00179 00180 if doType0MetCorrection: 00181 getattr(process,'patType1CorrectedPFMet'+postfix).srcType1Corrections = cms.VInputTag( 00182 cms.InputTag("patPFJetMETtype1p2Corr"+postfix,"type1"), 00183 cms.InputTag("patPFMETtype0Corr"+postfix) 00184 ) 00185 00186 00187 #process.patJetsPF.embedGenJetMatch = False 00188 #process.patJetsPF.embedPFCandidates = False 00189 #drop tracks 00190 process.patElectronsPF.embedTrack = True 00191 process.patMuonsPF.embedTrack = True 00192 process.electronMatchPF.maxDeltaR = cms.double(0.2) 00193 process.electronMatchPF.maxDPtRel = cms.double(999999.) 00194 process.electronMatchPF.checkCharge = False 00195 process.muonMatchPF.maxDeltaR = cms.double(0.2) 00196 process.muonMatchPF.maxDPtRel = cms.double(999999.) 00197 process.muonMatchPF.checkCharge = False 00198 if extMatch: 00199 process.electronMatchPF.mcStatus = cms.vint32(1,5) 00200 process.electronMatchPF.matched = "mergedTruth" 00201 process.muonMatchPF.mcStatus = cms.vint32(1,5) 00202 process.muonMatchPF.matched = "mergedTruth" 00203 process.genParticlesForJets.src = "mergedTruth" 00204 process.genParticlesForJetsNoMuNoNu.src = "mergedTruth" 00205 process.genParticlesForJetsNoNu.src = "mergedTruth" 00206 process.patJetPartonMatchPF.matched = "mergedTruth" 00207 process.patJetPartonsPF.src = "mergedTruth" 00208 process.photonMatchPF.matched = "mergedTruth" 00209 #process.tauGenJetsPF.genParticles = "mergedTruth" 00210 #process.tauMatchPF.matched = "mergedTruth" 00211 00212 #Remove jet pt cut 00213 #process.pfJetsPF.ptMin = 0. 00214 #include tau decay mode in pat::Taus (elese it will just be uninitialized) 00215 #process.patTausPF.addDecayMode = True 00216 #process.patTausPF.decayModeSrc = "shrinkingConePFTauDecayModeProducerPF" 00217 00218 #Set isolation cone to 0.3 for PF leptons 00219 # TODO: fix this for electrons and muons 00220 #process.pfElectrons.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("elPFIsoValueCharged03PFId")) 00221 #process.pfElectrons.deltaBetaIsolationValueMap = cms.InputTag("elPFIsoValuePU03PFId") 00222 #process.pfElectrons.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("elPFIsoValueNeutral03PFId"), cms.InputTag("elPFIsoValueGamma03PFId")) 00223 #process.pfIsolatedElectrons.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("elPFIsoValueCharged03PFId")) 00224 #process.pfIsolatedElectrons.deltaBetaIsolationValueMap = cms.InputTag("elPFIsoValuePU03PFId") 00225 #process.pfIsolatedElectrons.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("elPFIsoValueNeutral03PFId"), cms.InputTag("elPFIsoValueGamma03PFId")) 00226 00227 #process.pfElectronsPF.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("elPFIsoValueCharged03PFIdPF")) 00228 #process.pfElectronsPF.deltaBetaIsolationValueMap = cms.InputTag("elPFIsoValuePU03PFIdPF") 00229 #process.pfElectronsPF.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("elPFIsoValueNeutral03PFIdPF"), cms.InputTag("elPFIsoValueGamma03PFIdPF")) 00230 #process.pfIsolatedElectronsPF.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("elPFIsoValueCharged03PFIdPF")) 00231 #process.pfIsolatedElectronsPF.deltaBetaIsolationValueMap = cms.InputTag("elPFIsoValuePU03PFIdPF") 00232 #process.pfIsolatedElectronsPF.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("elPFIsoValueNeutral03PFIdPF"), cms.InputTag("elPFIsoValueGamma03PFIdPF")) 00233 00234 #process.pfMuons.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("muPFIsoValueCharged03mu03")) 00235 #process.pfMuons.deltaBetaIsolationValueMap = cms.InputTag("muPFIsoValuePU03") 00236 #process.pfMuons.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("muPFIsoValueNeutral03"), cms.InputTag("muPFIsoValueGamma03")) 00237 #process.pfIsolatedMuons.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("muPFIsoValueCharged03mu03")) 00238 #process.pfIsolatedMuons.deltaBetaIsolationValueMap = cms.InputTag("muPFIsoValuePU03") 00239 #process.pfIsolatedMuons.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("muPFIsoValueNeutral03"), cms.InputTag("muPFIsoValueGamma03")) 00240 00241 #process.pfMuonsPF.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("muPFIsoValueCharged03mu03PF")) 00242 #process.pfMuonsPF.deltaBetaIsolationValueMap = cms.InputTag("muPFIsoValuePU03PF") 00243 #process.pfMuonsPF.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("muPFIsoValueNeutral03PF"), cms.InputTag("muPFIsoValueGamma03PF")) 00244 #process.pfIsolatedMuonsPF.isolationValueMapsCharged = cms.VInputTag(cms.InputTag("muPFIsoValueCharged03mu03PF")) 00245 #process.pfIsolatedMuonsPF.deltaBetaIsolationValueMap = cms.InputTag("muPFIsoValuePU03PF") 00246 #process.pfIsolatedMuonsPF.isolationValueMapsNeutral = cms.VInputTag(cms.InputTag("muPFIsoValueNeutral03PF"), cms.InputTag("muPFIsoValueGamma03PF")) 00247 00248 #-- Enable pileup sequence ------------------------------------------------------------- 00249 #Vertices 00250 process.goodVertices = cms.EDFilter("VertexSelector", 00251 src = cms.InputTag("offlinePrimaryVertices"), 00252 cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), 00253 filter = cms.bool(False), 00254 ) 00255 00256 process.pfPileUpPF.Vertices = "goodVertices" 00257 process.pfPileUpPF.Enable = True 00258 00259 process.pfNoPileUpSequencePF.replace(process.pfPileUpPF, 00260 process.goodVertices + process.pfPileUpPF) 00261 00262 if not doSusyTopProjection: 00263 return 00264 #-- Top projection selection ----------------------------------------------------------- 00265 #Electrons 00266 #relax all selectors *before* pat-lepton creation 00267 process.pfElectronsFromVertexPF.dzCut = 9999.0 00268 process.pfElectronsFromVertexPF.d0Cut = 9999.0 00269 process.pfSelectedElectronsPF.cut = "" 00270 process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone(isolationCut = 3.) 00271 process.pfIsolatedElectronsPF.isolationCut = 0.15 00272 00273 process.pfElectronsFromGoodVertex = cms.EDFilter( 00274 "IPCutPFCandidateSelector", 00275 src = cms.InputTag("pfIsolatedElectronsPF"), # PFCandidate source 00276 vertices = cms.InputTag("goodVertices"), # vertices source 00277 d0Cut = cms.double(0.04), # transverse IP 00278 dzCut = cms.double(1.), # longitudinal IP 00279 d0SigCut = cms.double(99.), # transverse IP significance 00280 dzSigCut = cms.double(99.), # longitudinal IP significance 00281 ) 00282 00283 electronSelection = "abs( eta ) < 2.5 & pt > 5" 00284 electronSelection += " & mva_e_pi > 0.4" # same as patElectron::mva() 00285 #electronSelection += " & (isEB & (sigmaIetaIeta < 0.024 & hadronicOverEm < 0.15) | isEE & (sigmaIetaIeta < 0.040 & hadronicOverEm < 0.10))" #caloIdVL 00286 #electronSelection += " & (isEB & (deltaPhiSuperClusterTrackAtVtx < 0.15 & deltaEtaSuperClusterTrackAtVtx < 0.01) | isEE & (deltaPhiSuperClusterTrackAtVtx < 0.10 & deltaEtaSuperClusterTrackAtVtx < 0.01))" #trkIdVL 00287 electronSelection += " & gsfTrackRef().isNonnull() & gsfTrackRef().trackerExpectedHitsInner().numberOfHits() <= 0" 00288 process.pfUnclusteredElectronsPF = cms.EDFilter( "GenericPFCandidateSelector", 00289 src = cms.InputTag("pfElectronsFromGoodVertex"), #pfSelectedElectronsPF 00290 cut = cms.string(electronSelection) 00291 ) 00292 process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF, 00293 process.pfIsolatedElectronsPF + 00294 process.goodVertices * process.pfElectronsFromGoodVertex + 00295 process.pfUnclusteredElectronsPF + process.pfRelaxedElectronsPF) 00296 process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF" 00297 process.pfNoElectronPF.topCollection = "pfUnclusteredElectronsPF" 00298 #Muons 00299 #relaxe built-in preselection 00300 process.pfMuonsFromVertexPF.dzCut = 9999.0 00301 process.pfMuonsFromVertexPF.d0Cut = 9999.0 00302 process.pfSelectedMuonsPF.cut = "" 00303 process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone(isolationCut = 3) 00304 process.pfIsolatedMuonsPF.isolationCut = 0.15 00305 00306 process.pfMuonsFromGoodVertex = cms.EDFilter( 00307 "IPCutPFCandidateSelector", 00308 src = cms.InputTag("pfIsolatedMuonsPF"), # PFCandidate source 00309 vertices = cms.InputTag("goodVertices"), # vertices source 00310 d0Cut = cms.double(0.02), # transverse IP 00311 dzCut = cms.double(1.), # longitudinal IP 00312 d0SigCut = cms.double(99.), # transverse IP significance 00313 dzSigCut = cms.double(99.), # longitudinal IP significance 00314 ) 00315 muonSelection = "abs( eta ) < 2.5 & pt > 5" 00316 #GlobalMuonPromptTight 00317 muonSelection += " & muonRef().isNonnull & muonRef().isGlobalMuon()" 00318 muonSelection += " & muonRef().isTrackerMuon() & muonRef().numberOfMatches > 1" 00319 muonSelection += " & muonRef().globalTrack().normalizedChi2() < 10" 00320 muonSelection += " & muonRef().Track().numberOfValidHits() > 10" 00321 muonSelection += " & muonRef().globalTrack().hitPattern().numberOfValidMuonHits() > 0" 00322 muonSelection += " & muonRef().innerTrack().hitPattern().numberOfValidPixelHits() > 0" 00323 process.pfUnclusteredMuonsPF = cms.EDFilter( "GenericPFCandidateSelector", 00324 src = cms.InputTag("pfMuonsFromGoodVertex"), #pfSelectedMuonsPF 00325 cut = cms.string(muonSelection) 00326 ) 00327 process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF, 00328 process.pfIsolatedMuonsPF + 00329 process.goodVertices * process.pfMuonsFromGoodVertex + 00330 process.pfUnclusteredMuonsPF + process.pfRelaxedMuonsPF) 00331 process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF" 00332 process.pfNoMuonPF.topCollection = "pfUnclusteredMuonsPF" 00333 #Taus 00334 # TODO: Fix taus in 52X 00335 #process.pfTausPF.discriminators = cms.VPSet() 00336 #process.pfUnclusteredTausPF = process.pfTausPF.clone( 00337 # cut = cms.string("pt < 0") 00338 #) 00339 #process.pfTauSequencePF.replace(process.pfTausPF, process.pfTausPF+ process.pfUnclusteredTausPF) 00340 #process.pfNoTauPF.topCollection = "pfUnclusteredTausPF" 00341
def SUSY_pattuple_cff::loadSusyValidation | ( | process | ) |
Definition at line 527 of file SUSY_pattuple_cff.py.
00528 : 00529 process.load("JetMETCorrections.Configuration.JetCorrectionProducers_cff") 00530 process.load("DQM.Physics.susyValidation_cfi") 00531 process.load("DQMServices.Components.MEtoEDMConverter_cfi") 00532 process.load("DQMServices.Core.DQM_cfg") 00533 process.load("DQMServices.Components.DQMEnvironment_cfi") 00534 process.DQMStore = cms.Service("DQMStore") 00535 process.DQMStore.collateHistograms = cms.untracked.bool(True) 00536 process.options = cms.untracked.PSet( 00537 fileMode = cms.untracked.string('NOMERGE') 00538 )
def SUSY_pattuple_cff::loadType1METSequence | ( | process | ) |
Definition at line 392 of file SUSY_pattuple_cff.py.
00393 : 00394 process.load("JetMETCorrections.Type1MET.pfMETCorrections_cff") 00395 ## Type 0? 00396 # process.pfType1CorrectedMet.srcCHSSums = cms.VInputTag(cms.InputTag("pfchsMETcorr","type0")) 00397 # process.pfType1CorrectedMet.applyType2Corrections = cms.bool(False) 00398 # process.pfType1CorrectedMet.type0Rsoft = cms.double(0.6) 00399 # process.pfType1CorrectedMet.applyType0Corrections = cms.bool(True) 00400 process.Type1METSequence = cms.Sequence(process.producePFMETCorrections) 00401
def SUSY_pattuple_cff::removeMCDependence | ( | process | ) |
Definition at line 522 of file SUSY_pattuple_cff.py.
00523 : 00524 #-- Remove MC dependence ------------------------------------------------------ 00525 from PhysicsTools.PatAlgos.tools.coreTools import removeMCMatching 00526 removeMCMatching(process, ['All'])