#!/usr/bin/env python import os import sys import subprocess Nargs = len(sys.argv) if Nargs < 8: print ''' Usage: run_hdl3.py inETName inETHost inETPort outETName outETHost outETPort cMsgUDL where: inETName inETHost inETPort specifiy the ET system to read events from outETName outETHost outETPort specifiy the ET system to write events to cMsgUDL specfies the cMsg UDL of the farm manager ''' sys.exit(-1) print 'Number of args: ',len(sys.argv) inETName=sys.argv[1] inETHost=sys.argv[2] inETPort=sys.argv[3] outETName=sys.argv[4] outETHost=sys.argv[5] outETPort=sys.argv[6] cMsgUDL=sys.argv[7] # temporarily overide settings for direct connection #inETName = '/tmp/et_hdops_FCSgluon47' #inETHost = '172.19.5.47' #inETPort = '23931' #outETName = '/tmp/et_hdops_ERsoftROC' #outETHost = '172.19.5.19' #outETPort = '23921' # Combine ET info into format used by sim-recon DAQ library inET = 'ET:%s:L3:%s:%s' % ( inETName, inETHost, inETPort) outET = 'ET:%s:%s:%s' % (outETName, outETHost, outETPort) # Form command to launch hdl3 farm process cmd = ['hdlog', '-c', 'hdl3', inET, '-o', outET] #cmd.extend(['-PL3:DO_WIRE_BASED_TRACKING']) #cmd.extend(['-PL3:DO_BCAL_CLUSTER']) #cmd.extend(['-PL3:FRACTION_TO_KEEP=0.5']) cmd.extend(['-PL3:UDL=%s' % cMsgUDL]) cmd.extend(['-PPLUGINS=EventTagPi0,janactl']) cmd.extend(['-PNTHREADS=Ncores']) cmd.extend(['-PEVIO:NTHREADS=64']) cmd.extend(['-PEVIO:LINK=0']) #cmd.extend(['-PL3:MVA_CUT=-0.2']) #cmd.extend(['-PL3:MVA_WEIGHTS=/home/hdops/CDAQ/daq_dev_v0.31/daq/config/farm/weights']) #cmd.extend(['-PPARSE_CAEN1290TDC=0', '-PEVIO:PARSE_F1TDC=0', '-PEVIO:PARSE_F125=0', '-PEVIO:PARSE_F250=0']) # Make single string of command for printing that we can add to log file cmdstr = '' for s in cmd: cmdstr = '%s %s' % (cmdstr, s) f = open('%s/run_hdl3_cmdstr' % os.getenv('HDLOG','/gluex/log'), 'w') f.write(cmdstr) f.close() # Run program subprocess.call(cmd)