#!/usr/bin/env python3 import os import sys dataDir = sys.argv[1] mirrorRotation = sys.argv[2] cbmrootConfigPath = "/lustre/nyx/cbm/users/slebedev/cbm/trunk/build/config.sh" macroDir = "/lustre/nyx/cbm/users/slebedev/cbm/trunk/cbmroot/macro/rich/geotest/" taskId = os.environ.get('SLURM_ARRAY_TASK_ID') jobId = os.environ.get('SLURM_ARRAY_JOB_ID') nofEvents = 10000 print("dataDir:" + dataDir) os.system(("source {}").format(cbmrootConfigPath)) #os.command("export DISPLAY=localhost:0.0") # This line is needed, otherwise root will crash mcFile = dataDir + "/mc."+ taskId + ".root" parFile = dataDir + "/param."+ taskId + ".root" digiFile = dataDir + "/digi."+ taskId + ".root" recoFile = dataDir + "/reco."+ taskId + ".root" qaFile = dataDir + "/qa."+ taskId + ".root" geoSimFile = dataDir + "/geosim."+ taskId + ".root" geoSetup = "mirror" + str(mirrorRotation) + "_" + taskId resultDir = dataDir + "/results/results_" + geoSetup + "/" workDir = dataDir + "/workdir/" + jobId + "_" + taskId + "/" if os.path.exists(workDir): shutil.rmtree(workDir) os.makedirs(workDir) os.chdir(workDir) commandSim=('root -l -b -q {}/run_sim_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, geoSimFile, geoSetup, nofEvents) commandDigi=('root -l -b -q {}/run_digi_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, nofEvents) commandReco=('root -l -b -q {}/run_reco_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, geoSetup, resultDir, nofEvents) commandQa=('root -l -b -q {}/run_qa_geotest.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(macroDir, mcFile, parFile, digiFile, recoFile, qaFile, geoSetup, resultDir, nofEvents) os.system(commandSim) os.system(commandDigi) os.system(commandReco) os.system(commandQa)