115 if(rnd->
Rndm()>frac) {
116 return rnd->
Gaus(mTrue+smallBias,smallSigma);
118 return rnd->
Gaus(mTrue+wideBias,wideSigma);
131 Double_t const luminosityData=100000;
132 Double_t const luminosityMC=1000000;
135 Int_t const nDet=250;
136 Int_t const nGen=100;
145 TH1D *histMgenMC=
new TH1D(
"MgenMC",
";mass(gen)",nGen,xminGen,xmaxGen);
146 TH1D *histMdetMC=
new TH1D(
"MdetMC",
";mass(det)",nDet,xminDet,xmaxDet);
147 TH2D *histMdetGenMC=
new TH2D(
"MdetgenMC",
";mass(det);mass(gen)",nDet,xminDet,xmaxDet,
148 nGen,xminGen,xmaxGen);
150 for(
Int_t i=0;i<neventMC;i++) {
163 histMgenMC->
Fill(mGen,luminosityData/luminosityMC);
165 histMdetMC->
Fill(mDet,luminosityData/luminosityMC);
180 histMdetGenMC->
Fill(mDet,mGen,luminosityData/luminosityMC);
186 TH1D *histMgenData=
new TH1D(
"MgenData",
";mass(gen)",nGen,xminGen,xmaxGen);
187 TH1D *histMdetData=
new TH1D(
"MdetData",
";mass(det)",nDet,xminDet,xmaxDet);
188 Int_t neventData=rnd->
Poisson(luminosityData*crossSection);
189 for(
Int_t i=0;i<neventData;i++) {
196 histMgenData->
Fill(mGen);
199 histMdetData->
Fill(mDet);
224 Int_t iPeek=(
Int_t)(nGen*(estimatedPeakPosition-xminGen)/(xmaxGen-xminGen)
230 unfold.RegularizeBins(1,1,iPeek-nPeek,regMode);
232 unfold.RegularizeBins(iPeek+nPeek,1,nGen-(iPeek+nPeek),regMode);
238 if(unfold.SetInput(histMdetData,0.0)>=10000) {
239 std::cout<<
"Unfolding result may be wrong\n";
251 iBest=unfold.ScanLcurve(nScan,tauMin,tauMax,&lCurve,&logTauX,&logTauY);
252 std::cout<<
"tau="<<unfold.GetTau()<<
"\n";
253 std::cout<<
"chi**2="<<unfold.GetChi2A()<<
"+"<<unfold.GetChi2L()
254 <<
" / "<<unfold.GetNdf()<<
"\n";
258 logTauX->
GetKnot(iBest,t[0],x[0]);
259 logTauY->
GetKnot(iBest,t[0],y[0]);
270 for(
Int_t i=1;i<=nGen;i++) binMap[i]=i;
274 TH1D *histMunfold=
new TH1D(
"Unfolded",
";mass(gen)",nGen,xminGen,xmaxGen);
275 unfold.GetOutput(histMunfold,binMap);
276 TH1D *histMdetFold=
new TH1D(
"FoldedBack",
"mass(det)",nDet,xminDet,xmaxDet);
277 unfold.GetFoldedOutput(histMdetFold);
280 TH1D *histRhoi=
new TH1D(
"rho_I",
"mass",nGen,xminGen,xmaxGen);
281 unfold.GetRhoI(histRhoi,binMap);
300 histMdetGenMC->
Draw(
"BOX");
310 histMgenData->
Draw(
"SAME");
311 histMgenMC->
Draw(
"SAME HIST");
319 histMdetFold->
Draw();
321 histMdetData->
Draw(
"SAME");
322 histMdetMC->
Draw(
"SAME HIST");
336 bestLogTauX->
Draw(
"*");
341 bestLcurve->
Draw(
"*");
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Random number generator class based on M.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Base class for spline implementation containing the Draw/Paint methods //.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
This is the base class for the ROOT Random number generators.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Double_t Rndm()
Machine independent random number generator.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
tomato 1-D histogram with a double per channel (see TH1 documentation)}
virtual void GetKnot(Int_t i, Double_t &x, Double_t &y) const =0
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
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.
TUnfold is used to decompose a measurement y into several sources x given the measurement uncertainti...
A Graph is a graphics object made of two arrays X and Y with npoints each.
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
Int_t Fill(Double_t)
Invalid Fill method.
tomato 2-D histogram with a double per channel (see TH1 documentation)}