HistoHandler.hh
// -*- C++ -*-
#ifndef RIVET_HistoHandler_HH
#define RIVET_HistoHandler_HH
#include "Rivet/Rivet.hh"
#include "Rivet/Tools/Logging.fhh"
#include "Rivet/Analysis.fhh"
namespace Rivet {
class AnalysisObject;
class HistoHandler {
private:
HistoHandler() { }
~HistoHandler();
HistoHandler& operator=(const HistoHandler&);
HistoHandler(const HistoHandler&);
public:
static HistoHandler& getInstance() {
static HistoHandler _instance;
return _instance;
}
public:
const AnalysisObject* registerAnalysisObject(const Analysis& parent,
const AnalysisObject& histo,
const string& name);
const AnalysisObject* getAnalysisObject(const Analysis& parent,
const string& name) const {
return _getAnalysisObject(parent, name);
}
AnalysisObject* getAnalysisObject(const Analysis& parent,
const string& name) {
return _getAnalysisObject(parent, name);
}
void clear();
private:
AnalysisObject* _getAnalysisObject(const Analysis& parent,
const string& name) const;
Log& getLog() const;
private:
typedef const AnalysisObject* HistoHandle;
typedef vector<HistoHandle> HistoHandles;
typedef map<const string, HistoHandle> NamedHistos;
typedef map<const Analysis*, NamedHistos> NamedHistosMap;
NamedHistosMap _namedhistos;
};
}
#endif
Rivet
Definition: MC_JetAnalysis.hh:9
Rivet::HistoHandler::clear
void clear()
Definition: HistoHandler.cc:17
Rivet::HistoHandler::getAnalysisObject
AnalysisObject * getAnalysisObject(const Analysis &parent, const string &name)
Retrieve a named histo for the given Analysis parent (non-const version).
Definition: HistoHandler.hh:79
Rivet::Log
Definition: Logging.hh:9
Rivet::Analysis
This is the base class of all analysis classes in Rivet.
Definition: Analysis.hh:51
Rivet::HistoHandler::getInstance
static HistoHandler & getInstance()
Singleton getter function.
Definition: HistoHandler.hh:50
Rivet::HistoHandler::registerAnalysisObject
const AnalysisObject * registerAnalysisObject(const Analysis &parent, const AnalysisObject &histo, const string &name)
Copy an analysis object into a central collection and return the copy.
Definition: HistoHandler.cc:28
Rivet::HistoHandler
The projection handler is a central repository for histograms (and other analysis stats objects) to b...
Definition: HistoHandler.hh:26
Rivet::HistoHandler::getAnalysisObject
const AnalysisObject * getAnalysisObject(const Analysis &parent, const string &name) const
Retrieve a named histo for the given Analysis parent (const version).
Definition: HistoHandler.hh:72