Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mockupbuilder.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file mockupbuilder.py
1 import os
2 
3 import acts
4 import acts.examples.geant4 as actsG4
5 
6 mockupConfig = actsG4.MockupSectorBuilder.Config()
7 
8 mockupChamberConfigInner = actsG4.MockupSectorBuilder.ChamberConfig()
9 mockupChamberConfigInner.name = "Inner_Detector_Chamber"
10 mockupChamberConfigInner.SensitiveNames = ["Inner_Skin"]
11 mockupChamberConfigInner.PassiveNames = ["xx"]
12 
13 mockupChamberConfigMiddle = actsG4.MockupSectorBuilder.ChamberConfig()
14 mockupChamberConfigMiddle.name = "Middle_Detector_Chamber"
15 mockupChamberConfigMiddle.SensitiveNames = ["Middle_Skin"]
16 mockupChamberConfigMiddle.PassiveNames = ["xx"]
17 
18 mockupChamberConfigOuter = actsG4.MockupSectorBuilder.ChamberConfig()
19 mockupChamberConfigOuter.name = "Outer_Detector_Chamber"
20 mockupChamberConfigOuter.SensitiveNames = ["Outer_Skin"]
21 mockupChamberConfigOuter.PassiveNames = ["xx"]
22 
23 dirOfThisScript = os.path.dirname(__file__)
24 mockupConfig.gdmlPath = os.path.join(
25  dirOfThisScript,
26  "../../../../Detectors/MuonSpectrometerMockupDetector/MuonChamber.gdml",
27 )
28 mockupConfig.NumberOfSectors = 8
29 
30 mockupBuilder = actsG4.MockupSectorBuilder(mockupConfig)
31 
32 detectorVolumeInner = mockupBuilder.buildChamber(mockupChamberConfigInner)
33 
34 detectorVolumeOuter = mockupBuilder.buildChamber(mockupChamberConfigOuter)
35 
36 detectorVolumeMiddle = mockupBuilder.buildChamber(mockupChamberConfigMiddle)
37 
38 detectorVolumes = [detectorVolumeInner, detectorVolumeMiddle, detectorVolumeOuter]
39 
40 detectorVolumeSector = mockupBuilder.buildSector(detectorVolumes)
41 
42 mockupBuilder.drawSector(detectorVolumeSector, "sector_drawn_from_python")