# {'bin_i', {'total'=... , 'even'=... , 'odd'=... , 'swave'=...}}
pdfsDict = CpPlotsKit.getCPcompPdfKKbins()

#Get some useful stuff ncessesary for looping
KKbins      = CpPlotsKit.getNumKKbins()  #Get nummber of KKmass bins 
binNames    = CpPlotsKit.getKKbinNames() #Get list of KKmass bin names
CPcomps     = CpPlotsKit.getCpCompNames()#Get list of names of the CP components
observables = [ pdfBuild['observables'][name] for name in [ 'time', 'cpsi', 'ctheta', 'phi' ] ]

#Set plot options      
markStyle = 8
markSize  = 0.5
lineWidth = 4
CpPlotsKit.setLineColors( dict(total = kBlue, even=kRed, odd=kGreen+3, swave=kMagenta+3) )
CpPlotsKit.setLineStyles( dict(total = kSolid, even=9   , odd=7       , swave=5         ) )
CpPlotsKit.setLineWidth(lineWidth)


#LHCbLabel
from ROOT import TPaveText, gStyle
lhcbName = TPaveText(gStyle.GetPadLeftMargin() + 0.14,
                         0.87 - gStyle.GetPadTopMargin(),
                         gStyle.GetPadLeftMargin() + 0.20,
                         0.95 - gStyle.GetPadTopMargin(),
                         "BRNDC")
lhcbName.AddText("LHCb")
lhcbName.SetFillColor(0)
lhcbName.SetTextAlign(12)
lhcbName.SetBorderSize(0)

Beispiel #2
0
observables = [ pdfBuild['observables'][name] for name in [ 'time', 'cpsi', 'ctheta', 'phi' ] ]

#Make the y-axis titles look nicer
yTitles = []
for obs in observables:
    obsRange = obs.getRange()[1] - obs.getRange()[0]
    binWidth = round( obsRange / numBins[observables.index(obs)], 2) 
    if obs.getUnit(): yTitles.append( 'Candidates / ' + str(binWidth) + ' ' + obs.getUnit() )
    else:             yTitles.append( 'Candidates / ' + str(binWidth) )

#Set plot options      
markStyle = 8
markSize  = 0.5
CpPlotsKit.setLineColors( dict(total = kBlue , even=kRed, odd=kGreen+3, swave=kMagenta+3) )
CpPlotsKit.setLineStyles( dict(total = kSolid, even=9   , odd=7       , swave=5         ) )
CpPlotsKit.setLineWidth(4)

##Plot and Save
for ( pad, obs, nBins, xTitle, yTitle, yScale, logY )\
        in zip(  [ TCanvas(o.GetName()) for o in observables ]
               , observables
               , numBins
               , ( angleNames[0][1], angleNames[1][1], angleNames[2][1], 'B_{s}^{0} decay time [ps]' )
               , yTitles
               , 3 * ( ( None, 1400 ), ) + ( ( 0.1, 10e4 ), )
               , 3 * ( False, ) + ( True, )
                ) :
    print '\n\n\n Ploting Observable ' + obs.GetName() +  ' {0}/{1} '.format(observables.index(obs)+1, len(observables)) + '\n\n\n'
    plot(  pad, obs, sigData, pdf, xTitle=xTitle, yTitle=yTitle, yScale=yScale, logy=logY
           , frameOpts   = dict( Bins = nBins, Name = obs.GetName() + 'Histo'   )
           , dataOpts    = dict( MarkerStyle = markStyle, MarkerSize = markSize )