import sys, os, copy from math import sqrt,cos,sin pandapath = os.environ.get('PANDAPATH') sys.path.append(pandapath + '/macro/tpc/FOPI/python/argparse-1.2.1') sys.path.append(pandapath + '/macro/tpc/FOPI/mberger') import argparse, ROOT from functions import set_palette, openTree, thisIsTheEnd, getSlices, getColors2 from anaFile import anaFile import random parser=argparse.ArgumentParser(description='compare sim and data digi and cluster amps') parser.add_argument("data",help="path to the data histo file",type=str) #parser.add_argument("--runs",help="the runs to analyze",type=str,default="3883-3901") #parser.add_argument("--pattern",help="the pattern for the data files",type=str,default="ArCO2_85_recl_clcorr_planeErr_rev28618_paramRev28604_fourthIter") parser.add_argument("sim",help='path to the simulation histo file',type=str) args=parser.parse_args() files={} files['data']=anaFile(args.data) files['sim']=anaFile(args.sim) cols=getColors2() hClusterAmp={} hDigiAmp={} hDigiAmp_low={} counter=-1 canvas=ROOT.TCanvas("c1","Amp",1500,500) canvas.Divide(3,1) leg=ROOT.TLegend(0.6,0.7,0.9,0.9) opt="" for dtype in files: counter+=1 hClusterAmp[dtype]=files[dtype].get('single/hclusteramp') hClusterAmp[dtype].SetLineColor(cols[counter]) hClusterAmp[dtype].SetStats(0) hDigiAmp[dtype]=files[dtype].get('single/hdigiamp') hDigiAmp[dtype].SetLineColor(cols[counter]) hDigiAmp[dtype].SetStats(0) hDigiAmp_low[dtype]=files[dtype].get('single/hdigiamp_low') hDigiAmp_low[dtype].SetLineColor(cols[counter]) hDigiAmp_low[dtype].SetStats(0) canvas.cd(1) hClusterAmp[dtype].Draw(opt) canvas.cd(2) hDigiAmp[dtype].Draw(opt) canvas.cd(3) hDigiAmp_low[dtype].Draw(opt) opt="same" leg.AddEntry(hClusterAmp[dtype],dtype,"lp") canvas.cd(1) leg.Draw() thisIsTheEnd()