Пример #1
0
sumweight_path = "/cms/data/store/user/t2/users/klo/HeppyTree/heppy_80X_RA5_Legacy/July18_v1_SMS-T1tbs/"
sumweight_file = "treeProducerSusyRA5.root"
sumWeight = "SumGenWeights"
inUFTier2 = True

# _______________________________________________________________________________________________________________ ||
# T1tbs 1000
comp_1000 = Component("SMS-T1tbs",
                      treeDir + "SMS-T1tbs_mGluino1000/" + fileName,
                      treeName,
                      inUFTier2=inUFTier2)
cmpList_1000 = ComponentList([comp_1000])
T1tbs_1000 = Dataset(
    "SMS-T1tbs_mGluino1000",
    cmpList_1000,
    isSignal=True,
    isMC=True,
    xsFactor=0.09,
    plotLabel="T1tbs, m_{Gluino} = 1000",
)
T1tbs_1000.setSumWeight(sumweight_path + "mGluino1000/" + sumweight_file,
                        sumWeight,
                        inUFTier2=inUFTier2)

# _______________________________________________________________________________________________________________ ||
# T1tbs 1500
comp_1500 = Component("SMS-T1tbs",
                      treeDir + "SMS-T1tbs_mGluino1500/" + fileName,
                      treeName,
                      inUFTier2=inUFTier2)
