Exemple #1
0
            bkgrates = [j for i, j in (piechart[key][column]).iteritems()]
            if k % gridy == 0: k += 1
            plt.subplot(gridx, gridy, k)
            if 0 < sum(bkgrates) < 1:
                bkgrates = [i * (1. / sum(bkgrates)) for i in bkgrates]
            plt.pie(bkgrates, colors=colors)
            plt.axis('equal')
            k += 4

    plt.subplot(gridx, gridy, 1)
    plt.text(0.5, 0.5, "mt2ll>" + str(mt2llcut), fontsize=13)
    plt.axis('off')
    plt.subplot(gridx, gridy, gridy + 4)

    yellowgreen_patch = mpatches.Patch(color="yellowgreen", label=bkgs[0])
    gold_patch = mpatches.Patch(color="gold", label=bkgs[1])
    lightskyblue_patch = mpatches.Patch(color="lightskyblue", label=bkgs[2])
    lightcoral_patch = mpatches.Patch(color="lightcoral", label=bkgs[3])

    plt.legend(
        [yellowgreen_patch, gold_patch, lightskyblue_patch, lightcoral_patch],
        bkgs)
    plt.axis('off')
    plt.savefig('./piecharts/piecharts_mt2llcut_' + str(mt2llcut) + '.png')


for cut in mt2llcuts:
    makefigure(piechart, cut)
    latexmaker_2(piechart, cut, "SF")
    latexmaker_2(piechart, cut, "OF")
Exemple #2
0
      if k%gridy==0: k+=1
      plt.subplot(gridx,gridy,k)
      if 0<sum(bkgrates)<1 : bkgrates = [i*(1./sum(bkgrates)) for i in bkgrates]
      patches, texts = plt.pie(bkgrates,colors=colors)
      plt.axis('equal')
      k+=4

  plt.subplot(gridx,gridy,1)
  plt.text(0.5,0.5,"mt2ll>"+str(mt2llcut), fontsize=13)
  plt.axis('off')
  plt.subplot(gridx,gridy,gridy+4)
  
  # yellow_patch       = mpatches.Patch(color="yellow",label=bkgs[0])
  # grey_patch         = mpatches.Patch(color='0.75',label=)
  # lightsalmoon_patch = mpatches.Patch(color='lightsalmon', label)
  # darkred_patch      = mpatches.Patch(color='darkred',label)
  # deeppink_patch     = mpatches.Patch(color='deeppink',label)
  # yellowgreen_patch  = mpatches.Patch(color='yellowgreen',label)
  # cyan_patch         = mpatches.Patch(color='cyan',label)


  #plt.legend([yellowgreen_patch,gold_patch,lightskyblue_patch,lightcoral_patch,mediumblue_patch,red_patch,magenta_patch],bkgs)
  plt.legend(patches,bkgs)
  plt.axis('off')
  plt.savefig('/afs/cern.ch/user/w/wvandrie/www/Stops/test/piechartsTTX/piecharts_mt2llcut_'+str(int(mt2llcut))+'.png')
  
for cut in mt2llcuts:
  makefigure(piechart,cut)
  latexmaker_2(piechart,cut,"SF")
  latexmaker_2(piechart,cut,"OF")
Exemple #3
0
                bkgrates = [i * (1. / sum(bkgrates)) for i in bkgrates]
            patches, texts = plt.pie(bkgrates, colors=colors)
            plt.axis('equal')
            k += gridy

    plt.subplot(gridx, gridy, 1)
    plt.text(0.5, 0.5, "mt2ll>" + str(mt2llcut), fontsize=13)
    plt.axis('off')
    plt.subplot(gridx, gridy, gridy + 4)

    # yellow_patch       = mpatches.Patch(color="yellow",label=bkgs[0])
    # grey_patch         = mpatches.Patch(color='0.75',label=)
    # lightsalmoon_patch = mpatches.Patch(color='lightsalmon', label)
    # darkred_patch      = mpatches.Patch(color='darkred',label)
    # deeppink_patch     = mpatches.Patch(color='deeppink',label)
    # yellowgreen_patch  = mpatches.Patch(color='yellowgreen',label)
    # cyan_patch         = mpatches.Patch(color='cyan',label)

    #plt.legend([yellowgreen_patch,gold_patch,lightskyblue_patch,lightcoral_patch,mediumblue_patch,red_patch,magenta_patch],bkgs)
    plt.legend(patches, bkgs)
    plt.axis('off')
    plt.savefig('./piecharts/piecharts_mt2llcut_' + str(int(mt2llcut)) +
                '.png')


for cut in mt2llcuts:
    makefigure(piechart, cut)
    latexmaker_2(piechart, cut, "EE")
    latexmaker_2(piechart, cut, "MuMu")
    latexmaker_2(piechart, cut, "EMu")
Exemple #4
0
            plt.subplot(gridx,gridy,k)
            if 0<sum(bkgrates)<1 : bkgrates = [i*(1./sum(bkgrates)) for i in bkgrates]
            patches, texts = plt.pie(bkgrates,colors=colors)
            plt.axis('equal')
            k+=gridy

    plt.subplot(gridx,gridy,1)
    plt.text(0.5,0.5,"mt2ll>"+str(mt2llcut), fontsize=13)
    plt.axis('off')
    plt.subplot(gridx,gridy,gridy+4)

    # yellow_patch       = mpatches.Patch(color="yellow",label=bkgs[0])
    # grey_patch         = mpatches.Patch(color='0.75',label=)
    # lightsalmoon_patch = mpatches.Patch(color='lightsalmon', label)
    # darkred_patch      = mpatches.Patch(color='darkred',label)
    # deeppink_patch     = mpatches.Patch(color='deeppink',label)
    # yellowgreen_patch  = mpatches.Patch(color='yellowgreen',label)
    # cyan_patch         = mpatches.Patch(color='cyan',label)


    #plt.legend([yellowgreen_patch,gold_patch,lightskyblue_patch,lightcoral_patch,mediumblue_patch,red_patch,magenta_patch],bkgs)
    plt.legend(patches,bkgs)
    plt.axis('off')
    plt.savefig('./piecharts/piecharts_mt2llcut_'+str(int(mt2llcut))+'.png')

for cut in mt2llcuts:
    makefigure(piechart,cut)
    latexmaker_2(piechart,cut,"EE")
    latexmaker_2(piechart,cut,"MuMu")
    latexmaker_2(piechart,cut,"EMu")