8 from optparse
import OptionParser
12 BadModpr=open(options.filenamePR,
'r')
19 prf = re.findall(
r'(SubDetector.*?\n\n.*?)(?:\n+^$|\Z)',bmpr,re.MULTILINE|re.DOTALL)
20 prf =list(
map(
lambda x: re.split(
'\n+',x),prf))
31 findpr.pralld[k[0]]=prfd
35 findpr.prd=copy.deepcopy(findpr.pralld)
38 for k
in findpr.prd.keys():
40 for l
in findpr.prd[k].
keys():
41 if pcl
not in findpr.prd[k][l]:
49 BadModse=open(options.filenameSE,
'r')
54 sef = re.findall(
r'(SubDetector.*?\n\n.*?)(?:\n+^$|\Z)',bmse,re.MULTILINE|re.DOTALL)
55 sef =list(
map(
lambda x: re.split(
'\n+',x),sef))
73 seFile=open(
'SEinPRBadMod.txt',
'w')
74 prFile=open(
'PCLBadMod.txt',
'w')
75 seFile.write(
"Bad Modules from stream express which are still bad in Prompt Reco\n\n")
78 seFile.write(
"\n"+x+
"\n\n")
79 for y
in findse.sed[x]:
80 if y
in findpr.pralld[x]:
81 seFile.write(findpr.pralld[x][y]+
"\n")
84 prFile.write(
"Bad Modules from Prompt Reco (PCLBadModules) that are not bad in Stream Express\n\n")
87 prFile.write(
"\n"+x+
"\n\n")
88 for y
in findpr.prd[x]:
90 if y
not in findse.sed[x]:
92 prFile.write(findpr.prd[x][y]+
"\n")
98 if __name__ ==
"__main__":
100 usage =
"useage: %prog [options] "
101 parser = OptionParser(usage)
102 parser.set_defaults(mode=
"advanced")
103 parser.add_option(
"-p",
"--filePR", type=
"string", dest=
"filenamePR", help=
"Get the name of the Prompt Reco file")
104 parser.add_option(
"-s",
"--fileSE", type=
"string", dest=
"filenameSE", help=
"Get the name of the Stream Express file")
106 (options, args) = parser.parse_args()