ThePEG::MatcherBase Class Reference

MatcherBase is an abstract base class to be used for objects representing groups of ParticleData objects. More...

#include <MatcherBase.h>

Inheritance diagram for ThePEG::MatcherBase:

ThePEG::Interfaced ThePEG::InterfacedBase ThePEG::Base ThePEG::Named ThePEG::Pointer::ReferenceCounted ThePEG::Matcher< T >

List of all members.

Public Types

typedef set< tPDPtrtPDSet
 Convenient typedef.
typedef set< tPMPtrtPMSet
 Convenient typedef.

Public Member Functions

tPMPtr CC () const
 Get the matcher object matching the antiparticles of this.
Standard constructors and destructors.
 MatcherBase ()
 Default constructor.
 MatcherBase (const MatcherBase &)
 Copy-constructor.
virtual ~MatcherBase ()
 Destructor.
Virtual functions to be overridden by sub-classes.
virtual bool check (const ParticleData &) const =0
 Check if a particle type meets the criteria.
virtual PMPtr pmclone () const =0
 Specialized clone method for MatcherBase used by the Repository.
Check if something is matched.
bool checkp (const Particle &p) const
 Check if a Particle meets the criteria.
bool matches (const ParticleData &pd) const
 Check if a given particle type belongs to the set of matches.
bool matches (const Particle &p) const
 Check if a given particle belongs to the set of matches.
bool matches (const MatcherBase &pm) const
 Check if a given particle matcher belongs to the set of matches.
Access the sets of matching particles and matchers.
const tPDSetparticles () const
 Access to the set of matching particles.
const tPMSetmatchers () const
 Access to the set of matching matchers.
Access common properties of all matched particles.
Energy minMass () const
 Returns the minimum mass of the matching particles.
Energy maxMass () const
 Returns the maximum mass of the matching particles.
Energy mass () const
 Returns the common mass of the matching particles.
Energy width () const
 Returns the common width of the matching particles.
Length cTau () const
 Returns the common decay length of the matching particles.
PDT::Charge iCharge () const
 Return common charge.
bool charged () const
 Are the particles charged? If all matching particles are charged, return true, otherwise false.
bool positive () const
 Are the particles positively charged? If all matching particles are positively charged, return true, otherwise false.
bool negative () const
 Are the particles negatively charged? If all matching particles are negatively charged, return true, otherwise false.
PDT::Spin iSpin () const
 Return common spin.
PDT::Colour iColour () const
 If all matching particles have the same colour, the common colour is returned.
bool coloured () const
 Are the particles coloured? If all matching particles are coloured, return true, otherwise false.
int stable () const
 Are the particles stable? Returns (0)1 if all matching particles are (un)stable.
Functions used by the persistent I/O system.
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently.
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently.

Static Public Member Functions

static void Init ()
 Standard Init function used to initialize the interface.

Protected Member Functions

void addPIfMatch (tPDPtr)
 Add a particle to the set of matching particles if it meets the criteria.
void addMIfMatch (tPMPtr)
 Add a particle matcher to the set of matching matchers if it meets the criteria.
template<typename Iterator>
void addPIfMatch (Iterator first, Iterator last)
 Add a number of particles to the set of matching particles if they meets the criteria.
template<typename Cont>
void addPIfMatchFrom (const Cont &c)
 Add a number of particles to the set of matching particles if they meets the criteria.
template<typename Iterator>
void addMIfMatch (Iterator first, Iterator last)
 Add a number of particle matchers to the set of matching matchers if they meets the criteria.
template<typename Cont>
void addMIfMatchFrom (const Cont &c)
 Add a number of particle matchers to the set of matching matchers if they meets the criteria.
void clear ()
 Clear information about matching particles and matchers.
void setCC (tPMPtr pm, tPMPtr apm) const
 Set antipartner.
Standard Interfaced functions.
virtual void doupdate ()
 Check sanity of the object during the setup phase.

Private Member Functions

MatcherBaseoperator= (const MatcherBase &)
 Private and non-existent assignment operator.

Private Attributes

tPDSet matchingParticles
 The set of particle data objects matched by this matcher.
tPMSet matchingMatchers
 A set of matchers which matches a subset of this matcher.
Energy theMaxMass
 The maximum mass of all matching particles.
Energy theMinMass
 The minimum mass of all matching particles.
Energy commonMass
 The common mass of all matching particles.
Energy commonWidth
 The common width of all matching particles.
Length commonCTau
 The common decay length of all matching particles.
PDT::Charge commonCharge
 The common charge of all matching particles.
PDT::Spin commonSpin
 The common spin of all matching particles.
PDT::Colour commonColour
 The common colour of all matching particles.
int commonStable
 The common stability of all matching particles.
tPMPtr theAntiPartner
 Pointer to a matcher object which matches all anti particles which are matched by this matcher.

Static Private Attributes

