Ejemplo n.º 1
0
process.Flag_hcalLaserEventFilter = cms.Path(process.hcalLaserEventFilter)
process.Flag_HBHENoiseFilter = cms.Path(process.HBHENoiseFilterResultProducer+process.HBHENoiseFilter)
process.Flag_trkPOG_toomanystripclus53X = cms.Path(~process.toomanystripclus53X)
process.Flag_EcalDeadCellBoundaryEnergyFilter = cms.Path(process.EcalDeadCellBoundaryEnergyFilter)
process.Flag_trkPOG_manystripclus53X = cms.Path(~process.manystripclus53X)
process.Flag_HcalStripHaloFilter = cms.Path(process.HcalStripHaloFilter)
process.Flag_muonBadTrackFilter = cms.Path(process.muonBadTrackFilter)
process.Flag_CSCTightHalo2015Filter = cms.Path(process.CSCTightHalo2015Filter)
process.endjob_step = cms.EndPath(process.endOfProcess)
process.MINIAODSIMoutput_step = cms.EndPath(process.MINIAODSIMoutput)

# Schedule definition
process.schedule = cms.Schedule(process.Flag_HBHENoiseFilter,process.Flag_HBHENoiseIsoFilter,process.Flag_CSCTightHaloFilter,process.Flag_CSCTightHaloTrkMuUnvetoFilter,process.Flag_CSCTightHalo2015Filter,process.Flag_globalTightHalo2016Filter,process.Flag_globalSuperTightHalo2016Filter,process.Flag_HcalStripHaloFilter,process.Flag_hcalLaserEventFilter,process.Flag_EcalDeadCellTriggerPrimitiveFilter,process.Flag_EcalDeadCellBoundaryEnergyFilter,process.Flag_goodVertices,process.Flag_eeBadScFilter,process.Flag_ecalLaserCorrFilter,process.Flag_trkPOGFilters,process.Flag_chargedHadronTrackResolutionFilter,process.Flag_muonBadTrackFilter,process.Flag_trkPOG_manystripclus53X,process.Flag_trkPOG_toomanystripclus53X,process.Flag_trkPOG_logErrorTooManyClusters,process.Flag_METFilters,process.endjob_step,process.MINIAODSIMoutput_step)

#do not add changes to your config after this point (unless you know what you are doing)
from FWCore.ParameterSet.Utilities import convertToUnscheduled
process=convertToUnscheduled(process)
process.load('Configuration.StandardSequences.PATMC_cff')
from FWCore.ParameterSet.Utilities import cleanUnscheduled
process=cleanUnscheduled(process)

# customisation of the process.

# Automatic addition of the customisation function from PhysicsTools.PatAlgos.slimming.miniAOD_tools
from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllMC 

#call to customisation function miniAOD_customizeAllMC imported from PhysicsTools.PatAlgos.slimming.miniAOD_tools
process = miniAOD_customizeAllMC(process)

