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

In This Package:

dump Namespace Reference


Functions

def init
def _dir_
def _get_

Variables

list loc = sys.argv[1]
string loc = '/home/bviren/work/dayabay/code/dddb/dayabay.xml'
tuple g = gaudi.AppMgr()
tuple det = g.detSvc()

Function Documentation

def dump::init (   loc  ) 

Definition at line 7 of file dump.py.

00007               :
00008 
00009     #gaudi.loaddict('DetDict')
00010     g=gaudi.AppMgr()
00011     #g.DLLs   += [ "XmlTools"   , "DetDescCnv"    ,
00012     #              "DetDescSvc" , "DetDescChecks" , "RootHistCnv" ]
00013 
00014     ##g.HistogramPersistency = "ROOT"
00015     ##g.config()
00016 
00017     ##hsvc = g.service('HistogramPersistencySvc')
00018     ##hsvc.OutputFile = "test.root"
00019 
00020 
00021     ##g.DLLs += [ "RootHistCnv" ]
00022     g.ExtSvc += [ "XmlCnvSvc" , "XmlParserSvc" ] 
00023     g.EvtSel = "NONE"
00024     
00025     det = g.service('DetectorPersistencySvc')
00026     det.CnvServices = ["XmlCnvSvc"]
00027 
00028     det = g.service('XmlCnvSvc')
00029     det.AllowGenericConversion = True
00030 
00031     #XmlParserSvc = g.service('XmlParserSvc')
00032     #XmlParserSvc.EntityResolverSvc = "CondDBEntityResolverSvc"
00033 
00034     det = g.service('DetectorDataSvc')
00035     det.UsePersistency = True
00036     det.DetDbRootName  = "dd"
00037     det.DetStorageType = 7
00038     #det.DetDbLocation  = '/home/bviren/work/dayabay/code/lhcb/Det/XmlDDDB/DDDB/lhcb.xml'
00039     #det.DetDbLocation  = '/home/bviren/work/dayabay/code/dddb/dayabay.xml'
00040     det.DetDbLocation  = loc
00041     
def _dir_ ( self , node = None , level = -1 ) :

def dump::_dir_ (   self,
  node = None,
  level = -1 
) [private]

The simple tool to perform the inspection fo Data Store

Usage:

evtSvc = gaudi.evtSvc()
evtSvc.dir('MC')
data = evtSvc['Rec/Calo']
evtSvc.dir( data)

Definition at line 42 of file dump.py.

00042                                               :
00043     """
00044     The simple tool to perform the inspection fo Data Store
00045     
00046     Usage:
00047     
00048     evtSvc = gaudi.evtSvc()
00049     evtSvc.dir('MC')
00050     data = evtSvc['Rec/Calo']
00051     evtSvc.dir( data)
00052     
00053     """
00054     if 0 == level          : return gaudi.SUCCESS ;
00055     if   str is type(node) : node = self.retrieveObject( node )
00056     elif  not node         : return self.dir('', level )
00057     if not node            : return gaudi.FAILURE
00058     if     hasattr ( node , 'registry'   ) : node = node.registry()
00059     if     hasattr ( node , 'identifier' ) :
00060         obj = node.object ()
00061         if not obj :
00062             obj = self.retrieveObject( node.identifier() ) 
00063             print  node.identifier()
00064         else :
00065             if hasattr( obj , 'size'    ) :
00066                 size = obj.size()
00067                 if 0 == size : print "%s (empty) %s" % (  node.identifier() , type( obj ) )
00068                 elif hasattr ( obj , 'containedObjects' ) :
00069                     c = obj.containedObjects()[0]
00070                     print "%s container of %d %s objects " % ( node.identifier() , obj.size() , type(c))
00071                 else : 
00072                     print  "%s %s " % (  node.identifier() , type( node.object()) )
00073             else :
00074                 print  "%s %s " % (  node.identifier() , type( node.object()) )
00075     else : print "The node has no 'identifier'"
00076     # start the recursion 
00077     for l in self.leaves( node ) :
00078         if l : self.dir( l , level - 1 )  
00079     return gaudi.SUCCESS 
00080 
def _get_( self , node = None , cut = lambda x : True ) :

def dump::_get_ (   self,
  node = None,
  cut = lambda x : True 
) [private]

Definition at line 81 of file dump.py.

00081                                                : True ) :
00082     if   str is type(node) : node = self.retrieveObject( node )
00083     elif  not node         : return _get_( self , '' , cut  )
00084     if not node            : return []
00085     if     hasattr ( node , 'registry'   ) : node = node.registry()
00086     result = []
00087     if     hasattr ( node , 'identifier' ) :
00088         obj = node.object()
00089         if cut( obj ) : result += [ obj ]
00090     for l in self.leaves ( node ) :
00091         if l : result += _get_( self , l , cut )
00092     return result 
00093     
00094 gaudi.iDataSvc.dir = _dir_ 
00095 gaudi.iDataSvc.DIR = _get_ 
00096 
00097 
00098 


Variable Documentation

list dump::loc = sys.argv[1] [static]

Definition at line 103 of file dump.py.

string dump::loc = '/home/bviren/work/dayabay/code/dddb/dayabay.xml' [static]

Definition at line 105 of file dump.py.

tuple dump::g = gaudi.AppMgr() [static]

Definition at line 109 of file dump.py.

tuple dump::det = g.detSvc() [static]

Definition at line 110 of file dump.py.

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

Generated on Mon Apr 11 20:05:14 2011 for DetDescChecks by doxygen 1.4.7