import sys sys.path.append('/home/mberger/fopiroot/fopiroot_dev/macro/tpc/FOPI/mberger') import ROOT,glob,math,argparse from anaFile import anaFile from functions import * parser=argparse.ArgumentParser(description='plot snr for one or more files') parser.add_argument('anafiles',help='the ana files',type=str,nargs='+') parser.add_argument('--titles',help='the titles',type=str,default=[],nargs='+') parser.add_argument('--hlp',help='show help',action='store_true') args=parser.parse_args() ROOT.gROOT.ProcessLine(".x rootlogon.C") ROOT.gROOT.ProcessLine('gStyle->SetPalette(1)') ROOT.gROOT.ProcessLine('gROOT->SetStyle("Plain")') if args.hlp: parser.print_help() exit(0) rfiles=[] sampleSNR=[] digiSNR=[] clustSNR=[] legendSNR=[] digiSNRslice=[] clustSNRslice=[] zSlices=[] colors=getColors2() sampleSNR_max=[] sampleSNR_mpv=[] sampleSNR_mpvErr=[] digiSNR_max=[] clustSNR_max=[] fcounter=-1 for ifile in range(len(args.anafiles)): fcounter+=1 rfiles.append(anaFile(args.anafiles[ifile])) sampleSNR.append(rfiles[-1].getHist("ssnr")) digiSNR.append(rfiles[-1].getHist("hsnr")) clustSNR.append(rfiles[-1].getHist("csnr")) legendSNR.append(clustSNR[-1].Clone()) digiSNRslice.append(rfiles[-1].getSlicedHist("nsnr")) clustSNRslice.append(rfiles[-1].getSlicedHist("csnr")) zSlices.append(rfiles[-1].getDriftSlices()) sampleSNR_max.append(-1) digiSNR_max.append(-1) clustSNR_max.append(-1) sampleSNR_mpv.append(-1) sampleSNR_mpvErr.append(-1) counter=0 while len(args.titles)