cmpList_1500 = ComponentList([comp_1500])
T1tbs_1500 = Dataset(
Пример #2
0
import os
from Core.ComponentList import *
from Core.Dataset import Dataset

fileName = "SkimTree.root"
#common_path     = "/raid/raid7/lucien/SUSY/RPV/SkimTree/ZMuMu/2018-06-19/Data_ZMuMuSelection_v1/"
common_path = "/raid/raid7/kshi/SUSY/RPV/SkimTree/data/TTbar/"
inUFTier2 = False

sampleNames = [
    n for n in os.listdir(common_path)
    if os.path.isdir(os.path.join(common_path, n)) and "Muon" in n
]
allDataSamples = []
for sampleName in sampleNames:
    tmpList = ComponentList([
        Component(sampleName,
                  "/".join([common_path, sampleName, fileName]),
                  "Events",
                  inUFTier2,
                  maxEvents=-1)
    ], )
    tmpDataset = Dataset(
        sampleName,
        tmpList,
        isMC=False,
        json=os.environ['BASE_PATH'] +
        "/DataMC/JSON/13TeV/Run2016/Cert_271036-284044_13TeV_23Sep2016ReReco_Collisions16_JSON.txt",
    )
    allDataSamples.append(tmpDataset)
Пример #3
0
sumWeightFromT2 = True
saveSumWeightTxt = False

# ____________________________________________________________________________________________________________________________________________ ||
# ttZ
ttZ_cmpList = ComponentList([
    Component("ttZ",
              bkgSkimTreeDir +
              "ttZJets_TuneCP5_13TeV_madgraphMLM_pythia8.root",
              "passedEvents",
              inUFTier2=inUFTier2),
])

ttZ = Dataset(
    "ttZ",
    ttZ_cmpList,
    isMC=True,
    xs=0.6529,
)
handleSumWeight(
    ttZ,
    system,
    bkgTreeDir + "ttZJets_TuneCP5_13TeV_madgraphMLM_pythia8.root",
    sumWeightHist,
    True,
    saveSumWeightTxt,
    bkgSkimTreeDir + "ttZJets_TuneCP5_13TeV_madgraphMLM_pythia8.txt",
    bkgSkimTreeDir + "ttZJets_TuneCP5_13TeV_madgraphMLM_pythia8.txt",
)

# ____________________________________________________________________________________________________________________________________________ ||
# WWZ
bkgTreeDir = "/raid/raid7/kshi/Zprime/20190729/SkimTree_Run2016_mem_controlregion_MC/"
inUFTier2 = False
saveSumWeightTxt = False
sumWeightHist = "Ana/sumWeights"

# ____________________________________________________________________________________________________________________________________________ ||
DYJetsToLL_M50_memCR_cmpList = ComponentList([
    Component("DYJetsToLL_M50_memCR",
              bkgTreeDir +
              "DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8.root",
              "passedEvents",
              inUFTier2=inUFTier2),
])
DYJetsToLL_M50_memCR = Dataset(
    "DYJetsToLL_M50_memCR",
    DYJetsToLL_M50_memCR_cmpList,
    isMC=True,
    xs=6104,
)
handleSumWeight(
    DYJetsToLL_M50_memCR,
    system,
    bkgTreeDirT2_Feb21 +
    "DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8.root",
    #bkgTreeDir+"DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8.root",
    sumWeightHist,
    True,
    saveSumWeightTxt,
    bkgTreeDir + "DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8.txt",
)

# ____________________________________________________________________________________________________________________________________________ ||
Пример #5
0
from Core.ComponentList import *
from Core.Dataset import Dataset
from Utils.System import system
from Utils.SumWeight import handleSumWeight

# ____________________________________________________________________________________________________________________________________________ ||
Data_Run2018_cmpList = ComponentList([
    Component(
        "Data_Run2016",
        system.getStoragePath() +
        "/lucien/Higgs/DarkZ-NTuple/20190402/SkimTree_DarkPhoton_WrongFC_Run2018Data_m4l70/Data_Run2018_noDuplicates_FRWeightFromVukasinWZRemoved.root",
        "passedEvents",
        inUFTier2=False),
])
Data_Run2018 = Dataset(
    "WrongFC_Run2018",
    Data_Run2018_cmpList,
    isMC=False,
)
Пример #6
0
from Core.ComponentList import *
from Core.Dataset import Dataset

inUFTier2       = False

# ____________________________________________________________________________________________________________________________________________ ||
PedjaData_Run2016_cmpList = ComponentList(
        [
            Component("PedjaData_Run2016","/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180924/PedjaInput_rootfiles_MC80X_2lskim_M17_Feb21/Data_ZX_Run2017-03Feb2017_slimmedZX_FRWeight.root","selectedEvents",inUFTier2=inUFTier2),
        ]
        )
PedjaData_Run2016 = Dataset(
        "PedjaData_Run2016",
        PedjaData_Run2016_cmpList,
        isMC = False,
        )
Пример #7
0
#dir_path        = "/cms/data/store/user/t2/users/klo/HeppyTree/heppy_80X_RA5_Legacy/Sept18_v1/"
dir_path        = "/raid/raid7/lucien/SUSY/RA5/HeppyTree/Sept18_v1/"
inUFTier2       = False
treeName        = "tree"

componentDict = {}
if inUFTier2:
    fileNames = [ n for n in listdir_uberftp(dir_path) if n.endswith(".root") ]
else:
    fileNames = [ n for n in os.listdir(dir_path) if n.endswith(".root") ]

for fileName in fileNames:
    if "SMS" in fileName: continue # New signal model ntuples in Oct18_v1
    if "ext" not in fileName:
        sampleName = fileName.replace(".root","")
    else:
        sampleName = fileName.split("_ext")[0]
    tmpDataset = Dataset(
            sampleName,
            ComponentList(
                [Component(sampleName,os.path.join(dir_path,fileName),treeName,inUFTier2,),]
                ),
            isMC = True,
            isSignal = "SMS" in fileName,
            )
    tmpDataset.setSumWeight(os.path.join(dir_path,fileName),"SumGenWeights",inUFTier2)
    if sampleName not in componentDict:
        componentDict[sampleName] = tmpDataset
    else:
        componentDict[sampleName].add(tmpDataset)
from Core.ComponentList import *
from Core.Dataset import Dataset
from Utils.System import system
from Utils.SumWeight import handleSumWeight
import os

# ____________________________________________________________________________________________________________________________________________ ||
#
ZJetsToLL_LO_MLM = Dataset(
    "ZJetsToLL_LO_MLM",
    ComponentList([
        Component(
            "ZJetsToLL_LO_MLM",
            "/cmsuf/data/store/user/t2/users/klo/Delphes/ZJetsToLL_LO_MLM/2020-07-09/MuonTreeProducer/2020-07-09_MuonTreeProducer.root",
            "LiteTree",
            inUFTier2=False),
    ]),
    isMC=True,
    xs=1,
)
ZJetsToLL_LO_MLM.sumw = 4899797.
Пример #9
0
from Core.ComponentList import *
from Core.Dataset import Dataset
from Utils.System import system

dataTreeDir      = system.getStoragePath()+"/lucien/Higgs/DarkZ-NTuple/20190402/SkimTree_DarkPhoton_ZX_Run2018Data_m4l70/"
inUFTier2       = False

# ____________________________________________________________________________________________________________________________________________ ||
Data_Run2018_cmpList = ComponentList(
        [
            Component("Data_Run2018",dataTreeDir+"Data_Run2018_noDuplicates_FRWeightFromVukasinWZRemoved.root","passedEvents",inUFTier2=inUFTier2),
        ]
        )
Data_Run2018 = Dataset(
        "Data_Run2018",
        Data_Run2018_cmpList,
        isMC = False,
        )
Пример #10
0
#filePath        = "/raid/raid7/lucien/SUSY/RA5/SkimTree/SyncMC2016v2/TTW_RA5_sync/treeProducerSusyRA5/tree.root"
#filePath        = "/raid/raid7/lucien/SUSY/RA5/SkimTree/SyncMC2016v3/TTW_RA5_sync/treeProducerSusyRA5/tree.root"
#filePath        = "/raid/raid7/lucien/SUSY/RA5/SkimTree/SyncMC2016v4/TTW_RA5_sync/treeProducerSusyRA5/tree.root"
filePath = "/raid/raid7/lucien/SUSY/RA5/SkimTree/SyncMC2016v5/TTW_RA5_sync/treeProducerSusyRA5/tree.root"
inUFTier2 = False

cmpList = ComponentList([Component(
    sampleName,
    filePath,
    "tree",
    inUFTier2,
)])

SyncMC = Dataset(
    "SyncMC",
    cmpList,
    isMC=True,
    xs=1,
)
SyncMC.setSumWeight(filePath, "SumGenWeights", inUFTier2)

# ________________________________________________________________________________________________ ||
# Skim Tree
skimCmpList = ComponentList([
    Component(
        "SkimSyncMC",
        "/cms/data/store/user/t2/users/klo/HeppyTree/heppy_80X_RA5_Legacy/SyncMC2016/TTW_RA5_sync_LeptonJetRecleaner/SyncMC/SkimTree.root",
        #"/raid/raid7/lucien/SUSY/RA5/HeppyTree/SyncMC2016/TTW_RA5_sync_LeptonJetRecleaner/SyncMC/SkimTree.root",
        "tree",
        True,
    )
])
inUFTier2 = False
saveSumWeightTxt = False
sumWeightHist = "Ana/sumWeights"

# ____________________________________________________________________________________________________________________________________________ ||
# Z+X
predCR_cmpList = ComponentList([
    Component(
        "PredCR", predCRTreeDir +
        "/Data_Run2018_noDuplicates_FRWeightFromVukasinWZRemoved.root",
        "passedEvents", False),
])
predCR = Dataset(
    "PredCR",
    predCR_cmpList,
    isMC=True,
    isSignal=True,
    skipWeight=True,
)

## ____________________________________________________________________________________________________________________________________________ ||
#DYJetsToLL_M50_cmpList = ComponentList(
#        [
#            Component("DYJetsToLL_M50",bkgTreeDir+"DYJetsToLL_M50.root","passedEvents",inUFTier2=inUFTier2),
#        ]
#        )
#DYJetsToLL_M50 = Dataset(
#        "DYJetsToLL_M50",
#        DYJetsToLL_M50_cmpList,
#        isMC = True,
#        xs = 6104,
Пример #12
0
        ]

