rivet is hosted by Hepforge, IPPP Durham

Get the transverse spherocity scalars for hadron-colliders. More...

#include <Spherocity.hh>

List of all members.

Public Member Functions

 Spherocity ()
 Spherocity (const FinalState &fsp)
 Constructor.
 DEFAULT_RIVET_PROJ_CLONE (Spherocity)
 Clone on the heap.
virtual unique_ptr< Projectionclone () const =0
 Clone on the heap.
bool before (const Projection &p) const
virtual const std::set< PdgIdPairbeamPairs () const
virtual std::string name () const
 Get the name of the projection.
ProjectionaddPdgIdPair (PdgId beam1, PdgId beam2)
 Add a colliding beam pair.
LoggetLog () const
 Get a Log object based on the getName() property of the calling projection object.
void setName (const std::string &name)
 Used by derived classes to set their name.
void markAsOwned () const
Spherocity scalar accessors
double spherocity () const
 The spherocity scalar, $ S $, (minimum spherocity).
Spherocity axis accessors
const Vector3spherocityAxis () const
 The spherocity axis.
const Vector3spherocityMajorAxis () const
 The spherocity major axis (axis of max spherocity perpendicular to spherocity axis).
const Vector3spherocityMinorAxis () const
 The spherocity minor axis (axis perpendicular to spherocity and spherocity major).
AxesDefinition axis accessors.
const Vector3axis1 () const
const Vector3axis2 () const
 The 2nd most significant ("major") axis.
const Vector3axis3 () const
 The least significant ("minor") axis.
Direct methods

Ways to do the calculation directly, without engaging the caching system

void calc (const FinalState &fs)
 Manually calculate the spherocity, without engaging the caching system.
void calc (const vector< Particle > &fsparticles)
 Manually calculate the spherocity, without engaging the caching system.
void calc (const vector< FourMomentum > &fsmomenta)
 Manually calculate the spherocity, without engaging the caching system.
void calc (const vector< Vector3 > &threeMomenta)
 Manually calculate the spherocity, without engaging the caching system.
Projection "getting" functions
std::set< ConstProjectionPtrgetProjections () const
 Get the contained projections, including recursion.
template<typename PROJ >
const PROJ & getProjection (const std::string &name) const
const ProjectiongetProjection (const std::string &name) const
template<typename PROJ >
const PROJ & get (const std::string &name) const
Projection applying functions
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const Projection &proj) const
 Apply the supplied projection on event evt.
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const PROJ &proj) const
 Apply the supplied projection on event evt.
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const std::string &name) const
template<typename PROJ >
const PROJ & apply (const Event &evt, const Projection &proj) const
template<typename PROJ >
const PROJ & apply (const Event &evt, const PROJ &proj) const
template<typename PROJ >
const PROJ & apply (const Event &evt, const std::string &name) const

Protected Member Functions

void project (const Event &e)
 Perform the projection on the Event.
int compare (const Projection &p) const
 Compare projections.
Cmp< ProjectionmkNamedPCmp (const Projection &otherparent, const std::string &pname) const
Cmp< ProjectionmkPCmp (const Projection &otherparent, const std::string &pname) const
ProjectionHandlergetProjHandler () const
 Get a reference to the ProjectionHandler for this thread.
const Projection_applyProjection (const Event &evt, const std::string &name) const
const Projection_applyProjection (const Event &evt, const Projection &proj) const
Projection registration functions
template<typename PROJ >
const PROJ & declareProjection (const PROJ &proj, const std::string &name)
 Register a contained projection.
template<typename PROJ >
const PROJ & declare (const PROJ &proj, const std::string &name)
 Register a contained projection (user-facing version)
template<typename PROJ >
const PROJ & addProjection (const PROJ &proj, const std::string &name)
 Register a contained projection (user-facing version)
const Projection_declareProjection (const Projection &proj, const std::string &name)
 Untemplated function to do the work...

Protected Attributes

bool _allowProjReg
 Flag to forbid projection registration in analyses until the init phase.

Private Member Functions

