/search.css" rel="stylesheet" type="text/css"/> /search.js">
Functions | |
def | do_file |
def | start |
def | configure |
def DetHelpers::det_locate::do_file | ( | det, | |
filename | |||
) |
Definition at line 12 of file det_locate.py.
00013 : 00014 import ROOT 00015 zero = ROOT.Math.XYZPoint(0,0,0) 00016 xdir = ROOT.Math.XYZPoint(1,0,0) 00017 ydir = ROOT.Math.XYZPoint(0,1,0) 00018 zdir = ROOT.Math.XYZPoint(0,0,1) 00019 00020 import GaudiKernel.SystemOfUnits as units 00021 00022 fp = open(filename) 00023 coord = None 00024 00025 for line in fp.readlines(): 00026 line = line.strip() 00027 if not line: 00028 print 00029 continue 00030 if line[0] == '#': continue 00031 00032 #print 'Getting detector element: "%s"' % line 00033 de = det[line] 00034 if coord is None: 00035 coord = de 00036 print 'Using %s for coordinate system' % coord.name() 00037 gzero = de.geometry().toGlobal(zero) 00038 gxdir = de.geometry().toGlobal(xdir) 00039 gdx = [] 00040 gdx.append(gxdir.X()-gzero.X()) 00041 gdx.append(gxdir.Y()-gzero.Y()) 00042 gdx.append(gxdir.Z()-gzero.Z()) 00043 print "X-axis points to global direction (%6.3f %6.3f %6.3f)" % (gdx[0], gdx[1], gdx[2]) 00044 continue 00045 00046 ident = 0 00047 params = de.params() 00048 if params.exists("DetectorID"): 00049 ident = params.paramAsInt("DetectorID") 00050 if params.exists("PmtID"): 00051 ident = params.paramAsInt("PmtID") 00052 if params.exists("RpcID"): 00053 ident = params.paramAsInt("RpcID") 00054 00055 00056 gpoint = de.geometry().toGlobal(zero) 00057 00058 lpoint = coord.geometry().toLocal(gpoint) 00059 print "%7.2fm %7.2fm %7.2fm %s, (0x%x)" % \ 00060 (lpoint.X()/units.meter, lpoint.Y()/units.meter, lpoint.Z()/units.meter, line, ident) 00061 continue 00062 return
def DetHelpers::det_locate::start | ( | app, | |
args | |||
) |
Definition at line 63 of file det_locate.py.
def DetHelpers::det_locate::configure | ( | argv = None | ) |
Definition at line 71 of file det_locate.py.