コード例 #1
0
    def makePlots(n, r, s, t):
        hrList = []
        for sys in sysList:
            #All the rest will be within the json file
            print t
            path = ''
            if sys == 'nominal':
                path = path_in[0]
            else:
                path = path_in[1]

            if not sys == 'nominal':
                #file_ = '%s/Efficiency%s_%s_%s/%s_%sid%s_%s/%s'%(path_in[1],n,r,sys,t.upper(),t,r,sys,s)
                file_ = '%s/%s/%s_%s_all/%s' % (path, sysDic[sys], t.upper(),
                                                t, s)
            else:
                #file_ = '%s/Efficiency%s_%s/%s_%sid%s/%s'%(path_in[0],n,r,t.upper(),t,r,s)
                file_ = '%s/EfficiencyRun2017B_F/%s_%s_all/%s' % (
                    path, t.upper(), t, s)
            print 'file_ is', file_
            #sys_.exit()
            hr = HistoReader('RUN%s_%s%s%s' % (r, n, t, sys))
            hr.readfile(file_)
            #hr.SetNewRange(20, 120)
            hr.setInfo(sys)
            hr.CleanBigError(0.01)
            hr.setType(t)
            hrList.append(hr)

        hp = HistoPloter('.')
        ##Uncomment next line to have only min, max variations
        hp.MinMax = True
        hp.setRatioRange(0.98,
                         1.02)  #Set the ratio range. Default one is 0.85, 1.15
        print 'hrList is', hrList
コード例 #2
0
    def makePlots(n, r, s, t):
        hrList = []
        for sys in sysList:
            #All the rest will be within the json file
            print t
            if sys != 'nominal':
                file_ = '%s/Efficiency%s_%s_%s/%s_%sid%s_%s/%s' % (
                    path_in[1], n, r, sys, t.upper(), t, r, sys, s)
            else:
                file_ = '%s/Efficiency%s_%s/%s_%sid%s/%s' % (
                    path_in[0], n, r, t.upper(), t, r, s)
            print 'file_ is', file_
            hr = HistoReader('RUN%s_%s%s%s' % (r, n, t, sys))
            hr.readfile(file_)
            hr.SetNewRange(20, 120)
            hr.setInfo(sys)
            hr.CleanBigError(0.01)
            hr.setType(t)
            hrList.append(hr)

        hp = HistoPloter('.')
        ##Uncomment next line to have only min, max variations
        hp.MinMax = True
        hp.setRatioRange(0.98,
                         1.02)  #Set the ratio range. Default one is 0.85, 1.15
        hp.PlotEff1D(hrList)  #making the 1D plot
コード例 #3
0
    def makePlots(n, r, s, t):
        hrList = []
        for sys in sysList:
            #All the rest will be within the json file
            print t
            file_ = '%s/Efficiency%s_%s_%s/%s_%sid%s_%s/%s' % (
                path_in, n, r, sys, t.upper(), t, r, sys, s)
            print 'file_ is', file_
            hr = HistoReader('%s%s%s' % (n, t, sys))
            hr.readfile(file_)
            hr.SetNewRange(20, 120)
            hr.setInfo(sys)
            hr.CleanBigError(0.01)
            hr.setType(t)
            hrList.append(hr)

        hp = HistoPloter('.')
        hp.setRatioRange(0.98,
                         1.02)  #Set the ratio range. Default one is 0.85, 1.15
        hp.PlotEff1D(hrList)  #making the 1D plot
コード例 #4
0
            SFoutputJSONname ='RunBCDEF_%s_%s_%s'%('SF',n, r)
            jSF = JsonMaker(SFoutputJSONname)
            rSF = RootFileMaker(SFoutputJSONname)
            for t in Type:
                #All the rest will be within the json file
                outputJSONname ='RunBCDEF_%s_%s_%s_%s'%('Eff',t,n,r)
                MapList = []
                j = JsonMaker(outputJSONname)
                r_ = RootFileMaker(outputJSONname)
                for s in NumDic[n]:
                    file_ = '/eos/cms/store/group/phys_muon/fernanpe/Efficiencies_LegacyReReco2016_final/Efficiency%s_BCDEF_%s/%s_%sid_BCDEF/%s'%(n,r,t.upper(),t,s)
                    hr = HistoReader('hr')
                    hr.readfile(file_)     
#                    hr.SetNewRange(20, 120) 
                    hr.setInfo('dummy')         
                    hr.CleanBigError(0.01)  
                    hr.setType(t)      
                    MapList.append(hr.eff2D)

                    #For SF
                    if t == 'mc':
                        MC_MapList.append(hr.eff2D)
                    elif t == 'data':
                        DATA_MapList.append(hr.eff2D)

                #For DATA, MC
                j.makeJSON(MapList)
                r_.makeROOT(MapList)

            #For SF
            for mcm, datam in zip(MC_MapList,DATA_MapList):
コード例 #5
0
            DATA_MapList = []
            SFoutputJSONname = 'Run%s_%s_%s' % (r, 'SF', n)
            jSF = JsonMaker(SFoutputJSONname)
            for t in Type:
                #All the rest will be within the json file
                outputJSONname = 'Run%s_%s_%s' % (r, t, n)
                MapList = []
                j = JsonMaker(outputJSONname)
                for s in NumDic[n]:
                    file_ = '/afs/cern.ch/user/f/fernanpe/public/for_Gael/Efficiencies_2017/Efficiency%s_%s/%s_%sid%s/%s' % (
                        n, r, t.upper(), t, r, s)
                    hr = HistoReader('hr')
                    hr.readfile(file_)
                    hr.SetNewRange(20, 120)
                    hr.setInfo('dummy')
                    hr.CleanBigError(0.05)
                    hr.setType(t)
                    MapList.append(hr.eff2D)

                    #For SF
                    if t == 'mc':
                        MC_MapList.append(hr.eff2D)
                    elif t == 'data':
                        DATA_MapList.append(hr.eff2D)

                #For DATA, MC
                j.makeJSON(MapList)

            #For SF
            for mcm, datam in zip(MC_MapList, DATA_MapList):
                SF_MapList.append(datam.divideMap(mcm))
コード例 #6
0
    eff2D = hr_dataBC.eff2D
    eff2D.Print()
    eff2D.Print('up')
    eff2D.Print('down')

    print 'After Changing Range'
    print '----------------'
    hr_dataBC.SetNewRange(20, 90)
    eff2D = hr_dataBC.eff2D
    eff2D.Print()
    eff2D.Print('up')
    eff2D.Print('down')

    print 'After removing errors below 1%'
    print '----------------'
    hr_dataBC.CleanBigError(0.01)
    eff2D = hr_dataBC.eff2D
    eff2D.Print()
    eff2D.Print('up')
    eff2D.Print('down')

    print 'Other run'
    print '----------------'
    fileDE = '/afs/cern.ch/user/f/fernanpe/public/for_Gael/Efficiencies_2017/EfficiencyID_DE/DATA_dataidDE/' + Id
    hr_dataDE = HistoReader('DataDE')
    hr_dataDE.readfile(fileDE)
    hr_dataDE.SetNewRange(20, 90)
    hr_dataDE.CleanBigError(0.01)
    hr_dataDE.setLumi(10)
    hr_dataDE.setInfo('DE')
    hr_dataDE.setType('data')