#!/usr/bin/python from michel_spectrum import * from ROOT import * def makegstyle(cStyle): cStyle.SetPadBorderMode(0) cStyle.SetOptStat(0) ## Hide stats cStyle.SetOptTitle(1) ## Display histogram titles. cStyle.SetCanvasColor(10) ## Background color (white) cStyle.SetPadColor(10) ## Background color (white) cStyle.SetFillColor(10) ## Background color (white) cStyle.SetTitleFillColor(10) ## Background color (white) cStyle.SetStatColor(10) ## Background color (white) cStyle.SetPalette(1) ## Nicer colour scale for 2D histograms. cStyle.SetTitleBorderSize(0) ##duh return cStyle def call_ms(x,p): if p[1] == 0.: return michel_spectrum(x,p[0],{'rho':0.75,'eta':0.0,'xi':1.0,'delta':0.75},'base') elif p[1] == 1.: return michel_spectrum(x,p[0],{'rho':0.75,'eta':0.0,'xi':1.0,'delta':0.75},'all') else: return None if __name__ == '__main__': # make a list of TF1s specs = ['base','all'] TF1s = [] for spec_type in [0,1]: ##base,all for cos_theta in [ -1., 0., 1.]: TF1_name = specs[spec_type]+'_cos_theta_'+str(cos_theta) new_TF1 = TF1(TF1_name,call_ms,0.,0.995,2) new_TF1.SetParameter(0,cos_theta) new_TF1.SetParameter(1,float(spec_type)) TF1s.append(new_TF1) # and draw them gStyle = makegstyle(gStyle) c = TCanvas() TF1s[0].SetMaximum(2.) TF1s[0].SetLineStyle(2) TF1s[0].Draw() for t in TF1s[1:3]: t.SetLineStyle(2) t.Draw('same') for t in TF1s[3:]: t.Draw('same') au = raw_input('>')