1 / 2

Solution to exercise 2

Solution to exercise 2. using namespace RooFit ; void ex2() { RooWorkspace w("w", kTRUE ) ; // Make Gaussian pdf w.factory (" Gaussian ::g(x[-10,10], mean [-10,10],sigma[3,0.1,10])") ; // Make Chebychev pdf w.factory (" Chebychev :: bkg (x,{a0[0,-1,1],a1[0.1,-1,1]})") ;

Download Presentation

Solution to exercise 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Solution to exercise 2 usingnamespace RooFit ; void ex2() { RooWorkspace w("w",kTRUE) ; // MakeGaussian pdf w.factory("Gaussian::g(x[-10,10],mean[-10,10],sigma[3,0.1,10])") ; // MakeChebychev pdf w.factory("Chebychev::bkg(x,{a0[0,-1,1],a1[0.1,-1,1]})") ; // Makeextendedcomposite model w.factory("SUM::model(Nsig[0,10000]*g,Nbkg[0,10000]*bkg)") ; // Generate a small dataset RooDataSet* data = w::model.generate(w::x,500) ;

  2. Solution to exercise 2 // Fit model to data, save complete fit result RooFitResult* r = w::model.fitTo(*data,Save()) ; // Plot data, model, background component of model RooPlot* frame = w::x.frame() ; data->plotOn(frame) ; w::model.plotOn(frame) ; w::model.plotOn(frame,Components("bkg"),LineStyle(kDashed)) ; frame->Draw() ; // Visualizeuncertaintiesontotal pdf, background component w::model.plotOn(frame,VisualizeError(*r),MoveToBack()); w::model.plotOn(frame,VisualizeError(*r),Components("bkg"), MoveToBack(),FillColor(kYellow)) ; frame->Draw() ; }

More Related