import sys sys.path.append('/home/mberger/fopiroot/fopiroot_dev/macro/tpc/FOPI/mberger') import ROOT,glob,math,argparse from functions import Divideh,set_palette,setRange from anaFile import anaFile parser=argparse.ArgumentParser(description="plots track related infos like cluster per cm, cluster per track ...") parser.add_argument('anafile',help='the histo file',type=str) parser.add_argument('--titles',help='the titles for',type=str,default=[""],nargs="+") parser.add_argument('--sqrt',help='plot a sqrt function',action='store_true') parser.add_argument('--hlp',help='display help',action='store_true') args=parser.parse_args() if args.hlp: parser.print_help() exit(0) ROOT.gROOT.ProcessLine(".x rootlogon.C") ROOT.gROOT.ProcessLine('gROOT->SetStyle("Plain")') set_palette() rfile=anaFile(args.anafile) disthist=rfile.getHist('hcldistz') if args.sqrt: stepfunc=ROOT.TF1("stepfunc","[0]*[1]*TMath::Sqrt(x+[2])+[3]",-62.5,20) else: stepfunc=ROOT.TF1("stepfunc","[0]*1",0,80) stepfunc.SetNpx(1000) stepfunc.SetLineWidth(2) stepfunc.SetLineColor(2) c1=ROOT.TCanvas() disthist.GetXaxis().SetTitle("Z-Pos (cm)") disthist.GetYaxis().SetTitle("Distance (cm)") disthist.SetStats(0) disthist.Draw("colz") if args.sqrt: stepfunc.SetParameter(0,0.0197879) stepfunc.SetParameter(1,4) stepfunc.SetParameter(2,+62.5) stepfunc.SetParameter(3,1) # stepfunc.SetParameter(2,0) if args.sqrt: stepfunc.Draw("same") u=raw_input("Done?")