8from ShipGeoConfig
import AttrDict
13 if "FAIRSHIP_HASH" in os.environ:
14 o.FairShip = os.environ[
"FAIRSHIP_HASH"]
15 o.FairRoot = os.environ[
"FAIRROOT_HASH"]
17 tmp = os.environ[
"FAIRSHIP"] +
"/.git/refs/remotes/origin/master"
18 if os.path.isfile(tmp):
19 x = subprocess.check_output([
"more", tmp]).replace(
"\n",
"")
21 tmp = os.environ[
"FAIRSHIP"] +
"/.git/refs/heads/master"
22 if os.path.isfile(tmp):
23 x = subprocess.check_output([
"more", tmp]).replace(
"\n",
"")
25 tmp = os.environ[
"FAIRROOTPATH"] +
"/../FairRoot/.git/refs/heads/dev"
26 if os.path.isfile(tmp):
27 x = subprocess.check_output([
"more", tmp]).replace(
"\n",
"")
29 tmp = os.environ[
"FAIRROOTPATH"] +
"/../FairRoot/.git/refs/heads/master"
30 if os.path.isfile(tmp):
31 x = subprocess.check_output([
"more", tmp]).replace(
"\n",
"")
37 """Save geometry configuration to ROOT file as JSON string"""
38 if isinstance(ox, str):
42 if isinstance(f, str):
43 fg = ROOT.TFile.Open(f,
"update")
48 json_str = o.dumps_json()
52 config_str = ROOT.std.string(json_str)
53 fg.WriteObject(config_str, name)
56 if isinstance(f, str):
def execute(f, ox, name="ShipGeo")