2 #ifndef RIVET_ProjectionApplier_HH 3 #define RIVET_ProjectionApplier_HH 5 #include "Rivet/Config/RivetCommon.hh" 6 #include "Rivet/Projection.fhh" 7 #include "Rivet/ProjectionHandler.hh" 8 #include "Rivet/Tools/Logging.hh" 36 virtual std::string
name()
const = 0;
55 template <
typename PROJ>
58 return pcast<PROJ>(p);
62 template <
typename PROJ>
63 const PROJ&
get(
const std::string&
name)
const {
return getProjection<PROJ>(
name); }
78 template <
typename PROJ>
81 return pcast<PROJ>(_applyProjection(evt, proj));
85 template <
typename PROJ>
86 const PROJ&
apply(
const Event& evt,
const Projection& proj)
const {
return applyProjection<PROJ>(evt, proj); }
90 template <
typename PROJ>
93 return pcast<PROJ>(_applyProjection(evt, proj));
97 template <
typename PROJ>
98 const PROJ&
apply(
const Event& evt,
const PROJ& proj)
const {
return applyProjection<PROJ>(evt, proj); }
103 template <
typename PROJ>
105 return pcast<PROJ>(_applyProjection(evt, name));
109 template <
typename PROJ>
110 const PROJ&
apply(
const Event& evt,
const std::string&
name)
const {
return applyProjection<PROJ>(evt,
name); }
113 template <
typename PROJ>
114 const PROJ&
apply(
const std::string&
name,
const Event& evt)
const {
return applyProjection<PROJ>(evt,
name); }
125 Log& getLog()
const {
150 template <
typename PROJ>
152 const Projection& reg = _declareProjection(proj, name);
153 const PROJ& rtn =
dynamic_cast<const PROJ&
>(reg);
159 template <
typename PROJ>
163 template <
typename PROJ>
175 const Projection& _applyProjection(
const Event& evt,
const std::string& name)
const;
Definition: MC_Cent_pPb.hh:10
bool hasProjection(const std::string &name) const
Does this applier have a projection registered under the name name?
Definition: ProjectionApplier.hh:49
const PROJ & applyProjection(const Event &evt, const Projection &proj) const
Apply the supplied projection on event evt.
Definition: ProjectionApplier.hh:80
void markAsOwned() const
Mark this object as owned by a proj-handler.
Definition: ProjectionApplier.hh:120
const Projection & getProjection(const ProjectionApplier &parent, const string &name) const
static Log & getLog(const std::string &name)
const PROJ & apply(const std::string &name, const Event &evt) const
Definition: ProjectionApplier.hh:114
const PROJ & apply(const Event &evt, const PROJ &proj) const
Definition: ProjectionApplier.hh:98
std::set< ConstProjectionPtr > getProjections() const
Get the contained projections, including recursion.
Definition: ProjectionApplier.hh:44
const PROJ & applyProjection(const Event &evt, const std::string &name) const
Definition: ProjectionApplier.hh:104
const PROJ & apply(const Event &evt, const std::string &name) const
Definition: ProjectionApplier.hh:110
Logging system for controlled & formatted writing to stdout.
Definition: Logging.hh:10
virtual std::string name() const =0
Get the name of this Projection or Analysis class.
The projection handler is a central repository for projections to be used in a Rivet analysis run...
Definition: ProjectionHandler.hh:39
const PROJ & declareProjection(const PROJ &proj, const std::string &name)
Register a contained projection.
Definition: ProjectionApplier.hh:151
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
ProjectionHandler & getProjHandler() const
Get a reference to the ProjectionHandler for this thread.
Definition: ProjectionApplier.hh:131
Common base class for Projection and Analysis, used for internal polymorphism.
Definition: ProjectionApplier.hh:21
const PROJ & apply(const Event &evt, const Projection &proj) const
Definition: ProjectionApplier.hh:86
const PROJ & getProjection(const std::string &name) const
Definition: ProjectionApplier.hh:56
const Projection & getProjection(const std::string &name) const
Definition: ProjectionApplier.hh:67
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:160
const PROJ & applyProjection(const Event &evt, const PROJ &proj) const
Apply the supplied projection on event evt.
Definition: ProjectionApplier.hh:92
bool hasProjection(const ProjectionApplier &parent, const string &name) const
Check if there is a name projection registered by parent.
ProjectionApplier()
Constructor.
const PROJ & declare(const std::string &name, const PROJ &proj)
Register a contained projection (user-facing, arg-reordered version)
Definition: ProjectionApplier.hh:164
Base class for all Rivet projections.
Definition: Projection.hh:29
set< const Projection * > getChildProjections(const ProjectionApplier &parent, ProjDepth depth=SHALLOW) const