# End of customisation functions
Ejemplo n.º 2
0
def addSkim(process, isData=False, doJetFilter=True, doHLT=False):
    if doHLT:
        print "Applying HLT trigger selection"
        print "triggerSelection should be verified for new datasets."
        process.triggerSelection = cms.EDFilter( "TriggerResultsFilter",
            triggerConditions = cms.vstring(
                # EXO-16-003
                'HLT_HT250_DisplacedDijet40_DisplacedTrack_v*',
                'HLT_HT350_DisplacedDijet40_DisplacedTrack_v*',
                'HLT_HT400_DisplacedDijet40_Inclusive_v*',
                'HLT_HT500_DisplacedDijet40_Inclusive_v*',
                # Data: Run2015*
                # 'HLT_PFHT475_v*',
                # 'HLT_PFHT600_v*',
                # 'HLT_PFHT750_4Jet_v*',
                # 'HLT_PFHT800_v*',
                # MC: RunIISpring15DR74
                #'HLT_PFHT900_v*',
                # Signal region
                'HLT_PFHT800_v*',
                'HLT_PFHT900_v*',
            ),
            hltResults = cms.InputTag( "TriggerResults", "", "HLT" ),
            l1tResults = cms.InputTag( "" ),
            l1tIgnoreMask = cms.bool( False ),
            l1techIgnorePrescales = cms.bool( False ),
            daqPartitions = cms.uint32( 1 ),
            throw = cms.bool( False )
        )
    doFilter = True if doJetFilter else False # doFilter must be boolean type
    process.jetFilter = cms.EDFilter("JetFilter",
        doFilter = cms.bool( doFilter ),
        srcJets = cms.InputTag("ak4PFJetsCHS"),
        # srcJets = cms.InputTag("patJets"),
        # additionalCut = cms.string(""),
        additionalCut = cms.string("abs(eta) < 2.5 && pt > 50.0"),
        jetCuts = cms.VPSet(
            cms.PSet(
                minPt = cms.double(400.0),
                maxEta = cms.double(2.5),
                stringCut = cms.string(""),
                ),
            cms.PSet(
                minPt = cms.double(200.0),
                maxEta = cms.double(2.5),
                stringCut = cms.string(""),
                ),
            cms.PSet(
                minPt = cms.double(125.0),
                maxEta = cms.double(2.5),
                stringCut = cms.string(""),
                ),
            cms.PSet(
                minPt = cms.double(50.0),
                maxEta = cms.double(2.5),
                stringCut = cms.string(""),
                ),
        )
    )
    process.eventCountPreTrigger = cms.EDAnalyzer('EventCounter')
    process.eventCountPreFilter = cms.EDAnalyzer('EventCounter')
    process.eventCountPostFilter = cms.EDAnalyzer('EventCounter')
    ############################################################
    # Recreate miniAOD
    ############################################################
    if isData:
        # customisation of the process.
        process.load('Configuration.StandardSequences.PAT_cff')
        # Automatic addition of the customisation function from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllData
        #call to customisation function miniAOD_customizeAllData imported from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        process = miniAOD_customizeAllData(process)
    else:
        # customisation of the process.
        process.load('Configuration.StandardSequences.PATMC_cff')
        # Automatic addition of the customisation function from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllMC
        #call to customisation function miniAOD_customizeAllMC imported from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        process = miniAOD_customizeAllMC(process)
    ############################################################
    if doHLT: # Add triggerSelection
        return cms.Sequence(process.eventCountPreTrigger * process.triggerSelection * process.eventCountPreFilter * process.jetFilter * process.eventCountPostFilter)
    else: # Ignore triggerSelection
        return cms.Sequence(process.eventCountPreTrigger * process.eventCountPreFilter * process.jetFilter * process.eventCountPostFilter)
