Exemplo n.º 1
0

# Initialize lists to store data
voltages, drifttimes, drifttimes_err, starttimes, starttimes_err = [], [], [], [], []


# Get a list of all available tree names
def GetKeyNames(self, dir=""):
    self.cd(dir)
    return [key.GetName() for key in gDirectory.GetListOfKeys()]


TFile.GetKeyNames = GetKeyNames

# Calculate the gasamp value for each tree
key_list = f.GetKeyNames("")
for key in key_list:
    numbers = array(re.findall('\d+', key), dtype=int)
    if len(numbers) == 1:
        voltages.append(numbers[0])
        d, de, s, se = get_drifttime(key)
        drifttimes.append(d)
        drifttimes_err.append(de)
        starttimes.append(s)
        starttimes_err.append(se)

# Convert to numpy arrays
voltages = array(voltages, dtype=float)
drifttimes = array(drifttimes, dtype=float)

v_drift = dist / drifttimes
Exemplo n.º 2
0
runs[296173] = {
    "color": ROOT.kGreen+1,
    "marker": 24,
    "intL": "43.1 /pb",
    "initialLumi": "2.81e33 cm^{-2}/s",
    "date": "06/06/17",
    "comments": "",
    }

f = TFile(os.path.join(histdir, histfile))
def GetKeyNames( self, dir = "" ):
        self.cd(dir)
        return [key.GetName() for key in ROOT.gDirectory.GetListOfKeys()]
TFile.GetKeyNames = GetKeyNames

keyList = f.GetKeyNames('')
##print "\nKeys in file:", keyList
#for k in keyList:
#    if ('chargeoverpath' in k) and ('vs_bx' not in k):
#        print f.Get(k).ClassName(), k

plots = collections.OrderedDict()
plots['meanChargeoverpath_vs_bx_zoomed'] = {
        'histname': 'h_chargeoverpath_vs_bx',
        'class': 'TH2',
        'y-max': 600,
        'y-min': 350,
        'x-min': 1050,
        'x-max': 1300,
        'x-title': 'bx number',
        'y-title': 'charge / cm',
Exemplo n.º 3
0
import sys
from ROOT import gROOT
from ROOT import TFile
from ROOT import TKey


def GetKeyNames(self):
    return [key.GetName() for key in MyFile.GetListOfKeys()]


TFile.GetKeyNames = GetKeyNames

MyFile = TFile(
    "/home/cakir/NtuplerAnalyzer/SusySignals/ThirdRuns/NoPU/diboson/DeepSingle+DelphMET_NoPU_DiBoson_his.root"
)
keyList = MyFile.GetKeyNames()
print "\nKeys in file:", keyList

# scenarios and samples
scenarios = ['NoPU']
conditions = ['TreeS', 'TreeB']
gROOT.ProcessLine(".L /home/cakir/Desktop/PlottingTool/denemeStack.C")
for scene in scenarios:
    for samp in keyList:
        print "Key :", samp
        print "Scene:", scene
        if not samp == 'TreeS' or samp == 'TreeB':
            from ROOT import denemeStack
            denemeStack(scene, samp)
        else:
            break