Public Member Functions |
Static Public Member Functions |
Private Types |
Private Member Functions |
Private Attributes
HistoHandler Class Reference The projection handler is a central repository for histograms (and other analysis stats objects) to be used in a Rivet analysis run. This eliminates the need for analysis classes to contain large numbers of histogram pointer members, and allows histograms to be accessed via more user-friendly names than C++ variable names allow. More...
Collaboration diagram for HistoHandler:
![]()
Detailed DescriptionThe projection handler is a central repository for histograms (and other analysis stats objects) to be used in a Rivet analysis run. This eliminates the need for analysis classes to contain large numbers of histogram pointer members, and allows histograms to be accessed via more user-friendly names than C++ variable names allow. The core of the HistoHandler design is that it is a singleton class, essentially a wrapper around a map of Definition at line 26 of file HistoHandler.hh. Member Typedef Documentation
Typedef for histo pointer, to allow conversion to a smart pointer in this context. Definition at line 104 of file HistoHandler.hh.
Typedef for a vector of histo pointers. Definition at line 107 of file HistoHandler.hh.
Typedef for the structure used to contain named histos for a particular containing Analysis. Definition at line 111 of file HistoHandler.hh.
Structure used to map a containing Analysis to its set of histos. Definition at line 114 of file HistoHandler.hh. Constructor & Destructor Documentation
Private destructor means no inheritance from this class. Definition at line 23 of file HistoHandler.cc. References HistoHandler::clear(). { clear(); }
The copy constructor is hidden. Member Function Documentation
Definition at line 55 of file HistoHandler.cc. References HistoHandler::_namedhistos, HistoHandler::getLog(), and Log::TRACE. Referenced by HistoHandler::getAnalysisObject(). { getLog() << Log::TRACE << "Searching for child histo '" << name << "' of " << &parent << endl; NamedHistosMap::const_iterator nhs = _namedhistos.find(&parent); if (nhs == _namedhistos.end()) { stringstream ss; ss << "Couldn't find any histograms for parent analysis " << &parent; throw Error(ss.str()); } NamedHistos::const_iterator nh = nhs->second.find(name); if (nh == nhs->second.end()) { stringstream ss; ss << "Couldn't find histogram \"" << name << "\" for parent analysis " << &parent; throw Error(ss.str()); } //return *(nh->second); AnalysisObject* rtn = const_cast<AnalysisObject*>(nh->second); return rtn; }
Histo clearing method: deletes all known histos and empties the reference collections. Definition at line 17 of file HistoHandler.cc. References HistoHandler::_namedhistos. Referenced by HistoHandler::~HistoHandler(). { _namedhistos.clear(); }
Retrieve a named histo for the given Analysis parent (const version). Definition at line 72 of file HistoHandler.hh. References HistoHandler::_getAnalysisObject(). { return _getAnalysisObject(parent, name); }
Retrieve a named histo for the given Analysis parent (non-const version). Definition at line 79 of file HistoHandler.hh. References HistoHandler::_getAnalysisObject(). { return _getAnalysisObject(parent, name); }
Singleton getter function. Definition at line 50 of file HistoHandler.hh. { static HistoHandler _instance; return _instance; } Get a logger. Definition at line 12 of file HistoHandler.cc. Referenced by HistoHandler::_getAnalysisObject(), and HistoHandler::registerAnalysisObject(). { return Log::getLog("Rivet.HistoHandler"); }
The assignment operator is hidden.
Copy an analysis object into a central collection and return the copy. Definition at line 28 of file HistoHandler.cc. References HistoHandler::_namedhistos, HistoHandler::getLog(), Analysis::name(), and Log::TRACE. { getLog() << Log::TRACE << "Trying to register" << " analysis object " << &ao << " for parent " << &parent << "(" << parent.name() << ")" << " with name '" << name << "'" << endl; // If this name is already registered for this analysis, throw a complaint NamedHistosMap::const_iterator nhs = _namedhistos.find(&parent); if (nhs != _namedhistos.end()) { NamedHistos::const_iterator nh = nhs->second.find(name); if (nh != nhs->second.end()) { stringstream ss; ss << "Histogram \"" << name << "\" already exists for parent analysis " << &parent; throw Error(ss.str()); } } _namedhistos[&parent][name] = &ao; //return *(_namedhistos[&parent][name]); return const_cast<AnalysisObject*>(_namedhistos[&parent][name]); } Member Data Documentation
Core data member, associating a given Analysis to its histos. Definition at line 117 of file HistoHandler.hh. Referenced by HistoHandler::_getAnalysisObject(), HistoHandler::clear(), and HistoHandler::registerAnalysisObject(). The documentation for this class was generated from the following files: Generated on Fri Dec 21 2012 15:03:51 for The Rivet MC analysis system by ![]() |