#componentList = []
sampleDict = {}
sampleFileNames = listdir_uberftp(common_path,selection=lambda x: True)
for sampleName in sampleFileNames:
    if "TT_pow" in sampleName: continue
    if any([dataSample in sampleName for dataSample in dataSamples]): continue
    parentName = sampleName
    for postfix in postfixs:
        if postfix in sampleName: parentName = parentName.replace("_"+postfix,"")
    filePath = os.path.join(common_path,sampleName,fileName)
    cmpList = ComponentList(
            [Component(parentName,filePath,treeName,inUFTier2,)]
            )
    tmpDataset = Dataset(parentName,cmpList,)
    tmpDataset.setSumWeight(filePath,sumWeight,inUFTier2)
    #componentList.append(tmpDataset)
    if parentName not in sampleDict:
        sampleDict[parentName] = tmpDataset
    else:
        sampleDict[parentName].add(tmpDataset)

# Exceptionally handling TT Powheg sample
TT_pow_comps = makeComponents("TT_pow","/cms/data/store/user/klo/HeppyTree/heppy_80X_RA5_Legacy/July18_v1/TT_pow/180712_162135/0000/",treeName,inUFTier2)
TT_pow = Dataset("TT_pow",ComponentList([]),xs=1.)
TT_pow.sumw = 0.
for comp in TT_pow_comps:
    temp_comp_list = ComponentList([comp])
    tmpDataset = Dataset("TT_pow",temp_comp_list,xs=1.)
    tmpDataset.setSumWeight(comp.path,sumWeight,inUFTier2)
