Skip to content
Snippets Groups Projects
Commit ec3c20a5 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

RichFutureRecSys: Update example options and job submission scripts

parent 6d04db91
No related branches found
No related tags found
No related merge requests found
Pipeline #6927477 passed
......@@ -63,13 +63,16 @@ ApplicationMgr().HistogramPersistency = "ROOT"
from Configurables import RootHistCnv__PersSvc
RootHistCnv__PersSvc('RootHistCnv').ForceAlphaIds = True
myBuild = os.getenv('User_release_area', 'None').split('/')[-1]
myConf = os.getenv('BINARY_TAG', 'None')
rootFileBaseName = "RichFuture-" + myBuild + "-" + myConf + "-" + histos
rootFileBaseName = "RichFuture"
if not batchMode:
myBuild = os.getenv('User_release_area', 'None').split('/')[-1]
myConf = os.getenv('BINARY_TAG', 'None')
rootFileBaseName += "-" + myBuild + "-" + myConf + "-" + histos
HistogramPersistencySvc().OutputFile = rootFileBaseName + "-Histos.root"
# Event numbers
nEvents = (1000 if not batchMode else 99999999)
#nEvents = 100
EventSelector().PrintFreq = (100 if not batchMode else 250)
#LHCbApp().SkipEvents = 2
......
......@@ -11,7 +11,8 @@
from __future__ import print_function
from Gaudi.Configuration import *
import glob, os
import glob, os, shutil, uuid
from pathlib import Path
from GaudiConf import IOHelper
# name tag
......@@ -37,37 +38,62 @@ searchPaths = [
"/eos/lhcb/user/j/jonrob/" + relPath,
]
print("Data Files :-")
data = []
for path in searchPaths:
files = sorted(glob.glob(path + "*.digi"))
if len(files) > 0:
data += ["'PFN:" + file for file in files]
for f in files:
print(f)
data += files
else:
print("No data at", path)
# Batch options ?
if "CONDOR_FILE_BATCH" in os.environ:
# Use env vars to define reduced file range for this job
batch = int(os.environ["CONDOR_FILE_BATCH"])
nfiles = int(os.environ["CONDOR_FILES_PER_BATCH"])
print("CONDOR_FILE_BATCH", batch)
print("CONDOR_FILES_PER_BATCH", nfiles)
firstFile = batch * nfiles
lastFile = (batch + 1) * nfiles
if firstFile <= len(data):
if lastFile > len(data): lastFile = len(data)
print("Using restricted file range", firstFile, lastFile)
print("INFO: Using restricted file range", firstFile, lastFile)
data = data[firstFile:lastFile]
for f in data:
print(" ", f)
else:
print("WARNING: File range outside input data list")
data = []
IOHelper('ROOT').inputFiles(data, clear=True)
#cache_dir = "/var/work/" + os.environ["USER"] + "/DataCache"
#if "CACHE_DATA_LOCALLY" in os.environ:
# # Attempt to cache locally to work area
# new_data = []
# Path(cache_dir).mkdir(parents=True, exist_ok=True)
# for f in data:
# fsize = os.path.getsize(f)
# total, used, free = shutil.disk_usage(cache_dir)
# if free > fsize:
# cache_f = cache_dir + f
# if not os.path.isfile(cache_f):
# tmp_f = cache_f + ".tmp." + str(uuid.uuid4())
# print("Copying", f, "to", cache_dir)
# Path(os.path.dirname(cache_f)).mkdir(parents=True, exist_ok=True)
# shutil.copy(f, tmp_f)
# if not os.path.isfile(cache_f):
# shutil.move(tmp_f,cache_f)
# else:
# os.remove(tmp_f)
# new_data += [cache_f]
# data = new_data
#else:
# shutil.rmtree(cache_dir)
print("Data Files :-")
for f in data:
print(f)
# Append "PFN:" to each file
pfns = ["'PFN:" + f for f in data]
IOHelper('ROOT').inputFiles(pfns, clear=True)
FileCatalog().Catalogs = ['xmlcatalog_file:out.xml']
from Configurables import LHCbApp, DDDBConf
......
......@@ -11,7 +11,8 @@
from __future__ import print_function
from Gaudi.Configuration import *
import glob, os
import glob, os, shutil, uuid
from pathlib import Path
from GaudiConf import IOHelper
# name tag
......@@ -37,37 +38,62 @@ searchPaths = [
"/eos/lhcb/user/j/jonrob/" + relPath,
]
print("Data Files :-")
data = []
for path in searchPaths:
files = sorted(glob.glob(path + "*.digi"))
if len(files) > 0:
data += ["'PFN:" + file for file in files]
for f in files:
print(f)
data += files
else:
print("No data at", path)
# Batch options ?
if "CONDOR_FILE_BATCH" in os.environ:
# Use env vars to define reduced file range for this job
batch = int(os.environ["CONDOR_FILE_BATCH"])
nfiles = int(os.environ["CONDOR_FILES_PER_BATCH"])
print("CONDOR_FILE_BATCH", batch)
print("CONDOR_FILES_PER_BATCH", nfiles)
firstFile = batch * nfiles
lastFile = (batch + 1) * nfiles
if firstFile <= len(data):
if lastFile > len(data): lastFile = len(data)
print("Using restricted file range", firstFile, lastFile)
print("INFO: Using restricted file range", firstFile, lastFile)
data = data[firstFile:lastFile]
for f in data:
print(" ", f)
else:
print("WARNING: File range outside input data list")
data = []
IOHelper('ROOT').inputFiles(data, clear=True)
#cache_dir = "/var/work/" + os.environ["USER"] + "/DataCache"
#if "CACHE_DATA_LOCALLY" in os.environ:
# # Attempt to cache locally to work area
# new_data = []
# Path(cache_dir).mkdir(parents=True, exist_ok=True)
# for f in data:
# fsize = os.path.getsize(f)
# total, used, free = shutil.disk_usage(cache_dir)
# if free > fsize:
# cache_f = cache_dir + f
# if not os.path.isfile(cache_f):
# tmp_f = cache_f + ".tmp." + str(uuid.uuid4())
# print("Copying", f, "to", cache_dir)
# Path(os.path.dirname(cache_f)).mkdir(parents=True, exist_ok=True)
# shutil.copy(f, tmp_f)
# if not os.path.isfile(cache_f):
# shutil.move(tmp_f,cache_f)
# else:
# os.remove(tmp_f)
# new_data += [cache_f]
# data = new_data
#else:
# if os.path.exists(cache_dir): shutil.rmtree(cache_dir)
print("Data Files :-")
for f in data:
print(f)
# Append "PFN:" to each file
pfns = ["'PFN:" + f for f in data]
IOHelper('ROOT').inputFiles(pfns, clear=True)
FileCatalog().Catalogs = ['xmlcatalog_file:out.xml']
from Configurables import LHCbApp, DDDBConf
......
......@@ -123,7 +123,7 @@ def nFiles(lumi):
def nFilesPerJob(lumi):
return ("4" if lumi < 1.0e34 else "2")
return ("20" if lumi < 1.0e34 else "20")
def unsetenv():
......
......@@ -10,7 +10,7 @@
# or submit itself to any jurisdiction. #
###############################################################################
JNAME="Scope1"
JNAME="Scope2"
SubmitRoot=$HOME"/LHCb/stack/Feature/Rec/Rich/RichFutureRecSys/examples/jobs"
......@@ -29,19 +29,19 @@ u2lumis="1.5e34,1.2e34,1.0e34"
# name=$JNAME"/Tardis"
# ${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $name -4d --lumis "1.2e34" --photwinsR1 $twindow --photwinsR2 $twindow --ckResScaleR1 "1.00,1.00" --ckResScaleR2 "1.00,1.00"
# ${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $name -4d --lumis "1.2e34" --photwinsR1 $twindow --photwinsR2 $twindow --ckResScaleR1 "0.75,0.75" --ckResScaleR2 "0.75,0.75"
# ${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $name -4d --lumis "1.2e34" --photwinsR1 $twindow --photwinsR2 $twindow --ckResScaleR1 "0.50,0.50" --ckResScaleR2 "0.50,0.50" --detEffR1 "0.7#9,0.79" --detEffR2 "0.90,0.90" --pixQR1 "1.0,1.0" --pixQR2 "1.0,1.0"
# ${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $name -4d --lumis "1.2e34" --photwinsR1 $twindow --photwinsR2 $twindow --ckResScaleR1 "0.25,0.25" --ckResScaleR2 "0.25,0.25" --detEffR1 "0.5#8,0.58" --detEffR2 "0.79,0.79" --pixQR1 "1.0,1.0" --pixQR2 "1.0,1.0"
# ${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $name -4d --lumis "1.2e34" --photwinsR1 $twindow --photwinsR2 $twindow --ckResScaleR1 "0.50,0.50" --ckResScaleR2 "0.50,0.50" --detEffR1 "0.79,0.79" --detEffR2 "0.90,0.90" --pixQR1 "1.0,1.0" --pixQR2 "1.0,1.0"
# ${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $name -4d --lumis "1.2e34" --photwinsR1 $twindow --photwinsR2 $twindow --ckResScaleR1 "0.25,0.25" --ckResScaleR2 "0.25,0.25" --detEffR1 "0.58,0.58" --detEffR2 "0.79,0.79" --pixQR1 "1.0,1.0" --pixQR2 "1.0,1.0"
#done
# Specific scoping doc scenarios
siPMtw="0.075"
siPMtw="0.100"
# Option 1.0 - Value
${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $JNAME"/Value" -4d --lumis ${u2lumis} --photwinsR1 $siPMtw",0.3" --photwinsR2 $siPMtw",0.3" --ckResScaleR1 "0.426,0.913" --ckResScaleR2 "0.703,1.000" --detEffR1 "0.539,0.730" --detEffR2 "0.735,1.000" --pixQR1 "2.0,2.8" --pixQR2 "2.0,2.8"
# Option 2.0 - Mid Range
${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $JNAME"/MidRange" -4d --lumis ${u2lumis} --photwinsR1 $siPMtw","$siPMtw --photwinsR2 $siPMtw","$siPMtw --ckResScaleR1 "0.276,0.426" --ckResScaleR2 "0.253,0.253" --detEffR1 "0.539,0.539" --detEffR2 "0.735,0.735" --pixQR1 "1.0,2.0" --pixQR2 "1.0,2.0"
${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $JNAME"/MidRange" -4d --lumis ${u2lumis} --photwinsR1 $siPMtw","$siPMtw --photwinsR2 $siPMtw","$siPMtw --ckResScaleR1 "0.276,0.426" --ckResScaleR2 "0.253,0.346" --detEffR1 "0.539,0.539" --detEffR2 "0.735,0.735" --pixQR1 "1.0,2.0" --pixQR2 "1.0,2.0"
# Option 3.0 - Finest
${SubmitRoot}"/RunJobs.py" --useMCTracks --useMCHits --usePixelMCInfo --usePhotonMCInfo --overrideDetRegions -N $JNAME"/Finest" -4d --lumis ${u2lumis} --photwinsR1 $siPMtw","$siPMtw --photwinsR2 $siPMtw","$siPMtw --ckResScaleR1 "0.276,0.276" --ckResScaleR2 "0.253,0.253" --detEffR1 "0.539,0.539" --detEffR2 "0.735,0.735" --pixQR1 "1.0,1.0" --pixQR2 "1.0,1.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment