SND@LHC Software
Loading...
Searching...
No Matches
checkZpositions.py
Go to the documentation of this file.
1from __future__ import print_function
2import ROOT,sys
3from rootpyPickler import Unpickler
4badBoys={}
5f1,f2 = sys.argv[1], sys.argv[2]
6fgeoOld=ROOT.TFile(f1)
7upkl = Unpickler(fgeoOld)
8ShipGeoOld = upkl.load('ShipGeo')
9fgeoNew=ROOT.TFile(f2)
10upkl = Unpickler(fgeoNew)
11ShipGeoNew = upkl.load('ShipGeo')
12for x in ShipGeoNew:
13 if hasattr(eval('ShipGeoNew.'+x),'z'):
14 zold,znew = eval('ShipGeoOld.'+x+'.z'),eval('ShipGeoNew.'+x+'.z')
15 print(x,'z=',znew, ' old:', zold)
16 if zold!=znew: badBoys[x]=[znew,zold]
17if len(badBoys)>0: print("following differences detected:")
18for x in badBoys:
19 print(x,badBoys[x])
20