2 from pathlib
import Path
3 from multiprocessing
import Pool
4 from functools
import partial
30 from common
import getOpenDataDetectorDirectory
32 u = acts.UnitConstants
38 field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
39 rnd = acts.examples.RandomNumbers(seed=42)
42 events=endEvent - beginEvent, skip=beginEvent, numThreads=1
45 outputDir = Path(outputDir)
50 outputDirCsv=outputDir /
"csv",
58 outputDirCsv=outputDir /
"csv",
67 if "__main__" == __name__:
71 chunksize = n_events // (n_jobs - 1)
72 begins = range(0, n_events, chunksize)
73 ends = [
min(b + chunksize, n_events)
for b
in begins]
75 outputDir = Path.cwd()
77 with Pool(n_jobs)
as p:
78 p.starmap(partial(runGeant4EventRange, outputDir=outputDir),
zip(begins, ends))