#!/usr/bin/python import os,sys,getopt,math opts, args = getopt.getopt(sys.argv[1:],"Aa") AMP = 0 for opt,arg in opts: if opt in ("-a","-A"): AMP = 1 RUNS = [] for d in os.listdir("./"): if d.startswith("calibration3"): RUNS.append(d) RUNS.sort() for d in RUNS: RunNum = int(d[11:16]) cmd = 'root -b -q \"findp.C('+str(RunNum)+','+ str(AMP) + ')\"' os.system(cmd)