void _calcSpherocity (const vector< Vector3 > &fsmomenta)
 Explicitly calculate the spherocity values.

Private Attributes

vector< double > _spherocities
 The spherocity scalars.
vector< Vector3_spherocityAxes
 The spherocity axes.
bool _calculatedSpherocity
 Caching flag to avoid costly recalculations.

Friends

class Event
 Event is a friend.
class Cmp< Projection >
 The Cmp specialization for Projection is a friend.

Detailed Description

Get the transverse spherocity scalars for hadron-colliders.

Author:
Holger Schulz

The scalar (minimum) transverse spherocity is defined as

\[ S = \frac{\pi^2}{4} \mathrm{min}_{\vec{n}_\perp} \left( \frac{\sum_i \left|\vec{p}_{\perp,i} \times \vec{n}_\perp \right|}{\sum_i |\vec{p}_{\perp,i}|} \right)^2 \]

, with the direction of the unit vector $ \vec{n_\perp} $ which minimises $ T $ being identified as the spherocity axis. The unit vector which maximises the spherocity scalar in the plane perpendicular to $ \vec{n} $ is the "spherocity major" direction, and the vector perpendicular to both the spherocity and spherocity major directions is the spherocity minor. Both the major and minor directions have associated spherocity scalars.

Care must be taken in the case of Drell-Yan processes - there we should use the newly proposed observable $ a_T $.

Definition at line 30 of file Spherocity.hh.


Constructor & Destructor Documentation

Spherocity ( ) [inline]

Definition at line 34 of file Spherocity.hh.

{}
Spherocity ( const FinalState fsp) [inline]

Constructor.

Definition at line 37 of file Spherocity.hh.

      : _calculatedSpherocity(false)
    {
      setName("Spherocity");
      addProjection(fsp, "FS");
    }

Member Function Documentation

const Projection & _applyProjection ( const Event evt,
const std::string &  name 
) const [protected, inherited]

Non-templated version of string-based applyProjection, to work around header dependency issue.

Definition at line 22 of file ProjectionApplier.cc.

                                                                                  {
    return evt.applyProjection(getProjection(name));
  }
const Projection & _applyProjection ( const Event evt,
const Projection proj 
) const [protected, inherited]

Non-templated version of proj-based applyProjection, to work around header dependency issue.

Definition at line 28 of file ProjectionApplier.cc.

                                                                                      {
    return evt.applyProjection(proj);
  }
void _calcSpherocity ( const vector< Vector3 > &  fsmomenta) [private]

Explicitly calculate the spherocity values.

Definition at line 79 of file Spherocity.cc.

                                                                   {

    // Make a vector of the three-momenta in the final state
    // Explicitly set the z-component (parallel to beam axis) to zero
    // This creates a 3D-vector representation of the transverse momentum
    // but takes the full information momentum vectors as input

    // A small iteration over full momenta but set z-coord. to 0.0 to get transverse momenta
    vector<Vector3> fsperpmomenta;
    foreach (const Vector3& p, fsmomenta) {
      fsperpmomenta.push_back(Vector3(p.x(), p.y(), 0.0));
    }

    // This returns the scalar sum of (transverse) momenta
    double perpmomentumSum(0.0);
    foreach (const Vector3& p, fsperpmomenta) {
      perpmomentumSum += p.mod();
    }

    // Clear the caches
    _spherocities.clear();
    _spherocityAxes.clear();


    // Temporary variables for calcs
    Vector3 axis(0,0,0);
    double val = 0.;

    // Get spherocity
    _calcS(fsperpmomenta, val, axis);
    MSG_DEBUG("Mom sum = " << perpmomentumSum);
    double spherocity = 0.25 * PI * PI * val * val / (perpmomentumSum * perpmomentumSum);
    _spherocities.push_back(spherocity);

    // See if calculated spherocity value makes sense
    if (spherocity < 0.0 || spherocity > 1.0) {
      MSG_WARNING("Spherocity = " << spherocity);
    }

    MSG_DEBUG("Spherocity value = " << spherocity);

    MSG_DEBUG("Sperocity axis = " << axis);

    _spherocityAxes.push_back(axis);
  }
