/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
RootIOTest::howBig::howBig Class Reference
Inheritance diagram for RootIOTest::howBig::howBig:
Inheritance graph
[legend]
Collaboration diagram for RootIOTest::howBig::howBig:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize
def process_path
def __init__
def initialize
def execute
def finalize
def verbose
def debug
def info
def warning
def error
def fatal
def getAES
def initializeHeader
def finalizeHeader

Public Attributes

 infileObj
 filename
 TotBytes
 ZipBytes
 names
 tbytes
 zbytes
 msgSvc
 archiveSvc
 stats
 defaultInputLocation
 execNumber
 currentJobId

Detailed Description

Definition at line 36 of file howBig.py.


Constructor & Destructor Documentation

def RootIOTest::howBig::howBig::__init__ (   self,
  name 
)

Definition at line 38 of file howBig.py.

00039                            :
00040 
00041         DybPythonAlg.__init__(self,name)
00042 
00043         return
00044 
    

Member Function Documentation

def RootIOTest::howBig::howBig::initialize (   self)

Definition at line 45 of file howBig.py.

00046                         :
00047         print "Initializing howBig: ", self.name()
00048         status = DybPythonAlg.initialize(self)
00049         if status.isFailure(): return status
00050 
00051         global printlevel, printunits, ufactor
00052 
00053         return SUCCESS

def RootIOTest::howBig::howBig::execute (   self)

Definition at line 54 of file howBig.py.

00055                      :
00056 
00057         return SUCCESS
    
def RootIOTest::howBig::howBig::finalize (   self)

Definition at line 58 of file howBig.py.

00059                       :
00060 
00061 
00062 # get TDir for input file
00063         self.infileObj = gbl.gDirectory
00064 
00065 # get filename of input file. append ":/" to use as path
00066 # Check on validity of filename
00067         self.filename = self.infileObj.GetName() 
00068         if self.filename.count( 'PyROOT' ) > 0 :
00069             print "\n ERROR  It looks like you did not read any events. You need to read at least one event for howBig to work ERROR  \n"
00070             return FAILURE 
00071 
00072         print "\n Contents of ",self.filename
00073         self.filename += ":/"
00074         self.TotBytes = 0
00075         self.ZipBytes = 0
00076         self.names = []
00077         self.tbytes = []
00078         self.zbytes = []
00079         self.process_path("")
00080         nt = self.TotBytes
00081         nz = self.ZipBytes
00082         if printlevel == 0  or printlevel == 1 :
00083             # print absolute and fractional size of each header, and totals.
00084             checknt = 0
00085             checknz = 0
00086             for name in self.names:
00087                 ix = self.names.index(name)
00088                 t  = self.tbytes[ix]
00089                 checknt += t
00090                 pt = -1
00091                 if nt>0 : pt = float(100.*t)/float(nt)
00092                 z  = self.zbytes[ix]
00093                 checknz += z
00094                 pz = -1
00095                 if nz>0 : pz = float(100.*z)/float(nz)
00096                 if printlevel == 1 :
00097                     print "{2:10.2f}{3:2s} {4:6.2f}{6:1s}(on disk) {1:10.2f}{3:2s} {5:6.2f}{6:1s}(uncompressed)  {0:30} ".format(name, t/ufactor, z/ufactor, printunits, pt, pz, "%")
00098         
00099             pt = -1
00100             if nt>0 : pt = float(100.*checknt)/float(nt)
00101             pz = -1
00102             if nz>0 : pz = float(100.*checknz)/float(nz)
00103             print "{2:10.2f}{3:2s} {4:6.2f}{6:1s}(on disk) {1:10.2f}{3:2s} {5:6.2f}{6:1s}(uncompressed)  {0:30} \n".format('TOTALS', t/ufactor, z/ufactor, printunits, pt, pz, "%")
00104             
00105 
00106         status = DybPythonAlg.finalize(self)
00107         return status

def RootIOTest::howBig::howBig::process_path (   self,
  itemPath 
)
process path in root file. cribbed from Dan 

Definition at line 108 of file howBig.py.

00109                                      :
00110         ''' process path in root file. cribbed from Dan '''
00111         #print " process_path: ",itemPath
00112 
00113         filePath  = self.filename
00114         if len(itemPath)>0 :
00115             filePath += "/" + itemPath
00116         content = self.infileObj.Get(filePath)
00117         if not content and itemPath=="":
00118             filePath += ":/"
00119             content = self.infileObj # self.infileObj.Get(filePath)
00120         if not content :
00121             print "Failed to get item at ",filePath
00122             return
00123         if content.IsA().InheritsFrom("TTree") :
00124             name = content.GetName()
00125             self.names.append(name)
00126 
00127             nt   = content.GetTotBytes()
00128             self.tbytes.append(nt)
00129             self.TotBytes += nt
00130 
00131             nz   = content.GetZipBytes()
00132             self.zbytes.append(nz)
00133             self.ZipBytes += nz
00134 
00135             if printlevel > 1 : 
00136                 content.Print()
00137 
00138 
00139         elif content.IsA().InheritsFrom("TDirectory") :
00140             keylist = content.GetListOfKeys()
00141             for key in keylist :
00142                 dirItem = key.ReadObj()
00143                 dirItemPath = None
00144                 if len(itemPath)>0:
00145                     dirItemPath = itemPath + "/" + dirItem.GetName()
00146                 else :
00147                     dirItemPath = dirItem.GetName()
00148                 self.process_path( dirItemPath )
00149         else:
00150             print "Not processing",filePath,"of type",content.ClassName()
00151 
00152         
00153         return 


Member Data Documentation

Definition at line 58 of file howBig.py.

Definition at line 59 of file howBig.py.

Definition at line 59 of file howBig.py.

Definition at line 59 of file howBig.py.

Definition at line 59 of file howBig.py.

Definition at line 59 of file howBig.py.

Definition at line 59 of file howBig.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 10:20:12 for RootIOTest by doxygen 1.7.4