Ejemplo n.º 3
0
def addWJetSkim(process, isData=False):
    print "Adding WJet Skim step."
    print "triggerSelection should be verified for new datasets."
    print "electronID should be modified for each global tag."
    process.triggerSelection = cms.EDFilter( "TriggerResultsFilter",
        triggerConditions = cms.vstring(
            # Data: Run2015*
            'HLT_Ele27_eta2p1_WPLoose_Gsf_v*',
            'HLT_Ele27_eta2p1_WPTight_Gsf_v*',
            'HLT_IsoMu24_eta2p1_v*',
            # MC: RunIISpring15DR74
            'HLT_Ele27_eta2p1_WP75_Gsf_v*', # Off at 1.4e34
            'HLT_Ele32_eta2p1_WP75_Gsf_v*',
            # 'HLT_IsoMu24_eta2p1_v*', # same in data
            # 'HLT_IsoMu27_v*', # Good for data and MC, turn off for now for consistency

            # Exists in MC
            # 'HLT_Ele22_eta2p1_WP75_Gsf_v*',
            # 'HLT_IsoMu17_v*',
            # Exists in data, unprescaled
            # 'HLT_IsoMu20_v*',
            #
            # 'HLT_IsoMu22_v*',
            # 'HLT_IsoMu20_eta2p1_v*',
        ),
        hltResults = cms.InputTag( "TriggerResults", "", "HLT" ),
        l1tResults = cms.InputTag( "gtDigis" ),
        l1tIgnoreMask = cms.bool( False ),
        l1techIgnorePrescales = cms.bool( False ),
        daqPartitions = cms.uint32( 1 ),
        throw = cms.bool( False )
    )
    process.wJetFilter = cms.EDFilter("WJetFilter",
        isData = cms.bool( False ),
        srcMuons = cms.InputTag("slimmedMuons"),
        srcElectrons = cms.InputTag("slimmedElectrons"),
        srcJets = cms.InputTag("slimmedJets"),
        srcMET = cms.InputTag("slimmedMETs"),
        minPtMuon = cms.double(20.0),
        minPtElectron = cms.double(20.0),
        minPtMET = cms.double(20.0),
        minMt = cms.double(50.0),
        maxMt = cms.double(100.0),
        minDeltaR = cms.double(0.4),
        maxDeltaPhi = cms.double(0.4), # Doesn't do anything
        minPtSelectedJet = cms.double(20.0),
        maxPtAdditionalJets = cms.double(20.0), # Doesn't do anything
        electronID = cms.string('cutBasedElectronID-Spring15-25ns-V1-standalone-medium'),
        # electronID = cms.string('cutBasedElectronID-CSA14-50ns-V1-standalone-medium'),
    )
    if isData: process.wJetFilter.isData = cms.bool(True)
    process.eventCountPreTrigger = cms.EDAnalyzer('EventCounter')
    process.eventCountPreFilter = cms.EDAnalyzer('EventCounter')
    process.eventCountPostFilter = cms.EDAnalyzer('EventCounter')
    ############################################################
    # Recreate miniAOD
    ############################################################
    if isData:
        # customisation of the process.
        process.load('Configuration.StandardSequences.PAT_cff')
        # Automatic addition of the customisation function from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllData
        #call to customisation function miniAOD_customizeAllData imported from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        process = miniAOD_customizeAllData(process)
    else:
        # customisation of the process.
        process.load('Configuration.StandardSequences.PATMC_cff')
        # Automatic addition of the customisation function from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllMC
        #call to customisation function miniAOD_customizeAllMC imported from PhysicsTools.PatAlgos.slimming.miniAOD_tools
        process = miniAOD_customizeAllMC(process)
    ############################################################
    # Ignore trigger selection if MC
    if isData:
        return cms.Sequence(process.eventCountPreTrigger * (process.triggerSelection) * process.eventCountPreFilter * process.wJetFilter * process.eventCountPostFilter)
    else:
        return cms.Sequence(process.eventCountPreTrigger * cms.ignore(process.triggerSelection) * process.eventCountPreFilter * process.wJetFilter * process.eventCountPostFilter)
Ejemplo n.º 4
0
    process.Flag_BadPFMuonFilter,
    process.Flag_BadChargedCandidateSummer16Filter,
    process.Flag_BadPFMuonSummer16Filter, process.Flag_trkPOG_manystripclus53X,
    process.Flag_trkPOG_toomanystripclus53X,
    process.Flag_trkPOG_logErrorTooManyClusters, process.Flag_METFilters,
    process.endjob_step, process.MINIAODSIMoutput_step)
process.schedule.associate(process.patTask)
from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
associatePatAlgosToolsTask(process)

#do not add changes to your config after this point (unless you know what you are doing)
from FWCore.ParameterSet.Utilities import convertToUnscheduled
process = convertToUnscheduled(process)

# customisation of the process.

# Automatic addition of the customisation function from PhysicsTools.PatAlgos.slimming.miniAOD_tools
from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllMC

#call to customisation function miniAOD_customizeAllMC imported from PhysicsTools.PatAlgos.slimming.miniAOD_tools
process = miniAOD_customizeAllMC(process)

# End of customisation functions

# Customisation from command line

# Add early deletion of temporary data products to reduce peak memory need
from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
process = customiseEarlyDelete(process)
# End adding early deletion