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 |
Public Attributes | |
infileObj | |
filename | |
TotBytes | |
ZipBytes | |
msgSvc | |
archiveSvc | |
stats |
Definition at line 36 of file howBig.py.
def RootIOTest::howBig::howBig::__init__ | ( | self, | ||
name | ||||
) |
Definition at line 38 of file howBig.py.
00038 : 00039 00040 DybPythonAlg.__init__(self,name) 00041 00042 return 00043 00044 def initialize(self):
def RootIOTest::howBig::howBig::initialize | ( | self | ) |
def RootIOTest::howBig::howBig::execute | ( | self | ) |
def RootIOTest::howBig::howBig::finalize | ( | self | ) |
Definition at line 58 of file howBig.py.
00058 : 00059 00060 00061 # get TDir for input file 00062 self.infileObj = gbl.gDirectory 00063 00064 # get filename of input file. append ":/" to use as path 00065 # Check on validity of filename 00066 self.filename = self.infileObj.GetName() 00067 if self.filename.count( 'PyROOT' ) > 0 : 00068 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" 00069 return FAILURE 00070 00071 print "\n Contents of ",self.filename 00072 self.filename += ":/" 00073 self.TotBytes = 0 00074 self.ZipBytes = 0 00075 self.process_path("") 00076 nt = self.TotBytes 00077 nz = self.ZipBytes 00078 if printlevel == 0 or printlevel == 1 : 00079 print "{2:10.2f}MB(on disk) {1:10.2f}MB(uncompressed) {0:30} \n".format( 'TOTALS', nt/1e6, nz/1e6 ) 00080 00081 00082 status = DybPythonAlg.finalize(self) 00083 return status 00084 def process_path(self, itemPath) :
def RootIOTest::howBig::howBig::process_path | ( | self, | ||
itemPath | ||||
) |
Definition at line 85 of file howBig.py.
00085 : 00086 ''' process path in root file. cribbed from Dan ''' 00087 #print " process_path: ",itemPath 00088 00089 filePath = self.filename 00090 if len(itemPath)>0 : 00091 filePath += "/" + itemPath 00092 content = self.infileObj.Get(filePath) 00093 if not content and itemPath=="": 00094 filePath += ":/" 00095 content = self.infileObj # self.infileObj.Get(filePath) 00096 if not content : 00097 print "Failed to get item at ",filePath 00098 return 00099 if content.IsA().InheritsFrom("TTree") : 00100 name = content.GetName() 00101 nt = content.GetTotBytes() 00102 self.TotBytes += nt 00103 nz = content.GetZipBytes() 00104 self.ZipBytes += nz 00105 if printlevel > 1 : 00106 content.Print() 00107 if printlevel == 1 : 00108 print "{2:10.2f}MB(on disk) {1:10.2f}MB(uncompressed) {0:30}".format( name, nt/1e6, nz/1e6 ) 00109 00110 elif content.IsA().InheritsFrom("TDirectory") : 00111 keylist = content.GetListOfKeys() 00112 for key in keylist : 00113 dirItem = key.ReadObj() 00114 dirItemPath = None 00115 if len(itemPath)>0: 00116 dirItemPath = itemPath + "/" + dirItem.GetName() 00117 else : 00118 dirItemPath = dirItem.GetName() 00119 self.process_path( dirItemPath ) 00120 else: 00121 print "Not processing",filePath,"of type",content.ClassName() 00122 00123 00124 return 00125 def configure(argv=[]) : #None) :