@@ -40,7 +40,7 @@ const Double_t kDefConfLevel = 0.682689492137; // 1 sigma
4040const TEfficiency::EStatOption kDefStatOpt = TEfficiency::kFCP ;
4141const Double_t kDefWeight = 1 ;
4242
43-
43+ // clang-format off
4444// //////////////////////////////////////////////////////////////////////////////
4545/* * \class TEfficiency
4646 \ingroup Hist
@@ -96,8 +96,8 @@ events with different weights were filled in the same histogram.
9696If you start a new analysis, it is highly recommended to use the TEfficiency class
9797from the beginning. You can then use one of the constructors for fixed or
9898variable bin size and your desired dimension. These constructors append the
99- created TEfficiency object to the current directory. So it will be written
100- automatically to a file during the next TFile::Write command.
99+ created TEfficiency object to the current directory if TH1::AddDirectoryStatus() is
100+ true. It will be written automatically to a file during the next TFile::Write command.
101101
102102Example: create a two-dimensional TEfficiency object with
103103- name = "eff"
@@ -116,8 +116,9 @@ to construct the TEfficiency object. The histograms "passed" and "total" have
116116to fulfill the conditions mentioned in TEfficiency::CheckConsistency, otherwise the construction will fail.
117117As the histograms already exist, the new TEfficiency is by default **not** attached
118118to the current directory to avoid duplication of data. If you want to store the
119- new object anyway, you can either write it directly by calling TObject::Write or attach it to a directory using TEfficiency::SetDirectory.
120- This also applies to TEfficiency objects created by the copy constructor TEfficiency::TEfficiency(const TEfficiency& rEff).
119+ new object anyway, you can either write it directly by calling TObject::Write or attach it to a directory using
120+ TEfficiency::SetDirectory. This also applies to TEfficiency objects created by the copy constructor
121+ TEfficiency::TEfficiency(const TEfficiency& rEff).
121122
122123\anchor EFF02a
123124### Example 1
@@ -131,7 +132,8 @@ if(TEfficiency::CheckConsistency(h_pass,h_total))
131132{
132133 pEff = new TEfficiency(h_pass,h_total);
133134 // this will write the TEfficiency object to "myfile.root"
134- // AND pEff will be attached to the current directory
135+ // AND pEff will be attached to the current directory if
136+ // TH1::AddDirectoryStatus() is true.
135137 pEff->Write();
136138}
137139~~~~~~~~~~~~~~~
@@ -155,15 +157,15 @@ if(TEfficiency::CheckConsistency(h_pass,h_total))
155157~~~~~~~~~~~~~~~
156158
157159In case you already have two filled histograms and you only want to
158- plot them as a graph, you should rather use TGraphAsymmErrors::TGraphAsymmErrors(const TH1* pass,const TH1* total,Option_t* opt)
159- to create a graph object.
160+ plot them as a graph, you should rather use TGraphAsymmErrors::TGraphAsymmErrors(const TH1* pass,const TH1*
161+ total,Option_t* opt) to create a graph object.
160162
161163\anchor EFF03
162164## III. Filling with events
163- You can fill the TEfficiency object by calling the TEfficiency::Fill(Bool_t bPassed,Double_t x,Double_t y,Double_t z) method.
164- The "bPassed" boolean flag indicates whether the current event is good
165- (both histograms are filled) or not (only TEfficiency::fTotalHistogram is filled).
166- The x, y and z variables determine the bin which is filled. For lower dimensions, the z- or even the y-value may be omitted.
165+ You can fill the TEfficiency object by calling the TEfficiency::Fill(Bool_t bPassed,Double_t x,Double_t y,Double_t z)
166+ method. The "bPassed" boolean flag indicates whether the current event is good (both histograms are filled) or not (only
167+ TEfficiency::fTotalHistogram is filled). The x, y and z variables determine the bin which is filled. For lower
168+ dimensions, the z- or even the y-value may be omitted.
167169
168170Begin_Macro(source)
169171{
@@ -540,11 +542,11 @@ p_{2} = \frac{\sigma_{2}}{\sigma_{1} + \sigma_{2}} = \frac{N_{2}w_{2}}{N_{1}w_{1
540542### VI.1 Information about the internal histograms
541543The methods TEfficiency::GetPassedHistogram and TEfficiency::GetTotalHistogram
542544return a constant pointer to the internal histograms. They can be used to
543- obtain information about the internal histograms (e.g., the binning, number of passed / total events in a bin, mean values...).
544- One can obtain a clone of the internal histograms by calling TEfficiency::GetCopyPassedHisto or TEfficiency::GetCopyTotalHisto.
545- The returned histograms are completely independent from the current
546- TEfficiency object. By default, they are not attached to a directory to
547- avoid the duplication of data and the user is responsible for deleting them.
545+ obtain information about the internal histograms (e.g., the binning, number of passed / total events in a bin, mean
546+ values...). One can obtain a clone of the internal histograms by calling TEfficiency::GetCopyPassedHisto or
547+ TEfficiency::GetCopyTotalHisto. The returned histograms are completely independent from the current TEfficiency object.
548+ By default, they are not attached to a directory to avoid the duplication of data and the user is responsible for
549+ deleting them.
548550
549551
550552~~~~~~~~~~~~~~~{.cpp}
@@ -682,6 +684,7 @@ Begin_Macro(source)
682684End_Macro
683685
684686*/
687+ // clang-format on
685688
686689// //////////////////////////////////////////////////////////////////////////////
687690// / Default constructor
@@ -1503,7 +1506,8 @@ Double_t TEfficiency::BetaMode(Double_t a,Double_t b)
15031506// / Notes:
15041507// / - calls: SetName(name), SetTitle(title)
15051508// / - set the statistic option to the default (kFCP)
1506- // / - appends this object to the current directory SetDirectory(gDirectory)
1509+ // / - appends this object to the current directory SetDirectory(gDirectory) if
1510+ // / TH1::AddDirectoryStatus() is active.
15071511
15081512void TEfficiency::Build (const char * name,const char * title)
15091513{
@@ -3481,9 +3485,11 @@ void TEfficiency::SetConfidenceLevel(Double_t level)
34813485// / directory (if it exists) and a new reference to this TEfficiency object is
34823486// / added to the given directory.
34833487// /
3484- // / Notes: - If the given directory is 0, the TEfficiency object does not
3485- // / belong to any directory and will not be written to file during the
3486- // / next TFile::Write() command.
3488+ // / Notes:
3489+ // / - If the given directory is nullptr, the TEfficiency object does not
3490+ // / belong to any directory and will not be written to file during the
3491+ // / next TFile::Write() command. This also means that the user has ownership
3492+ // / of this object.
34873493
34883494void TEfficiency::SetDirectory (TDirectory* dir)
34893495{
0 commit comments