Ejemplo n.º 1
0
def LoadCfgForSubmission():
    # get the options
    from PhysicsTools.NanoAODTools.postprocessing.framework.crabhelper import getCrabOption
    doData = getCrabOption("doData", False)

    print 'Shall we do data?', doData

    print '[TTHpostProcessor]: Submission step'
    from PhysicsTools.NanoAODTools.postprocessing.datasets.mc2017 import samples as mcSamples
    from PhysicsTools.NanoAODTools.postprocessing.datasets.data2017 import samples as dataSamples

    if doData:
        jsonFile = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions17/13TeV/ReReco/Cert_294927-306462_13TeV_EOY2017ReReco_Collisions17_JSON.txt'

        selectedSamples = dataSamples

        DatasetsAndTriggersMap = {}
        DatasetsAndVetosMap = {}
        DatasetsAndTriggersMap["DoubleMuon"] = triggers_mumu_iso + triggers_3mu
        DatasetsAndTriggersMap[
            "DoubleEG"] = triggers_ee + triggers_3e + triggers_ee_noniso
        DatasetsAndTriggersMap[
            "MuonEG"] = triggers_mue + triggers_2mu1e + triggers_2e1mu + triggers_mue_noiso
        DatasetsAndTriggersMap["SingleMuon"] = triggers_1mu_iso
        DatasetsAndTriggersMap["SingleElectron"] = triggers_1e_iso
        DatasetsAndTriggersMap["MET"] = []
        DatasetsAndTriggersMap["Electron_noOverlapRemov"] = []

        DatasetsAndVetosMap["DoubleMuon"] = []
        DatasetsAndVetosMap["DoubleEG"] = DatasetsAndTriggersMap[
            "DoubleMuon"] + DatasetsAndVetosMap["DoubleMuon"]
        DatasetsAndVetosMap["MuonEG"] = DatasetsAndTriggersMap[
            "DoubleEG"] + DatasetsAndVetosMap["DoubleEG"]
        DatasetsAndVetosMap["SingleMuon"] = DatasetsAndTriggersMap[
            "MuonEG"] + DatasetsAndVetosMap["MuonEG"]
        DatasetsAndVetosMap["SingleElectron"] = DatasetsAndTriggersMap[
            "SingleMuon"] + DatasetsAndVetosMap["SingleMuon"]
        DatasetsAndVetosMap["MET"] = []
        DatasetsAndVetosMap["Electron_noOverlapRemov"] = []

        for sample in selectedSamples:
            jsn = open(jsonFile, 'r')
            sample.options['json'] = json.loads(jsn.read())
            sample.options['isData'] = True
            jsn.close()
            for smp, trig in DatasetsAndTriggersMap.iteritems():
                if smp in sample.name:
                    sample.options['triggers'] = trig
                    sample.options['vetotriggers'] = DatasetsAndVetosMap[smp]

                    break

    else:
        selectedSamples = mcSamples
        for sample in selectedSamples:
            sample.options['isData'] = False

    return selectedSamples
Ejemplo n.º 2
0
# get the options
from PhysicsTools.NanoAODTools.postprocessing.framework.crabhelper import getCrabOption

# definition of output (additional skim may be applied in the modules)
### SKIM
cut = None

### SLIM FILE
outputSlim = os.environ[
    'CMSSW_BASE'] + "/python/PhysicsTools/NanoAODTools/postprocessing/modules/WZ_EWK/OutputSlim.txt"
inputSlim = os.environ[
    'CMSSW_BASE'] + "/python/PhysicsTools/NanoAODTools/postprocessing/modules/WZ_EWK/InputSlim.txt"
jsonFile = os.environ[
    'CMSSW_BASE'] + "/python/PhysicsTools/NanoAODTools/postprocessing/modules/WZ_EWK/Cert_314472-325175_13TeV_17SeptEarlyReReco2018ABC_PromptEraD_Collisions18_JSON.txt"

doData = getCrabOption("doData", False)

if True:
    print '[WZpostProcessor]: Submission step'
    from PhysicsTools.NanoAODTools.postprocessing.datasets.triggers_13TeV_DATA2018 import *
    from PhysicsTools.NanoAODTools.postprocessing.datasets.mc2018_v5 import samples as mcSamples
    from PhysicsTools.NanoAODTools.postprocessing.datasets.data2018_v5 import samples as dataSamples

    if doData:
        selectedSamples = dataSamples

        DatasetsAndTriggersMap = {}
        DatasetsAndVetosMap = {}
        DatasetsAndTriggersMap["DoubleMuon"] = triggers_mumu_iso + triggers_3mu
        DatasetsAndTriggersMap[
            "MuonEG"] = triggers_mue + triggers_2mu1e + triggers_2e1mu + triggers_mue_noiso