2#ifndef RIVET_ProjectionHandler_HH
3#define RIVET_ProjectionHandler_HH
9#include "Rivet/Config/RivetCommon.hh"
10#include "Rivet/Projection.fhh"
64 typedef map<const ProjectionApplier*, NamedProjs> NamedProjsMap;
68 NamedProjsMap _namedprojs;
106 std::unique_lock<std::mutex> lock(
mtx);
107 static map<std::thread::id,ProjectionHandler> _instances;
108 return _instances[std::this_thread::get_id()];
134 unique_ptr<Projection> _clone(
const Projection& proj);
142 string _getStatus()
const;
147 const string& name)
const;
165 const string& name)
const;
Common base class for Projection and Analysis, used for internal polymorphism.
Definition: ProjectionApplier.hh:21
The projection handler is a central repository for projections to be used in a Rivet analysis run.
Definition: ProjectionHandler.hh:43
const Projection & getProjection(const ProjectionApplier &parent, const string &name) const
set< const Projection * > getChildProjections(const ProjectionApplier &parent, ProjDepth depth=SHALLOW) const
ProjectionHandler & operator=(const ProjectionHandler &)=delete
The assignment operator is hidden.
bool hasProjection(const ProjectionApplier &parent, const string &name) const
Check if there is a name projection registered by parent.
const Projection & registerProjection(const ProjectionApplier &parent, const Projection &proj, const string &name)
Attach and retrieve a projection as a reference.
static std::mutex mtx
Singleton creation function.
Definition: ProjectionHandler.hh:102
set< ProjHandle > ProjHandles
Typedef for a vector of Projection pointers.
Definition: ProjectionHandler.hh:50
ProjectionHandler()=default
The standard constructor.
ProjDepth
Enum to specify depth of projection search.
Definition: ProjectionHandler.hh:57
ProjectionHandler(const ProjectionHandler &)=delete
The copy constructor is hidden.
map< string, ProjHandle > NamedProjs
Typedef for the structure used to contain named projections for a particular containing Analysis or P...
Definition: ProjectionHandler.hh:54
~ProjectionHandler()=default
Private destructor means no inheritance from this class.
Base class for all Rivet projections.
Definition: Projection.hh:29
Definition: MC_Cent_pPb.hh:10
std::shared_ptr< const Projection > ProjHandle
Typedef for Projection (smart) pointer.
Definition: ProjectionHandler.hh:16