Ejemplo n.º 1
0
# GaudiPython configuration.
gaudi = GaudiPython.AppMgr()
tes = gaudi.evtsvc()

# Run.
import sys, ROOT
from math import floor
evtmax = -1  #1000#-1
#try: evtmax = int(sys.argv[1])
#except: evtmax = float('inf')
evtnum = 0
ntuple = Ntuple('output.root',
                tes,
                gaudi.toolsvc(),
                gaudi.detSvc(),
                recJB.Output,
                recSVs.outputLocation(),
                recMus.algorithm().Output,
                addBackTags=True)
while evtmax < 0 or evtnum < evtmax:
    gaudi.run(1)
    if not bool(tes['/Event']): break
    evtnum += 1
    ntuple.clear()

    # Fill event info.
    try:
        ntuple.ntuple['evt_pvr_n'][0] = len(tes['Rec/Vertex/Primary'])
    except:
        continue
    try:
Ejemplo n.º 2
0
from Ntuple import Ntuple

# GaudiPython configuration.
gaudi = GaudiPython.AppMgr()
tes   = gaudi.evtsvc()

# Run.
import sys, ROOT
from math import floor
evtmax = -1
#'
#try: evtmax = int(sys.argv[1])
#except: evtmax = float('inf')
evtnum = 0
ntuple = Ntuple('output.root', tes, gaudi.toolsvc(), gaudi.detSvc(), recJB.Output, recSVs.outputLocation(), recMus.algorithm().Output)
#gaudi.run(39000)#TODO
while evtmax < 0 or evtnum < evtmax:
    gaudi.run(1)
    if not bool(tes['/Event']): break
    evtnum += 1
    ntuple.clear()

    # Fill event info.
    try: ntuple.ntuple['evt_pvr_n'][0] = len(tes['Rec/Vertex/Primary'])
    except: continue
    try: ntuple.addEventInfo();
    except: continue

    fill = False;
Ejemplo n.º 3
0
# GaudiPython configuration.
gaudi = GaudiPython.AppMgr()
tes = gaudi.evtsvc()

# Run.
import sys, ROOT
from math import floor
#evtmax = 10000 #TODO
evtmax = -1  #TODO
#try: evtmax = int(sys.argv[1])
#except: evtmax = float('inf')
evtnum = 0
ntuple = Ntuple('output.root',
                tes,
                gaudi.toolsvc(),
                gaudi.detSvc(),
                primaries='/Event/' + stream + '/Rec/Vertex/Primary')
while evtmax < 0 or evtnum < evtmax:
    gaudi.run(1)
    if not bool(tes['/Event']): break
    evtnum += 1
    ntuple.clear()

    # Fill event info.
    try:
        ntuple.ntuple['evt_pvr_n'][0] = len(tes['/Event/' + stream +
                                                '/Rec/Vertex/Primary'])
    except:
        continue
Ejemplo n.º 4
0
from Ntuple import Ntuple

# GaudiPython configuration.
gaudi = GaudiPython.AppMgr()
tes = gaudi.evtsvc()

# Run.
import sys, ROOT
from math import floor
evtmax = -1
#try: evtmax = int(sys.argv[1])
#except: evtmax = float('inf')
evtnum = 0
ntuple = Ntuple('output.root', tes, gaudi.toolsvc(), gaudi.detSvc(),
                recJB.Output, recSVs.outputLocation(),
                recMus.algorithm().Output)
while evtmax < 0 or evtnum < evtmax:
    gaudi.run(1)
    if not bool(tes['/Event']): break
    evtnum += 1
    ntuple.clear()

    # Fill event info.
    try:
        ntuple.ntuple['evt_pvr_n'][0] = len(tes['Rec/Vertex/Primary'])
    except:
        continue
    try:
        ntuple.ntuple['evt_trk_n'][0] = len(
            tes['Phys/StdAllNoPIDsPions/Particles'])
Ejemplo n.º 5
0
LHCB = gbl.LHCb

from Ntuple import Ntuple

# GaudiPython configuration.
gaudi = GaudiPython.AppMgr()
tes   = gaudi.evtsvc()

# Run.
import sys, ROOT
from math import floor
evtmax = -1
#try: evtmax = int(sys.argv[1])
#except: evtmax = float('inf')
evtnum = 0
ntuple = Ntuple('output.root', tes, gaudi.toolsvc(), gaudi.detSvc(), recJB.Output, recSVs.outputLocation(), recMus.algorithm().Output)
while evtmax < 0 or evtnum < evtmax:
    gaudi.run(1)
    if not bool(tes['/Event']): break
    evtnum += 1
    ntuple.clear()

    # Fill event info.
    try: ntuple.ntuple['evt_pvr_n'][0] = len(tes['Rec/Vertex/Primary'])
    except: continue
    try: ntuple.addEventInfo();
    except: continue

    # Fill generator level info.
    fill = False;
    gens = tes['MC/Particles']
Ejemplo n.º 6
0
#!/usr/bin/env python

import ROOT

from Ntuple import Ntuple

ROOT.gROOT.SetBatch(True)

n = Ntuple("DataTree")
n.add("data.root")
entries = n.GetEntries()
print "Entries: ", entries

gauss_h = ROOT.TH1F("gauss", "Gaussian distribution", 100, -5., 5.)
uniform_h = ROOT.TH1I("uniform", "Uniform distribution", 101, 0, 101)

for entry in range(entries):
    n.GetEntry(entry)
    gauss_h.Fill(n.val("gauss_0"))
    uniform_h.Fill(n.val("uniform_0"))

canvas = ROOT.TCanvas("c", "c", 400, 400)
gauss_h.Draw()
canvas.SaveAs("gauss.ntuple_py.pdf")
canvas.Clear()
uniform_h.Draw()
canvas.SaveAs("uniform.ntuple_py.pdf")
Ejemplo n.º 7
0
LHCB = gbl.LHCb

from Ntuple import Ntuple

# GaudiPython configuration.
gaudi = GaudiPython.AppMgr()
tes = gaudi.evtsvc()

# Run.
import sys, ROOT
from math import floor
evtmax = -1  #TODO
#try: evtmax = int(sys.argv[1])
#except: evtmax = float('inf')
evtnum = 0
ntuple = Ntuple('output.root', tes, gaudi.toolsvc(), gaudi.detSvc())
while evtmax < 0 or evtnum < evtmax:
    gaudi.run(1)
    if not bool(tes['/Event']): break
    evtnum += 1
    ntuple.clear()

    # Fill event info.
    try:
        ntuple.ntuple['evt_pvr_n'][0] = len(tes['Rec/Vertex/Primary'])
    except:
        continue

    # Fill generator level info.
    fill = False