Exemplo n.º 1
0
# selectedComponents = selectedComponents[-1:]

tbd = [
    'DY2JetsToLL_M50_LO',
    'DY3JetsToLL_M50_LO',
    'DY4JetsToLL_M50_LO',
    'HiggsGGH125',
    'WZTo3LNu_amcatnlo',
]

selectedComponents = [s for s in selectedComponents if s.name in tbd]

if doSUSY:
    from CMGTools.RootTools.samples.autoAAAconfig import autoAAA
    autoAAA(selectedComponents)

preprocessor = None
if cmssw:
    sequence.append(fileCleaner)
    cfg_name = "$CMSSW_BASE/src/CMGTools/H2TauTau/prod/h2TauTauMiniAOD_ditau_data_cfg.py" if data else "$CMSSW_BASE/src/CMGTools/H2TauTau/prod/h2TauTauMiniAOD_ditau_cfg.py"
    preprocessor = CmsswPreprocessor(cfg_name, addOrigAsSecondary=False)

# the following is declared in case this cfg is used in input to the
# heppy.py script
from PhysicsTools.HeppyCore.framework.eventsfwlite import Events

config = cfg.Config(components=selectedComponents,
                    sequence=sequence,
                    services=outputService,
                    preprocessor=preprocessor,
for pd, triggers in DatasetsAndTriggers:
    for comp in byCompName(allData, [pd]):
        comp.triggers = triggers[:]
        comp.vetoTriggers = vetoTriggers[:]
        dataSamples.append(comp)
    vetoTriggers += triggers[:]

selectedComponents = mcSamples + dataSamples
if getHeppyOption('selectComponents'):
    if getHeppyOption('selectComponents')=='MC':
        selectedComponents = mcSamples
    elif getHeppyOption('selectComponents')=='DATA':
        selectedComponents = dataSamples
    else:
        selectedComponents = byCompName(selectedComponents, getHeppyOption('selectComponents').split(","))
autoAAA(selectedComponents, quiet=not(getHeppyOption("verboseAAA",False)), redirectorAAA="xrootd-cms.infn.it") # must be done before mergeExtensions
configureSplittingFromTime(mcSamples,250 if preprocessor else 10,10)
configureSplittingFromTime(dataSamples,80 if preprocessor else 10,10)
selectedComponents, _ = mergeExtensions(selectedComponents, verbose=True)

# create and set preprocessor if requested
if getHeppyOption("nanoPreProcessor"):
    from CMGTools.Production.nanoAODPreprocessor import nanoAODPreprocessor
    preproc_cfg = {2016: ("mc94X2016","data94X2016"),
                   2017: ("mc94Xv2","data94Xv2"),
                   2018: ("mc102X","data102X_ABC","data102X_D")}
    preproc_cmsswArea = "/afs/cern.ch/work/v/vtavolar/SusySOSSW_2_clean/nanoAOD/clean/CMSSW_10_2_16_UL"#/afs/cern.ch/user/v/vtavolar/work/SusySOSSW_2_clean/nanoAOD/CMSSW_10_2_15" #MODIFY ACCORDINGLY
    preproc_mc = nanoAODPreprocessor(cfg='%s/src/PhysicsTools/NanoAOD/test/%s_NANO.py'%(preproc_cmsswArea,preproc_cfg[year][0]),cmsswArea=preproc_cmsswArea,keepOutput=True)
    if year==2018:
        preproc_data_ABC = nanoAODPreprocessor(cfg='%s/src/PhysicsTools/NanoAOD/test/%s_NANO.py'%(preproc_cmsswArea,preproc_cfg[year][1]),cmsswArea=preproc_cmsswArea,keepOutput=True, injectTriggerFilter=True, injectJSON=True)
        preproc_data_D = nanoAODPreprocessor(cfg='%s/src/PhysicsTools/NanoAOD/test/%s_NANO.py'%(preproc_cmsswArea,preproc_cfg[year][2]),cmsswArea=preproc_cmsswArea,keepOutput=True, injectTriggerFilter=True, injectJSON=True)
Exemplo n.º 3
0
import PhysicsTools.HeppyCore.framework.config as cfg
from PhysicsTools.HeppyCore.framework.config import printComps
from PhysicsTools.HeppyCore.framework.heppy_loop import getHeppyOption
from PhysicsTools.HeppyCore.framework.eventsfwlite import Events

from CMGTools.H2TauTau.proto.analyzers.TauIsoAnalyzer import TauIsoAnalyzer
from CMGTools.H2TauTau.proto.analyzers.TauIsoTreeProducer import TauIsoTreeProducer
from CMGTools.H2TauTau.proto.samples.fall17.htt_common import DYJetsToLL_M50_LO, QCD_Pt_15to7000_TuneCP5_Flat2017, QCD_Pt_15to7000_TuneCP5_Flat
from CMGTools.RootTools.samples.autoAAAconfig import autoAAA

production = getHeppyOption('production', False)

selected_components = [DYJetsToLL_M50_LO]
selected_components = [QCD_Pt_15to7000_TuneCP5_Flat2017]
selected_components = [QCD_Pt_15to7000_TuneCP5_Flat]
autoAAA(selected_components)

tau_iso_ana = cfg.Analyzer(
    TauIsoAnalyzer,
    name='TauIsoAnalyzer',
)

tau_iso_tree = cfg.Analyzer(
    TauIsoTreeProducer,
    name='TauIsoTreeProducer',
    defaultFloatType='F',  #save storage space
    reject_gen_leptons=True)

sequence = cfg.Sequence([tau_iso_ana, tau_iso_tree])

if not production:
        from CMGTools.RootTools.samples.samples_13TeV_RunIIFall17MiniAOD import samples as mcSamples_
        from CMGTools.RootTools.samples.samples_13TeV_DATA2017 import dataSamples_31Mar2018 as allData
    elif year == 2016:
        from CMGTools.RootTools.samples.samples_13TeV_RunIISummer16MiniAODv3 import samples as mcSamples_
        from CMGTools.RootTools.samples.samples_13TeV_DATA2016 import dataSamples_17Jul2018 as allData
else:
    if year == 2018:
        from CMGTools.RootTools.samples.samples_13TeV_RunIIAutumn18NanoAODv4 import samples as mcSamples_
        from CMGTools.RootTools.samples.samples_13TeV_DATA2018_NanoAOD import dataSamples_1June2019 as allData
    elif year == 2017:
        from CMGTools.RootTools.samples.samples_13TeV_RunIIFall17NanoAODv4 import samples as mcSamples_
        from CMGTools.RootTools.samples.samples_13TeV_DATA2017_NanoAOD import dataSamples_1June2019 as allData
    elif year == 2016:
        from CMGTools.RootTools.samples.samples_13TeV_RunIISummer16NanoAODv4 import samples as mcSamples_
        from CMGTools.RootTools.samples.samples_13TeV_DATA2016_NanoAOD import dataSamples_1June2019 as allData
autoAAA(mcSamples_+allData, quiet=not(getHeppyOption("verboseAAA",False))) # must be done before mergeExtensions
mcSamples_, _ = mergeExtensions(mcSamples_)

# Triggers
if year == 2018:
    from CMGTools.RootTools.samples.triggers_13TeV_DATA2018 import all_triggers as triggers
elif year == 2017:
    from CMGTools.RootTools.samples.triggers_13TeV_DATA2017 import all_triggers as triggers
    triggers["FR_1mu_iso"] = [] # they probably existed but we didn't use them in 2017
elif year == 2016:
    from CMGTools.RootTools.samples.triggers_13TeV_DATA2016 import all_triggers as triggers
    triggers["FR_1mu_noiso_smpd"] = [] 


DatasetsAndTriggers = []
if analysis == "main":
Exemplo n.º 5
0
# make data
dataSamples = []
vetoTriggers = []
for pd, triggers in DatasetsAndTriggers:
    for comp in byCompName(allData, [pd]):
        comp.triggers = triggers[:]
        comp.vetoTriggers = vetoTriggers[:]
        dataSamples.append(comp)
    vetoTriggers += triggers[:]

selectedComponents = mcSamples + dataSamples
if getHeppyOption('selectComponents'):
    selectedComponents = byCompName(
        selectedComponents,
        getHeppyOption('selectComponents').split(","))
autoAAA(selectedComponents, quiet=not (getHeppyOption("verboseAAA", False)))
configureSplittingFromTime(mcSamples, 250 if preprocessor else 10, 10)
configureSplittingFromTime(dataSamples, 80 if preprocessor else 10, 10)
selectedComponents, _ = mergeExtensions(selectedComponents)

# create and set preprocessor if requested
if getHeppyOption("nanoPreProcessor"):
    from CMGTools.Production.nanoAODPreprocessor import nanoAODPreprocessor
    preproc_cfg = {
        2016: ("mc94X2016", "data94X2016"),
        2017: ("mc94Xv2", "data94Xv2"),
        2018: ("mc102X", "data102X_ABC", "data102X_D")
    }
    preproc_cmsswArea = "/afs/cern.ch/user/v/vtavolar/work/SusySOSSW_2_clean/nanoAOD/CMSSW_10_2_15"  #MODIFY ACCORDINGLY
    preproc_mc = nanoAODPreprocessor(
        cfg='%s/src/PhysicsTools/NanoAOD/test/%s_NANO.py' %