Esempio n. 1
0
def cmsPrel(lumi,  energy,  simOnly,  onLeft=True,  sp=0, textScale=1.):
    latex = TLatex()
  
    t = gStyle.GetPadTopMargin()/(1-sp)
    tmpTextSize=0.75*t
    latex.SetTextSize(tmpTextSize)
    latex.SetNDC()
    textSize=latex.GetTextSize()
    textSize*=textScale

    latex.SetName("lumiText")
    latex.SetTextFont(42)

    lumyloc = 0.965
    cmsyloc = 0.893
    simyloc = 0.858
    if sp!=0:
        lumyloc = 0.945
        cmsyloc = 0.85
        simyloc = 0.8
    cmsalign = 31
    cmsxloc = 0.924
    if onLeft:
        cmsalign = 11
        cmsxloc = 0.204
    xlumi = 1-gStyle.GetPadRightMargin()
    if (lumi > 0.):
        latex.SetTextAlign(31) # align left, right=31
        latex.SetTextSize(textSize*0.6/0.75)
        if(lumi > 1000. ):
            latex.DrawLatex(xlumi,lumyloc,
                            " {lumi} fb^{{-1}} ({energy} TeV)".format(
                                lumi=lumi/1000.,
                                energy=energy
                            ))
        else:
            latex.DrawLatex(xlumi,lumyloc,
                            " {lumi} pb^{{-1}} ({energy} TeV)".format(
                                lumi=lumi,
                                energy=energy
                            ))
  
    else:
        latex.SetTextAlign(31) # align right=31
        latex.SetTextSize(textSize*0.6/0.75)
        latex.DrawLatex(xlumi,lumyloc," {energy} TeV".format(energy=energy))
  
 
    latex.SetTextAlign(cmsalign) # align left / right
    latex.SetTextFont(61)
    latex.SetTextSize(textSize)
    latex.DrawLatex(cmsxloc, cmsyloc,"CMS")
  
    latex.SetTextFont(52)
    latex.SetTextSize(textSize*0.76)
    
    if(simOnly):
        latex.DrawLatex(cmsxloc, simyloc,"Simulation")
Esempio n. 2
0
		CMS_lumi.writeExtraText=False
		if tipo=='exp':
			CMS_lumi.writeExtraText=True
		CMS_lumi.CMS_lumi(c, 4, 33)
		latex=TLatex(0.2 ,0.1,signalWB_legendnames[masspoint])
		if tipo=='obs':
			latex=TLatex(0.2 ,0.1,signalWB_legendnames_obs[masspoint])
		latex.SetTextFont(42)
		#latex.SetTextSize(latex.GetTextSize()*0.85)
		#latex.SetTextAlign(11)
		latex.Draw()
		if tipo=='obs':
			leg_x=0.3
			leg_y=0.8
			legend=TLegend(leg_x,leg_y,leg_x+0.20,leg_y+0.15)
 			legend.SetTextSize(latex.GetTextSize())
  			legend.SetBorderSize(0)
  			legend.SetTextFont(42)
  			legend.SetLineColor(1)
  			legend.SetLineStyle(1)
  			legend.SetLineWidth(1)
  			legend.SetFillColor(0)
  			legend.SetFillStyle(0)
  			legend.SetHeader('')
  			tg=TGraph(3,xx,yy)
  			tg.SetLineColor(2)
			tg.SetLineWidth(503)
			tg.SetFillStyle(3005)
			tg.SetFillColor(2)
  			legend.AddEntry(tg,"SSM Z' excl.",'lf')
			#legend.Draw()