import glob,argparse,sys,subprocess,time,os,ROOT,psutil parser=argparse.ArgumentParser(description='start FOPI-ROOT stuff') parser.add_argument('--mc',help='generate mc file',action='store_true') parser.add_argument('--digi',help='generate digi file',action='store_true') parser.add_argument('--reco',help='generate a reco file',action='store_true') parser.add_argument('--ana',help='generate a hist file',action='store_true') parser.add_argument('--data',help='do reco for data (default=mc)',action='store_true') parser.add_argument('--runs',help='wich runs to reco in case of data',type=str,default='None') parser.add_argument('--field',help='drift field strength to use',type=int,default=86) parser.add_argument('--gas',help='gas to use (ar/ne)',type=str,default='ar') parser.add_argument('--gain',help='Gain to use',type=int,default=85) parser.add_argument('--nobfield',help='disable b-field',action='store_true') parser.add_argument('--const',help='Do constant MC generator',action='store_true') parser.add_argument('--cyl',help='Do Cylinder MC generator',action='store_true') parser.add_argument('--sphere',help='Do Sperical MC generator',action='store_true') parser.add_argument('--cosmics',help='Do Cosmics MC generator',action='store_true') parser.add_argument('--events',help='number of events to process',type=int,default=0) parser.add_argument('--mode',help='which mode to run.\n for const: 0=along y; 1=along x; 2=45 degree ',type=int, default=0) parser.add_argument('--mcFolder',help='folder to store or find the MC file in',type=str,default="None") parser.add_argument('--digiFolder',help='folder to store or find the DIGI file in',type=str,default="None") parser.add_argument('--recoFolder',help='folder to store or find the RECO file in',type=str,default="None") parser.add_argument('--fC',help='Loop over values of fC (start stop step)',type=float,default=[-1,-1,-1],nargs=3) parser.add_argument('--fG',help='Loop over values of fG (start stop step)',type=float,default=[-1,-1,-1],nargs=3) parser.add_argument('--errors',help='Loop over the 3 different error calculation modes:\n Standard, No, New',type=int,default=[0,0,0],nargs=3) parser.add_argument('--corrs',help='Loop over corrections:\n standard, recl, clcorr, clcorr+recl',type=int,default=[0,0,0,0],nargs=4) parser.add_argument('--phi',help='loop over phi angles',type=float,default=[-400,-400,-400],nargs=3) parser.add_argument('--multiMC',help='one MC file for every run',action='store_true') parser.add_argument('--nProcess',help='number of processes to run parallel',default=1,type=int) parser.add_argument('--nRun',help='number of this run_stuff version. necessary if mor than 1 run_stuff.py will be started.',type=int,default=1) parser.add_argument('--keepRunFile',help='keep the runfile. dont delete it',action='store_true') parser.add_argument('--checkev',help='check if the number of events in the file is less than the given value, if yes redo the file',action='store_true') parser.add_argument('--log',help='write output to log file run_stuff.log',action='store_true') parser.add_argument('--hlp',help='print help',action='store_true') args=parser.parse_args() if args.hlp: parser.print_help() exit(0)