Example #1
0
def patTool(process, runOnMC=True, useMiniAOD=True):
    process.load("RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff")

    if not useMiniAOD:
        process.load('Configuration.StandardSequences.PAT_cff')
        from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllMC, miniAOD_customizeAllData
        if runOnMC:
            miniAOD_customizeAllMC(process)
        else:
            miniAOD_customizeAllData(process)

        #for muon isolation
        process.patMuons.isolationValues.user = cms.VInputTag(
            "muPFIsoValueCharged03", "muPFIsoValueNeutral03",
            "muPFIsoValueGamma03", "muPFIsoValuePU03",
            "muPFIsoValueChargedAll03")
        #for electron isolation
        process.patElectrons.isolationValues.user = cms.VInputTag(
            "elPFIsoValueCharged03PFId", "elPFIsoValueNeutral03PFId",
            "elPFIsoValueGamma03PFId", "elPFIsoValuePU03PFId",
            "elPFIsoValueChargedAll03PFId")
        process.patElectrons.isolationValuesNoPFId.user = cms.VInputTag(
            "elPFIsoValueCharged03NoPFId", "elPFIsoValueNeutral03NoPFId",
            "elPFIsoValueGamma03NoPFId", "elPFIsoValuePU03NoPFId",
            "elPFIsoValueChargedAll03NoPFId")
Example #2
0
def patTool(process, runOnMC=True, useMiniAOD = True):
    process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
    process.load("RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff")

    if not useMiniAOD:
        process.load("RecoEgamma.ElectronIdentification.ElectronIDValueMapProducer_cfi")
        process.load('Configuration.StandardSequences.PAT_cff')
        from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllMC,miniAOD_customizeAllData
        if runOnMC:
            miniAOD_customizeAllMC(process)
        else :
            miniAOD_customizeAllData(process)

        ## tem - due to ak4GenJetsNoNu not in AOD for now
        process.load('CommonTools.ParticleFlow.genForPF2PAT_cff')
Example #3
0
def patTool(process, runOnMC=True, useMiniAOD=True):
    if not useMiniAOD:  #running pretty much the default miniAOD steps!
        # doing all filters
        process.load('PhysicsTools.PatAlgos.slimming.metFilterPaths_cff')
        from PhysicsTools.PatAlgos.slimming.metFilterPaths_cff import allMetFilterPaths
        for filt in allMetFilterPaths:
            process.schedule.append(getattr(process, 'Flag_' + filt))

        process.load('Configuration.StandardSequences.PAT_cff')

        from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeAllMC, miniAOD_customizeAllData
        if runOnMC:
            miniAOD_customizeAllMC(process)
        else:
            miniAOD_customizeAllData(process)

        process.patJetsPuppi.embedGenPartonMatch = cms.bool(False)
        process.patJetCorrFactorsPuppi.useRho = cms.bool(False)
    process.schedule.append(process.p)
#call to customisation function customiseMerging_Reselect imported from TauAnalysis.MCEmbeddingTools.customisers
process = customiseMerging_Reselect(process)

# End of customisation functions
#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_customizeAllData

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

# End of customisation functions

# Customisation from command line

process.patTrigger.processName = cms.string('SIMembedding')
#Have logErrorHarvester wait for the same EDProducers to finish as those providing data for the OutputModule
from FWCore.Modules.logErrorHarvester_cff import customiseLogErrorHarvesterUsingOutputCommands
process = customiseLogErrorHarvesterUsingOutputCommands(process)

# 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
#call to customisation function customiseDataRun2Common_25ns imported from Configuration.DataProcessing.RecoTLR
process = customiseDataRun2Common_25ns(process)

# Automatic addition of the customisation function from TauAnalysis.EmbeddingProducer.customisers
from TauAnalysis.EmbeddingProducer.customisers import customisoptions,customiseLHEandCleaning 

#call to customisation function customisoptions imported from TauAnalysis.EmbeddingProducer.customisers
process = customisoptions(process)

#call to customisation function customiseLHEandCleaning imported from TauAnalysis.EmbeddingProducer.customisers
process = customiseLHEandCleaning(process)

# End of customisation functions
#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.PAT_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_customizeAllData 

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

# End of customisation functions
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)
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)
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)
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)
def addGJetSkim(process, isData=False):
    print "Adding GJet Skim step."
    print "triggerSelection should be verified for new datasets."
    print "photonID should be modified for each global tag."
    process.triggerSelection = cms.EDFilter( "TriggerResultsFilter",
        triggerConditions = cms.vstring(
            # Data: Run2015*
            'HLT_Photon165_HE10_v*',
            # MC: RunIISpring15DR74
        ),
        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.gJetFilter = cms.EDFilter("GJetFilter",
        isData = cms.bool( False ),
        srcPhotons = cms.InputTag("slimmedPhotons"),
        srcJets = cms.InputTag("slimmedJets"),
        minPtPhoton = cms.double(175.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
        photonID = cms.string('cutBasedPhotonID-Spring15-25ns-V1-standalone-medium'),
        #photonID = cms.string('cutBasedPhotonID-Spring15-50ns-V1-standalone-medium'),
    )
    if isData: process.gJetFilter.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)

    from PhysicsTools.SelectorUtils.tools.vid_id_tools import *
    my_id_modules = ['RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring15_25ns_V1_cff']

    #add them to the VID producer
    for idmod in my_id_modules:
       setupAllVIDIdsInModule(process,idmod,setupVIDPhotonSelection)

    ############################################################
    # Ignore trigger selection if MC
    if isData:
        return cms.Sequence(process.eventCountPreTrigger * cms.ignore(process.triggerSelection) * process.eventCountPreFilter * process.gJetFilter * process.eventCountPostFilter)
    else:
        return cms.Sequence(process.eventCountPreTrigger * cms.ignore(process.triggerSelection) * process.eventCountPreFilter * process.gJetFilter * process.eventCountPostFilter)