93 Double_t lowRange = 00, highRange = 200;
96 RooRealVar invMass(
"invMass",
"M_{inv}", lowRange, highRange,
"GeV");
97 RooRealVar isolation(
"isolation",
"isolation", 0., 20.,
"GeV");
104 std::cout <<
"make z model" << std::endl;
106 RooRealVar mZ(
"mZ",
"Z Mass", 91.2, lowRange, highRange);
107 RooRealVar sigmaZ(
"sigmaZ",
"Width of Gaussian", 2,0,10,
"GeV");
108 RooGaussian mZModel(
"mZModel",
"Z+jets Model", invMass, mZ, sigmaZ);
118 "z isolation decay constant", -1);
119 RooExponential zIsolationModel(
"zIsolationModel",
"z isolation model",
120 isolation, zIsolDecayConst);
123 RooProdPdf zModel(
"zModel",
"4-d model for Z",
129 std::cout <<
"make qcd model" << std::endl;
135 RooRealVar qcdMassDecayConst(
"qcdMassDecayConst",
136 "Decay const for QCD mass spectrum",
137 -0.01, -100, 100,
"1/GeV");
139 invMass, qcdMassDecayConst);
147 "Et resolution constant", -.1);
148 RooExponential qcdIsolationModel(
"qcdIsolationModel",
"QCD isolation model",
149 isolation, qcdIsolDecayConst);
152 RooProdPdf qcdModel(
"qcdModel",
"2-d model for QCD",
153 RooArgSet(qcdMassModel, qcdIsolationModel));
160 RooRealVar zYield(
"zYield",
"fitted yield for Z",50 ,0.,1000) ;
161 RooRealVar qcdYield(
"qcdYield",
"fitted yield for QCD", 100 ,0.,1000) ;
164 std::cout <<
"make full model" << std::endl;
171 model.graphVizTree(
"fullModel.dot");
173 std::cout <<
"import model" << std::endl;
183 Int_t nEvents = 1000;
191 std::cout <<
"make data set and import to workspace" << std::endl;
201 std::cout <<
"Calculate sWeights" << std::endl;
236 std::cout <<
"Check SWeights:" << std::endl;
239 std::cout << std::endl <<
"Yield of Z is "
240 << zYield->
getVal() <<
". From sWeights it is "
244 std::cout <<
"Yield of QCD is "
245 << qcdYield->
getVal() <<
". From sWeights it is "
249 for(
Int_t i=0; i < 10; i++)
251 std::cout <<
"z Weight " << sData->
GetSWeight(i,
"zYield")
252 <<
" qcd Weight " << sData->
GetSWeight(i,
"qcdYield")
257 std::cout << std::endl;
260 std::cout <<
"import new dataset with sWeights" << std::endl;
270 std::cout <<
"make plots" << std::endl;
295 data->plotOn(frame ) ;
296 model->plotOn(frame) ;
300 frame->
SetTitle(
"Fit of model to discriminating variable");
321 frame2->
SetTitle(
"isolation distribution for Z");
333 frame3->
SetTitle(
"isolation distribution for QCD");
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Calls RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const ;.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
Double_t getVal(const RooArgSet *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooConstVar represent a constant real-valued object.
RooDataSet is a container class to hold unbinned data.
static RooMsgService & instance()
Return reference to singleton instance.
void setSilentMode(Bool_t flag)
A RooPlot is a plot frame and a container for graphics objects within that frame.
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
RooProdPdf is an efficient implementation of a product of PDFs of the form.
RooRealVar represents a fundamental (non-derived) real valued object.
This class calculates sWeights used to create an sPlot.
Double_t GetYieldFromSWeight(const char *sVariable) const
Sum the SWeights for a particular specie over all events This should equal the total (weighted) yield...
Double_t GetSWeight(Int_t numEvent, const char *sVariable) const
Double_t GetSumOfEventSWeight(Int_t numEvent) const
Sum the SWeights for a particular event.
The RooWorkspace is a persistable container for RooFit projects.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
RooCmdArg Extended(Bool_t flag=kTRUE)
RooCmdArg Rename(const char *suffix)
RooCmdArg Components(const RooArgSet &compSet)
RooCmdArg DataError(Int_t)
RooCmdArg LineColor(Color_t color)
RooCmdArg LineStyle(Style_t style)
@(#)root/roostats:$Id$ Author: George Lewis, Kyle Cranmer