00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 import FWCore.ParameterSet.Config as cms
00011
00012 def addDefaultSUSYPAT(process,mcInfo=True,HLTMenu='HLT',JetMETCorrections=['L2Relative', 'L3Absolute'],mcVersion='',theJetNames = ['AK5PF'],doValidation=False,extMatch=False,doSusyTopProjection=False,doType1MetCorrection=True,doType0MetCorrection=False):
00013 loadPF2PAT(process,mcInfo,JetMETCorrections,extMatch,doSusyTopProjection,doType1MetCorrection,doType0MetCorrection,'PF')
00014 addTagInfos(process,JetMETCorrections)
00015 if not mcInfo:
00016 removeMCDependence(process)
00017 loadPAT(process,JetMETCorrections,extMatch)
00018 addJetMET(process,theJetNames,JetMETCorrections,mcVersion)
00019
00020
00021
00022
00023 process.eventCountProducer = cms.EDProducer("EventCountProducer")
00024
00025
00026
00027 process.susyPatDefaultSequence = cms.Sequence( process.eventCountProducer
00028
00029
00030 * process.patPF2PATSequence
00031 * process.patPF2PATSequencePF
00032 )
00033
00034 if mcInfo and extMatch:
00035 extensiveMatching(process)
00036 process.susyPatDefaultSequence.replace(process.patDefaultSequence, process.extensiveMatching+process.patDefaultSequence)
00037
00038 if doValidation:
00039 loadSusyValidation(process)
00040 process.susyPatDefaultSequence.replace(process.patPF2PATSequencePF, process.patPF2PATSequencePF * process.ak5CaloJetsL2L3 * process.metJESCorAK5CaloJet * process.RecoSusyValidation * process.PatSusyValidation*process.MEtoEDMConverter)
00041
00042 def extensiveMatching(process):
00043 process.load("SimGeneral.TrackingAnalysis.trackingParticlesNoSimHits_cfi")
00044 process.load("SimMuon.MCTruth.MuonAssociatorByHits_cfi")
00045 process.mergedTruth = cms.EDProducer("GenPlusSimParticleProducer",
00046 src = cms.InputTag("g4SimHits"),
00047 setStatus = cms.int32(5),
00048 filter = cms.vstring("pt > 0.0"),
00049 genParticles = cms.InputTag("genParticles")
00050 )
00051 process.load("MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi")
00052
00053 from MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi import addUserData as addClassByHits
00054 addClassByHits(process.patMuons,labels=['classByHitsGlb'],extraInfo=True)
00055 addClassByHits(process.patMuonsPF,labels=['classByHitsGlb'],extraInfo=True)
00056
00057 process.extensiveMatching = cms.Sequence(process.mergedTruth+process.muonClassificationByHits)
00058
00059 def loadPAT(process,JetMETCorrections,extMatch):
00060
00061 from PhysicsTools.PatAlgos.tools.pfTools import usePFIso
00062 usePFIso( process )
00063 process.patElectrons.isolationValues = cms.PSet(
00064 pfNeutralHadrons = cms.InputTag("elPFIsoValueNeutral03PFIdPFIso"),
00065 pfChargedAll = cms.InputTag("elPFIsoValueChargedAll03PFIdPFIso"),
00066 pfPUChargedHadrons = cms.InputTag("elPFIsoValuePU03PFIdPFIso"),
00067 pfPhotons = cms.InputTag("elPFIsoValueGamma03PFIdPFIso"),
00068 pfChargedHadrons = cms.InputTag("elPFIsoValueCharged03PFIdPFIso")
00069 )
00070 process.patElectrons.isolationValuesNoPFId = cms.PSet(
00071 pfNeutralHadrons = cms.InputTag("elPFIsoValueNeutral03NoPFIdPFIso"),
00072 pfChargedAll = cms.InputTag("elPFIsoValueChargedAll03NoPFIdPFIso"),
00073 pfPUChargedHadrons = cms.InputTag("elPFIsoValuePU03NoPFIdPFIso"),
00074 pfPhotons = cms.InputTag("elPFIsoValueGamma03NoPFIdPFIso"),
00075 pfChargedHadrons = cms.InputTag("elPFIsoValueCharged03NoPFIdPFIso")
00076 )
00077 process.patDefaultSequence.replace(process.patElectrons,process.eleIsoSequence+process.patElectrons)
00078 process.patDefaultSequence.replace(process.patMuons,process.muIsoSequence+process.patMuons)
00079
00080
00081 process.cleanPatPhotons.checkOverlaps.electrons.requireNoOverlaps = False
00082
00083
00084 process.patElectrons.embedTrack = True
00085 process.patMuons.embedTrack = True
00086
00087
00088
00089
00090
00091
00092
00093 process.load("ElectroWeakAnalysis.WENu.simpleEleIdSequence_cff")
00094 process.patElectrons.electronIDSources = cms.PSet(
00095 eidTight = cms.InputTag("eidTight"),
00096 eidLoose = cms.InputTag("eidLoose"),
00097 eidRobustTight = cms.InputTag("eidRobustTight"),
00098 eidRobustHighEnergy = cms.InputTag("eidRobustHighEnergy"),
00099 eidRobustLoose = cms.InputTag("eidRobustLoose"),
00100 simpleEleId95relIso= cms.InputTag("simpleEleId95relIso"),
00101 simpleEleId90relIso= cms.InputTag("simpleEleId90relIso"),
00102 simpleEleId85relIso= cms.InputTag("simpleEleId85relIso"),
00103 simpleEleId80relIso= cms.InputTag("simpleEleId80relIso"),
00104 simpleEleId70relIso= cms.InputTag("simpleEleId70relIso"),
00105 simpleEleId60relIso= cms.InputTag("simpleEleId60relIso"),
00106 simpleEleId95cIso= cms.InputTag("simpleEleId95cIso"),
00107 simpleEleId90cIso= cms.InputTag("simpleEleId90cIso"),
00108 simpleEleId85cIso= cms.InputTag("simpleEleId85cIso"),
00109 simpleEleId80cIso= cms.InputTag("simpleEleId80cIso"),
00110 simpleEleId70cIso= cms.InputTag("simpleEleId70cIso"),
00111 simpleEleId60cIso= cms.InputTag("simpleEleId60cIso"))
00112 process.patDefaultSequence.replace(process.patElectrons,process.simpleEleIdSequence+process.patElectrons)
00113
00114
00115
00116 process.electronMatch.checkCharge = False
00117 process.electronMatch.maxDeltaR = cms.double(0.2)
00118 process.electronMatch.maxDPtRel = cms.double(999999.)
00119 process.muonMatch.checkCharge = False
00120 process.muonMatch.maxDeltaR = cms.double(0.2)
00121 process.muonMatch.maxDPtRel = cms.double(999999.)
00122
00123
00124 process.patJetPartonMatch.maxDeltaR = cms.double(0.25)
00125 process.patJetPartonMatch.maxDPtRel = cms.double(999999.)
00126 process.patJetGenJetMatch.maxDeltaR = cms.double(0.25)
00127 process.patJetGenJetMatch.maxDPtRel = cms.double(999999.)
00128 if extMatch:
00129 process.electronMatch.mcStatus = cms.vint32(1,5)
00130 process.electronMatch.matched = "mergedTruth"
00131 process.muonMatch.mcStatus = cms.vint32(1,5)
00132 process.muonMatch.matched = "mergedTruth"
00133 process.patJetPartonMatch.matched = "mergedTruth"
00134 process.patJetPartons.src = "mergedTruth"
00135 process.photonMatch.matched = "mergedTruth"
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161 if ("L1FastJet" in JetMETCorrections):
00162 process.pfJets.doAreaFastjet = True
00163 process.pfJetsPF.doAreaFastjet = True
00164
00165 def loadPF2PAT(process,mcInfo,JetMETCorrections,extMatch,doSusyTopProjection,doType1MetCorrection,doType0MetCorrection,postfix):
00166
00167 process.load("PhysicsTools.PatAlgos.patSequences_cff")
00168
00169 process.patJetCorrFactors.levels = JetMETCorrections
00170
00171 from PhysicsTools.PatAlgos.tools.pfTools import usePF2PAT
00172 usePF2PAT(process,runPF2PAT=True,
00173 jetAlgo = 'AK5',
00174 runOnMC = (mcInfo==1),
00175 postfix = postfix,
00176 jetCorrections = ('AK5PFchs', JetMETCorrections),
00177 typeIMetCorrections = doType1MetCorrection)
00178
00179 if doType0MetCorrection:
00180 getattr(process,'patType1CorrectedPFMet'+postfix).srcType1Corrections = cms.VInputTag(
00181 cms.InputTag("patPFJetMETtype1p2Corr"+postfix,"type1"),
00182 cms.InputTag("patPFMETtype0Corr"+postfix)
00183 )
00184
00185
00186
00187
00188
00189 process.patElectronsPF.embedTrack = True
00190 process.patMuonsPF.embedTrack = True
00191 process.electronMatchPF.maxDeltaR = cms.double(0.2)
00192 process.electronMatchPF.maxDPtRel = cms.double(999999.)
00193 process.electronMatchPF.checkCharge = False
00194 process.muonMatchPF.maxDeltaR = cms.double(0.2)
00195 process.muonMatchPF.maxDPtRel = cms.double(999999.)
00196 process.muonMatchPF.checkCharge = False
00197 if extMatch:
00198 process.electronMatchPF.mcStatus = cms.vint32(1,5)
00199 process.electronMatchPF.matched = "mergedTruth"
00200 process.muonMatchPF.mcStatus = cms.vint32(1,5)
00201 process.muonMatchPF.matched = "mergedTruth"
00202 process.genParticlesForJets.src = "mergedTruth"
00203 process.genParticlesForJetsNoMuNoNu.src = "mergedTruth"
00204 process.genParticlesForJetsNoNu.src = "mergedTruth"
00205 process.patJetPartonMatchPF.matched = "mergedTruth"
00206 process.patJetPartonsPF.src = "mergedTruth"
00207 process.photonMatchPF.matched = "mergedTruth"
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249 process.goodVertices = cms.EDFilter("VertexSelector",
00250 src = cms.InputTag("offlinePrimaryVertices"),
00251 cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"),
00252 filter = cms.bool(False),
00253 )
00254
00255 process.pfPileUpPF.Vertices = "goodVertices"
00256 process.pfPileUpPF.Enable = True
00257
00258 process.pfNoPileUpSequencePF.replace(process.pfPileUpPF,
00259 process.goodVertices + process.pfPileUpPF)
00260
00261 if not doSusyTopProjection:
00262 return
00263
00264
00265
00266 process.pfElectronsFromVertexPF.dzCut = 9999.0
00267 process.pfElectronsFromVertexPF.d0Cut = 9999.0
00268 process.pfSelectedElectronsPF.cut = ""
00269 process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone(isolationCut = 3.)
00270 process.pfIsolatedElectronsPF.isolationCut = 0.15
00271
00272 process.pfElectronsFromGoodVertex = cms.EDFilter(
00273 "IPCutPFCandidateSelector",
00274 src = cms.InputTag("pfIsolatedElectronsPF"),
00275 vertices = cms.InputTag("goodVertices"),
00276 d0Cut = cms.double(0.04),
00277 dzCut = cms.double(1.),
00278 d0SigCut = cms.double(99.),
00279 dzSigCut = cms.double(99.),
00280 )
00281
00282 electronSelection = "abs( eta ) < 2.5 & pt > 5"
00283 electronSelection += " & mva_e_pi > 0.4"
00284
00285
00286 electronSelection += " & gsfTrackRef().isNonnull() & gsfTrackRef().trackerExpectedHitsInner().numberOfHits() <= 0"
00287 process.pfUnclusteredElectronsPF = cms.EDFilter( "GenericPFCandidateSelector",
00288 src = cms.InputTag("pfElectronsFromGoodVertex"),
00289 cut = cms.string(electronSelection)
00290 )
00291 process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF,
00292 process.pfIsolatedElectronsPF +
00293 process.goodVertices * process.pfElectronsFromGoodVertex +
00294 process.pfUnclusteredElectronsPF + process.pfRelaxedElectronsPF)
00295 process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF"
00296 process.pfNoElectronPF.topCollection = "pfUnclusteredElectronsPF"
00297
00298
00299 process.pfMuonsFromVertexPF.dzCut = 9999.0
00300 process.pfMuonsFromVertexPF.d0Cut = 9999.0
00301 process.pfSelectedMuonsPF.cut = ""
00302 process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone(isolationCut = 3)
00303 process.pfIsolatedMuonsPF.isolationCut = 0.15
00304
00305 process.pfMuonsFromGoodVertex = cms.EDFilter(
00306 "IPCutPFCandidateSelector",
00307 src = cms.InputTag("pfIsolatedMuonsPF"),
00308 vertices = cms.InputTag("goodVertices"),
00309 d0Cut = cms.double(0.02),
00310 dzCut = cms.double(1.),
00311 d0SigCut = cms.double(99.),
00312 dzSigCut = cms.double(99.),
00313 )
00314 muonSelection = "abs( eta ) < 2.5 & pt > 5"
00315
00316 muonSelection += " & muonRef().isNonnull & muonRef().isGlobalMuon()"
00317 muonSelection += " & muonRef().isTrackerMuon() & muonRef().numberOfMatches > 1"
00318 muonSelection += " & muonRef().globalTrack().normalizedChi2() < 10"
00319 muonSelection += " & muonRef().Track().numberOfValidHits() > 10"
00320 muonSelection += " & muonRef().globalTrack().hitPattern().numberOfValidMuonHits() > 0"
00321 muonSelection += " & muonRef().innerTrack().hitPattern().numberOfValidPixelHits() > 0"
00322 process.pfUnclusteredMuonsPF = cms.EDFilter( "GenericPFCandidateSelector",
00323 src = cms.InputTag("pfMuonsFromGoodVertex"),
00324 cut = cms.string(muonSelection)
00325 )
00326 process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF,
00327 process.pfIsolatedMuonsPF +
00328 process.goodVertices * process.pfMuonsFromGoodVertex +
00329 process.pfUnclusteredMuonsPF + process.pfRelaxedMuonsPF)
00330 process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF"
00331 process.pfNoMuonPF.topCollection = "pfUnclusteredMuonsPF"
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342 def loadPATTriggers(process,HLTMenu,theJetNames,electronMatches,muonMatches,tauMatches,jetMatches,photonMatches):
00343
00344 def pfSwitchOnTriggerMatchEmbedding(process, matches, src, embedder, sequence='patDefaultSequencePF'):
00345 setattr(process,src.replace('PF','TriggerMatchPF'),getattr(process,embedder).clone(src=src, matches=matches))
00346 theSequence = getattr(process,sequence)
00347 theSequence += getattr(process,src.replace('PF','TriggerMatchPF'))
00348 from PhysicsTools.PatAlgos.tools.trigTools import switchOnTrigger, switchOnTriggerMatchEmbedding
00349 switchOnTrigger(process, triggerProducer='patTrigger', triggerEventProducer='patTriggerEvent', sequence='patDefaultSequence', hltProcess=HLTMenu)
00350 process.patTriggerPF = process.patTrigger.clone()
00351 process.patTriggerEventPF = process.patTriggerEvent.clone()
00352 process.patDefaultSequencePF += process.patTriggerPF
00353 process.patDefaultSequencePF += process.patTriggerEventPF
00354 switchOnTrigger(process, triggerProducer='patTriggerPF', triggerEventProducer='patTriggerEventPF', sequence='patDefaultSequencePF', hltProcess=HLTMenu)
00355
00356 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanElectronTriggerMatchHLTEle20SWL1R
00357 process.patElectronMatch = cleanElectronTriggerMatchHLTEle20SWL1R.clone(matchedCuts = cms.string( electronMatches ))
00358 process.patElectronMatchPF = cleanElectronTriggerMatchHLTEle20SWL1R.clone(matchedCuts = cms.string( electronMatches ), src='selectedPatElectronsPF')
00359 process.patDefaultSequencePF += process.patElectronMatchPF
00360 switchOnTriggerMatchEmbedding( process, ['patElectronMatch'], hltProcess=HLTMenu)
00361 pfSwitchOnTriggerMatchEmbedding( process, ['patElectronMatchPF'], 'selectedPatElectronsPF', 'cleanPatElectronsTriggerMatch' )
00362
00363 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanMuonTriggerMatchHLTMu9
00364 process.patMuonMatch = cleanMuonTriggerMatchHLTMu9.clone(matchedCuts = cms.string( muonMatches ))
00365 process.patMuonMatchPF = cleanMuonTriggerMatchHLTMu9.clone(matchedCuts = cms.string( muonMatches ),src = 'selectedPatMuonsPF',matched='patTriggerPF')
00366 process.patDefaultSequencePF += process.patMuonMatchPF
00367 switchOnTriggerMatchEmbedding( process, ['patMuonMatch'], hltProcess=HLTMenu)
00368 pfSwitchOnTriggerMatchEmbedding( process, ['patMuonMatchPF'], 'selectedPatMuonsPF', 'cleanPatMuonsTriggerMatch' )
00369
00370 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanPhotonTriggerMatchHLTPhoton20CleanedL1R
00371 process.patPhotonMatch = cleanPhotonTriggerMatchHLTPhoton20CleanedL1R.clone(matchedCuts = cms.string( photonMatches ))
00372 switchOnTriggerMatchEmbedding( process, ['patPhotonMatch'], hltProcess=HLTMenu)
00373
00374 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanJetTriggerMatchHLTJet15U
00375 process.patJetMatchAK5Calo = cleanJetTriggerMatchHLTJet15U.clone(matchedCuts = cms.string( jetMatches ),src='cleanPatJetsAK5Calo')
00376 switchOnTriggerMatchEmbedding( process, ['patJetMatchAK5Calo'], hltProcess=HLTMenu)
00377 for jetType in theJetNames:
00378 setattr(process,'patJetMatch'+jetType,cleanJetTriggerMatchHLTJet15U.clone(matchedCuts = cms.string( jetMatches ),src = 'cleanPatJets'+jetType))
00379 process.patJetMatchPF = cleanJetTriggerMatchHLTJet15U.clone(src='selectedPatJetsPF', matchedCuts = cms.string( jetMatches ))
00380 process.patDefaultSequencePF += process.patJetMatchPF
00381 for jetType in theJetNames:
00382 switchOnTriggerMatchEmbedding( process, ['patJetMatch'+jetType], hltProcess=HLTMenu)
00383 pfSwitchOnTriggerMatchEmbedding( process, ['patJetMatchPF'], 'selectedPatJetsPF', 'cleanPatJetsAK5CaloTriggerMatch' )
00384
00385 from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanTauTriggerMatchHLTDoubleLooseIsoTau15
00386 process.patTauMatch = cleanTauTriggerMatchHLTDoubleLooseIsoTau15.clone(matchedCuts = cms.string( tauMatches ))
00387 process.patTauMatchPF = cleanTauTriggerMatchHLTDoubleLooseIsoTau15.clone(src='selectedPatTausPF', matchedCuts = cms.string( tauMatches ))
00388 process.patDefaultSequencePF += process.patTauMatchPF
00389 switchOnTriggerMatchEmbedding( process, ['patTauMatch'], hltProcess=HLTMenu)
00390 pfSwitchOnTriggerMatchEmbedding( process, ['patTauMatchPF'], 'selectedPatTausPF', 'cleanPatTausTriggerMatch' )
00391
00392 def loadType1METSequence(process):
00393 process.load("JetMETCorrections.Type1MET.pfMETCorrections_cff")
00394
00395
00396
00397
00398
00399 process.Type1METSequence = cms.Sequence(process.producePFMETCorrections)
00400
00401
00402 def addTypeIIMet(process) :
00403
00404 from PhysicsTools.PatAlgos.recoLayer0.jetMETCorrections_cff import metJESCorAK5CaloJet
00405 process.metJESCorAK5CaloJetTypeII = metJESCorAK5CaloJet.clone()
00406 process.metJESCorAK5CaloJetTypeII.useTypeII = True
00407 process.metJESCorAK5CaloJetTypeII.hasMuonsCorr = False
00408
00409 process.metJESCorAK5CaloJetMuonsTypeII = process.metJESCorAK5CaloJetMuons.clone(
00410 uncorMETInputTag = cms.InputTag('metJESCorAK5CaloJetTypeII')
00411 )
00412
00413 process.patMETCorrections.replace(
00414 process.metJESCorAK5CaloJet,
00415 (process.metJESCorAK5CaloJetTypeII*
00416 process.metJESCorAK5CaloJetMuonsTypeII)+
00417 process.metJESCorAK5CaloJet
00418 )
00419
00420 process.patMETsAK5CaloTypeII = process.patMETs.clone(
00421 metSource = cms.InputTag("metJESCorAK5CaloJetMuonsTypeII")
00422 )
00423
00424 process.patDefaultSequence.replace(
00425 process.patMETsAK5Calo,
00426 process.patMETsAK5Calo+
00427 process.patMETsAK5CaloTypeII
00428 )
00429
00430 def addTagInfos(process,JetMETCorrections):
00431 from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
00432 switchJetCollection( process,
00433 jetCollection=cms.InputTag('ak5CaloJets'),
00434 jetCorrLabel=('AK5Calo', JetMETCorrections))
00435
00436 def addSUSYJetCollection(process,JetMETCorrections,jets = 'IC5Calo',mcVersion='',doJTA=True,doType1MET=True,doJetID=True,jetIdLabel=None):
00437 from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
00438 algorithm = jets[0:3]
00439 type = jets[3:len(jets)]
00440 jetCorrLabel = (jets,cms.vstring(JetMETCorrections))
00441 if 'IC' in algorithm: collection = algorithm.replace('IC','iterativeCone')
00442 elif 'SC' in algorithm: collection = algorithm.replace('SC','sisCone')
00443 elif 'AK' in algorithm: collection = algorithm.replace('AK','ak')
00444 elif 'KT' in algorithm: collection = algorithm.replace('KT','kt')
00445 else: raise ValueError, "Unknown jet algorithm: %s" % (jets)
00446 jetIdLabel = algorithm.lower()
00447 if type == 'Calo':
00448 jetCollection = '%(collection)sCaloJets' % locals()
00449 if not 'AK7' in algorithm:
00450 doType1MET = True
00451 elif type == 'PF':
00452 jetCollection = '%(collection)sPFJets' % locals()
00453 doJetID = False
00454 elif type == 'JPT':
00455 if 'IC' in algorithm: collectionJPT = algorithm.replace('IC','Icone')
00456 elif 'SC' in algorithm: collectionJPT = algorithm.replace('SC','sisCone')
00457 elif 'AK' in algorithm: collectionJPT = algorithm.replace('AK','AntiKt')
00458 else: raise ValueError, "Unknown jet algorithm: %s" % (jets)
00459 jetCollection = 'JetPlusTrackZSPCorJet%(collectionJPT)s' % locals()
00460 elif type == 'Track':
00461 jetCollection = '%(collection)sTrackJets' % locals()
00462 jetCorrLabel = None
00463 doJetID = False
00464 else: raise ValueError, "Unknown jet type: %s" % (jets)
00465
00466 addJetCollection(process, cms.InputTag(jetCollection),
00467 algorithm, type,
00468 doJTA = doJTA,
00469 doBTagging = True,
00470 jetCorrLabel = jetCorrLabel,
00471 doType1MET = doType1MET,
00472 doL1Cleaning = True,
00473 doL1Counters = True,
00474 doJetID = doJetID,
00475 jetIdLabel = jetIdLabel,
00476 genJetCollection = cms.InputTag('%(collection)sGenJets' % locals())
00477 )
00478
00479 def addJetMET(process,theJetNames,JetMETCorrections,mcVersion):
00480
00481
00482 for jetName in theJetNames:
00483 addSUSYJetCollection(process,JetMETCorrections,jetName,mcVersion)
00484
00485
00486 theJetNames.append('')
00487 for jetName in theJetNames:
00488 module = getattr(process,'patJets'+jetName)
00489 module.addTagInfos = False
00490 module.embedGenJetMatch = False
00491
00492 theJetNames.pop()
00493
00494
00495 from PhysicsTools.PatAlgos.tools.metTools import addTcMET
00496 addTcMET(process,'TC')
00497
00498
00499
00500 process.cleanPatJetsAK5Calo = process.cleanPatJets
00501 process.patMETsAK5Calo = process.patMETs
00502
00503
00504
00505
00506
00507 process.patHemispheres.patJets = process.cleanPatJetsAK5Calo.label()
00508 process.countPatJets.src = process.cleanPatJetsAK5Calo.label()
00509
00510
00511 process.patCandidateSummary.candidates.remove(cms.InputTag('patMETs'))
00512 process.patCandidateSummary.candidates.append(cms.InputTag('patMETsAK5Calo'))
00513 process.patCandidateSummary.candidates.append(cms.InputTag('patMHTsAK5Calo'))
00514 process.cleanPatCandidateSummary.candidates.remove(cms.InputTag('cleanPatJets'))
00515 process.cleanPatCandidateSummary.candidates.append(cms.InputTag('cleanPatJetsAK5Calo'))
00516
00517 for jets in theJetNames:
00518 process.patCandidateSummary.candidates.append(cms.InputTag('patJets'+jets))
00519 process.selectedPatCandidateSummary.candidates.append(cms.InputTag('selectedPatJets'+jets))
00520 process.cleanPatCandidateSummary.candidates.append(cms.InputTag('cleanPatJets'+jets))
00521
00522 def removeMCDependence( process ):
00523
00524 from PhysicsTools.PatAlgos.tools.coreTools import removeMCMatching
00525 removeMCMatching(process, ['All'])
00526
00527 def loadSusyValidation(process):
00528 process.load("JetMETCorrections.Configuration.JetCorrectionProducers_cff")
00529 process.load("DQM.Physics.susyValidation_cfi")
00530 process.load("DQMServices.Components.MEtoEDMConverter_cfi")
00531 process.load("DQMServices.Core.DQM_cfg")
00532 process.load("DQMServices.Components.DQMEnvironment_cfi")
00533 process.DQMStore = cms.Service("DQMStore")
00534 process.DQMStore.collateHistograms = cms.untracked.bool(True)
00535 process.options = cms.untracked.PSet(
00536 fileMode = cms.untracked.string('NOMERGE')
00537 )
00538
00539 def getSUSY_pattuple_outputCommands( process ):
00540 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContent, patExtraAodEventContent, patTriggerEventContent, patTriggerStandAloneEventContent, patEventContentTriggerMatch
00541 keepList = []
00542 susyAddEventContent = [
00543
00544
00545 'keep *_selectedPatMuonsPF_*_*',
00546 'keep *_selectedPatElectronsPF_*_*',
00547 'keep *_selectedPatTausPF_*_*',
00548 'keep *_selectedPatJetsPF_*_*',
00549
00550 'keep L1GlobalTriggerObjectMapRecord_*_*_*',
00551 'keep L1GlobalTriggerReadoutRecord_*_*_*',
00552
00553 'keep recoGenJets_*GenJets*_*_*',
00554 'keep recoGenMETs_*_*_*',
00555
00556 'keep edmMergeableCounter_eventCountProducer_*_*',
00557 'keep recoRecoChargedRefCandidates_trackRefsForJets_*_*',
00558
00559 'keep *_electronMergedSeeds_*_*',
00560 'keep *_Conversions_*_*',
00561 'keep recoPFCandidates_particleFlow_*_*',
00562
00563
00564
00565
00566 'keep recoConversions_conversions_*_*',
00567 'keep recoTracks_*onversions_*_*',
00568 'keep HcalNoiseSummary_*_*_*',
00569 'keep *BeamHaloSummary_*_*_*',
00570
00571 'keep *_offlinePrimaryVerticesGap_*_*',
00572 'keep *_offlinePrimaryVerticesGapWithBS_*_*',
00573
00574 'keep *_MEtoEDMConverter_*_PAT',
00575 'drop recoTracks_generalTracks*_*_*',
00576 'drop *_towerMaker_*_*',
00577 'keep *_pfType1CorrectedMet*_*_*',
00578 ]
00579 keepList.extend(patEventContent)
00580 keepList.extend(patExtraAodEventContent)
00581 keepList.extend(patTriggerEventContent)
00582 keepList.extend(patEventContentTriggerMatch)
00583 keepList.extend(susyAddEventContent)
00584 return keepList
00585