rivet is hosted by Hepforge, IPPP Durham

Project out the incoming beams. More...

#include <Beam.hh>

List of all members.

Public Member Functions

 Beam ()
 Default (and only) constructor.
 DEFAULT_RIVET_PROJ_CLONE (Beam)
 Clone on the heap.
FourVector pv () const
 Get the beam interaction primary vertex (PV) position.
virtual void project (const Event &e)
 Project on to the Event.
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
Beam particles and kinematics
const ParticlePairbeams () const
 The pair of beam particles in the current collision.
PdgIdPair beamIds () const
double sqrtS () const
 Get centre of mass energy, $ \sqrt{s} $.
FourMomentum cmsBoostVec () const
 Get the Lorentz boost to the beam centre-of-mass.
LorentzTransform cmsTransform () const
 Get the Lorentz transform to the beam centre-of-mass.
Vector3 cmsBetaVec () const
 Get the beta factor vector for the Lorentz boost to the beam centre-of-mass.
Vector3 cmsGammaVec () const
 Get the gamma factor vector for the Lorentz boost to the beam centre-of-mass.
Per-nucleon beam kinematics
double asqrtS () const
 Get per-nucleon centre of mass energy, $ \sqrt{s}/(A_1 + A_2) $.
Vector3 acmsBetaVec () const
 Get the Lorentz boost to the per-nucleon beam centre-of-mass.
Vector3 acmsGammaVec () const
 Get the Lorentz boost to the per-nucleon beam centre-of-mass.
LorentzTransform acmsTransform () const
 Get the Lorentz transform to the per-nucleon beam centre-of-mass.
Standard constructors and destructors.
virtual unique_ptr< Projectionclone () const =0
 Clone on the heap.
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

virtual int compare (const Projection &p) const =0
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

virtual int compare (const Projection &UNUSED(p)) const
 Compare with other projections -- it's always the same, since there are no params.

Private Attributes

ParticlePair _theBeams
 The beam particles in the current collision.

Friends

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

Detailed Description

Project out the incoming beams.

Definition at line 129 of file Beam.hh.


Constructor & Destructor Documentation

Beam ( ) [inline]

Default (and only) constructor.

Definition at line 133 of file Beam.hh.

{ setName("Beam"); }

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);
  }
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;
  }
Vector3 acmsBetaVec ( ) const [inline]

Get the Lorentz boost to the per-nucleon beam centre-of-mass.

Definition at line 174 of file Beam.hh.

{ return Rivet::acmsBetaVec(beams()); }
Vector3 acmsGammaVec ( ) const [inline]

Get the Lorentz boost to the per-nucleon beam centre-of-mass.

Definition at line 177 of file Beam.hh.

{ return Rivet::acmsGammaVec(beams()); }
LorentzTransform acmsTransform ( ) const [inline]

Get the Lorentz transform to the per-nucleon beam centre-of-mass.

Definition at line 180 of file Beam.hh.

{ return Rivet::acmsTransform(beams()); }
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));
    }
double asqrtS ( ) const [inline]

Get per-nucleon centre of mass energy, $ \sqrt{s}/(A_1 + A_2) $.

Definition at line 171 of file Beam.hh.

{ return Rivet::asqrtS(beams()); }
PdgIdPair beamIds ( ) const [inline]

The pair of beam particle PDG codes in the current collision

Deprecated:
Use pids(beams())

Definition at line 147 of file Beam.hh.

{ return pids(beams()); }
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;
  }
const ParticlePair& beams ( ) const [inline]

The pair of beam particles in the current collision.

Definition at line 143 of file Beam.hh.

{ return _theBeams; }
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);
    }
  }
virtual unique_ptr<Projection> clone ( ) const [pure virtual, inherited]

Clone on the heap.

Implemented in JetAlg, AxesDefinition, and ParticleFinder.

Vector3 cmsBetaVec ( ) const [inline]

Get the beta factor vector for the Lorentz boost to the beam centre-of-mass.

Definition at line 159 of file Beam.hh.

