def susyPat(process,options) : if not options.patify: if not options.quiet : print "WARNING: selection (slimming) not applied for options patify(False)." __patOutput__(process, options.secondaryOutput) return cms.Path() else: from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT jetAlgoList = filter(lambda s: s.lower() in options.jetCollections, ['AK7Calo','AK5PF','AK7PF']) addDefaultSUSYPAT(process, mcInfo = not options.isData, HLTMenu = 'HLT', jetMetCorrections = options.jetCorrections, theJetNames = jetAlgoList) for algo in ['']+jetAlgoList : setattr( getattr( process, 'patJetGenJetMatch'+algo), 'maxDeltaR', cms.double(0.7 if '7' in algo else 0.5) ) __patOutput__(process, options.secondaryOutput) return cms.Path(process.susyPatDefaultSequence + patAllElectronsPF(process) + patAllMuonsPF(process))
def susyPat(process, options): if not options.patify: if not options.quiet: print "WARNING: selection (slimming) not applied for options patify(False)." __patOutput__(process, options.secondaryOutput) return cms.Path() else: from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT jetAlgoList = filter(lambda s: s.lower() in options.jetCollections, ['AK7Calo', 'AK5PF', 'AK7PF']) addDefaultSUSYPAT(process, mcInfo=not options.isData, HLTMenu='HLT', jetMetCorrections=options.jetCorrections, theJetNames=jetAlgoList) for algo in [''] + jetAlgoList: setattr(getattr(process, 'patJetGenJetMatch' + algo), 'maxDeltaR', cms.double(0.7 if '7' in algo else 0.5)) __patOutput__(process, options.secondaryOutput) return cms.Path(process.susyPatDefaultSequence + patAllElectronsPF(process) + patAllMuonsPF(process))
)) ############################################################################### ## ## SUSY PAT FOR RA2 ## ############################################################################### #-- SUSYPAT specifics --------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands process.GlobalTag.globaltag = globalTag addDefaultSUSYPAT(process, mcInfo=True, HLTMenu='Redigi', jetMetCorrections=['L1FastJet', 'L2Relative', 'L3Absolute'], mcVersion='', theJetNames=['AK5PF'], doSusyTopProjection=False) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False process.patJetsPF.embedCaloTowers = False process.patJetsPF.embedPFCandidates = False
if runningOnMC == False: jetMetCorr.append('L2L3Residual') process.GlobalTag.globaltag = "START52_V11C::All" if runningOnMC == False: process.GlobalTag.globaltag = "GR_R_52_V9D::All" process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( '/store/data/Run2012B/HTMHT/AOD/PromptReco-v1/000/197/044/56E6003A-00BE-E111-9AF5-0019B9F72F97.root' ) ) # Due to problem in production of LM samples: same event number appears multiple times process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') addDefaultSUSYPAT(process,mcInfo=runningOnMC,HLTMenu=hltMenu,jetMetCorrections=jetMetCorr,mcVersion='',theJetNames=theJetColls, doSusyTopProjection=False) #-- Adjust collections to use PFNoPU jets ------------------------------------- # do not use Z-mass window for PU subtraction # such that JEC works properly process.pfPileUpPF.checkClosestZVertex = cms.bool(False) # do not remove muons and electrons from the jet clustering input # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections) process.pfIsolatedElectrons.isolationCut = -1 process.pfIsolatedMuons.isolationCut = -1 # do not remove taus from the jet collection process.pfTausPF.discriminators = cms.VPSet() process.pfUnclusteredTausPF = process.pfTausPF.clone(
reportEvery = cms.untracked.int32(1) ) process.MessageLogger.cerr.FwkReport.reportEvery = 100 # Due to problem in production of LM samples: same event number appears multiple times process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') #-- Calibration tag ----------------------------------------------------------- # Should match input file's tag process.GlobalTag.globaltag = 'MC_3XY_V15::All' #Data: GR09_P_V8_34X , MC: MC_3XY_V15 #process.GlobalTag.globaltag = 'STARTUP31X_V2::All' #Data: GR09_P_V8_34X , MC: MC_3XY_V15 ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT: Parameters are: mcInfo, HLT menu, Jet energy corrections, MC version ('31x' or '31xReReco332') addDefaultSUSYPAT(process,True,'HLT','Summer09_7TeV','31x') SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################## END SUSYPAT specifics #################################### #-- Output module configuration ----------------------------------------------- process.out.fileName = 'SUSYPAT_7TeV.root' # <-- CHANGE THIS TO SUIT YOUR NEEDS # Custom settings process.out.splitLevel = cms.untracked.int32(99) # Turn on split level (smaller files???) process.out.overrideInputFileSplitLevels = cms.untracked.bool(True) process.out.dropMetaData = cms.untracked.string('DROPPED') # Get rid of metadata related to dropped collections process.out.outputCommands = cms.untracked.vstring('drop *', *SUSY_pattuple_outputCommands ) # Analyzer
def runRA2Preselection(process, globalTag, isData=True, reportEveryEvt=5000, testFileName="", numProcessedEvt=10): print "*** SETUP OF 'runRA2Preselection' ********************************" if isData : print " Run on data" else: print " Run on MC" print " GlobalTag = "+globalTag print "******************************************************************" #-- Meta data to be logged in DBS --------------------------------------------- process.configurationMetadata = cms.untracked.PSet( version = cms.untracked.string('$Revision: 1.4 $'), name = cms.untracked.string('$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/Skimming/python/Preselection_cff.py,v $'), annotation = cms.untracked.string('SUSY pattuple definition') ) #-- Message Logger ------------------------------------------------------------ process.MessageLogger.categories.append('PATSummaryTables') process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet( limit = cms.untracked.int32(-1), reportEvery = cms.untracked.int32(1) ) process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt #-- Input Source -------------------------------------------------------------- process.maxEvents.input = numProcessedEvt process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(testFileName)) #-- SUSYPAT specifics --------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands if isData: hltMenu = 'HLT' else: hltMenu = 'REDIGI' theJetColls = ['AK5PF'] jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute'] if isData: jetMetCorr.append('L2L3Residual') process.GlobalTag.globaltag = globalTag addDefaultSUSYPAT(process, mcInfo=not isData, HLTMenu=hltMenu, jetMetCorrections=jetMetCorr, mcVersion='', theJetNames=theJetColls, doSusyTopProjection=False) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False process.patJetsPF.embedCaloTowers = False process.patJetsPF.embedPFCandidates = False #-- Adjust collections to use PFNoPU jets ------------------------------------- # do not use Z-mass window for PU subtraction # such that JEC works properly process.pfPileUpPF.checkClosestZVertex = cms.bool(False) # do not remove muons and electrons from the jet clustering input # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections) process.pfIsolatedElectronsPF.isolationCut = -1 process.pfIsolatedMuonsPF.isolationCut = -1 # make loose clones of the original electron collection process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone() process.pfRelaxedElectronsPF.isolationCut = 9999 process.pfElectronsFromVertexPF.dzCut = 9999.0 process.pfElectronsFromVertexPF.d0Cut = 9999.0 process.pfSelectedElectronsPF.cut = "" process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF" process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF, process.pfIsolatedElectronsPF + process.pfRelaxedElectronsPF) # make loose clones of the original muon collection process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone() process.pfRelaxedMuonsPF.isolationCut = 9999 process.pfMuonsFromVertexPF.dzCut = 9999.0 process.pfMuonsFromVertexPF.d0Cut = 9999.0 process.pfSelectedMuonsPF.cut = "" process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF" process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF, process.pfIsolatedMuonsPF + process.pfRelaxedMuonsPF) # do not remove taus from the jet collection process.pfTausPF.discriminators = cms.VPSet() process.pfUnclusteredTausPF = process.pfTausPF.clone( cut = cms.string("pt < 0") ) process.pfTauSequencePF.replace(process.pfTausPF, process.pfTausPF+ process.pfUnclusteredTausPF) process.pfNoTauPF.topCollection = "pfUnclusteredTausPF" #------------------------------------------------------------------------------ #-- Overwrite default output content ------------------------------------------ from SandBox.Skims.RA2Content_cff import getRA2PATOutput process.out.outputCommands = getRA2PATOutput(process) process.out.dropMetaData = cms.untracked.string('DROPPED') #-- RA2 filtering ------------------------------------------------------------- process.load('SandBox.Skims.RA2Objects_cff') process.load('SandBox.Skims.RA2Selection_cff') process.load('SandBox.Skims.RA2Cleaning_cff') ## Modify selection and filters for skims process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2) process.htPFchsFilter.MinHT = cms.double(350) ## Set filters in tagging mode; stores filter decision as boolean: ## - true : event passes filter ## - false : event gets rejected by filter process.eeNoiseFilter.taggingMode = True process.trackingFailureFilter.taggingMode = True process.beamHaloFilter.taggingMode = True process.inconsistentMuons.taggingMode = True process.greedyMuons.taggingMode = True process.ra2EcalTPFilter.taggingMode = True process.ra2EcalBEFilter.taggingMode = True process.hcalLaserEventFilter.taggingMode = True process.eeBadScFilter.taggingMode = True process.ecalLaserCorrFilter.taggingMode = True # Rejects the event, replaced by HBHENoiseFilterRA2 that # stores booleans process.ra2NoiseCleaning.remove(process.HBHENoiseFilter) # Tracking-POG Cleaning (booleans have inverted meaning # compared to the other filters!) process.ra2PostCleaning += process.trackingPOGCleaning process.load("SandBox.Skims.provInfoMuons_cfi") process.load("SandBox.Skims.provInfoElectrons_cfi") process.cleanpatseq = cms.Sequence( process.susyPatDefaultSequence * process.ra2StdCleaning * process.ra2Objects * process.provInfoMuons * process.provInfoElectrons * process.ra2PostCleaning ) process.dump = cms.EDAnalyzer("EventContentAnalyzer") process.ppfchs = cms.Path( process.cleanpatseq * process.countJetsPFchsPt50Eta25 * process.htPFchsFilter ) #-- Output module configuration ----------------------------------------------- process.out.fileName = cms.untracked.string('RA2Skim.root') process.out.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('ppfchs') ) process.outpath = cms.EndPath( process.out )
# JEC if options.mcInfo == False: options.jetCorrections.append('L2L3Residual') options.jetCorrections.insert(0, 'L1FastJet') print "jetCorrections: " print options.jetCorrections # The postfix used in the SUSYPAT. This is set fixed in the SUSYPAT, so I cannot tune it and # have to extract it out. postfix = "PF" ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT addDefaultSUSYPAT(process, options.mcInfo, options.hltName, options.jetCorrections, options.mcVersion, options.jetTypes, options.doValidation, options.doExtensiveMatching, options.doSusyTopProjection) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands(process) ############################## END SUSYPAT specifics #################################### #from PhysicsTools.PatAlgos.tools.pfTools import useGsfElectrons #useGsfElectrons(process,postfix) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False
'(hasFilterLabel("hltL1HTT150singleMuL3PreFiltered5") && path("HLT_PFHT400_Mu5_PFMET45_v*",0,0)) || ' '(hasFilterLabel("hltL1HTT150singleMuL3PreFiltered5") && path("HLT_PFNoPUHT400_Mu5_PFMET45_v*",0,0)) || ' '(hasFilterLabel("hltL1HTT150singleMuL3PreFiltered5") && path("HLT_PFHT400_Mu5_PFMET50_v*",0,0)) || ' '(hasFilterLabel("hltL1HTT150singleMuL3PreFiltered5") && path("HLT_PFNoPUHT400_Mu5_PFMET50_v*",0,0))' ')'), maxDPtRel = cms.double( 0.5 ), # no effect here maxDeltaR = cms.double( 0.5 ), resolveAmbiguities = cms.bool( True ), resolveByMatchQuality = cms.bool( True ) ) ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT addDefaultSUSYPAT(process,options.mcInfo,options.hltName,options.jetCorrections,options.mcVersion,options.jetTypes,options.doValidation,options.doExtensiveMatching,options.doSusyTopProjection) process.load('PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi') #from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcher_cfi import cleanMuonTriggerMatchHLTMu20 from PhysicsTools.PatAlgos.tools.trigTools import * switchOnTrigger( process, hltProcess = options.hltName, sequence = "susyPatDefaultSequence") # This is optional and can be omitted. switchOnTriggerMatchEmbedding( process, [ 'muonTriggerMatchHLTMuons' ], hltProcess = options.hltName, sequence = "susyPatDefaultSequence") SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################## END SUSYPAT specifics #################################### #-- HLT selection ------------------------------------------------------------ import HLTrigger.HLTfilters.hltHighLevel_cfi as hlt if options.hltSelection: process.hltFilter = hlt.hltHighLevel.clone(
from PhysicsTools.PatAlgos.patEventContent_cff import patEventContent process.out = cms.OutputModule("PoolOutputModule", #verbose = cms.untracked.bool(True), fileName = cms.untracked.string('patTuple.root'), SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ), outputCommands = cms.untracked.vstring('drop *', "keep *_BFieldColl_*_*_","keep *_JetCorrColl_*_*_", *patEventContent ) ) #-- SUSYPAT and GlobalTag Settings ----------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands process.GlobalTag.globaltag = globalTags[datasetType] if isMC: addDefaultSUSYPAT(process,True,'HLT',['L1FastJet','L2Relative','L3Absolute'],'',['AK5PF']) else: addDefaultSUSYPAT(process,False,'HLT',['L1FastJet','L2Relative','L3Absolute','L2L3Residual'],'',['AK5PF']) process.pfNoTauPF.enable = cms.bool(False) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) # make loose clones of the original electron collection process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone() process.pfRelaxedElectronsPF.isolationCut = 9999.0 process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF" process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF, process.pfIsolatedElectronsPF + process.pfRelaxedElectronsPF) # make loose clones of the original muon collection
process.load("PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cff") process.patTrigger.addL1Algos = cms.bool( True ) process.out = cms.OutputModule("PoolOutputModule", #verbose = cms.untracked.bool(True), SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ), fileName = cms.untracked.string(options.outfile), outputCommands = cms.untracked.vstring() # outputCommands = cms.untracked.vstring('keep *') ) #-- SUSYPAT and GlobalTag Settings ----------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands process.GlobalTag.globaltag = options.GT addDefaultSUSYPAT(process,isMC,options.hltName,jec,'',['AK5PF']) process.patJetsAK5PF.addTagInfos = cms.bool(True) process.pfNoTauPF.enable = cms.bool(False) #SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################## END SUSYPAT specifics #################################### ################### Add Type-I PFMET (for default RECO-PF jets) ######################## #process.load('RecoMET.METFilters.EcalDeadCellBoundaryEnergyFilter_cfi') process.load("JetMETCorrections.Type1MET.pfMETCorrections_cff") if isMC: process.pfJetMETcorr.jetCorrLabel = "ak5PFL1FastL2L3" else: process.pfJetMETcorr.jetCorrLabel = "ak5PFL1FastL2L3Residual"
def runRA2Preselection(process, globalTag, isData=True, reportEveryEvt=5000, testFileName="", numProcessedEvt=10): print "*** SETUP OF 'runRA2Preselection' ********************************" if isData : print " Run on data" else: print " Run on MC" print " GlobalTag = "+globalTag print "******************************************************************" #-- Meta data to be logged in DBS --------------------------------------------- process.configurationMetadata = cms.untracked.PSet( version = cms.untracked.string('$Revision: 1.5 $'), name = cms.untracked.string('$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/Skimming/python/Preselection_cff.py,v $'), annotation = cms.untracked.string('SUSY pattuple definition') ) #-- Message Logger ------------------------------------------------------------ process.MessageLogger.categories.append('PATSummaryTables') process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet( limit = cms.untracked.int32(-1), reportEvery = cms.untracked.int32(1) ) process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt #-- Input Source -------------------------------------------------------------- process.maxEvents.input = numProcessedEvt process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(testFileName)) #-- SUSYPAT specifics --------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands if isData: hltMenu = 'HLT' else: hltMenu = 'REDIGI' theJetColls = ['AK5PF'] jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute'] if isData: jetMetCorr.append('L2L3Residual') process.GlobalTag.globaltag = globalTag addDefaultSUSYPAT(process, mcInfo=not isData, HLTMenu=hltMenu, jetMetCorrections=jetMetCorr, mcVersion='', theJetNames=theJetColls, doSusyTopProjection=False) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False process.patJetsPF.embedCaloTowers = False process.patJetsPF.embedPFCandidates = False #-- Adjust collections to use PFNoPU jets ------------------------------------- # do not use Z-mass window for PU subtraction # such that JEC works properly process.pfPileUpPF.checkClosestZVertex = cms.bool(False) # do not remove muons and electrons from the jet clustering input # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections) process.pfIsolatedElectronsPF.isolationCut = -1 process.pfIsolatedMuonsPF.isolationCut = -1 # make loose clones of the original electron collection process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone() process.pfRelaxedElectronsPF.isolationCut = 9999 process.pfElectronsFromVertexPF.dzCut = 9999.0 process.pfElectronsFromVertexPF.d0Cut = 9999.0 process.pfSelectedElectronsPF.cut = "" process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF" process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF, process.pfIsolatedElectronsPF + process.pfRelaxedElectronsPF) # make loose clones of the original muon collection process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone() process.pfRelaxedMuonsPF.isolationCut = 9999 process.pfMuonsFromVertexPF.dzCut = 9999.0 process.pfMuonsFromVertexPF.d0Cut = 9999.0 process.pfSelectedMuonsPF.cut = "" process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF" process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF, process.pfIsolatedMuonsPF + process.pfRelaxedMuonsPF) # do not remove taus from the jet collection process.pfTausPF.discriminators = cms.VPSet() process.pfUnclusteredTausPF = process.pfTausPF.clone( cut = cms.string("pt < 0") ) process.pfTauSequencePF.replace(process.pfTausPF, process.pfTausPF+ process.pfUnclusteredTausPF) process.pfNoTauPF.topCollection = "pfUnclusteredTausPF" #------------------------------------------------------------------------------ #-- Overwrite default output content ------------------------------------------ from SandBox.Skims.RA2Content_cff import getRA2PATOutput process.out.outputCommands = getRA2PATOutput(process) process.out.dropMetaData = cms.untracked.string('DROPPED') #-- RA2 filtering ------------------------------------------------------------- process.load('SandBox.Skims.RA2Objects_cff') process.load('SandBox.Skims.RA2Selection_cff') process.load('SandBox.Skims.RA2Cleaning_cff') ## Modify selection and filters for skims process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2) process.htPFchsFilter.MinHT = cms.double(350) ## Set filters in tagging mode; stores filter decision as boolean: ## - true : event passes filter ## - false : event gets rejected by filter process.eeNoiseFilter.taggingMode = True process.trackingFailureFilter.taggingMode = True process.beamHaloFilter.taggingMode = True process.inconsistentMuons.taggingMode = True process.greedyMuons.taggingMode = True process.ra2EcalTPFilter.taggingMode = True process.ra2EcalBEFilter.taggingMode = True process.hcalLaserEventFilter.taggingMode = True process.eeBadScFilter.taggingMode = True process.ecalLaserCorrFilter.taggingMode = True # Rejects the event, replaced by HBHENoiseFilterRA2 that # stores booleans process.ra2NoiseCleaning.remove(process.HBHENoiseFilter) # Tracking-POG Cleaning (booleans have inverted meaning # compared to the other filters!) process.ra2PostCleaning += process.trackingPOGCleaning process.load("SandBox.Skims.provInfoMuons_cfi") process.load("SandBox.Skims.provInfoElectrons_cfi") process.cleanpatseq = cms.Sequence( process.susyPatDefaultSequence * process.ra2StdCleaning * process.ra2Objects * process.provInfoMuons * process.provInfoElectrons * process.ra2PostCleaning ) process.dump = cms.EDAnalyzer("EventContentAnalyzer") process.ppfchs = cms.Path( process.cleanpatseq * process.countJetsPFchsPt50Eta25 * process.htPFchsFilter ) #-- Output module configuration ----------------------------------------------- process.out.fileName = cms.untracked.string('RA2Skim.root') process.out.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('ppfchs') ) process.outpath = cms.EndPath( process.out )
############################################################################### ## ## SUSY PAT FOR RA2 ## ############################################################################### #-- SUSYPAT specifics --------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands process.GlobalTag.globaltag = globalTag addDefaultSUSYPAT(process, mcInfo=True, HLTMenu='Redigi', jetMetCorrections=['L1FastJet', 'L2Relative', 'L3Absolute'], mcVersion='', theJetNames=['AK5PF'], doSusyTopProjection=False ) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False process.patJetsPF.embedCaloTowers = False process.patJetsPF.embedPFCandidates = False
def makeTreeFromSignalScan( process, globalTag, smsModel, smsMotherMass, smsLSPMass, SMStopol, xs=1, numEvtsInSample=1, lumi=5.088, reportEveryEvt=5000, testFileName="/store/mc/Summer12/WJetsToLNu_HT-400ToInf_8TeV-madgraph/AODSIM/PU_S7_START52_V9-v1/0000/041CF749-57A0-E111-B6DD-0026189438DA.root", numProcessedEvt=20): #-- Meta data to be logged in DBS --------------------------------------------- process.configurationMetadata = cms.untracked.PSet( version=cms.untracked.string('$Revision: 1.1 $'), name=cms.untracked.string( '$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/TreeMaker/python/makeTreeFromSignalScan_cff.py,v $' ), annotation=cms.untracked.string('SUSY pattuple definition')) #-- Message Logger ------------------------------------------------------------ process.MessageLogger.categories.append('PATSummaryTables') process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet( limit=cms.untracked.int32(-1), reportEvery=cms.untracked.int32(1)) process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt #-- Input Source -------------------------------------------------------------- process.maxEvents.input = numProcessedEvt process.source.duplicateCheckMode = cms.untracked.string( 'noDuplicateCheck') process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring(testFileName)) #-- SUSYPAT specifics --------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands hltMenu = 'REDIGI' theJetColls = ['AK5PF'] jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute'] process.GlobalTag.globaltag = globalTag addDefaultSUSYPAT(process, mcInfo=True, HLTMenu=hltMenu, jetMetCorrections=jetMetCorr, mcVersion='', theJetNames=theJetColls, doSusyTopProjection=False) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False process.patJetsPF.embedCaloTowers = False process.patJetsPF.embedPFCandidates = False #-- Adjust collections to use PFNoPU jets ------------------------------------- # do not use Z-mass window for PU subtraction # such that JEC works properly process.pfPileUpPF.checkClosestZVertex = cms.bool(False) # do not remove muons and electrons from the jet clustering input # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections) process.pfIsolatedElectronsPF.isolationCut = -1 process.pfIsolatedMuonsPF.isolationCut = -1 # make loose clones of the original electron collection process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone() process.pfRelaxedElectronsPF.isolationCut = 9999 process.pfElectronsFromVertexPF.dzCut = 9999.0 process.pfElectronsFromVertexPF.d0Cut = 9999.0 process.pfSelectedElectronsPF.cut = "" process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF" process.pfElectronSequencePF.replace( process.pfIsolatedElectronsPF, process.pfIsolatedElectronsPF + process.pfRelaxedElectronsPF) # make loose clones of the original muon collection process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone() process.pfRelaxedMuonsPF.isolationCut = 9999 process.pfMuonsFromVertexPF.dzCut = 9999.0 process.pfMuonsFromVertexPF.d0Cut = 9999.0 process.pfSelectedMuonsPF.cut = "" process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF" process.pfMuonSequencePF.replace( process.pfIsolatedMuonsPF, process.pfIsolatedMuonsPF + process.pfRelaxedMuonsPF) # do not remove taus from the jet collection process.pfTausPF.discriminators = cms.VPSet() process.pfUnclusteredTausPF = process.pfTausPF.clone( cut=cms.string("pt < 0")) process.pfTauSequencePF.replace( process.pfTausPF, process.pfTausPF + process.pfUnclusteredTausPF) process.pfNoTauPF.topCollection = "pfUnclusteredTausPF" #------------------------------------------------------------------------------ #-- Overwrite default output content ------------------------------------------ from SandBox.Skims.RA2Content_cff import getRA2PATOutput process.out.outputCommands = getRA2PATOutput(process) process.out.dropMetaData = cms.untracked.string('DROPPED') #-- RA2 filtering ------------------------------------------------------------- process.prefilterCounter = cms.EDProducer("EventCountProducer") process.postStdCleaningCounter = cms.EDProducer("EventCountProducer") process.postPostCleaningCounter = cms.EDProducer("EventCountProducer") process.postPFchsJetsCounter = cms.EDProducer("EventCountProducer") process.postPFchsHTCounter = cms.EDProducer("EventCountProducer") process.postPFchsMHTCounter = cms.EDProducer("EventCountProducer") process.load('SandBox.Skims.RA2Objects_cff') process.load('SandBox.Skims.RA2Selection_cff') process.load('SandBox.Skims.RA2Cleaning_cff') # Adjust object filters for signal-scan values process.htPFchsFilter.MinHT = cms.double(300.0) process.mhtPFchsFilter.MinMHT = cms.double(100.0) process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2) ## please comment this block to remove tagging mode of ##filters and reject events failing any of following filters process.eeNoiseFilter.taggingMode = False process.trackingFailureFilter.taggingMode = False process.beamHaloFilter.taggingMode = False process.ra2NoiseCleaning.remove(process.HBHENoiseFilter) process.inconsistentMuons.taggingMode = False process.greedyMuons.taggingMode = False process.ra2EcalTPFilter.taggingMode = False process.ra2EcalBEFilter.taggingMode = False process.hcalLaserEventFilter.taggingMode = False process.eeBadScFilter.taggingMode = False process.load("SandBox.Skims.provInfoMuons_cfi") process.load("SandBox.Skims.provInfoElectrons_cfi") process.cleanpatseq = cms.Sequence( process.susyPatDefaultSequence * process.prefilterCounter * process.ra2StdCleaning * process.postStdCleaningCounter * process.ra2Objects * process.provInfoMuons * process.provInfoElectrons * process.ra2PostCleaning * process.postPostCleaningCounter) ## --- Setup WeightProducer -------------------------------------------- from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer process.WeightProducer = weightProducer.clone( weight=cms.double(-1.0), Method=cms.string("Constant"), XS=cms.double(xs), NumberEvts=cms.double(numEvtsInSample), Lumi=cms.double(lumi), LumiScale=cms.double(1.0), FileNamePUDataDistribution=cms.string("NONE"), PU=cms.int32(0)) ## --- SMS Model Filter ------------------------------------------------ # Filter files for specified signal point out of dataset # Code from UserCode/seema/SusyAnalysis/AnalysisUtils from SusyAnalysis.AnalysisUtils.smsModelFilter_cfi import smsModelFilter process.SMSModelFilter = smsModelFilter.clone( SusyScanTopology=cms.string(smsModel), SusyScanMotherMass=cms.double(smsMotherMass), SusyScanLSPMass=cms.double(smsLSPMass), SusyScanFracLSP=cms.double(0.0)) #---JL #--for PDF sys process.pdfWeight = cms.EDProducer( "PdfWeightProducer", PdfInfoTag=cms.untracked.InputTag("generator"), PdfSetNames=cms.untracked.vstring("cteq66.LHgrid", "MSTW2008nlo68cl.LHgrid", "NNPDF20_100.LHgrid") #PdfSetNames = cms.untracked.vstring("NNPDF20_100.LHgrid") ) #---for ISR sys process.lastParticles = cms.EDProducer("ISRProducer") process.ISRsys = cms.Sequence(process.lastParticles) #---put the susy params process.load("RA2Classic.SUSYParams.susyparams_cfi") process.susyparams.Model = cms.string(SMStopol) #-- end JL ## --- Setup of TreeMaker ---------------------------------------------- process.TFileService = cms.Service( "TFileService", fileName=cms.string("RA2Selection.root")) from RA2Classic.TreeMaker.treemaker_cfi import TreeMaker process.RA2TreeMaker = TreeMaker.clone( TreeName=cms.string("RA2PreSelection"), VertexCollection=cms.InputTag('goodVertices'), HT=cms.InputTag('htPFchs'), HTJets=cms.InputTag('patJetsPFchsPt50Eta25'), MHT=cms.InputTag('mhtPFchs'), MHTJets=cms.InputTag('patJetsPFchsPt30'), VarsDouble=cms.VInputTag(cms.InputTag('WeightProducer:weight'), "susyparams:m0", "susyparams:m12", "susyparams:evtProcID"), VarsDoubleNamesInTree=cms.vstring('Weight', "massMom", "massDau", "procID"), CandidateCollections=cms.VInputTag('patJetsPFchsPt30', 'patMuonsPFIDIso', 'patElectronsIDIso'), CandidateNamesInTree=cms.vstring('Jets', 'PATMuonsPFIDIso', 'PATElectronsIDIso'), VarsDoubleV=cms.VInputTag("pdfWeight:cteq66", "pdfWeight:MSTW2008nlo68cl", "pdfWeight:NNPDF20"), VarsDoubleNamesInTreeV=cms.vstring("cteq66", "MSTW2008nlo68cl", "NNPDF20")) #process.dump = cms.EDAnalyzer("EventContentAnalyzer") process.ppfchs = cms.Path( process.SMSModelFilter * process.cleanpatseq * process.countJetsPFchsPt50Eta25 * process.postPFchsJetsCounter * process.htPFchsFilter * process.postPFchsHTCounter * process.mhtPFchsFilter * process.postPFchsMHTCounter * process.WeightProducer * #--JL process.pdfWeight * process.ISRsys * process.susyparams * #--end JL process.RA2TreeMaker) process.schedule = cms.Schedule(process.ppfchs)
#'/store/data/Commissioning10/MinimumBias/RECO/SD_Mu-Jun9thSkim_v1/0041/FE82CCF6-197F-DF11-AEA5-001A92971B8A.root' #'/store/relval/CMSSW_3_7_0_pre5/RelValProdTTbar/GEN-SIM-RECO/MC_37Y_V4-v1/0023/BA92C6D3-8863-DF11-B3AF-002618943939.root'] process.maxEvents.input = options.maxEvents # Due to problem in production of LM samples: same event number appears multiple times process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') #-- Calibration tag ----------------------------------------------------------- if options.GlobalTag: process.GlobalTag.globaltag = options.GlobalTag ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT, parameters are: mcInfo, HLT menu, Jet energy corrections, mcVersion ('35x' for 35x samples, empty string for 36X samples),JetCollections addDefaultSUSYPAT(process,options.mcInfo,options.hltName,options.JetCorrections,options.mcVersion,jetList) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################## END SUSYPAT specifics #################################### import HLTrigger.HLTfilters.hltHighLevel_cfi as hlt if options.hltSelection: process.hltFilter = hlt.hltHighLevel.clone( HLTPaths = cms.vstring(options.hltSelection), throw = False ) process.susyPatDefaultSequence.replace(process.eventCountProducer, process.eventCountProducer * process.hltFilter) #-- Output module configuration ----------------------------------------------- process.out.fileName = options.output
def makeTreeFromSignalScan(process, globalTag, smsModel, smsMotherMass, smsLSPMass, SMStopol, xs=1, numEvtsInSample=1, lumi=5.088, reportEveryEvt=5000, testFileName="/store/mc/Summer12/WJetsToLNu_HT-400ToInf_8TeV-madgraph/AODSIM/PU_S7_START52_V9-v1/0000/041CF749-57A0-E111-B6DD-0026189438DA.root", numProcessedEvt=20): #-- Meta data to be logged in DBS --------------------------------------------- process.configurationMetadata = cms.untracked.PSet( version = cms.untracked.string('$Revision: 1.1 $'), name = cms.untracked.string('$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/TreeMaker/python/makeTreeFromSignalScan_cff.py,v $'), annotation = cms.untracked.string('SUSY pattuple definition') ) #-- Message Logger ------------------------------------------------------------ process.MessageLogger.categories.append('PATSummaryTables') process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet( limit = cms.untracked.int32(-1), reportEvery = cms.untracked.int32(1) ) process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt #-- Input Source -------------------------------------------------------------- process.maxEvents.input = numProcessedEvt process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(testFileName)) #-- SUSYPAT specifics --------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands hltMenu = 'REDIGI' theJetColls = ['AK5PF'] jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute'] process.GlobalTag.globaltag = globalTag addDefaultSUSYPAT(process, mcInfo=True, HLTMenu=hltMenu, jetMetCorrections=jetMetCorr, mcVersion='', theJetNames=theJetColls, doSusyTopProjection=False) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False process.patJetsPF.embedCaloTowers = False process.patJetsPF.embedPFCandidates = False #-- Adjust collections to use PFNoPU jets ------------------------------------- # do not use Z-mass window for PU subtraction # such that JEC works properly process.pfPileUpPF.checkClosestZVertex = cms.bool(False) # do not remove muons and electrons from the jet clustering input # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections) process.pfIsolatedElectronsPF.isolationCut = -1 process.pfIsolatedMuonsPF.isolationCut = -1 # make loose clones of the original electron collection process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone() process.pfRelaxedElectronsPF.isolationCut = 9999 process.pfElectronsFromVertexPF.dzCut = 9999.0 process.pfElectronsFromVertexPF.d0Cut = 9999.0 process.pfSelectedElectronsPF.cut = "" process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF" process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF, process.pfIsolatedElectronsPF + process.pfRelaxedElectronsPF) # make loose clones of the original muon collection process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone() process.pfRelaxedMuonsPF.isolationCut = 9999 process.pfMuonsFromVertexPF.dzCut = 9999.0 process.pfMuonsFromVertexPF.d0Cut = 9999.0 process.pfSelectedMuonsPF.cut = "" process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF" process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF, process.pfIsolatedMuonsPF + process.pfRelaxedMuonsPF) # do not remove taus from the jet collection process.pfTausPF.discriminators = cms.VPSet() process.pfUnclusteredTausPF = process.pfTausPF.clone( cut = cms.string("pt < 0") ) process.pfTauSequencePF.replace(process.pfTausPF, process.pfTausPF+ process.pfUnclusteredTausPF) process.pfNoTauPF.topCollection = "pfUnclusteredTausPF" #------------------------------------------------------------------------------ #-- Overwrite default output content ------------------------------------------ from SandBox.Skims.RA2Content_cff import getRA2PATOutput process.out.outputCommands = getRA2PATOutput(process) process.out.dropMetaData = cms.untracked.string('DROPPED') #-- RA2 filtering ------------------------------------------------------------- process.prefilterCounter = cms.EDProducer("EventCountProducer") process.postStdCleaningCounter = cms.EDProducer("EventCountProducer") process.postPostCleaningCounter = cms.EDProducer("EventCountProducer") process.postPFchsJetsCounter = cms.EDProducer("EventCountProducer") process.postPFchsHTCounter = cms.EDProducer("EventCountProducer") process.postPFchsMHTCounter = cms.EDProducer("EventCountProducer") process.load('SandBox.Skims.RA2Objects_cff') process.load('SandBox.Skims.RA2Selection_cff') process.load('SandBox.Skims.RA2Cleaning_cff') # Adjust object filters for signal-scan values process.htPFchsFilter.MinHT = cms.double(300.0) process.mhtPFchsFilter.MinMHT = cms.double(100.0) process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2) ## please comment this block to remove tagging mode of ##filters and reject events failing any of following filters process.eeNoiseFilter.taggingMode = False process.trackingFailureFilter.taggingMode = False process.beamHaloFilter.taggingMode = False process.ra2NoiseCleaning.remove(process.HBHENoiseFilter) process.inconsistentMuons.taggingMode = False process.greedyMuons.taggingMode = False process.ra2EcalTPFilter.taggingMode = False process.ra2EcalBEFilter.taggingMode = False process.hcalLaserEventFilter.taggingMode = False process.eeBadScFilter.taggingMode = False process.load("SandBox.Skims.provInfoMuons_cfi") process.load("SandBox.Skims.provInfoElectrons_cfi") process.cleanpatseq = cms.Sequence( process.susyPatDefaultSequence * process.prefilterCounter * process.ra2StdCleaning * process.postStdCleaningCounter * process.ra2Objects * process.provInfoMuons * process.provInfoElectrons * process.ra2PostCleaning * process.postPostCleaningCounter ) ## --- Setup WeightProducer -------------------------------------------- from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer process.WeightProducer = weightProducer.clone( weight = cms.double(-1.0), Method = cms.string("Constant"), XS = cms.double(xs), NumberEvts = cms.double(numEvtsInSample), Lumi = cms.double(lumi), LumiScale = cms.double(1.0), FileNamePUDataDistribution = cms.string("NONE"), PU = cms.int32(0) ) ## --- SMS Model Filter ------------------------------------------------ # Filter files for specified signal point out of dataset # Code from UserCode/seema/SusyAnalysis/AnalysisUtils from SusyAnalysis.AnalysisUtils.smsModelFilter_cfi import smsModelFilter process.SMSModelFilter = smsModelFilter.clone( SusyScanTopology = cms.string(smsModel), SusyScanMotherMass = cms.double(smsMotherMass), SusyScanLSPMass = cms.double(smsLSPMass), SusyScanFracLSP = cms.double(0.0) ) #---JL #--for PDF sys process.pdfWeight = cms.EDProducer("PdfWeightProducer", PdfInfoTag = cms.untracked.InputTag("generator"), PdfSetNames = cms.untracked.vstring("cteq66.LHgrid","MSTW2008nlo68cl.LHgrid","NNPDF20_100.LHgrid") #PdfSetNames = cms.untracked.vstring("NNPDF20_100.LHgrid") ) #---for ISR sys process.lastParticles = cms.EDProducer("ISRProducer") process.ISRsys = cms.Sequence(process.lastParticles) #---put the susy params process.load("RA2Classic.SUSYParams.susyparams_cfi") process.susyparams.Model = cms.string(SMStopol) #-- end JL ## --- Setup of TreeMaker ---------------------------------------------- process.TFileService = cms.Service( "TFileService", fileName = cms.string("RA2Selection.root") ) from RA2Classic.TreeMaker.treemaker_cfi import TreeMaker process.RA2TreeMaker = TreeMaker.clone( TreeName = cms.string("RA2PreSelection"), VertexCollection = cms.InputTag('goodVertices'), HT = cms.InputTag('htPFchs'), HTJets = cms.InputTag('patJetsPFchsPt50Eta25'), MHT = cms.InputTag('mhtPFchs'), MHTJets = cms.InputTag('patJetsPFchsPt30'), VarsDouble = cms.VInputTag(cms.InputTag('WeightProducer:weight'),"susyparams:m0","susyparams:m12","susyparams:evtProcID"), VarsDoubleNamesInTree = cms.vstring('Weight',"massMom","massDau","procID"), CandidateCollections = cms.VInputTag('patJetsPFchsPt30','patMuonsPFIDIso','patElectronsIDIso'), CandidateNamesInTree = cms.vstring('Jets','PATMuonsPFIDIso','PATElectronsIDIso'), VarsDoubleV = cms.VInputTag("pdfWeight:cteq66","pdfWeight:MSTW2008nlo68cl","pdfWeight:NNPDF20"), VarsDoubleNamesInTreeV = cms.vstring("cteq66","MSTW2008nlo68cl","NNPDF20") ) #process.dump = cms.EDAnalyzer("EventContentAnalyzer") process.ppfchs = cms.Path( process.SMSModelFilter * process.cleanpatseq * process.countJetsPFchsPt50Eta25 * process.postPFchsJetsCounter * process.htPFchsFilter * process.postPFchsHTCounter * process.mhtPFchsFilter * process.postPFchsMHTCounter * process.WeightProducer * #--JL process.pdfWeight* process.ISRsys* process.susyparams* #--end JL process.RA2TreeMaker ) process.schedule = cms.Schedule(process.ppfchs)
## Output Module Configuration (expects a path 'p') from PhysicsTools.PatAlgos.patEventContent_cff import patEventContent process.out = cms.OutputModule("PoolOutputModule", verbose = cms.untracked.bool(True), fileName = cms.untracked.string('patTuple.root'), SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ), outputCommands = cms.untracked.vstring('drop *', "keep *_BFieldColl_*_*_","keep *_JetCorrColl_*_*_",*patEventContent ) ) #process.outpath = cms.EndPath(process.out) #-- SUSYPAT and GlobalTag Settings ----------------------------------------------------------- #process.GlobalTag.globaltag = 'START42_V13::All' # MC Setting from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands process.GlobalTag.globaltag = 'GR_R_42_V19::All' # Data Setting addDefaultSUSYPAT(process,False,'HLT',['L1FastJet','L2Relative','L3Absolute','L2L3Residual'],'',['AK5PF','AK5JPT']) process.metJESCorAK5PFTypeI.corrector = cms.string('ak5PFL2L3Residual') # Type1PFMET Residual for data only. #addDefaultSUSYPAT(process,True,'HLT',['L1FastJet','L2Relative','L3Absolute'],'',['AK5PF','AK5JPT']) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################## END SUSYPAT specifics #################################### #Turn on trigger info from PhysicsTools.PatAlgos.tools.trigTools import switchOnTrigger switchOnTrigger(process, triggerProducer='patTrigger', triggerEventProducer='patTriggerEvent', sequence='patDefaultSequence', hltProcess="HLT") process.load("Workspace.ConfigurableAnalysis.configurableAnalysis_ForPattuple_cff") process.load('CommonTools/RecoAlgos/HBHENoiseFilterResultProducer_cfi') #-- Output module configuration ----------------------------------------------- process.out.fileName = "SUSYPAT.root" process.out.splitLevel = cms.untracked.int32(99) # Turn on split level (smaller files???)
#process.GlobalTag.globaltag = 'START36_V9::All' ### Setting for Running on Commissioing10 361p4 Data, also change secVertex Btag. #addDefaultSUSYPAT(process,False,'HLT','Spring10','',['IC5Calo','AK5JPT']) #process.GlobalTag.globaltag = 'GR10_P_V6::All' ### Setting for Running on 362 MC with REDIGI36X HLT tag. #addDefaultSUSYPAT(process,True,'REDIGI36X','Spring10','',['IC5Calo','AK5JPT']) #process.GlobalTag.globaltag = 'START36_V9::All' ### Setting for Running on Commissioing10 358p3 Data, also change secVertex Btag. #addDefaultSUSYPAT(process,False,'HLT','Spring10','35x',['IC5Calo','AK5JPT']) #process.GlobalTag.globaltag = 'GR10_P_V5::All' ### Setting for Running on Jun9thReReco data addDefaultSUSYPAT(process, False, 'HLT', 'Spring10', '', ['IC5Calo', 'AK5JPT']) #process.GlobalTag.globaltag = 'GR_R_37X_V6A::All' #needed to run in 38X... seems to work on 37X RECO also... #process.GlobalTag.globaltag = cms.string('START38_V8::All') process.GlobalTag.globaltag = cms.string('GR10_P_V10::All') ### Setting for Running on 37X MC #addDefaultSUSYPAT(process,True,'HLT','Spring10','',['IC5Calo','AK5JPT']) #process.GlobalTag.globaltag = 'START37_V5::All' ### Setting for Running on Jul16thReReco data #addDefaultSUSYPAT(process,False,'HLT','Spring10','',['IC5Calo','AK5JPT']) #process.GlobalTag.globaltag = 'GR_R_37X_V6D::All' ##########################################################################################
process.maxEvents.input = 100 # Due to problem in production of LM samples: same event number appears multiple times process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') ##run on 31X mc samples #from PhysicsTools.PatAlgos.tools.cmsswVersionTools import * #run33xOn31xMC(process) #-- Calibration tag ----------------------------------------------------------- # Should match input file's tag process.GlobalTag.globaltag = 'MC_3XY_V18::All' ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT, parameters are: mcInfo, HLT menu, Jet energy corrections, JetCollections addDefaultSUSYPAT(process,True,'HLT','Summer09_7TeV_ReReco332','31xReReco332',['AK5PF','AK5JPT','AK5Track']) #SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################### END SUSYPAT specifics #################################### # # ##-- Output module configuration ----------------------------------------------- #process.out.fileName = 'SUSYPAT_7TeV.root' # <-- CHANGE THIS TO SUIT YOUR NEEDS # ## Custom settings #process.out.splitLevel = cms.untracked.int32(99) # Turn on split level (smaller files???) #process.out.overrideInputFileSplitLevels = cms.untracked.bool(True) #process.out.dropMetaData = cms.untracked.string('DROPPED') # Get rid of metadata related to dropped collections #process.out.outputCommands = cms.untracked.vstring('drop *', *SUSY_pattuple_outputCommands ) del process.outpath # Analyzer section process.TFileService = cms.Service("TFileService",
else: if options.GlobalTag == "": options.GlobalTag = 'GR09_R_34X_V3::All' options.files = 'rfio://castorcms/?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/caf/user/edelhoff/SusyCAF/examplePAT/BeamCommissioning09_MinimumBias_Jan23Skim_V00-05-10.root' process.source = cms.Source('PoolSource', fileNames = cms.untracked.vstring(options.files) ) process.maxEvents.input = options.maxEvents #-- Calibration tag ----------------------------------------------------------- process.GlobalTag.globaltag = options.GlobalTag schedule = cms.Schedule() if options.patify and options.fromRECO: from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT: Parameters are: mcInfo, HLT menu, Jet energy corrections, MC version ('31x' or '31xReReco332') #addDefaultSUSYPAT(process,options.mcInfo,'HLT',options.JetCorrections,None,['IC5','SC5','AK7','KT4','AK5PF','AK7PF','AK5JPT','AK5Track']) addDefaultSUSYPAT(process,True,'HLT','Summer09_7TeV','31x',['IC5','SC5','AK5PF','AK5JPT','AK5Track']) process.jetGenJetMatch.maxDeltaR = cms.double(0.5) #default AK5 jet # process.jetGenJetMatchAK7.maxDeltaR = cms.double(0.5) process.jetGenJetMatchSC5.maxDeltaR = cms.double(0.5) process.jetGenJetMatchIC5.maxDeltaR = cms.double(0.5) # process.jetGenJetMatchKT4.maxDeltaR = cms.double(0.5) process.jetGenJetMatchAK5PF.maxDeltaR = cms.double(0.5) # process.jetGenJetMatchAK7PF.maxDeltaR = cms.double(0.5) process.jetGenJetMatchAK5JPT.maxDeltaR = cms.double(0.5) process.jetGenJetMatchAK5Track.maxDeltaR = cms.double(0.5) process.susyPat = cms.Path(process.seqSUSYDefaultSequence) schedule.append(process.susyPat) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) #-- Output module configuration ----------------------------------------------- process.out.fileName = options.secondaryOutput
'rfio:/castor/cern.ch/user/y/yohay/361p4/gg_361p4_EG_PD_prompt_reco_runs138560-139790_HLT15_withTimingCut_98_1_xYS.root', 'rfio:/castor/cern.ch/user/y/yohay/361p4/gg_361p4_EG_PD_prompt_reco_runs138560-139790_HLT15_withTimingCut_99_1_88g.root', 'rfio:/castor/cern.ch/user/y/yohay/361p4/gg_361p4_EG_PD_prompt_reco_runs138560-139790_HLT15_withTimingCut_9_1_mPC.root' ] process.maxEvents.input = -1 # Due to problem in production of LM samples: same event number appears multiple times process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') #-- Calibration tag ----------------------------------------------------------- # Should match input file's tag process.GlobalTag.globaltag = 'GR_R_36X_V11A::All' ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT, parameters are: mcInfo, HLT menu, Jet energy corrections, mcVersion ('35x' for 35x samples, empty string for 36X samples),JetCollections addDefaultSUSYPAT(process,False,'HLT','Spring10','',['IC5Calo','AK5JPT']) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################## END SUSYPAT specifics #################################### #-- Output module configuration ----------------------------------------------- process.out.fileName = '/data/yohay/SUSYPAT_gg_data.root' # <-- CHANGE THIS TO SUIT YOUR NEEDS # Custom settings process.out.splitLevel = cms.untracked.int32(99) # Turn on split level (smaller files???) process.out.overrideInputFileSplitLevels = cms.untracked.bool(True) process.out.dropMetaData = cms.untracked.string('DROPPED') # Get rid of metadata related to dropped collections process.out.outputCommands = cms.untracked.vstring('drop *', *SUSY_pattuple_outputCommands ) #to avoid running out of memory process.options = cms.untracked.PSet( fileMode = cms.untracked.string('NOMERGE')
# -- Calibration tag ----------------------------------------------------------- if options.GlobalTag: process.GlobalTag.globaltag = options.GlobalTag ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands # Apply SUSYPAT addDefaultSUSYPAT( process, options.mcInfo, options.hltName, options.jetCorrections, options.mcVersion, options.jetTypes, options.doValidation, options.doExtensiveMatching, options.doSusyTopProjection, options.electronHLTMatches, options.muonHLTMatches, options.tauHLTMatches, options.jetHLTMatches, options.photonHLTMatches, ) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands(process) ############################## END SUSYPAT specifics #################################### # -- HLT selection ------------------------------------------------------------ import HLTrigger.HLTfilters.hltHighLevel_cfi as hlt if options.hltSelection: process.hltFilter = hlt.hltHighLevel.clone(
#'/store/mc/Spring10/MinBias/GEN-SIM-RECO/START3X_V25B_356ReReco-v1/0007/FE90A396-233C-DF11-8106-002618943898.root' #'/store/data/Commissioning10/MinimumBias/RAW-RECO/Apr1Skim_GOODCOLL-v1/0140/E27B88D1-8040-DF11-B3FC-00261894391B.root' '/store/mc/Spring10/TTbarJets-madgraph/GEN-SIM-RECO/START3X_V26_S09-v1/0011/A4121AB4-0747-DF11-8984-0030487F171B.root' ] process.maxEvents.input = 100 # Due to problem in production of LM samples: same event number appears multiple times process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') #-- Calibration tag ----------------------------------------------------------- # Should match input file's tag process.GlobalTag.globaltag = 'MC_36Y_V6::All' ############################# START SUSYPAT specifics #################################### from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands #Apply SUSYPAT, parameters are: mcInfo, HLT menu, Jet energy corrections, mcVersion ('35x' for 35x samples, empty string for 36X samples),JetCollections addDefaultSUSYPAT(process,True,'HLT','Spring10','35x',['IC5Calo','AK5PF']) SUSY_pattuple_outputCommands = getSUSY_pattuple_outputCommands( process ) ############################## END SUSYPAT specifics #################################### #-- Output module configuration ----------------------------------------------- process.out.fileName = 'SUSYPAT.root' # <-- CHANGE THIS TO SUIT YOUR NEEDS # Custom settings process.out.splitLevel = cms.untracked.int32(99) # Turn on split level (smaller files???) process.out.overrideInputFileSplitLevels = cms.untracked.bool(True) process.out.dropMetaData = cms.untracked.string('DROPPED') # Get rid of metadata related to dropped collections process.out.outputCommands = cms.untracked.vstring('drop *', *SUSY_pattuple_outputCommands ) #-- Execution path ------------------------------------------------------------ # Full path
def makeTreeFromFSIM(process, globalTag, reportEveryEvt=5000, testFileName="/store/mc/Summer12/WJetsToLNu_HT-400ToInf_8TeV-madgraph/AODSIM/PU_S7_START52_V9-v1/0000/041CF749-57A0-E111-B6DD-0026189438DA.root", numProcessedEvt=20): #-- Meta data to be logged in DBS --------------------------------------------- process.configurationMetadata = cms.untracked.PSet( version = cms.untracked.string('$Revision: 1.2 $'), name = cms.untracked.string('$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/TreeMaker/python/makeTreeFromSignalScan_cff.py,v $'), annotation = cms.untracked.string('SUSY pattuple definition') ) #-- Message Logger ------------------------------------------------------------ process.MessageLogger.categories.append('PATSummaryTables') process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet( limit = cms.untracked.int32(-1), reportEvery = cms.untracked.int32(1) ) process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt #-- Input Source -------------------------------------------------------------- process.maxEvents.input = numProcessedEvt process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(testFileName)) #-- SUSYPAT specifics --------------------------------------------------------- from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands hltMenu = 'REDIGI' theJetColls = ['AK5PF'] jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute'] process.GlobalTag.globaltag = globalTag addDefaultSUSYPAT(process, mcInfo=True, HLTMenu=hltMenu, jetMetCorrections=jetMetCorr, mcVersion='', theJetNames=theJetColls, doSusyTopProjection=False) # Remove the PAT cleaning and filtering sequences process.patDefaultSequence.remove(process.selectedPatCandidates) process.patDefaultSequence.remove(process.cleanPatCandidates) process.patDefaultSequence.remove(process.countPatCandidates) # Disable embedment so that lepton cleaning method works process.patJetsAK5PF.embedCaloTowers = False process.patJetsAK5PF.embedPFCandidates = False process.patJetsPF.embedCaloTowers = False process.patJetsPF.embedPFCandidates = False #-- Adjust collections to use PFNoPU jets ------------------------------------- # do not use Z-mass window for PU subtraction # such that JEC works properly process.pfPileUpPF.checkClosestZVertex = cms.bool(False) # do not remove muons and electrons from the jet clustering input # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections) process.pfIsolatedElectronsPF.isolationCut = -1 process.pfIsolatedMuonsPF.isolationCut = -1 # make loose clones of the original electron collection process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone() process.pfRelaxedElectronsPF.isolationCut = 9999 process.pfElectronsFromVertexPF.dzCut = 9999.0 process.pfElectronsFromVertexPF.d0Cut = 9999.0 process.pfSelectedElectronsPF.cut = "" process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF" process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF, process.pfIsolatedElectronsPF + process.pfRelaxedElectronsPF) # make loose clones of the original muon collection process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone() process.pfRelaxedMuonsPF.isolationCut = 9999 process.pfMuonsFromVertexPF.dzCut = 9999.0 process.pfMuonsFromVertexPF.d0Cut = 9999.0 process.pfSelectedMuonsPF.cut = "" process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF" process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF, process.pfIsolatedMuonsPF + process.pfRelaxedMuonsPF) # do not remove taus from the jet collection process.pfTausPF.discriminators = cms.VPSet() process.pfUnclusteredTausPF = process.pfTausPF.clone( cut = cms.string("pt < 0") ) process.pfTauSequencePF.replace(process.pfTausPF, process.pfTausPF+ process.pfUnclusteredTausPF) process.pfNoTauPF.topCollection = "pfUnclusteredTausPF" #------------------------------------------------------------------------------ #-- Overwrite default output content ------------------------------------------ from SandBox.Skims.RA2Content_cff import getRA2PATOutput process.out.outputCommands = getRA2PATOutput(process) process.out.dropMetaData = cms.untracked.string('DROPPED') #-- RA2 filtering ------------------------------------------------------------- process.prefilterCounter = cms.EDProducer("EventCountProducer") process.postStdCleaningCounter = cms.EDProducer("EventCountProducer") process.postPostCleaningCounter = cms.EDProducer("EventCountProducer") process.postPFchsJetsCounter = cms.EDProducer("EventCountProducer") process.postPFchsHTCounter = cms.EDProducer("EventCountProducer") process.postPFchsMHTCounter = cms.EDProducer("EventCountProducer") process.load('SandBox.Skims.RA2Objects_cff') process.load('SandBox.Skims.RA2Selection_cff') process.load('SandBox.Skims.RA2Cleaning_cff') # Adjust object filters for signal-scan values process.htPFchsFilter.MinHT = cms.double(300.0) process.mhtPFchsFilter.MinMHT = cms.double(100.0) process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2) ## RA2 cleaning process.ra2NoiseCleaning.remove(process.HBHENoiseFilterRA2) # Not in FASTSIM process.ra2NoiseCleaning.remove(process.HBHENoiseFilter) # Not in FASTSIM process.ra2NoiseCleaning.remove(process.beamHaloFilter) # Not in FASTSIM process.trackingFailureFilter.taggingMode = False process.inconsistentMuons.taggingMode = False process.greedyMuons.taggingMode = False process.ra2EcalTPFilter.taggingMode = False process.ra2EcalBEFilter.taggingMode = False process.hcalLaserEventFilter.taggingMode = False process.ecalLaserCorrFilter.taggingMode = False process.eeBadScFilter.taggingMode = False process.manystripclus53X.taggedMode = cms.untracked.bool(False) process.toomanystripclus53X.taggedMode = cms.untracked.bool(False) process.logErrorTooManyClusters.taggedMode = cms.untracked.bool(False) process.trackingPOGCleaning = cms.Sequence( ~process.manystripclus53X * ~process.toomanystripclus53X * ~process.logErrorTooManyClusters ) #process.ra2NoiseCleaning += process.trackingPOGCleaning process.ra2NoiseCleaning += process.ra2PBNR from SandBox.Skims.hoNoiseFilter_cfi import hoNoiseFilter process.RA2HONoiseFilter = hoNoiseFilter.clone( patJetsInputTag = cms.InputTag('patJetsPFchsPt30'), jetPtMin = cms.double(30), jetEtaMax = cms.double(5), maxHOEfrac = cms.double(0.4), taggingMode = cms.bool(False) ) process.ra2NoiseCleaning += process.RA2HONoiseFilter process.load("SandBox.Skims.provInfoMuons_cfi") process.load("SandBox.Skims.provInfoElectrons_cfi") process.cleanpatseq = cms.Sequence( process.susyPatDefaultSequence * process.prefilterCounter * process.ra2StdCleaning * process.postStdCleaningCounter * process.ra2Objects * process.provInfoMuons * process.provInfoElectrons * process.ra2PostCleaning * process.postPostCleaningCounter ) ## Lepton veto process.load('SandBox.Skims.RA2Leptons_cff') process.LeptonVeto = cms.Sequence( process.ra2PFMuonVeto * process.ra2ElectronVeto ) ## --- Setup WeightProducer -------------------------------------------- from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer process.WeightProducer = weightProducer.clone( weight = cms.double(-1.0), Method = cms.string("Constant"), XS = cms.double(1), NumberEvts = cms.double(1), Lumi = cms.double(1), LumiScale = cms.double(1.0), PU = cms.int32(2), # PU Summer12S7 FileNamePUDataDistribution = cms.string("RA2Classic/WeightProducer/data/DataPileupHistogram_RA2Summer12_190456-208686_ABCD.root") ) ## --- Setup of TreeMaker ---------------------------------------------- process.TFileService = cms.Service( "TFileService", fileName = cms.string("RA2Selection.root") ) from RA2Classic.TreeMaker.treemaker_cfi import TreeMaker process.RA2TreeMaker = TreeMaker.clone( TreeName = cms.string("RA2Selection"), VertexCollection = cms.InputTag('goodVertices'), HT = cms.InputTag('htPFchs'), HTJets = cms.InputTag('patJetsPFchsPt50Eta25'), MHT = cms.InputTag('mhtPFchs'), MHTJets = cms.InputTag('patJetsPFchsPt30'), VarsDouble = cms.VInputTag(cms.InputTag('WeightProducer:weight')), VarsDoubleNamesInTree = cms.vstring('Weight'), ) #process.dump = cms.EDAnalyzer("EventContentAnalyzer") process.ppfchs = cms.Path( process.cleanpatseq * process.LeptonVeto * process.countJetsPFchsPt50Eta25 * process.postPFchsJetsCounter * process.htPFchsFilter * process.postPFchsHTCounter * process.mhtPFchsFilter * process.postPFchsMHTCounter * process.WeightProducer * process.RA2TreeMaker ) process.schedule = cms.Schedule(process.ppfchs)