51 def RateInPD(Run,PrimaryDataset,lsMin,lsMax,printLS=False):
52 dbs_cmd =
""" dbs search --query='find file,lumi,file.numevents, file.size 53 where run=%d and dataset like /%s/*/RAW 54 and lumi >= %d and lumi <= %d 55 and file.status=VALID '""" % (Run, PrimaryDataset,lsMin, lsMax)
56 rows = commands.getoutput(dbs_cmd)
57 lines = rows.split(
"\n")
75 if LumiSections.count(LS) == 0:
76 LumiSections.append(LS)
77 if Files.count(file) == 0:
81 NumberOfLSInFile[file] =1
83 NumberOfLSInFile[file] = NumberOfLSInFile[file]+1
86 Number_of_LS = len(LumiSections)
90 rate = Evts / (Number_of_LS * LS_Length)
92 size_per_event = (Size / Evts) / 1000.
95 print(
"Rate in \t",PrimaryDataset,
"\t is : \t",rate,
" Hz",
" \t size is : \t",size_per_event,
"kB / event ")
99 for (LS,file)
in six.iteritems(LSinFile):
100 nls = NumberOfLSInFile[file]
101 RatePerLS[LS] = RatePerLS[LS] / nls
102 RatePerLS[LS] = RatePerLS[LS] / LS_Length
108 print(
"lsmin lsmax",lsmin,lsmax)
109 for ls
in range(lsmin,lsmax):
110 if not repr(ls)
in RatePerLS.keys():
112 print(
"Missing LS ",ls)
def RateInPD(Run, PrimaryDataset, lsMin, lsMax, printLS=False)
S & print(S &os, JobReport::InputFile const &f)