// -*- C++ -*- #ifndef RIVET_Cparam_HH #define RIVET_Cparam_HH #include "Rivet/Particle.hh" #include "Rivet/Projection.hh" #include "Rivet/Projections/AxesDefinition.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Event.hh" namespace Rivet { //Projection to find the cparam for a given event. class Cparam : public AxesDefinition { public: /// Constructor. Cparam(const FinalState& fsp) : _calculatedCparam(false) { setName("Cparam"); addProjection(fsp, "FS"); } /// Clone on the heap. virtual const Projection* clone() const { return new Cparam(*this); } protected: /// Perform the projection on the Event void project(const Event& e) { const vector ps = applyProjection(e, "FS").particles(); calc(ps); } /// Compare projections int compare(const Projection& p) const { return mkNamedPCmp(p, "FS"); } public: ///@{ Cparam scalar accessors /// The cparam scalar, \f$ T \f$, (cparam along taxis). const double cparam() const { return _cparams[0]; } ///@{ Cparam axis accessors, doesnt make sense for this projection but needed to satisfy definition of a AxesDefinition Projection: /// The cparam axis. const Vector3& cparamAxis() const { return _cparamAxes[0]; } ///@{ AxesDefinition axis accessors. const Vector3& axis1() const { return cparamAxis(); } const Vector3& axis2() const { return cparamAxis(); } const Vector3& axis3() const { return cparamAxis(); } public: /// @name Direct methods /// Ways to do the calculation directly, without engaging the caching system //@{ /// Manually calculate the cparam, without engaging the caching system void calc(const FinalState& fs); /// Manually calculate the cparam, without engaging the caching system void calc(const vector& fsparticles); /// Manually calculate the cparam, without engaging the caching system void calc(const vector& fsmomenta); //@} private: /// The cparam scalars. vector _cparams; /// The cparam axes. vector _cparamAxes; /// Caching flag to avoid costly recalculations. bool _calculatedCparam; private: /// Explicitly calculate the cparam values. void _calcCparam(const vector& fsmomenta); }; } #endif