Exemplo n.º 1
0
from array import array

r.gROOT.SetBatch(True)

#############################
print(
    "\n===== Unfolding procedures: Response matrices & ROOT files production ====="
)
print("> Setting binning, paths, and other details...")
# ---------------------------------------------------------------- PRELIMINARIES
vl.SetUpWarnings()
minipath = vl.minipath
if (len(sys.argv) > 1):
    print("    - Manual minitrees' folder input!\n")
    if (sys.argv[1] == "last"):
        minipath = vl.GetLastFolder(vl.storagepath)
    else:
        minipath = vl.storagepath + sys.argv[1] + "/"

print "    - The minitrees' path is:\n", minipath
plotsoutputpath = "/nfs/fanae/user/vrbouza/www/TFM/Unfolding/"
matrixoutputpath = "./temp/"

genCut = "TWeight_normal * (Tpassgen == 1)"
recoCut = "TWeight_normal * (Tpassreco == 1)"
Cut = "TWeight * (Tpassgen == 1)"
fiduCut = "TWeight * ((Tpassreco == 1) && (Tpassgen == 0))"

markersize = 0.8

VarNames = vl.varList["Names"]["Variables"]
Exemplo n.º 2
0
    r.gROOT.SetBatch(True)
    verbose = False
    print "===== BDT's histograms procedure with systs. profiling to be obtained after fitting\n"
    if (len(sys.argv) > 1):
        nCores      = int(sys.argv[1])
        print ('> Parallelization will be done with ' + str(nCores) + ' cores')
    else:
        print '> Sequential execution mode chosen'
        nCores      = 1

    if (len(sys.argv) > 2):
        varName     = sys.argv[2]
        print "> Chosen variable:", varName, "\n"
        if (len(sys.argv) > 3):
            if sys.argv[3] == 'last':
                pathToTree    = vl.GetLastFolder(storagepath)
            else:
                pathToTree    = storagepath + sys.argv[3] + "/"
        else:
            pathToTree  = "../../../TW_temp/"
        print "> Minitrees will be read from:", pathToTree, "\n"
    else:
        print "> Default choice of variable and minitrees\n"
        varName     = 'LeadingLepEta'
        pathToTree  = "../../../TW_temp/"
    
    r.gROOT.LoadMacro('../../Histo.C+')
    r.gROOT.LoadMacro('../../Looper.C+')
    r.gROOT.LoadMacro('../../Plot.C+')
    r.gROOT.LoadMacro('../../PlotToPy.C+')
    r.gROOT.LoadMacro('../../Datacard.C+')
Exemplo n.º 3
0
import ROOT
import varList
import sys, os
print "===== BDT's histograms procedure\n"

storagepath = "/nfs/fanae/user/vrbouza/Storage/TW/MiniTrees/"
pathToTree    = ""

if (len(sys.argv) > 1):
    varName     = sys.argv[1]
    print "> Chosen variable:", varName, "\n"
    if (len(sys.argv) > 2):
      pathToTree    = storagepath + sys.argv[2] + "/"
    else:
      pathToTree    = varList.GetLastFolder(storagepath)
    print "> Minitrees will be read from:", pathToTree, "\n"
else:
    print "> Default choice of variable and minitrees\n"
    varName     = 'LeadingJetPt'
    minipath    = "../../../TW_temp/"

NameOfTree = "Mini1j1t";

ROOT.gROOT.SetBatch(True)
ROOT.gROOT.LoadMacro('../../Histo.C+')
ROOT.gROOT.LoadMacro('../../Looper.C+')
ROOT.gROOT.LoadMacro('../../PlotToPy.C+')
ROOT.gROOT.ProcessLine('.L temp/' + varName + '.C+')
print '> Succesfully loaded binning information from temp/' + varName + '.C', "\n"