{ return Rivet::cmsBetaVec(beams()); }
FourMomentum cmsBoostVec ( ) const [inline]

Get the Lorentz boost to the beam centre-of-mass.

Definition at line 153 of file Beam.hh.

{ return Rivet::cmsBoostVec(beams()); }
Vector3 cmsGammaVec ( ) const [inline]

Get the gamma factor vector for the Lorentz boost to the beam centre-of-mass.

Definition at line 162 of file Beam.hh.

{ return Rivet::cmsGammaVec(beams()); }
LorentzTransform cmsTransform ( ) const [inline]

Get the Lorentz transform to the beam centre-of-mass.

Definition at line 156 of file Beam.hh.

{ return Rivet::cmsTransform(beams()); }
virtual int compare ( const Projection p) const [protected, pure virtual, inherited]

This function is used to define a unique ordering between different Projection objects of the same class. If this is considered to be equivalent to the Projector object, p, in the argument the function should return 0. If this object should be ordered before p a negative value should be returned, otherwise a positive value should be returned. This function must never be called explicitly, but should only be called from the operator<(const Projection &). When implementing the function in concrete sub-classes, it is then guaranteed that the Projection object p in the argument is of the same class as the sub-class and can be safely dynamically casted to that class.

When implementing this function in a sub-class, the immediate base class version of the function should be called first. If the base class function returns a non-zero value, that value should be returned immediately. Only if zero is returned should this function check the member variables of the sub-class to determine whether this should be ordered before or after p, or if it is equivalent with p.

Implemented in FastJets, JetAlg, ParticleFinder, JetShape, VetoedFinalState, IdentifiedFinalState, WFinder, ZFinder, Hemispheres, DressedLeptons, PartonicTops, HeavyHadrons, MissingMomentum, SmearedJets, Sphericity, InvMassFinalState, Thrust, LossyFinalState< FILTER >, LossyFinalState< ConstRandomFilter >, LeadingParticlesFinalState, ParisiTensor, FoxWolframMoments, Spherocity, NeutralFinalState, PromptFinalState, SmearedParticles, VisibleFinalState, TauFinder, SmearedMET, InitialQuarks, NonPromptFinalState, FinalState, DISFinalState, NonHadronicFinalState, HadronicFinalState, DISKinematics, DISLepton, MergedFinalState, ChargedFinalState, BeamThrust, CentralEtHCM, ChargedLeptons, and FParameter.

virtual int compare ( const Projection UNUSEDp) const [inline, private, virtual]

Compare with other projections -- it's always the same, since there are no params.

Definition at line 196 of file Beam.hh.

{ return EQUIVALENT; }
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) [virtual]

Project on to the Event.

Implements Projection.

Definition at line 110 of file Beam.cc.

                                   {
    _theBeams = Rivet::beams(e);
    MSG_DEBUG("Beam particles = " << _theBeams << " => sqrt(s) = " << sqrtS()/GeV << " GeV");
  }
FourVector pv ( ) const

Get the beam interaction primary vertex (PV) position.

Definition at line 116 of file Beam.cc.

                            {
    HepMC::FourVector v1, v2;
    const ParticlePair bpair = beams();
    if (bpair.first.genParticle() && bpair.first.genParticle()->end_vertex())
      v1 = bpair.first.genParticle()->end_vertex()->position();
    if (bpair.second.genParticle() && bpair.second.genParticle()->end_vertex())
      v2 = bpair.second.genParticle()->end_vertex()->position();
    const FourVector rtn = (v1 == v2) ? FourVector(v1.t(), v1.x(), v1.y(), v1.z()) : FourVector();
    MSG_DEBUG("Beam PV 4-position = " << rtn);
    return rtn;
  }
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 sqrtS ( ) const [inline]

Get centre of mass energy, $ \sqrt{s} $.

Definition at line 150 of file Beam.hh.

{ return Rivet::sqrtS(beams()); }

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.

The beam particles in the current collision.

Definition at line 199 of file Beam.hh.


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