const Projection & _declareProjection ( const Projection proj,
const std::string &  name 
) [protected, inherited]

Untemplated function to do the work...

Definition at line 34 of file ProjectionApplier.cc.

                                                                             {
    if (!_allowProjReg) {
      cerr << "Trying to register projection '"
           << proj.name() << "' before init phase in '" << this->name() << "'." << endl;
      exit(2);
    }
    const Projection& reg = getProjHandler().registerProjection(*this, proj, name);
    return reg;
  }
Projection& addPdgIdPair ( PdgId  beam1,
PdgId  beam2 
) [inline, inherited]

Add a colliding beam pair.

Definition at line 108 of file Projection.hh.

                                                       {
      _beamPairs.insert(PdgIdPair(beam1, beam2));
      return *this;
    }
const PROJ& addProjection ( const PROJ &  proj,
const std::string &  name 
) [inline, protected, inherited]

Register a contained projection (user-facing version)

Deprecated:
Use declareProjection() or declare()
Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 157 of file ProjectionApplier.hh.

{ return declareProjection(proj, name); }
const PROJ& apply ( const Event evt,
const Projection proj 
) const [inline, inherited]

Apply the supplied projection on event evt (user-facing alias).

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 80 of file ProjectionApplier.hh.

{ return applyProjection<PROJ>(evt, proj); }
const PROJ& apply ( const Event evt,
const PROJ &  proj 
) const [inline, inherited]

Apply the supplied projection on event evt (user-facing alias).

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 92 of file ProjectionApplier.hh.

{ return applyProjection<PROJ>(evt, proj); }
const PROJ& apply ( const Event evt,
const std::string &  name 
) const [inline, inherited]

Apply the supplied projection on event evt (user-facing alias).

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 104 of file ProjectionApplier.hh.

{ return applyProjection<PROJ>(evt, name); }
const PROJ& applyProjection ( const Event evt,
const Projection proj 
) const [inline, inherited]

Apply the supplied projection on event evt.

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 74 of file ProjectionApplier.hh.

                                                                                {
      return pcast<PROJ>(_applyProjection(evt, proj));
    }
const PROJ& applyProjection ( const Event evt,
const PROJ &  proj 
) const [inline, inherited]

Apply the supplied projection on event evt.

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 86 of file ProjectionApplier.hh.

                                                                          {
      return pcast<PROJ>(_applyProjection(evt, proj));
    }
const PROJ& applyProjection ( const Event evt,
const std::string &  name 
) const [inline, inherited]

Apply the named projection on event evt.

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 98 of file ProjectionApplier.hh.

                                                                               {
      return pcast<PROJ>(_applyProjection(evt, name));
    }
const Vector3& axis1 ( ) const [inline, virtual]

Axis accessors, in decreasing order of significance. The main axis.

Implements AxesDefinition.

Definition at line 86 of file Spherocity.hh.

{ return spherocityAxis(); }
const Vector3& axis2 ( ) const [inline, virtual]

The 2nd most significant ("major") axis.

Implements AxesDefinition.

Definition at line 87 of file Spherocity.hh.

{ return spherocityMajorAxis(); }
const Vector3& axis3 ( ) const [inline, virtual]

The least significant ("minor") axis.

Implements AxesDefinition.

Definition at line 88 of file Spherocity.hh.

{ return spherocityMinorAxis(); }
const set< PdgIdPair > beamPairs ( ) const [virtual, inherited]

Return the allowed beam pairs on which this projection can operate, not including recursion. Derived classes should ensure that all contained projections are registered in the _projections set for the beam constraint chaining to work.

Todo:
Remove the beam constraints system from projections.

Definition at line 35 of file Projection.cc.

                                                   {
    set<PdgIdPair> ret = _beamPairs;
    set<ConstProjectionPtr> projs = getProjections();
    for (set<ConstProjectionPtr>::const_iterator ip = projs.begin(); ip != projs.end(); ++ip) {
      ConstProjectionPtr p = *ip;
      getLog() << Log::TRACE << "Proj addr = " << p << endl;
      if (p) ret = intersection(ret, p->beamPairs());
    }
    return ret;
  }
