/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
DetHelpers::TestCoordSysSvc::TesterAlg Class Reference
Inheritance diagram for DetHelpers::TestCoordSysSvc::TesterAlg:
Inheritance graph
[legend]
Collaboration diagram for DetHelpers::TestCoordSysSvc::TesterAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def do_point

Public Attributes

 npoints
 target_de_name
 css
 ExecuteOnce

Detailed Description

Definition at line 6 of file TestCoordSysSvc.py.


Constructor & Destructor Documentation

def DetHelpers::TestCoordSysSvc::TesterAlg::__init__ (   self,
  myname,
  npoints,
  target_de_name 
)

Definition at line 8 of file TestCoordSysSvc.py.

00009                                                     :
00010         GaudiAlgo.__init__(self,myname)
00011         self.npoints = npoints
00012         self.target_de_name = target_de_name
00013         return


Member Function Documentation

def DetHelpers::TestCoordSysSvc::TesterAlg::initialize (   self)

Definition at line 14 of file TestCoordSysSvc.py.

00015                         :
00016         sc = GaudiAlgo.initialize(self)
00017         if sc.isFailure(): 
00018             print 'Failed to initialize GaudiAlgo base class'
00019             return sc
00020         self.css = self.svc('ICoordSysSvc','CoordSysSvc')
00021         if not self.css: 
00022             print 'Failed to get CoordSysSvc'
00023             return FAILURE
00024         self.ExecuteOnce = True
00025         return sc;

def DetHelpers::TestCoordSysSvc::TesterAlg::execute (   self)

Definition at line 26 of file TestCoordSysSvc.py.

00027                      :
00028 
00029         import GaudiKernel.SystemOfUnits as units
00030 
00031         import time
00032         start = time.time()
00033         for x in range(0,self.npoints):
00034             print x
00035             for y in range(0,self.npoints):
00036                 for z in range(0,self.npoints):
00037                     pt = [x*units.mm,y*units.mm,z*units.mm]
00038                     self.do_point(pt)
00039                     if x+y+z == 0: first = time.time()
00040                     continue
00041                 continue
00042             continue
00043         stop = time.time()
00044 
00045         print "\nFirst in %f seconds, remaining %d points in %f seconds"%\
00046             (first-start,pow(self.npoints,3)-1,stop-first)
00047         
00048 
00049         return SUCCESS

def DetHelpers::TestCoordSysSvc::TesterAlg::do_point (   self,
  pt 
)

Definition at line 50 of file TestCoordSysSvc.py.

00051                          :
00052 
00053 
00054         # Get underlying DE object
00055         de = self.getDet(self.target_de_name)
00056         if not de:
00057             print 'Failed to get DE',self.target_de_name
00058             return FAILURE
00059 
00060         # Make a point at the center of the target DE
00061         import PyCintex
00062         Gaudi = PyCintex.makeNamespace('Gaudi')
00063         point = Gaudi.XYZPoint(pt[0],pt[1],pt[2])
00064         gpoint = de.geometry().toGlobal(point)
00065         
00066         # Sanity check
00067         btde = self.css.belongsToDE(gpoint)
00068         while btde:
00069             if btde.name() != de.name(): break
00070             btde = btde.parentIDetectorElement()
00071             continue
00072         if not btde:
00073             print 'Bogus: center of target DE is not in target DE',\
00074                 self.target_de_name
00075             return FAILURE
00076                 
00077         # Find coord system
00078         csde = self.css.coordSysDE(gpoint)
00079         if not csde:
00080             print 'Failed to find coordinate system DE for '\
00081                 '[',gpoint.x(),gpoint.y(),gpoint.z(),']'
00082             return FAILURE
00083 
00084         #print 'Found coordinate system DE for target',self.target_de_name,\
00085         #    'as:',csde.name()
00086                     
00087         return SUCCESS


Member Data Documentation

Definition at line 8 of file TestCoordSysSvc.py.

Definition at line 8 of file TestCoordSysSvc.py.

Definition at line 14 of file TestCoordSysSvc.py.

Definition at line 14 of file TestCoordSysSvc.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:27 for DetHelpers by doxygen 1.7.4