Пример #13
0
bkgTreeDir = "/raid/raid7/lucien/Higgs/HZZ4l/NTuple/ZPlusX/WrongFC/20181209/SkimTree_WrongFC_Run2016Data_v1/"
inUFTier2 = False

ZPlusXFile = "/raid/raid7/lucien/Higgs/HZZ4l/NTuple/ZPlusX/WrongFC/20181209/SkimTree_WrongFC_Run2016Data_v1/Data_Run2016-03Feb2017_4l_noDuplicates_FRWeight.root"
qqZZSumWFile = "/cms/data/store/user/t2/users/archived/dsperka/Run2/HZZ4l/SubmitArea_13TeV/rootfiles_MC80X_4lskim_M17_Feb21/"
sumWeightHist = "Ana/sumWeights"

# ____________________________________________________________________________________________________________________________________________ ||
predCR_cmpList = ComponentList([
    Component("PredCR", ZPlusXFile, "passedEvents", False),
])
predCR = Dataset(
    "PredCR",
    predCR_cmpList,
    isMC=True,
    isSignal=True,
    skipWeight=True,
)

# ____________________________________________________________________________________________________________________________________________ ||
WFC_Reducible_cmpList = ComponentList([
    Component("WrongFC_Reducible",
              ZPlusXFile,
              "passedEvents",
              inUFTier2=inUFTier2),
])
WFC_Reducible = Dataset(
    "WrongFC_Reducible",
    WFC_Reducible_cmpList,
    isMC=True,
Пример #14
0
else:
    fileNames = [n for n in os.listdir(dir_path) if n.endswith(".root")]

for fileName in fileNames:
    if "SMS" not in fileName: continue
    if "ext" not in fileName:
        sampleName = fileName.replace(".root", "")
    else:
        sampleName = fileName.split("_ext")[0]
    tmpDataset = Dataset(
        sampleName,
        ComponentList([
            Component(
                sampleName,
                os.path.join(dir_path, fileName),
                treeName,
                inUFTier2,
            ),
        ]),
        isMC=True,
        isSignal=True,
        xs=xs_dict[sampleName].value if sampleName in xs_dict else None,
    )
    tmpDataset.setSumWeight(os.path.join(dir_path, fileName), "SumGenWeights",
                            inUFTier2)
    if sampleName not in componentDict:
        componentDict[sampleName] = tmpDataset
    else:
        componentDict[sampleName].add(tmpDataset)
sigComponentDict = componentDict
from Core.ComponentList import *
from Core.Dataset import Dataset
from Utils.System import system
from Utils.SumWeight import handleSumWeight
import os

dataSkimTreeDir = "/cmsuf/data/store/user/t2/users/klo/Zprime/EXO-18-008/80X_Data_DarkZNTuple/"
inUFTier2 = True

# ____________________________________________________________________________________________________________________________________________ ||
# Data2016
data2016_cmpList = ComponentList([
    Component("Data2016",
              dataSkimTreeDir + "/Data_Run2016-03Feb2017_4l.root",
              "passedEvents",
              inUFTier2=inUFTier2),
])

data2016 = Dataset(
    "Data2016",
    data2016_cmpList,
    isMC=False,
)

# ____________________________________________________________________________________________________________________________________________ ||
dataSamples = [
    data2016,
]
Пример #16
0
from Core.ComponentList import *
from Core.Dataset import Dataset

cmp = Component(
    "TGJets",
    "/cms/data/store/user/klo/RA5/NTuples/2016/NanoAOD/MC/TGJets_TuneCUETP8M1_13TeV_amcatnlo_madspin_pythia8/InclusiveSelection_v1/180509_144401/0000/",
    "Events",
    keyword="tree",
    inUFTier2=True,
)

cmpList = ComponentList([
    cmp,
], )

TGJets = Dataset(
    "TGJets",
    cmpList,
    xs=2.967,  #pb
)
TGJets.setSumWeight(
    "/raid/raid7/lucien/SUSY/RA5/SumGenWeight/NanoAOD_InclusiveSelection_v1/Run2016/TGJets/EventWeight.root"
)
kappa                   = 0.0001
saveSumWeightTxt        = False
fileNameTemplate        = "HToZdZdTo4L_M125_MZd%s_eps2e-2_kap1e-4_TuneCP5_13TeV_madgraph_pythia8.root"
datasetName             = "HToZdZd_M%s"
skimTreePath            = "passedEvents"
mass_points             = [4,5,6,7,8,9,10,15,20,25,30,35,40,45,50,55,60,]

# ____________________________________________________________________________________________________________________________________________ ||
sigSampleDict = {}
for m in mass_points:
    inputFilePath = os.path.join(sigSkimTreeDir,fileNameTemplate%m) if m not in [4,5,] else os.path.join(sigSkimTreeDir2,fileNameTemplate%m)
    tmpDataset = Dataset(
            datasetName%m,
            ComponentList(
                [ Component(datasetName%m,inputFilePath,skimTreePath,inUFTier2=inUFTier2) ]
                ),
            isMC = True,
            isSignal = True,
            xs = Higgs_prod_xs*kappa**2*HZdZd_xs_dict[m],
            )
    handleSumWeight(
            tmpDataset,
            system,
            os.path.join(sigTreeDir,fileNameTemplate%m),
            sumWeightHist,
            True,
            saveSumWeightTxt,
            inputFilePath.replace(".root",".txt"),
            )
    sigSampleDict[m] = tmpDataset
sigSamples = sigSampleDict.values()
Пример #18
0
inUFTier2 = True
sumWeightHist = "Ana/sumWeights"
saveSumWeightTxt = False

# ____________________________________________________________________________________________________________________________________________ ||
# qqZZ
qqZZ_cmpList = ComponentList([
    Component("qqZZTo4L",
              bkgSkimTreeDir + "ZZTo4L_TuneCP5_13TeV_powheg_pythia8.root",
              "passedEvents",
              inUFTier2=inUFTier2),
])

qqZZTo4L = Dataset(
    "qqZZTo4L",
    qqZZ_cmpList,
    isMC=True,
    xs=1.256,
)
handleSumWeight(
    qqZZTo4L,
    system,
    bkgTreeDir + "ZZTo4L_TuneCP5_13TeV_powheg_pythia8.root",
    sumWeightHist,
    True,
    saveSumWeightTxt,
    bkgSkimTreeDir + "ZZTo4L_TuneCP5_13TeV_powheg_pythia8.txt",
    bkgSkimTreeDir + "ZZTo4L_TuneCP5_13TeV_powheg_pythia8.txt",
)

# ____________________________________________________________________________________________________________________________________________ ||
# ggZZTo4mu
#dataTreeDir     = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180806/SkimTree_Data80X_ZXCRSelection/"
#dataTreeDir     = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180806/SkimTree_Data80X_HIG-16-041-ZXCRSelection_v2/"
#dataTreeDir     = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180905/SkimTree_DarkPhoton_ZX_Run2016Data_m4l70/"
#dataTreeDir      = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180924/SkimTree_DarkPhoton_ZX_Run2016Data_m4l70/"
dataTreeDir     = "/raid/raid7/kshi/Zprime/20190729/SkimTree_Run2016_mem_controlregion_Data/"
inUFTier2       = False

# ____________________________________________________________________________________________________________________________________________ ||
Data_memCR_Run2016_cmpList = ComponentList(
        [
            #Component("Data_Run2016_DoubleEG",dataTreeDir+"DoubleEG.root","passedEvents",inUFTier2=inUFTier2),
            #Component("Data_Run2016_DoubleMuon",dataTreeDir+"DoubleMuon.root","passedEvents",inUFTier2=inUFTier2),
            #Component("Data_Run2016_MuonEG",dataTreeDir+"MuonEG.root","passedEvents",inUFTier2=inUFTier2),
            #Component("Data_Run2016_SingleElectron",dataTreeDir+"SingleElectron.root","passedEvents",inUFTier2=inUFTier2),
            #Component("Data_Run2016_SingleMuon",dataTreeDir+"SingleMuon.root","passedEvents",inUFTier2=inUFTier2),
            Component("Data_memCR_Run2016_totaldata",dataTreeDir+"total_Data.root","passedEvents",inUFTier2=inUFTier2),
        ]
        )
Data_memCR_Run2016 = Dataset(
        "Data_memCR_Run2016",
        Data_memCR_Run2016_cmpList,
        isMC = True,
        skipWeight = True,
        )
'''
bkgSamples = [
            Data_memCR_Run2016,
        ]
'''
Пример #20
0
from Skimmer.ZMuMuSkimmer import SkimTreeZMuMuSkimmer
from Analyzer.GasGainAnalyzer import SkimTreeGasGainPlotter, SkimTreePositionPlotter
from Analyzer.RunAnalyzer import SkimTreeRunPlotter
from EndModule.GasGainEndModule import SkimTreeGasGainEndModule, SkimTreePositionEndModule

from Config.Chamber import *

import os

inputDir = "/cmsuf/data/store/user/t2/users/klo/CSC/Skim/210304_Data_2017A_hadd/"
componentList = []
for f in os.listdir(inputDir):
    fname = f.replace(".root", "")
    tmp = Dataset(
        fname,
        ComponentList(
            [Component(fname, os.path.join(inputDir, f), "tree", False)]),
    )
    componentList.append(tmp)

rootTree = "tree"
nCores = 10
disableProgressBar = False
nEvents = -1
outputDir = "output/GasGain_2021-03-04/"
justEndSequence = False

sequence = Sequence()
sequence.add(SkimTreeZMuMuSkimmer("ZMuMuSkimmer"))
gasGainPlotter = SkimTreeGasGainPlotter("GasGainPlotter")
skimTreeRunPlotter = SkimTreeRunPlotter("RunPlotter")
Пример #21
0
from Core.ComponentList import *
from Core.Dataset import Dataset
from Utils.System import system
from Utils.SumWeight import handleSumWeight

predCRTreeDir = system.getStoragePath(
) + "/lucien/Higgs/DarkZ-NTuple/20190218/SkimTree_HToZdZd_ZX_Run2016Data_m4l70_noZCandRatioCut/"
inUFTier2 = False

# ____________________________________________________________________________________________________________________________________________ ||
# Z+X
predCR_cmpList = ComponentList([
    #Component("PredCR",predCRTreeDir+"Data_Run2016-2l_noDuplicates_FRWeight.root","passedEvents",False),
    Component(
        "PredCR", predCRTreeDir +
        "Data_Run2016-2l_noDuplicates_FRWeightFromVukasin.root",
        "passedEvents", False),
])
predCR = Dataset(
    "PredCR",
    predCR_cmpList,
    isMC=True,
    isSignal=True,
    skipWeight=True,
)
Пример #22
0
from Utils.SumWeight import handleSumWeight

#dataTreeDir     = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180806/SkimTree_Data80X_ZXCRSelection/"
#dataTreeDir     = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180806/SkimTree_Data80X_HIG-16-041-ZXCRSelection_v2/"
#dataTreeDir     = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180905/SkimTree_DarkPhoton_ZX_Run2016Data_m4l70/"
#dataTreeDir      = "/raid/raid7/lucien/Higgs/DarkZ-NTuple/20180924/SkimTree_DarkPhoton_ZX_Run2016Data_m4l70/"
dataTreeDir = "/raid/raid7/kshi/Zprime/20190729/SkimTree_Run2016_mem_controlregion_Data/"
inUFTier2 = False

# ____________________________________________________________________________________________________________________________________________ ||
Data_memCR_sr_Run2016_cmpList = ComponentList([
    #Component("Data_sr_Run2016_DoubleEG",dataTreeDir+"DoubleEG.root","passedEvents",inUFTier2=inUFTier2),
    #Component("Data_sr_Run2016_DoubleMuon",dataTreeDir+"DoubleMuon.root","passedEvents",inUFTier2=inUFTier2),
    #Component("Data_sr_Run2016_MuonEG",dataTreeDir+"MuonEG.root","passedEvents",inUFTier2=inUFTier2),
    #Component("Data_sr_Run2016_SingleElectron",dataTreeDir+"SingleElectron.root","passedEvents",inUFTier2=inUFTier2),
    #Component("Data_sr_Run2016_SingleMuon",dataTreeDir+"SingleMuon.root","passedEvents",inUFTier2=inUFTier2),
    Component("Data_memCR_sr_Run2016_totaldata",
              dataTreeDir + "total_Data.root",
              "passedEvents",
              inUFTier2=inUFTier2)
])
Data_memCR_sr_Run2016 = Dataset(
    "Data_memCR_sr_Run2016",
    Data_memCR_sr_Run2016_cmpList,
    isMC=False,
)

dataSamples = [
    Data_memCR_sr_Run2016,
]
from Core.ComponentList import *
from Core.Dataset import Dataset
from Utils.System import system
from Utils.SumWeight import handleSumWeight
import os

# ____________________________________________________________________________________________________________________________________________ ||
#
HToZaTo2l2g_M1 = Dataset(
    "HToZaTo2l2g_M1",
    ComponentList([
        #Component("HToZaTo2l2g_M1","/Users/lucien/CMS/DelphesAnalysis/HToZaTo2l2g/Data/2020-06-02_MuonTreeProducer_combined.root","LiteTree",inUFTier2=False),
        Component(
            "HToZaTo2l2g_M1",
            "/cmsuf/data/store/user/t2/users/klo/Delphes/ALP_HToZaTo2l2g_M1/2020-06-02/MuonTreeProducer/2020-06-02_MuonTreeProducer_combined.root",
            "LiteTree",
            inUFTier2=False),
    ]),
    isMC=True,
    xs=1,
)
HToZaTo2l2g_M1.sumw = 4995000.
Пример #24
0
from Core.ComponentList import *
from Core.Dataset import Dataset
from Core.Utils.MakeComponent import makeComponents

sampleName = "TTHnobb_pow"
fileName = "treeProducerSusyRA5.root"
TreeDir = "/cms/data/store/user/t2/users/klo/HeppyTree/heppy_80X_RA5_Legacy/July18_v2_LeptonJetRecleaner/"
sumweight_path = "/cms/data/store/user/t2/users/klo/HeppyTree/heppy_80X_RA5_Legacy/July18_v1/"
inUFTier2 = True
filePath = os.path.join(sumweight_path, sampleName, fileName)

#cmp = makeComponents(sampleName, TreeDir, "Events", inUFTier2)

cmpList = ComponentList([
    Component("TTHnobb_pow",
              TreeDir + sampleName + "/" + "TTHnobb_pow_%s_SkimTree.root" % i,
              "tree", inUFTier2) for i in range(0, 1)
])

TTHnobb_pow = Dataset(
    "TTHnobb_pow",
    cmpList,
    isMC=True,
    xs=1,
)
TTHnobb_pow.setSumWeight(filePath, "SumGenWeights", inUFTier2)

Samples = [TTHnobb_pow]
Пример #25
0
    15,
    20,
    25,
    30,
    35,
]

