FairShip
Loading...
Searching...
No Matches
checkZpositions.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
7from ShipGeoConfig import load_from_root_file
8
9badBoys = {}
10f1, f2 = sys.argv[1], sys.argv[2]
11fgeoOld = ROOT.TFile(f1)
12ShipGeoOld = load_from_root_file(fgeoOld, "ShipGeo")
13fgeoNew = ROOT.TFile(f2)
14ShipGeoNew = load_from_root_file(fgeoNew, "ShipGeo")
15for x in ShipGeoNew:
16 if hasattr(eval("ShipGeoNew." + x), "z"):
17 zold, znew = eval("ShipGeoOld." + x + ".z"), eval("ShipGeoNew." + x + ".z")
18 print(x, "z=", znew, " old:", zold)
19 if zold != znew:
20 badBoys[x] = [znew, zold]
21if len(badBoys) > 0:
22 print("following differences detected:")
23for x in badBoys:
24 print(x, badBoys[x])