static
AbstractClassDescription
< MatcherBase
initMatcherBase
 The static object used to initialize the description of this class.

Friends

class Repository
 Repository needs to be a friend.


Detailed Description

MatcherBase is an abstract base class to be used for objects representing groups of ParticleData objects.

Concrete implementations will typically use the templated Matcher class for easy building of a full sub-class.

See also:
ParticleData

Matcher

Definition at line 29 of file MatcherBase.h.


Member Function Documentation

virtual PMPtr ThePEG::MatcherBase::pmclone (  )  const [pure virtual]

Specialized clone method for MatcherBase used by the Repository.

A sub class must make sure that also the MatcherBase object corresponding to the complex conjugate of this is cloned.

Implemented in ThePEG::Matcher< T >.

bool ThePEG::MatcherBase::matches ( const ParticleData pd  )  const [inline]

Check if a given particle type belongs to the set of matches.

This function looks for the same ParticleData object in the set of all particles matched by this matcher. May be quicker than to go through the check proceedure.

Definition at line 96 of file MatcherBase.h.

References matchingParticles, and ThePEG::member().

Referenced by matches().

bool ThePEG::MatcherBase::matches ( const Particle p  )  const [inline]

Check if a given particle belongs to the set of matches.

This function looks for the corresponding ParticleData object in the set of all particles matched by this matcher. May be quicker than to go through the check proceedure.

Definition at line 107 of file MatcherBase.h.

References ThePEG::Particle::data(), and matches().

bool ThePEG::MatcherBase::matches ( const MatcherBase pm  )  const [inline]

Check if a given particle matcher belongs to the set of matches.

This function looks for the same MatcherBase object in the set of all matchers matched by this matcher.

Definition at line 114 of file MatcherBase.h.

References matchingMatchers, and ThePEG::member().

Energy ThePEG::MatcherBase::mass (  )  const [inline]

Returns the common mass of the matching particles.

If all matching particles do not have exactly the same mass, -1.0 GeV is returned.

Definition at line 147 of file MatcherBase.h.

References commonMass.

Energy ThePEG::MatcherBase::width (  )  const [inline]

Returns the common width of the matching particles.

If all matching particles do not have exactly the same width, -1.0 GeV is returned.

Definition at line 153 of file MatcherBase.h.

References commonWidth.

Length ThePEG::MatcherBase::cTau (  )  const [inline]

Returns the common decay length of the matching particles.

If all matching particles do not have exactly the same decay length -1.0 mm is returned.

Definition at line 160 of file MatcherBase.h.

References commonCTau.

PDT::Charge ThePEG::MatcherBase::iCharge (  )  const [inline]

Return common charge.

If all matching particles have the same charge the common charge is returned. Otherwise if all are positive (negative), PDT::Positive (PDT::Negative) is returned. Otherwise if all are charged, PDT::Charged is returned. Otherwise PDT::ChargeUndefined is returned.

Definition at line 169 of file MatcherBase.h.

References commonCharge.

PDT::Spin ThePEG::MatcherBase::iSpin (  )  const [inline]

Return common spin.

If all matching particles have the same spin, the common spin is returned. Otherwise PDT::SpinUndefined is returned.

Definition at line 194 of file MatcherBase.h.

References commonSpin.

PDT::Colour ThePEG::MatcherBase::iColour (  )  const [inline]

If all matching particles have the same colour, the common colour is returned.

Otherwise if all are coloured, PDT::Coloured is returned. Otherwise PDT::ColourUndefined is returned.

Definition at line 201 of file MatcherBase.h.

References commonColour.

int ThePEG::MatcherBase::stable (  )  const [inline]

Are the particles stable? Returns (0)1 if all matching particles are (un)stable.

Otherwise -1 is returned.

Definition at line 213 of file MatcherBase.h.

References commonStable.

tPMPtr ThePEG::MatcherBase::CC (  )  const [inline]

Get the matcher object matching the antiparticles of this.

If no-one exists null is returned.

Definition at line 220 of file MatcherBase.h.

References theAntiPartner.

void ThePEG::MatcherBase::persistentOutput ( PersistentOStream os  )  const

Function used to write out object persistently.

Parameters:
os the persistent output stream written to.

Reimplemented from ThePEG::Interfaced.

void ThePEG::MatcherBase::persistentInput ( PersistentIStream is,
int  version 
)

Function used to read in object persistently.

Parameters:
is the persistent input stream read from.
version the version number of the object when written.

Reimplemented from ThePEG::Interfaced.


Friends And Related Function Documentation

friend class Repository [friend]

Repository needs to be a friend.

Reimplemented from ThePEG::Interfaced.

Definition at line 34 of file MatcherBase.h.


Member Data Documentation

The static object used to initialize the description of this class.

Indicates that this is an abstract class with persistent data.

Definition at line 388 of file MatcherBase.h.


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

Generated on Thu Apr 29 12:43:17 2010 for ThePEG by  doxygen 1.5.5