Ejemplo n.º 1
0
    def CreatCanvas(self):
        H_ref = 600
        W_ref = 800
        W = W_ref
        H = H_ref
        T = 0.08 * H_ref
        B = 0.12 * H_ref
        L = 0.12 * W_ref
        R = 0.04 * W_ref
        # Set the tdr style

        canvas = Canvas(width=W, height=H)
        canvas.SetFillColor(0)
        canvas.SetBorderMode(0)
        canvas.SetFrameFillStyle(0)
        canvas.SetFrameBorderMode(0)
        canvas.SetLeftMargin(L / W)
        canvas.SetRightMargin(R / W)
        canvas.SetTopMargin(T / H)
        canvas.SetBottomMargin(B / H)
        canvas.SetTickx(0)
        canvas.SetTicky(0)
        return canvas
Ejemplo n.º 2
0
print "[ROOTFILES LOADED]" + str(round(time.time() - t0,2)) + "seconds"

variableDictionary = variableDictionary(Region,doBreakdown)
skimmed = 0
for variable in variableDictionary:
    nbins = int(variableDictionary[variable]['nbins'])
    xmin  = float(variableDictionary[variable]['xmin'])
    xmax  = float(variableDictionary[variable]['xmax'])
    xlabel = variableDictionary[variable]['latex']
    units = variableDictionary[variable]['units']
    ylabel = generateYlabel(units,nbins,xmin,xmax)

    print "[VARIABLE][" + variable  + "]" + str(round(time.time() - t0,0)) + "seconds"

    canvas = Canvas(width=canvaswidth,height=int((1-(1-doRatio)*0.2)*canvasheight))
    canvas.SetFrameBorderMode(0)

    topmargins    = (1.0 , 1.0 )
    bottommargins = (0.0  , 0.4  )
    leftmargins   = (0.0  , 0.0  )
    rightmargins  = (0.0  , 0.0  )
    
    top    = topmargins[doRatio]
    bottom = bottommargins[doRatio]
    left   = leftmargins[doRatio]
    right  = 1 - rightmargins[doRatio]

    canvas.cd()

    histpad = Pad(left,bottom,right, top,color="white",bordersize =5)
    if not doRatio: