本文整理汇总了C++中RooRealVar::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ RooRealVar::SetName方法的具体用法?C++ RooRealVar::SetName怎么用?C++ RooRealVar::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RooRealVar
的用法示例。
在下文中一共展示了RooRealVar::SetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rf208_convolution
void rf208_convolution()
{
// S e t u p c o m p o n e n t p d f s
// ---------------------------------------
// Construct observable
RooRealVar t("t","t",-10,30) ;
// Construct landau(t,ml,sl) ;
RooRealVar ml("ml","mean bw",5.,-20,20) ;
RooRealVar sl("sl","sigma bw",1,0.1,10) ;
RooBreitWigner bw("bw","bw",t,ml,sl) ;
// Construct gauss(t,mg,sg)
RooRealVar mg("mg","mg",0) ;
RooRealVar sg("sg","sg",2,0.1,10) ;
RooGaussian gauss("gauss","gauss",t,mg,sg) ;
// C o n s t r u c t c o n v o l u t i o n p d f
// ---------------------------------------
// Set #bins to be used for FFT sampling to 10000
t.setBins(10000,"cache") ;
// Construct landau (x) gauss
RooFFTConvPdf lxg("lxg","bw (X) gauss",t,bw,gauss) ;
// S a m p l e , f i t a n d p l o t c o n v o l u t e d p d f
// ----------------------------------------------------------------------
// Sample 1000 events in x from gxlx
RooDataSet* data = lxg.generate(t,10000) ;
// Fit gxlx to data
lxg.fitTo(*data) ;
// Plot data, landau pdf, landau (X) gauss pdf
RooPlot* frame = t.frame(Title("landau (x) gauss convolution")) ;
data->plotOn(frame) ;
lxg.plotOn(frame) ;
bw.plotOn(frame,LineStyle(kDashed)) ;
// Draw frame on canvas
new TCanvas("rf208_convolution","rf208_convolution",600,600) ;
gPad->SetLeftMargin(0.15) ; frame->GetYaxis()->SetTitleOffset(1.4) ; frame->Draw() ;
//add a variable to the dataset
RooFormulaVar *r_formula = new RooFormulaVar("r_formula","","@0",t);
RooRealVar* r = (RooRealVar*) data->addColumn(*r_formula);
r->SetName("r");
r->SetTitle("r");
RooDataSet* data_r =(RooDataSet*) data->reduce(*r, "");
r->setRange("sigrange",-10.,30.);
RooPlot* r_frame = r->frame(Range("sigRange"),Title(" r (x) gauss convolution")) ;
data_r->plotOn(r_frame, MarkerColor(kRed));
r_frame->GetXaxis()->SetRangeUser(-10., 30.);
r_frame->Draw() ;
}