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

In This Package:

Functions
XmlDetDesc::dumper Namespace Reference

Functions

def dress_idatasvc
def detsvc
def dump

Function Documentation

def XmlDetDesc::dumper::dress_idatasvc ( )

Definition at line 6 of file dumper.py.

00007                     :
00008     import GaudiPython as gaudi
00009 
00010     def _dir_ ( self , node = None , level = -1 ) :
00011         """
00012         The simple tool to perform the inspection fo Data Store
00013         
00014         Usage:
00015         
00016         evtSvc = gaudi.evtSvc()
00017         evtSvc.dir('MC')
00018         data = evtSvc['Rec/Calo']
00019         evtSvc.dir( data)
00020         
00021         """
00022         if 0 == level          : return gaudi.SUCCESS ;
00023         if   str is type(node) : node = self.retrieveObject( node )
00024         elif  not node         : return self.dir('', level )
00025         if not node            : return gaudi.FAILURE
00026         if     hasattr ( node , 'registry'   ) : node = node.registry()
00027         if     hasattr ( node , 'identifier' ) :
00028             obj = node.object ()
00029             if not obj :
00030                 obj = self.retrieveObject( node.identifier() ) 
00031                 print  node.identifier()
00032                 pass
00033             else :
00034                 if hasattr( obj , 'size'    ) :
00035                     size = obj.size()
00036                     if 0 == size : print "%s (empty) %s" % (  node.identifier() , type( obj ) )
00037                     elif hasattr ( obj , 'containedObjects' ) :
00038                         c = obj.containedObjects()[0]
00039                         print "%s container of %d %s objects " % ( node.identifier() , obj.size() , type(c))
00040                         pass
00041                     else : 
00042                         print  "%s %s " % (  node.identifier() , type( node.object()) )
00043                         pass
00044                 else :
00045                     print  "%s %s " % (  node.identifier() , type( node.object()) )
00046                     pass
00047         else : print "The node has no 'identifier'"
00048         # start the recursion 
00049         for l in self.leaves( node ) :
00050             if l : self.dir( l , level - 1 )  
00051             continue
00052         return gaudi.SUCCESS 
00053         
00054     def _get_( self , node = None , cut = lambda x : True ) :
00055         if   str is type(node) : node = self.retrieveObject( node )
00056         elif  not node         : return _get_( self , '' , cut  )
00057         if not node            : return []
00058         if     hasattr ( node , 'registry'   ) : node = node.registry()
00059         result = []
00060         if     hasattr ( node , 'identifier' ) :
00061             obj = node.object()
00062             if cut( obj ) : result += [ obj ]
00063             pass
00064         for l in self.leaves ( node ) :
00065             if l : result += _get_( self , l , cut )
00066             continue
00067         return result 
00068     
00069     gaudi.iDataSvc.dir = _dir_ 
00070     gaudi.iDataSvc.DIR = _get_ 
00071 

def XmlDetDesc::dumper::detsvc ( )

Definition at line 72 of file dumper.py.

00073             :
00074     dress_idatasvc()
00075     import GaudiPython as gp
00076     g = gp.AppMgr()
00077     dsv = g.detSvc()
00078     return dsv  

def XmlDetDesc::dumper::dump ( )

Definition at line 79 of file dumper.py.

00080           :
00081     dress_idatasvc()
00082     import GaudiPython as gaudi
00083     app = gaudi.AppMgr()
00084     det = app.detSvc()
00085     det.dir("/dd")
00086     det.dump()
00087 
00088     return

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:07 for XmlDetDesc by doxygen 1.7.4