bool before ( const Projection p) const [inherited]

Determine whether this object should be ordered before the object p given as argument. If p is of a different class than this, the before() function of the corresponding type_info objects is used. Otherwise, if the objects are of the same class, the virtual compare(const Projection &) will be returned.

Definition at line 24 of file Projection.cc.

                                                   {
    const std::type_info& thisid = typeid(*this);
    const std::type_info& otherid = typeid(p);
    if (thisid == otherid) {
      return compare(p) < 0;
    } else {
      return thisid.before(otherid);
    }
  }
void calc ( const FinalState fs)

Manually calculate the spherocity, without engaging the caching system.

Definition at line 10 of file Spherocity.cc.

                                            {
    calc(fs.particles());
  }
void calc ( const vector< Particle > &  fsparticles)

Manually calculate the spherocity, without engaging the caching system.

Definition at line 15 of file Spherocity.cc.

                                                           {
    vector<Vector3> threeMomenta;
    threeMomenta.reserve(fsparticles.size());
    foreach (const Particle& p, fsparticles) {
      threeMomenta.push_back( p.momentum().vector3() );
    }
    _calcSpherocity(threeMomenta);
  }
void calc ( const vector< FourMomentum > &  fsmomenta)

Manually calculate the spherocity, without engaging the caching system.

Definition at line 25 of file Spherocity.cc.

                                                             {
    vector<Vector3> threeMomenta;
    threeMomenta.reserve(fsmomenta.size());
    foreach (const FourMomentum& v, fsmomenta) {
      threeMomenta.push_back(v.vector3());
    }
    _calcSpherocity(threeMomenta);
  }
void calc ( const vector< Vector3 > &  threeMomenta)

Manually calculate the spherocity, without engaging the caching system.

Definition at line 35 of file Spherocity.cc.

                                                        {
    _calcSpherocity(fsmomenta);
  }
virtual unique_ptr<Projection> clone ( ) const [pure virtual, inherited]

Clone on the heap.

Implements Projection.

int compare ( const Projection p) const [inline, protected, virtual]

Compare projections.

Implements Projection.

Definition at line 59 of file Spherocity.hh.

                                           {
      return mkNamedPCmp(p, "FS");
    }
const PROJ& declare ( const PROJ &  proj,
const std::string &  name 
) [inline, protected, inherited]

Register a contained projection (user-facing version)

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 151 of file ProjectionApplier.hh.

{ return declareProjection(proj, name); }
const PROJ& declareProjection ( const PROJ &  proj,
const std::string &  name 
) [inline, protected, inherited]

Register a contained projection.

The type of the argument is used to instantiate a new projection internally: this new object is applied to events rather than the argument object. Hence you are advised to only use locally-scoped Projection objects in your Projection and Analysis constructors, and to avoid polymorphism (e.g. handling ConcreteProjection via a pointer or reference to type Projection) since this will screw up the internal type management.

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 142 of file ProjectionApplier.hh.

                                                                           {
      const Projection& reg = _declareProjection(proj, name);
      const PROJ& rtn = dynamic_cast<const PROJ&>(reg);
      return rtn;
    }

Clone on the heap.

const PROJ& get ( const std::string &  name) const [inline, inherited]

Get the named projection, specifying return type via a template argument (user-facing alias).

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 57 of file ProjectionApplier.hh.

{ return getProjection<PROJ>(name); }
Log& getLog ( ) const [inline, inherited]

Get a Log object based on the getName() property of the calling projection object.

Reimplemented from ProjectionApplier.

Definition at line 115 of file Projection.hh.

                        {
      string logname = "Rivet.Projection." + name();
      return Log::getLog(logname);
    }
const PROJ& getProjection ( const std::string &  name) const [inline, inherited]

Get the named projection, specifying return type via a template argument.

Todo:
Add SFINAE to require that PROJ inherit from Projection

Definition at line 50 of file ProjectionApplier.hh.

                                                           {
      const Projection& p = getProjHandler().getProjection(*this, name);
      return pcast<PROJ>(p);
    }
