All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
python.stagestatus.StageStatus Class Reference

Public Member Functions

def __init__
 
def update
 

Public Attributes

 stage
 
 exists
 
 nfile
 
 nev
 
 nana
 
 nerror
 
 nmiss
 

Detailed Description

Definition at line 21 of file stagestatus.py.

Constructor & Destructor Documentation

def python.stagestatus.StageStatus.__init__ (   self,
  stage 
)

Definition at line 25 of file stagestatus.py.

25 
26  def __init__(self, stage):
27 
28  # Default values.
29 
30  self.stage = stage # Stage name.
31  self.exists = False # Does bookdir exist?
32  self.nfile = 0 # Number of good art files.
33  self.nev = 0 # Number of good art events.
34  self.nana = 0 # Number of good non-art root files.
35  self.nerror = 0 # Number of workers with errors.
36  self.nmiss = 0 # Number of unprocessed input files.
37 
38  # Update data.
39 
40  self.update()

Member Function Documentation

def python.stagestatus.StageStatus.update (   self)

Definition at line 43 of file stagestatus.py.

43 
44  def update(self):
45 
46  bookdir = self.stage.bookdir
47 
48  # Test whether output directory exists.
49 
50  if larbatch_posix.exists(bookdir):
51 
52  # Output directory exists.
53 
54  self.exists = True
55  self.nfile = 0
56  self.nev = 0
57  self.nana = 0
58  self.nerror = 0
59  self.nmiss = 0
60 
61  # Count good files and events.
62 
63  eventsfile = os.path.join(bookdir, 'events.list')
64  if larbatch_posix.exists(eventsfile):
65  lines = larbatch_posix.readlines(eventsfile)
66  for line in lines:
67  words = line.split()
68  if len(words) >= 2:
69  self.nfile = self.nfile + 1
70  self.nev = self.nev + int(words[1])
71 
72  # Count good files analysis root files.
73 
74  filesana = os.path.join(bookdir, 'filesana.list')
75  if larbatch_posix.exists(filesana):
76  lines = larbatch_posix.readlines(filesana)
77  for line in lines:
78  self.nana = self.nana + 1
79 
80  # Count errors.
81 
82  badfile = os.path.join(bookdir, 'bad.list')
83  if larbatch_posix.exists(badfile):
84  lines = larbatch_posix.readlines(badfile)
85  for line in lines:
86  if line.strip():
87  self.nerror += 1
88 
89  # Count missing files.
90 
91  missingfile = os.path.join(bookdir, 'missing_files.list')
92  if larbatch_posix.exists(missingfile):
93  lines = larbatch_posix.readlines(missingfile)
94  for line in lines:
95  if line.strip():
96  self.nmiss += 1
97 
98  else:
99 
100  # Output directory does not exist.
101 
102  self.exists = False
103 

Member Data Documentation

python.stagestatus.StageStatus.exists

Definition at line 30 of file stagestatus.py.

python.stagestatus.StageStatus.nana

Definition at line 33 of file stagestatus.py.

python.stagestatus.StageStatus.nerror

Definition at line 34 of file stagestatus.py.

python.stagestatus.StageStatus.nev

Definition at line 32 of file stagestatus.py.

python.stagestatus.StageStatus.nfile

Definition at line 31 of file stagestatus.py.

python.stagestatus.StageStatus.nmiss

Definition at line 35 of file stagestatus.py.

python.stagestatus.StageStatus.stage

Definition at line 29 of file stagestatus.py.


The documentation for this class was generated from the following file: