CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
findBadModT9 Namespace Reference

Functions

def findpr
 
def findse
 
def printall
 

Variables

tuple MyfilenamePR = findpr(options)
 
tuple MyfilenameSE = findse(options)
 
tuple Myprintall = printall()
 
tuple parser = OptionParser(usage)
 
string usage = "useage: %prog [options] "
 
 verbose = True
 

Function Documentation

def findBadModT9.findpr (   options)

Definition at line 11 of file findBadModT9.py.

References relativeConstraints.keys.

11 
12 def findpr(options):
13  BadModpr=open(options.filenamePR,'r')
14  bmpr=BadModpr.read()
15  mod="Module"
16  pcl="PCLBadModule"
17  sub="SubDetector"
18 
19 
20  prf = re.findall(r'(SubDetector.*?\n\n.*?)(?:\n+^$|\Z)',bmpr,re.MULTILINE|re.DOTALL)
21  prf =list(map(lambda x: re.split('\n+',x),prf))
22  findpr.prd={}
23  findpr.pralld={}
24  # create dictionaries
25  prfd={}
26 
27 
28  for k in prf:
29  for l in k[1:]:
30  n=re.split("\W+",l)
31  prfd[n[1]]=(l)
32  findpr.pralld[k[0]]=prfd
33  prfd={}
34 
35 
36  findpr.prd=copy.deepcopy(findpr.pralld)
37  #dictionary with pclbadmodules only
38 
39  for k in findpr.prd.keys():
40 
41  for l in findpr.prd[k].keys():
42  if pcl not in findpr.prd[k][l]:
43  findpr.prd[k].pop(l)
44 
45  #for k in findpr.pralld:
46  # print len(findpr.pralld[k])
47  return 0
def findBadModT9.findse (   options)

Definition at line 48 of file findBadModT9.py.

48 
49 def findse(options):
50  BadModse=open(options.filenameSE,'r')
51  bmse=BadModse.read()
52 
53  sub="SubDetector"
54 
55  sef = re.findall(r'(SubDetector.*?\n\n.*?)(?:\n+^$|\Z)',bmse,re.MULTILINE|re.DOTALL)
56  sef =list(map(lambda x: re.split('\n+',x),sef))
57  findse.sed={}
58 
59  sefd={}
60  for k in sef:
61  for l in k[1:]:
62  n=re.split("\W+",l)
63  sefd[n[1]]=(l)
64  findse.sed[k[0]]=sefd
65  sefd={}
66 
67 
68 
69  return 0
70 
71 
def findBadModT9.printall ( )

Definition at line 72 of file findBadModT9.py.

72 
73 def printall():
74  seFile=open('SEinPRBadMod.txt','w')
75  prFile=open('PCLBadMod.txt','w')
76  seFile.write("Bad Modules from stream express which are still bad in Prompt Reco\n\n")
77 
78  for x in findse.sed:
79  seFile.write("\n"+x+"\n\n")
80  for y in findse.sed[x]:
81  if y in findpr.pralld[x]:
82  seFile.write(findpr.pralld[x][y]+"\n")
83 
84 
85  prFile.write("Bad Modules from Prompt Reco (PCLBadModules) that are not bad in Stream Express\n\n")
86 
87  for x in findpr.prd:
88  prFile.write("\n"+x+"\n\n")
89  for y in findpr.prd[x]:
90 
91  if y not in findse.sed[x]:
92 
93  prFile.write(findpr.prd[x][y]+"\n")
94 
95  return 0
96 

Variable Documentation

tuple findBadModT9.MyfilenamePR = findpr(options)

Definition at line 108 of file findBadModT9.py.

tuple findBadModT9.MyfilenameSE = findse(options)

Definition at line 109 of file findBadModT9.py.

tuple findBadModT9.Myprintall = printall()

Definition at line 110 of file findBadModT9.py.

tuple findBadModT9.parser = OptionParser(usage)

Definition at line 101 of file findBadModT9.py.

string findBadModT9.usage = "useage: %prog [options] "

Definition at line 100 of file findBadModT9.py.

findBadModT9.verbose = True

Definition at line 99 of file findBadModT9.py.