rs102_hypotestwithshapes for RooStats project
This tutorial macro shows a typical search for a new particle by studying an invariant mass distribution. The macro creates a simple signal model and two background models, which are added to a RooWorkspace. The macro creates a toy dataset, and then uses a RooStats ProfileLikleihoodCalculator to do a hypothesis test of the background-only and signal+background hypotheses. In this example, shape uncertainties are not taken into account, but normalization uncertainties are.
Processing /mnt/build/workspace/root-makedoc-v608/rootspi/rdoc/src/v6-08-00-patches/tutorials/roostats/rs102_hypotestwithshapes.C...
#include <string>
void rs102_hypotestwithshapes() {
AddModel(wspace);
AddData(wspace);
DoHypothesisTest(wspace);
MakePlots(wspace);
delete wspace;
}
Double_t lowRange = 60, highRange = 200;
RooRealVar invMass(
"invMass",
"M_{inv}", lowRange, highRange,
"GeV");
RooRealVar sigma1(
"sigma1",
"Width of Gaussian",12.,2,100) ;
RooGaussian sigModel(
"sigModel",
"Signal Model", invMass, mH, sigma1);
mH.setConstant();
sigma1.setConstant();
RooRealVar sigma1_z(
"sigma1_z",
"Width of Gaussian",10.,6,100) ;
RooGaussian zjjModel(
"zjjModel",
"Z+jets Model", invMass, mZ, sigma1_z);
mZ.setConstant();
sigma1_z.setConstant();
a0.setConstant();
a1.setConstant();
a2.setConstant();
RooRealVar fzjj(
"fzjj",
"fraction of zjj background events",.4,0.,1) ;
RooRealVar fsigExpected(
"fsigExpected",
"expected fraction of signal events",.2,0.,1) ;
fsigExpected.setConstant();
RooRealVar mu(
"mu",
"signal strength in units of SM expectation",1,0.,2) ;
RooRealVar ratioSigEff(
"ratioSigEff",
"ratio of signal efficiency to nominal signal efficiency",1. ,0.,2) ;
}
}
cout << "-------------------------------------------------" << endl;
cout <<
"The p-value for the null is " << htr->
NullPValue() << endl;
cout <<
"Corresponding to a significance of " << htr->
Significance() << endl;
cout << "-------------------------------------------------\n\n" << endl;
}
frame->
SetTitle(
"An example fit to the signal + background model");
xframe2->
SetTitle(
"An example fit to the background-only model");
}
- Author
- Kyle Cranmer
Definition in file rs102_hypotestwithshapes.C.