# write parameters to file
    pdfConfig.getParametersFromPdf( pdf, fitData )
    pdfConfig.writeParametersToFile( filePath = parFileOut )


###########################################################################################################################################
## make plots ##
################

# import plotting tools
from P2VV.Load import LHCbStyle
from P2VV.Utilities.Plotting import plot, CPcomponentsPlotingToolkit
from ROOT import TCanvas, kRed, kGreen, kMagenta, kBlue, kSolid

#Initialaze the CP components ploting toolkit
CpPlotsKit = CPcomponentsPlotingToolkit(pdf,sigData)

#Get dictionary with all the pdfs in the KKmass bins
# {'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
Exemple #2
0
# import plotting tools
from P2VV.Load import LHCbStyle
from P2VV.Utilities.Plotting import plot, CPcomponentsPlotingToolkit
from ROOT import TCanvas, kRed, kGreen, kMagenta, kBlue, kSolid

#LHCbLabel
from ROOT import TPaveText, gStyle
lhcbName = TPaveText(0.28, 0.77, 0.38, 0.90, "BRNDC")
lhcbName.AddText("LHCb")
lhcbName.SetFillColor(0)
lhcbName.SetTextAlign(12)
lhcbName.SetBorderSize(0)

#Initialaze the CP components ploting toolkit
CpPlotsKit = CPcomponentsPlotingToolkit(pdf,sigData)

#Get some useful stuff ncessesary for looping
#observables = list(pdf.Observables()-pdf.ConditionalObservables()) # DecayTime + angles
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