def METHOD_NAME(Run,PrimaryDataset,lsMin,lsMax,printLS=False):
    dbs_cmd = """ dbs search --query='find file,lumi,file.numevents, file.size
		where run=%d and dataset like /%s/*/RAW 
		and lumi >= %d and lumi <= %d
		and file.status=VALID '""" % (Run, PrimaryDataset,lsMin, lsMax)
    rows = subprocess.getoutput(dbs_cmd)
    lines = rows.split("\n")
    j=0
    LumiSections = []
    Files = []
    Evts = 0
    Size = 0
    LSinFile = {}
    NumberOfLSInFile = {}
    for Line in lines:
        j=j+1
        if j <=4:
            continue
        line=Line.split()
        LS = line[1]
        file = line[0]
        Nevts = int(line[2])
        size = int(line[3])
        LSinFile[LS] = file
        if LumiSections.count(LS) == 0:
            LumiSections.append(LS)
        if Files.count(file) == 0:
            Files.append(file)
            Evts += Nevts
            Size += size
            NumberOfLSInFile[file] =1
        else:
            NumberOfLSInFile[file] = NumberOfLSInFile[file]+1
        RatePerLS[LS] = Nevts
    Number_of_LS = len(LumiSections)
    LS_Length = 23.3
    if Run < 125100:
        LS_Length = 93.3
    rate = Evts / (Number_of_LS * LS_Length)
    if Evts > 0:
        size_per_event = (Size / Evts) / 1000.
    else:
        size_per_event=-1
    print("Rate in \t",PrimaryDataset,"\t is : \t",rate," Hz", " \t size is : \t",size_per_event, "kB / event ")
    lsmin=9999999
    lsmax=-1
    for (LS,file) in LSinFile.items():
        nls = NumberOfLSInFile[file]
        RatePerLS[LS] = RatePerLS[LS] / nls
        RatePerLS[LS] = RatePerLS[LS] / LS_Length
        if int(LS) > lsmax:
            lsmax=int(LS)
        if int(LS) < lsmin:
            lsmin=int(LS)
    if printLS:
        print("lsmin lsmax",lsmin,lsmax)
        for ls in range(lsmin,lsmax):
            if not repr(ls) in RatePerLS.keys():
                RatePerLS[LS] = 0
                print("Missing LS ",ls)