forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdigitization_config.py
More file actions
executable file
·42 lines (30 loc) · 1.05 KB
/
digitization_config.py
File metadata and controls
executable file
·42 lines (30 loc) · 1.05 KB
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
#!/usr/bin/env python3
from pathlib import Path
import acts
from acts.examples import (
DigitizationConfigurator,
GenericDetector,
DigiConfigContainer,
)
from acts.examples.json import readDigiConfigFromJson, writeDigiConfigToJson
u = acts.UnitConstants
def runDigitizationConfig(
trackingGeometry,
input: Path,
output: Path,
):
inputConfig = readDigiConfigFromJson(str(input))
digiConfigurator = DigitizationConfigurator()
digiConfigurator.compactify = True
digiConfigurator.inputDigiComponents = inputConfig
trackingGeometry.visitSurfaces(digiConfigurator)
outputConfig = DigiConfigContainer(digiConfigurator.outputDigiComponents)
writeDigiConfigToJson(outputConfig, str(output))
if "__main__" == __name__:
detector = GenericDetector()
trackingGeometry = detector.trackingGeometry()
runDigitizationConfig(
trackingGeometry=trackingGeometry,
input=Path(__file__).parent / "../../Configs/generic-digi-smearing-config.json",
output=Path.cwd() / "digi-config-out.json",
)