@@ -384,7 +384,7 @@ void HFInvMassFitter::doFit()
384384 countSignal (mRawYieldCounted , mRawYieldCountedErr );
385385 calculateSignificance (mSignificance , mSignificanceErr );
386386 // Fit to data ratio
387- mRatioFrame = mass->frame (Title (" Fit/Data Ratio " ));
387+ mRatioFrame = mass->frame (Title (Form ( " %s " , mHistoInvMass -> GetTitle ()) ));
388388 calculateFitToDataRatio ();
389389 }
390390}
@@ -672,21 +672,9 @@ void HFInvMassFitter::drawResidual(TVirtualPad* pad)
672672void HFInvMassFitter::drawRatio (TVirtualPad* pad)
673673{
674674 pad->cd ();
675- mRatioFrame ->GetYaxis ()->SetTitle (" " );
676- TPaveText* textInfo = new TPaveText (0.12 , 0.65 , 0.47 , .89 , " NDC" );
677- textInfo->SetBorderSize (0 );
678- textInfo->SetFillStyle (0 );
679- textInfo->SetTextColor (kBlue );
680- textInfo->AddText (Form (" S = %.0f #pm %.0f " , mRawYield , mRawYieldErr ));
681- textInfo->AddText (Form (" S_{count} = %.0f #pm %.0f " , mRawYieldCounted , mRawYieldCountedErr ));
682- textInfo->AddText (Form (" mean = %.3f #pm %.3f" , mRooMeanSgn ->getVal (), mRooMeanSgn ->getError ()));
683- if (mTypeOfSgnPdf == DoubleGaus) {
684- textInfo->AddText (Form (" sigma = %.3f #pm %.3f" , mRooSigmaSgn ->getVal (), mRooSigmaSgn ->getError ()));
685- textInfo->AddText (Form (" sigma 2 = %.3f #pm %.3f" , mRooSecSigmaSgn ->getVal (), mRooSecSigmaSgn ->getError ()));
686- } else {
687- textInfo->AddText (Form (" sigma = %.3f #pm %.3f" , mRooSigmaSgn ->getVal (), mRooSigmaSgn ->getError ()));
688- }
689- mRatioFrame ->addObject (textInfo);
675+ mRatioFrame ->GetXaxis ()->SetTitleOffset (1.2 );
676+ mRatioFrame ->GetYaxis ()->SetTitleOffset (1.5 );
677+ mRatioFrame ->GetYaxis ()->SetTitle (" Fit / Data" );
690678 double xMin = mRatioFrame ->GetXaxis ()->GetXmin ();
691679 double xMax = mRatioFrame ->GetXaxis ()->GetXmax ();
692680 TLine* line = new TLine (xMin, 1.0 , xMax, 1.0 );
@@ -885,7 +873,7 @@ void HFInvMassFitter::plotRefl(RooAbsPdf* pdf)
885873}
886874
887875// Calculate fit to data ratio
888- void HFInvMassFitter::calculateFitToDataRatio ()
876+ void HFInvMassFitter::calculateFitToDataRatio () const
889877{
890878 if (!mInvMassFrame )
891879 return ;
@@ -913,9 +901,9 @@ void HFInvMassFitter::calculateFitToDataRatio()
913901 ratioHist->SetPointError (i, 0 , 0 , err, err);
914902 }
915903
904+ mRatioFrame ->addPlotable (ratioHist, " P" );
916905 mRatioFrame ->SetMinimum (0.5 );
917906 mRatioFrame ->SetMaximum (1.5 );
918- mRatioFrame ->addPlotable (ratioHist, " P" );
919907}
920908
921909// Fix reflection pdf
0 commit comments