1 from optparse
import OptionParser
2 import sys, os, subprocess, shutil, ROOT, array, math
4 usage =
"usage: %prog[options]" 5 parser = OptionParser(usage=usage)
7 parser.add_option(
"-f",
"--filename",dest=
"filename",help=
"filename for histogram creation",default=
"NA")
9 (options,args)=parser.parse_args()
10 pathname = options.filename
16 f = ROOT.TFile(
str(pathname))
17 for keys
in f.GetListOfKeys():
18 output_objects.append(f.Get(keys.GetName()))
27 ROOT.gStyle.SetPaintTextFormat(
"4.4f")
28 c1=ROOT.TCanvas(
"c1",
"c1",750,750)
31 if objects.GetName()==start:
32 for keys
in objects.GetListOfKeys():
33 collision.append(objects.Get(keys.GetName()))
35 for particles
in collision:
36 if particles.GetName()==particle:
38 for keys
in particles.GetListOfKeys():
39 histogram.append(particles.Get(keys.GetName()))
41 for hists
in histogram:
42 if hists.GetName()==histos:
44 for i
in range(1,hists.GetNbinsX()):
45 if(hists.GetXaxis()).GetBinLabel(i)==
"":
48 for j
in range(1,hists.GetNbinsY()):
49 if(hists.GetYaxis()).GetBinLabel(j)==
"":
55 (hists.GetXaxis()).SetRangeUser(0,xmax)
56 (hists.GetYaxis()).SetRangeUser(0,ymax)
57 hists.SetMinimum(0.0001)
58 hists.Draw(
"COLZTEXT")
68 ROOT.gStyle.SetPaintTextFormat(
"4.4f")
69 c1=ROOT.TCanvas(
"c1",
"c1",750,750)
72 if objects.GetName()==start:
73 for keys
in objects.GetListOfKeys():
74 collision.append(objects.Get(keys.GetName()))
77 for hists
in collision:
78 if hists.GetName()==histos:
80 for i
in range(1,hists.GetNbinsX()):
81 if(hists.GetXaxis()).GetBinLabel(i)==
"":
84 for j
in range(1,hists.GetNbinsY()):
85 if(hists.GetYaxis()).GetBinLabel(j)==
"":
91 (hists.GetXaxis()).SetRangeUser(0,xmax)
92 (hists.GetYaxis()).SetRangeUser(0,ymax)
93 hists.SetMinimum(0.0001)
94 hists.Draw(
"COLZTEXT")
def drawhistos(lists, start, particle, histos)
def allparticlehistos(lists, start, histos)