FairShip
Loading...
Searching...
No Matches
inspectGeant4Geo.py
Go to the documentation of this file.
1# SPDX-License-Identifier: LGPL-3.0-or-later
2# SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP Collaboration
3
4import sys
5
6import ROOT
7import shipRoot_conf
8from ShipGeoConfig import load_from_root_file
9
11
12fname = "geofile_full.10.0.Pythia8-TGeant4.root"
13if len(sys.argv) > 1:
14 fname = sys.argv[1]
15
16fgeo = ROOT.TFile(fname)
17sGeo = fgeo.Get("FAIRGeom")
18import shipDet_conf
19
20run = ROOT.FairRunSim()
21ShipGeo = load_from_root_file(fgeo, "ShipGeo")
22modules = shipDet_conf.configure(run, ShipGeo)
23run.SetUserConfig("g4Config.C")
24run.SetName("TGeant4")
25import tempfile
26
27sink = ROOT.FairRootFileSink(tempfile.mktemp(suffix=".root"))
28run.SetSink(sink)
29ROOT.SetOwnership(sink, False) # C++ FairRun takes ownership
30run.Init()
31run.Run(0)
32import geomGeant4
33
None printWeightsandFields(bool onlyWithField=True, exclude=None)
None printVMCFields()
configure(run, ship_geo, str|None geofile=None)
None configure(darkphoton=None)