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

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize
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

 msgSvc
 archiveSvc
 stats
 defaultInputLocation
 execNumber
 currentJobId

Detailed Description

Definition at line 50 of file hdrValid.py.


Constructor & Destructor Documentation

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

Definition at line 52 of file hdrValid.py.

00053                            :
00054 
00055         DybPythonAlg.__init__(self,name)
00056         return
00057 
    

Member Function Documentation

def RootIOTest::hdrValid::hdrValid::initialize (   self)

Definition at line 58 of file hdrValid.py.

00059                         :
00060         print "Initializing ", self.name()
00061         status = DybPythonAlg.initialize(self)
00062         if status.isFailure(): return status
00063         global debuglevel, filetype, userTrees, keepgoing, expected
00064         dbglvl = int( debuglevel )
00065 
00066         if dbglvl>0: print self.name()," filetype",filetype
00067 
00068         # compose treename from base and trees given input filetype
00069         # OR create an empty treename and ignore trees in input file(s)
00070         # OR given trees by user on command line
00071         base = '/Event'
00072         if userTrees is None :
00073             if filetype.lower() == 'premix' :
00074                 trees= ['Gen','Sim','SimReadout']
00075             elif filetype.lower() ==  'mixed' :
00076                 trees= ['Gen','Sim','Readout']
00077             elif (filetype.lower() == 'none') or (filetype.lower() == 'ignore'):
00078                 trees = []
00079             else:
00080                 print self.name()," ERROR. Invalid input file type",filetype
00081                 return FAILURE
00082         else:
00083             ''' User specified trees take precedence '''
00084             trees = userTrees
00085             if dbglvl>0: print self.name()," userTrees=",userTrees
00086 
00087         path = []
00088         for tree in trees:
00089             path.append(base + '/' + tree + '/' + tree + 'Header')
00090 
00091         if dbglvl>1: print self.name(),"path",path
00092 
00093         # get input streams
00094         streams = nuwa.opts.input_streams
00095         
00096         # make sure that # of executions in nuwa.py line is "-n -1" iff
00097         # we expect a certain number of executions
00098         if expected>-1 :
00099             if nuwa.opts.executions == -1 :
00100                 pass
00101             else:
00102                 print self.name(),"WARNING You expect",expected,"execution cycles in input file,",\
00103                     " but you specified `-n",nuwa.opts.executions,"` instead of `-n -1`"
00104         
00105         if dbglvl>1: 
00106             print self.name(),"streams",streams
00107 
00108         RootInputFile = gbl.RootInputFile
00109 
00110         nBad = 0
00111         nFiles = 0
00112 
00113         for key in streams :
00114             if dbglvl>0 : print self.name(),"key",key,"has",len(streams[key]),"entries"
00115             for fname in streams[key]:
00116                 if dbglvl>0 : print "fname",fname
00117                 nFiles += 1
00118                 for treename in path: 
00119                     branchname = treename.strip(base).replace("/","_")
00120                     istat = RootInputFile.TestForObject(fname,treename, branchname)
00121                     if dbglvl> 0: print "treename, branchname, ClassID",treename,branchname,istat
00122                     if istat == 0 :
00123                         print self.name(),"FATAL ERROR in hdrValid. File",fname,\
00124                             "\n",self.name(),"ERROR in hdrValid tree",treename,"branch",branchname
00125                         nBad += 1
00126                         if not keepgoing : 
00127                             return FAILURE
00128 
00129         if expected>-1 and nFiles>1 :
00130             print self.name(),"WARNING Have",nFiles,"input files. You claim there are",expected,\
00131                 "execution cycles for the job, not the file. Is this what you want?"
00132 
00133         if nBad == 0:
00134             print self.name(),"SUCCESS judges all",nFiles,"input files OK"
00135         else:
00136             print self.name(),"FATAL ERROR Found",nBad,"files with invalid header in a total of",nFiles,"files"
00137             return FAILURE
00138 
00139         return SUCCESS
00140 

def RootIOTest::hdrValid::hdrValid::execute (   self)

Definition at line 141 of file hdrValid.py.

00142                      :
00143 
00144         # ensure that we're dealing with an integer as the debug flag
00145         global debuglevel, nExec
00146         dbglvl = int( debuglevel )
00147 
00148 
00149         nExec += 1
00150         if dbglvl>0 : 
00151             if (nExec <= 10) or (nExec <=100 and nExec%10 == 0) or (nExec <=1000 and nExec%100 == 0) or (nExec<=10000 and nExec%1000 == 0) or (nExec%10000 == 0) :
00152                 print self.name(),"execute() nExec=",nExec
00153         return SUCCESS
    
def RootIOTest::hdrValid::hdrValid::finalize (   self)

Definition at line 154 of file hdrValid.py.

00155                       :
00156         global debuglevel, filetype, userTrees, keepgoing, expected, nExec
00157         status = DybPythonAlg.finalize(self)
00158 
00159         print self.name()," Observed",nExec,"execution cycles"
00160         if expected > -1 :
00161             print "Finalizing ", self.name()
00162             if nExec == expected :
00163                 print self.name(),"SUCCESS Observed number of executions",nExec,"is equal to expectation"
00164             else:
00165                 print self.name(),"FATAL Observed number of executions",nExec,"is NOT equal to expectation",expected
00166                 if nuwa.opts.executions is not -1:print self.name(),\
00167                         "This FATAL ERROR is not surprising because you specified `nuwa.py -n",nuwa.opts.executions,\
00168                         "` instead of `-n -1`"
00169                 return FAILURE
00170         return status


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