# ____________________________________________________________________________________________________________________________________________ ||
sigSampleDict = {}
for m in mass_points:
    tmpDataset = Dataset(
        datasetName % m,
        ComponentList([
            Component(datasetName % m,
                      os.path.join(sigSkimTreeDir, fileNameTemplate % m),
                      skimTreePath,
                      inUFTier2=inUFTier2)
        ]),
        isMC=True,
        isSignal=True,
        xs=Higgs_prod_xs * epsilon**2 * HZZd_xs_dict[m],
    )
    handleSumWeight(
        tmpDataset,
        system,
        os.path.join(sigTreeDir, fileNameTemplate % m),
        sumWeightHist,
        True,
        saveSumWeightTxt,
        os.path.join(sigSkimTreeDir,
                     (fileNameTemplate % m).replace(".root", ".txt")),
        os.path.join(sigSkimTreeDir,
Пример #26
0
from Core.Utils.UFTier2Utils import *
import os

common_path = "/cms/data/store/user/t2/users/klo/HeppyTree/heppy_80X_RA5_Legacy/Data2016_July18_v1/"
fileName    = "treeProducerSusyRA5.root"
inUFTier2   = True
treeName    = "tree"
pdNames     = [
                "MuonEG",
                "DoubleMuon",
                "DoubleEG",
              ]
selection   = lambda x: "Run2016B" not in x

#componentList = []
sampleDict = {}
sampleFileNames = listdir_uberftp(common_path,selection=lambda x: True)
for pdName in pdNames:
    sampleNameList = [k for k in sampleFileNames if pdName in k and selection(k)]
    cmp_list = []
    for sampleName in sampleNameList:
        cmp_list.append(Component(sampleName,os.path.join(common_path,sampleName,fileName),treeName,inUFTier2,))
    cmpList = ComponentList(cmp_list)
    tmpDataset = Dataset(pdName,cmpList,isMC=False)
    if pdName not in sampleDict:
        sampleDict[pdName] = tmpDataset
    else:
        sampleDict[pdName].add(tmpDataset)

componentList = sampleDict.values()
from Core.ComponentList import *
from Core.Dataset import Dataset
from Utils.System import system

dataTreeDir = system.getStoragePath(
) + "/lucien/Higgs/DarkZ-NTuple/20181116/SkimTree_DarkPhoton_ZX_Run2017Data_m4l70/"
inUFTier2 = False

# ____________________________________________________________________________________________________________________________________________ ||
Data_Run2017_cmpList = ComponentList([
    Component("Data_Run2017",
              dataTreeDir +
              "Data_Run2017-17Nov2017_noDuplicates_FRWeightv2.root",
              "passedEvents",
              inUFTier2=inUFTier2),
])
Data_Run2017 = Dataset(
    "Data_Run2017",
    Data_Run2017_cmpList,
    isMC=False,
)
inUFTier2           = False
sumWeightHist       = "Ana/sumWeights"
sumWeightFromT2     = True

# ____________________________________________________________________________________________________________________________________________ ||
# Z+X
ZPlusX_cmpList = ComponentList(
        [
            Component("ZPlusX",
                zxSkimTreeDir+"Data_Run2017-17Nov2017_noDuplicates_FRWeight.root",
                "passedEvents",False)
        ]
        )
ZPlusX = Dataset(
        "ZPlusX",
        ZPlusX_cmpList,
        isMC                = True,
        skipWeight          = True,
        )

# ____________________________________________________________________________________________________________________________________________ ||
# Data2017
data2017_cmpList = ComponentList(
        [ 
            Component("Data2017",dataTreeDir+"/Data_Run2017-17Nov2017_4l_noDuplicates.root","passedEvents",inUFTier2=inUFTier2),
        ]
        )

data2017 = Dataset(
        "Data2017",
        data2017_cmpList,
        isMC                = False,
inUFTier2 = False
sumWeightHist = "Ana/sumWeights"
sumWeightFromT2 = False
saveSumWeightTxt = False

# ____________________________________________________________________________________________________________________________________________ ||
# Z+X
ZPlusX_cmpList = ComponentList([
    Component(
        "ZPlusX", zxSkimTreeDir +
        "Data_Run2018_noDuplicates_FRWeightFromVukasinWZRemoved.root",
        "passedEvents", False)
])
ZPlusX = Dataset(
    "ZPlusX",
    ZPlusX_cmpList,
    isMC=True,
    skipWeight=True,
)

# ____________________________________________________________________________________________________________________________________________ ||
# Data2017
data2018_cmpList = ComponentList([
    Component("Data2018",
              dataTreeDir + "Data_Run2018_UFHZZNTuple_noDuplicates.root",
              "passedEvents",
              inUFTier2=inUFTier2),
])

data2018 = Dataset(
    "Data2018",
    data2018_cmpList,
Пример #30
0
inUFTier2 = True
filePath1 = os.path.join(sumweight_path, sampleName, fileName)
filePath2 = os.path.join(sumweight_path, sumweightName, fileName)

#cmp = makeComponents(sampleName, TreeDir, "Events", inUFTier2)

cmpList = ComponentList([
    Component(
        "WJetsToLNu_LO",
        TreeDir + sampleName + "/" + "WJetsToLNu_LO_%s_SkimTree.root" % i,
        "tree", inUFTier2) for i in range(0, 2)
])

WJetsToLNu_LO = Dataset(
    "WJetsToLNu_LO",
    cmpList,
    isMC=True,
    xs=1,
)

WJetsToLNu_LO_ext = Dataset(
    "WJetsToLNu_LO_ext",
    ComponentList([]),
    isMC=True,
    xs=1,
)

WJetsToLNu_LO.setSumWeight(filePath1, "SumGenWeights", inUFTier2)
WJetsToLNu_LO_ext.setSumWeight(filePath2, "SumGenWeights", inUFTier2)

WJetsToLNu_LO.add(WJetsToLNu_LO_ext)