using namespace RooFit ; void ex10() { // Make an empty workspace that exports its contents to CINT RooWorkspace *w = new RooWorkspace("w",kTRUE) ; // This constructs the small variation of the model of Ex1 // instead of Nexp = S+B we do Nexp = mu*S + B // // Here S is now the _nominal_ signal expectation, a constant, and where // mu is the 'signal strength modifier', a floating parameters // The product mu*S has now the same role as the original S parameter // of the model of ex1, but we have expressed the floating parameter // in a different way, that is independent of the predicted signal yield // // mu = 1 --> Signal strength is equal to nominal expection // mu = 0 --> Signal srength is zero // mu = 2 --> Signal strength is twice the nominal expectation // // We also choose the nominal values of S and B somewhat differently (20 each) w->factory("Poisson::model(N[100],expr::Nexp('mu*S+B',mu[1,0,5],S[20],B[20]))") ; RooDataSet data("data","data",*w->var("N")) ; w->var("N")->setVal(45) ; data.add(*w->var("N")) ; // Have a look at all the objects created in the workspace w->Print("t") ; // *** STEP-1 *** return ; // Now we will transform the _constant_ background with // floating background parameter and introduce a subsidiary // measurement that constrains that floating parameter // First we make B a floating parameter w->var("B")->setConstant(kFALSE) ; // Now we construct a Gaussian subsidiary measurment w->factory("Gaussian::subsidiary(Bnom[20],B,sigmaB[5])") ; // Finally, we construct a new model that the product of the // original model and the subsidiary measurement w->factory("PROD::model2(model,subsidiary)") ; w->Print("t") ; }