49 def RateInPD(Run,PrimaryDataset,lsMin,lsMax,printLS=False):
50 dbs_cmd =
""" dbs search --query='find file,lumi,file.numevents, file.size 51 where run=%d and dataset like /%s/*/RAW 52 and lumi >= %d and lumi <= %d 53 and file.status=VALID '""" % (Run, PrimaryDataset,lsMin, lsMax)
54 rows = commands.getoutput(dbs_cmd)
55 lines = rows.split(
"\n")
73 if LumiSections.count(LS) == 0:
74 LumiSections.append(LS)
75 if Files.count(file) == 0:
79 NumberOfLSInFile[file] =1
81 NumberOfLSInFile[file] = NumberOfLSInFile[file]+1
84 Number_of_LS = len(LumiSections)
88 rate = Evts / (Number_of_LS * LS_Length)
90 size_per_event = (Size / Evts) / 1000.
93 print "Rate in \t",PrimaryDataset,
"\t is : \t",rate,
" Hz",
" \t size is : \t",size_per_event,
"kB / event " 97 for (LS,file)
in LSinFile.iteritems():
98 nls = NumberOfLSInFile[file]
99 RatePerLS[LS] = RatePerLS[LS] / nls
100 RatePerLS[LS] = RatePerLS[LS] / LS_Length
106 print "lsmin lsmax",lsmin,lsmax
107 for ls
in range(lsmin,lsmax):
108 if not repr(ls)
in RatePerLS.keys():
110 print "Missing LS ",ls
def RateInPD(Run, PrimaryDataset, lsMin, lsMax, printLS=False)