100 filesDir =
"LatestRuns/Results/";
101 fileList =
ls(filesDir)
102 listOfRunsAndLumi = {};
104 if(
not listOfRunsAndLumi):
105 listOfRunsAndLumi =
getListOfRunsAndLumiFromFile(-1,
"/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions10/7TeV/StreamExpress/Cert_132440-149442_7TeV_StreamExpress_Collisions10_JSON_v3.txt");
107 runKeys = listOfRunsAndLumi.keys();
110 for fileName
in fileList:
111 regExp = re.search(
'(\D+)(\d+)_(\d+)_(\d+).txt',fileName);
113 error =
"Can't find reg exp";
115 runFiles.append(long(regExp.group(3)));
121 runsAndLumisInRR = {};
124 for lumiRange
in listOfRunsAndLumi[run]:
126 for l
in range(lumiRange[0],lumiRange[1]+1):
127 RRList.append(long(l));
129 runsAndLumisInRR[run] = RRList;
131 runsAndLumisProcessed = {}
132 for fileName
in fileList:
133 file = open(filesDir+fileName)
135 if line.find(
"Runnumber") != -1:
136 run = long(line.replace(
'\n',
'').
split(
' ')[1])
137 elif line.find(
"LumiRange") != -1:
138 lumiLine = line.replace(
'\n',
'').
split(
' ')
139 begLumi = long(lumiLine[1])
140 endLumi = long(lumiLine[3])
141 if begLumi != endLumi:
142 error =
"The lumi range is greater than 1 for run " + str(run) +
" " + line +
" in file: " + runListDir + fileName
145 if not run
in runsAndLumisProcessed:
146 runsAndLumisProcessed[run] = []
147 if begLumi
in runsAndLumisProcessed[run]:
148 print "Lumi " + str(begLumi) +
" in event " + str(run) +
" already exist. This MUST not happen but right now I will ignore this lumi!"
150 runsAndLumisProcessed[run].
append(begLumi)
156 for lumi
in runsAndLumisInRR[run]:
159 if(run
not in runFiles):
160 print "Can't find run", run,
"in the files!"
162 elif(
not lumi
in runsAndLumisProcessed[run]):
163 missingLumis.append(lumi)
164 if(len(missingLumis) != 0):
165 print "In run", run,
"these lumis are missing ->", missingLumis