-
Notifications
You must be signed in to change notification settings - Fork 0
/
reconstruction_job.py
60 lines (51 loc) · 2.3 KB
/
reconstruction_job.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from DIRAC.Core.Base import Script
Script.parseCommandLine()
from ILCDIRAC.Interfaces.API.DiracILC import DiracILC
from ILCDIRAC.Interfaces.API.NewInterface.UserJob import UserJob
from ILCDIRAC.Interfaces.API.NewInterface.Applications import GaudiApp
dIlc = DiracILC()
# ParticleList = ["mu-", "e-", "pi-"]
ParticleList = ["mu-", "e-"]
# ParticleList = ["mu-"]
# MomentumList = ["1", "2", "5", "10", "20", "50", "100", "200"]
# 200 GeV events are really slow and big
MomentumList = ["1", "2", "5", "10", "20", "50", "100"]
# MomentumList = ["1", "2"]
ThetaList = ["10", "20", "30", "40", "50", "60", "70", "80", "89"]
# ThetaList = ["10", "20"]
args = [(Particle, theta, momentum) for Particle in ParticleList for momentum in MomentumList for theta in ThetaList]
outputBasenames = [f"REC_{arg[0]}_{arg[1]}deg_{arg[2]}GeV_1000evt" for arg in args]
outputFiles = [[f"{name}_aida.root", f"{name}_edm4hep.root"] for name in outputBasenames]
inputFiles = [f"SIM_{arg[0]}_{arg[1]}deg_{arg[2]}GeV_1000evt.edm4hep.root" for arg in args]
# detectorModel = "CLD_o2_v05"
detectorModel = "FCCee_o1_v04"
detectorPath = f"$K4GEO/FCCee/CLD/compact/{detectorModel}/{detectorModel}.xml"
job = UserJob()
job.setSplitDoNotAlterOutputFilename()
job.setName('RecoSingleParticle_%n')
# job.setSplitParameter('particle', particles)
# job.setSplitParameter('energy', energies)
# job.setSplitParameter('theta', thetas)
job.setSplitParameter('outputBasename', outputBasenames)
job.setSplitParameter('inputFile', inputFiles)
job.setSplitInputData([f"LFN:/ilc/user/L/LReichenbac/resolutions/sim/{detectorModel}/{file}" for file in inputFiles])
job.setSplitOutputData(outputFiles, f'resolutions/rec_e4h/{detectorModel}', 'CERN-DST-EOS')
job.setOutputSandbox('*.log')
job.setInputSandbox(["CLDConfig/CLDConfig/PandoraSettingsCLD"])
# job.setInputSandbox(glob.glob("PandoraSettingsCLD/*"))
gaudi = GaudiApp()
gaudi.setExecutableName("k4run")
gaudi.setVersion("key4hep_nightly")
gaudi.setSteeringFile("CLDConfig/CLDConfig/CLDReconstruction.py")
gaudi.setInputFileFlag("--inputFiles")
gaudi.setOutputFileFlag("")
# TODO: turn on --trackingOnly
gaudi.setExtraCLIArguments(
# "--inputFiles=%(inputFile)s "
"--outputBasename=%(outputBasename)s "
"-n 1000 "
f"--GeoSvc.detectors={detectorPath} "
"--trackingOnly"
)
job.append(gaudi)
job.submit(dIlc, mode="wms")