const Projection& getProjection ( const std::string &  name) const [inline, inherited]

Get the named projection (non-templated, so returns as a reference to a Projection base class).

Definition at line 61 of file ProjectionApplier.hh.

                                                                 {
      return getProjHandler().getProjection(*this, name);
    }
std::set<ConstProjectionPtr> getProjections ( ) const [inline, inherited]

Get the contained projections, including recursion.

Definition at line 43 of file ProjectionApplier.hh.

ProjectionHandler& getProjHandler ( ) const [inline, protected, inherited]

Get a reference to the ProjectionHandler for this thread.

Definition at line 122 of file ProjectionApplier.hh.

                                              {
      return _projhandler;
    }
void markAsOwned ( ) const [inline, inherited]

Mark object as owned by the _projhandler

Todo:
Huh? What's this for?

Definition at line 111 of file ProjectionApplier.hh.

{ _owned = true; }
Cmp< Projection > mkNamedPCmp ( const Projection otherparent,
const std::string &  pname 
) const [protected, inherited]

Shortcut to make a named Cmp<Projection> comparison with the *this object automatically passed as one of the parent projections.

Definition at line 47 of file Projection.cc.

                                                                                                  {
    return pcmp(*this, otherparent, pname);
  }
Cmp< Projection > mkPCmp ( const Projection otherparent,
const std::string &  pname 
) const [protected, inherited]

Shortcut to make a named Cmp<Projection> comparison with the *this object automatically passed as one of the parent projections.

Note:
Alias for mkNamedPCmp

Definition at line 51 of file Projection.cc.

                                                                                             {
    return pcmp(*this, otherparent, pname);
  }
virtual std::string name ( ) const [inline, virtual, inherited]

Get the name of the projection.

Implements ProjectionApplier.

Definition at line 102 of file Projection.hh.

                                   {
      return _name;
    }
void project ( const Event e) [inline, protected, virtual]

Perform the projection on the Event.

Implements Projection.

Definition at line 51 of file Spherocity.hh.

                                 {
      const vector<Particle> ps
        = applyProjection<FinalState>(e, "FS").particles();
      calc(ps);
    }
void setName ( const std::string &  name) [inline, inherited]

Used by derived classes to set their name.

Definition at line 121 of file Projection.hh.

                                        {
      _name = name;
    }
double spherocity ( ) const [inline]

The spherocity scalar, $ S $, (minimum spherocity).

Definition at line 69 of file Spherocity.hh.

{ return _spherocities[0]; }
const Vector3& spherocityAxis ( ) const [inline]

The spherocity axis.

Definition at line 76 of file Spherocity.hh.

{ return _spherocityAxes[0]; }
const Vector3& spherocityMajorAxis ( ) const [inline]

The spherocity major axis (axis of max spherocity perpendicular to spherocity axis).

Definition at line 78 of file Spherocity.hh.

{ return _spherocityAxes[1]; }
const Vector3& spherocityMinorAxis ( ) const [inline]

The spherocity minor axis (axis perpendicular to spherocity and spherocity major).

Definition at line 80 of file Spherocity.hh.

{ return _spherocityAxes[2]; }

Friends And Related Function Documentation

friend class Cmp< Projection > [friend, inherited]

The Cmp specialization for Projection is a friend.

Definition at line 36 of file Projection.hh.

friend class Event [friend, inherited]

Event is a friend.

Definition at line 33 of file Projection.hh.


Member Data Documentation

bool _allowProjReg [protected, inherited]

Flag to forbid projection registration in analyses until the init phase.

Definition at line 176 of file ProjectionApplier.hh.

bool _calculatedSpherocity [private]

Caching flag to avoid costly recalculations.

Definition at line 122 of file Spherocity.hh.

vector<double> _spherocities [private]

The spherocity scalars.

Definition at line 116 of file Spherocity.hh.

vector<Vector3> _spherocityAxes [private]

The spherocity axes.

Definition at line 119 of file Spherocity.hh.


The documentation for this class was generated from the following files: