#include #include #include #include #include #include void Argus () { // Observable RooWorkspace w("w", kTRUE); w.factory("Gaussian::gauss(mes[5.20, 5.30], mean[5.28, 5.2, 5.3], width[0.0027, 0.001, 1])"); w.factory("ArgusBG::argus(mes, 5.291, argpag[-20, -100, -1])"); w.factory("SUM::sum(nSig[200, 0, 10000] * gauss, nBkg[800, 0, 10000] * argus)"); // Generate a toyMC sample from composite PDF RooDataSet *data = w.pdf("sum")->generate(*w.var("mes"), 2000); // Perform extended ML fit of composite PDF to toy data w.pdf("sum")->fitTo(*data); // Plot toy data and composite PDF overlaid RooPlot *mesFrame = w.var("mes")->frame(); data->plotOn(mesFrame); w.pdf("sum")->plotOn(mesFrame); w.pdf("sum")->plotOn(mesFrame, RooFit::Components(*w.pdf("argus")), RooFit::LineStyle(kDashed)); mesFrame->Draw(); } // Argus