Implementing the TEfficiency class in TFileService
A good fraction of the histograms that we fill are efficiencies of one sort or another. The TEfficiency class of ROOT is specifically designed for this purpose. It acts like a histogram, but is stored internally as two histograms, one for the trials and a 2nd for the successes. This makes it possible to Add() efficiency histograms, fit with the correct binomial errors, generate various confidence levels, etc. It has many methods in common with those of ordinary histograms.
The existence of this class is not common knowledge, but it should be!
In any case, TEfficiency is not currently implemented in TFileService. I'm guessing (hoping) that adding this to the service wouldn't be a big deal. Once it's in there, I can start urging people to try it!
#1 Updated by Christopher Green over 4 years ago
- Category set to User Code
- Status changed from New to Feedback
TFileService has two function template overloads which we believe are applicable to your situation:
makeAndRegister<>(). The former is intended for entities such as
THxxx, which append themselves to the current
TDirectory automatically, and the latter for entities such as
TGraph, which do not. Please try using the
make<>() function for
TEfficiency, as the documentation to which you link states that objects of this type are automatically added to the current
Please let us know if this has the behavior you desire.