thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::MatcherBase Class Referenceabstract

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:

Public Types

typedef set< tPDPtrtPDSet
 Convenient typedef.
 
typedef set< tPMPtrtPMSet
 Convenient typedef.
 
- Public Types inherited from ThePEG::InterfacedBase
enum  InitState { initializing = -1 , uninitialized = 0 , initialized = 1 , runready = 2 }
 Enumeration reflecting the state of an InterfacedBase object. More...
 
- Public Types inherited from ThePEG::Pointer::ReferenceCounted
typedef unsigned int CounterType
 The integer type used for counting.
 

Public Member Functions

Standard constructors and destructors.
 MatcherBase ()
 Default constructor.
 
 MatcherBase (const MatcherBase &)
 Copy-constructor.
 
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.
 
tPMPtr CC () const
 Get the matcher object matching the antiparticles of this.
 
- Public Member Functions inherited from ThePEG::Interfaced
virtual ~Interfaced ()
 Empty virtual destructor.
 
virtual bool defaultInit ()
 Functions which are to be used during the actual event generation, after the setup is complete.
 
PPtr getParticle (PID) const
 Create a new Particle instance given a id number.
 
PDPtr getParticleData (PID) const
 Return a pointer to the ParticleData object corresponding to the given id number.
 
bool used () const
 Returns true if this object has actally been used.
 
void useMe () const
 Should be called to indicate that this object has actually been used.
 
tEGPtr generator () const
 Return a pointer to the EventGenerator controlling the run.
 
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.
 
- Public Member Functions inherited from ThePEG::InterfacedBase
virtual ~InterfacedBase ()
 The virtual (empty) destructor;.
 
string fullName () const
 Returns the full name of this object including its path, e.g.
 
string name () const
 Returns the name of this object, without the path.
 
string path () const
 Returns the path to this object including the trailing '/'.
 
string comment () const
 Returns a comment assigned to this object.
 
void setup (istream &is)
 Read setup info from a standard istream is.
 
void update ()
 Calls the doupdate() function with recursion prevention.
 
void init ()
 Calls the doinit() function with recursion prevention.
 
virtual bool preInitialize () const
 Return true if this object needs to be initialized before all other objects (except those for which this function also returns true).
 
void initrun ()
 Calls the doinitrun() function with recursion prevention.
 
void finish ()
 Calls the dofinish() function with recursion prevention.
 
void touch ()
 This function should be called every time something in this object has changed in a way that a sanity check with update() is needed.
 
void reset ()
 Set the state of this object to uninitialized.
 
void clear ()
 Calls reset() and unTouch().
 
InitState state () const
 Return the state of initialization of this object.
 
bool locked () const
 Return true if the BaseRepository is not allowed to change the state of this object.
 
bool touched () const
 Return true if the state of this object has been changed since the last call to update().
 
virtual IBPtr fullclone () const
 Return a full clone of this object possibly doing things to the clone to make it sane.
 
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.
 
virtual void debugme () const
 Print out debugging information for this object on std::cerr.
 
- Public Member Functions inherited from ThePEG::Base
virtual ~Base ()
 The virtual destructor.
 
void debug () const
 Print out debugging information for this object on std::cerr.
 
virtual void debugme () const
 Print out debugging information for this object on std::cerr.
 
- Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted
CounterType referenceCount () const
 Return the reference count.
 
- Public Member Functions inherited from ThePEG::Named
 Named (const string &newName=string())
 Constructor with name.
 
 Named (const Named &)=default
 Explicit default copy-constructor (too avoid compiler warnings)
 
const string & name () const
 Return name.
 
bool operator== (const Named &other) const
 Test for equality.
 
bool operator< (const Named &other) const
 Lexicographical comparison.
 

Friends

class Repository
 Repository needs to be a friend.
 

Standard Interfaced functions.

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 AbstractClassDescription< MatcherBaseinitMatcherBase
 The static object used to initialize the description of this class.
 
virtual void doupdate ()
 Check sanity of the object during the setup phase.
 
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.
 
static void setCC (tPMPtr pm, tPMPtr apm)
 Set antipartner.
 
MatcherBaseoperator= (const MatcherBase &)=delete
 Private and non-existent assignment operator.
 

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 void Init ()
 Standard Init function used to initialize the interface.
 

Additional Inherited Members

- Static Public Member Functions inherited from ThePEG::Interfaced
static void Init ()
 Standard Init function.
 
- Static Public Member Functions inherited from ThePEG::InterfacedBase
static void Init ()
 Standard Init function.
 
- Static Public Member Functions inherited from ThePEG::Base
static void Init ()
 The standard Init function used to initialize the interfaces.
 
- Public Attributes inherited from ThePEG::Pointer::ReferenceCounted
const unsigned long uniqueId
 The unique ID.
 
- Protected Member Functions inherited from ThePEG::Interfaced
void reporeg (IBPtr object, string name) const
 Register the given object in the Repository with the given name in a subdirectory with the same name as this object.
 
template<typename PtrT >
bool setDefaultReference (PtrT &ptr, string classname, string objectname)
 If the pointer, ptr, to an object is not set, create an object of class classname and register it with the Repository with the given objectname in a sib-directory with the same name as this object.
 
 Interfaced ()
 Protected default constructor.
 
 Interfaced (const string &newName)
 Protected constructor taking a name as argument.
 
 Interfaced (const Interfaced &i)
 Protected copy-constructor.
 
void setGenerator (tEGPtr generator)
 Protected function to reset the generator pointer, required for automatic decayer generation in Herwig++ BSM models.
 
- Protected Member Functions inherited from ThePEG::InterfacedBase
virtual void readSetup (istream &is)
 Read setup info from a standard istream is.
 
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk.
 
virtual void doinitrun ()
 Initialize this object.
 
virtual void dofinish ()
 Finalize this object.
 
virtual IVector getReferences ()
 Return a vector of all pointers to Interfaced objects used in this object.
 
virtual void rebind (const TranslationMap &)
 Rebind pointer to other Interfaced objects.
 
virtual IBPtr clone () const =0
 Return a simple clone of this object.
 
 InterfacedBase ()
 Protected default constructor.
 
 InterfacedBase (string newName)
 Protected constructor with the name given as argument.
 
 InterfacedBase (const InterfacedBase &i)
 Protected copy-constructor.
 
- Protected Member Functions inherited from ThePEG::Pointer::ReferenceCounted
 ReferenceCounted ()
 Default constructor.
 
 ReferenceCounted (const ReferenceCounted &)
 Copy-constructor.
 
ReferenceCountedoperator= (const ReferenceCounted &)
 Assignment.
 
- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 
- Static Protected Member Functions inherited from ThePEG::Interfaced
static void registerRepository (IBPtr)
 Register an Interfaced object with the Repository.
 
static void registerRepository (IBPtr, string newName)
 Register an Interfaced object with the Repository, giving it a name.
 

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 Typedef Documentation

◆ tPDSet

Convenient typedef.

Definition at line 39 of file MatcherBase.h.

◆ tPMSet

Convenient typedef.

Definition at line 44 of file MatcherBase.h.

Member Function Documentation

◆ addMIfMatch()

template<typename Iterator >
void ThePEG::MatcherBase::addMIfMatch ( Iterator  first,
Iterator  last 
)
inlineprotected

Add a number of particle matchers to the set of matching matchers if they meets the criteria.

Definition at line 288 of file MatcherBase.h.

References addMIfMatch().

◆ addMIfMatchFrom()

template<typename Cont >
void ThePEG::MatcherBase::addMIfMatchFrom ( const Cont &  c)
inlineprotected

Add a number of particle matchers to the set of matching matchers if they meets the criteria.

Definition at line 297 of file MatcherBase.h.

References addMIfMatch().

◆ addPIfMatch()

template<typename Iterator >
void ThePEG::MatcherBase::addPIfMatch ( Iterator  first,
Iterator  last 
)
inlineprotected

Add a number of particles to the set of matching particles if they meets the criteria.

Definition at line 270 of file MatcherBase.h.

References addPIfMatch().

◆ addPIfMatchFrom()

template<typename Cont >
void ThePEG::MatcherBase::addPIfMatchFrom ( const Cont &  c)
inlineprotected

Add a number of particles to the set of matching particles if they meets the criteria.

Definition at line 279 of file MatcherBase.h.

References addPIfMatch().

◆ CC()

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 215 of file MatcherBase.h.

References theAntiPartner.

◆ charged()

bool ThePEG::MatcherBase::charged ( ) const
inline

Are the particles charged? If all matching particles are charged, return true, otherwise false.

Definition at line 170 of file MatcherBase.h.

References ThePEG::PDT::charged(), and commonCharge.

◆ check()

virtual bool ThePEG::MatcherBase::check ( const ParticleData ) const
pure virtual

Check if a particle type meets the criteria.

Implemented in ThePEG::Matcher< T >.

Referenced by checkp().

◆ checkp()

bool ThePEG::MatcherBase::checkp ( const Particle p) const
inline

Check if a Particle meets the criteria.

Definition at line 83 of file MatcherBase.h.

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

◆ coloured()

bool ThePEG::MatcherBase::coloured ( ) const
inline

Are the particles coloured? If all matching particles are coloured, return true, otherwise false.

Definition at line 202 of file MatcherBase.h.

References ThePEG::PDT::coloured(), and commonColour.

◆ cTau()

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 155 of file MatcherBase.h.

References commonCTau.

◆ doupdate()

virtual void ThePEG::MatcherBase::doupdate ( )
protectedvirtual

Check sanity of the object during the setup phase.

Reimplemented from ThePEG::InterfacedBase.

◆ iCharge()

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 164 of file MatcherBase.h.

References commonCharge.

◆ iColour()

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 196 of file MatcherBase.h.

References commonColour.

◆ iSpin()

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 189 of file MatcherBase.h.

References commonSpin.

◆ mass()

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 142 of file MatcherBase.h.

References commonMass.

◆ matchers()

const tPMSet & ThePEG::MatcherBase::matchers ( ) const
inline

Access to the set of matching matchers.

Definition at line 123 of file MatcherBase.h.

References matchingMatchers.

◆ matches() [1/3]

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 109 of file MatcherBase.h.

References matchingMatchers, and ThePEG::member().

◆ matches() [2/3]

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 102 of file MatcherBase.h.

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

Referenced by matches().

◆ matches() [3/3]

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 91 of file MatcherBase.h.

References matchingParticles, and ThePEG::member().

◆ maxMass()

Energy ThePEG::MatcherBase::maxMass ( ) const
inline

Returns the maximum mass of the matching particles.

Definition at line 136 of file MatcherBase.h.

References theMaxMass.

◆ minMass()

Energy ThePEG::MatcherBase::minMass ( ) const
inline

Returns the minimum mass of the matching particles.

Definition at line 131 of file MatcherBase.h.

References theMinMass.

◆ negative()

bool ThePEG::MatcherBase::negative ( ) const
inline

Are the particles negatively charged? If all matching particles are negatively charged, return true, otherwise false.

Definition at line 182 of file MatcherBase.h.

References commonCharge, and ThePEG::PDT::negative().

◆ particles()

const tPDSet & ThePEG::MatcherBase::particles ( ) const
inline

Access to the set of matching particles.

Definition at line 119 of file MatcherBase.h.

References matchingParticles.

◆ persistentInput()

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

Function used to read in object persistently.

Parameters
isthe persistent input stream read from.
versionthe version number of the object when written.

◆ persistentOutput()

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

Function used to write out object persistently.

Parameters
osthe persistent output stream written to.

◆ pmclone()

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 >.

◆ positive()

bool ThePEG::MatcherBase::positive ( ) const
inline

Are the particles positively charged? If all matching particles are positively charged, return true, otherwise false.

Definition at line 176 of file MatcherBase.h.

References commonCharge, and ThePEG::PDT::positive().

◆ setCC()

static void ThePEG::MatcherBase::setCC ( tPMPtr  pm,
tPMPtr  apm 
)
inlinestaticprotected

Set antipartner.

Definition at line 309 of file MatcherBase.h.

Referenced by ThePEG::Matcher< T >::setCC().

◆ stable()

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 208 of file MatcherBase.h.

References commonStable.

◆ width()

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 148 of file MatcherBase.h.

References commonWidth.

Friends And Related Function Documentation

◆ Repository

friend class Repository
friend

Repository needs to be a friend.

Definition at line 34 of file MatcherBase.h.

Member Data Documentation

◆ commonCharge

PDT::Charge ThePEG::MatcherBase::commonCharge
private

The common charge of all matching particles.

Definition at line 354 of file MatcherBase.h.

Referenced by charged(), iCharge(), negative(), and positive().

◆ commonColour

PDT::Colour ThePEG::MatcherBase::commonColour
private

The common colour of all matching particles.

Definition at line 364 of file MatcherBase.h.

Referenced by coloured(), and iColour().

◆ commonCTau

Length ThePEG::MatcherBase::commonCTau
private

The common decay length of all matching particles.

Definition at line 349 of file MatcherBase.h.

Referenced by cTau().

◆ commonMass

Energy ThePEG::MatcherBase::commonMass
private

The common mass of all matching particles.

Definition at line 339 of file MatcherBase.h.

Referenced by mass().

◆ commonSpin

PDT::Spin ThePEG::MatcherBase::commonSpin
private

The common spin of all matching particles.

Definition at line 359 of file MatcherBase.h.

Referenced by iSpin().

◆ commonStable

int ThePEG::MatcherBase::commonStable
private

The common stability of all matching particles.

Definition at line 369 of file MatcherBase.h.

Referenced by stable().

◆ commonWidth

Energy ThePEG::MatcherBase::commonWidth
private

The common width of all matching particles.

Definition at line 344 of file MatcherBase.h.

Referenced by width().

◆ initMatcherBase

AbstractClassDescription<MatcherBase> ThePEG::MatcherBase::initMatcherBase
staticprivate

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

Indicates that this is an abstract class with persistent data.

Definition at line 383 of file MatcherBase.h.

◆ matchingMatchers

tPMSet ThePEG::MatcherBase::matchingMatchers
private

A set of matchers which matches a subset of this matcher.

Definition at line 324 of file MatcherBase.h.

Referenced by matchers(), and matches().

◆ matchingParticles

tPDSet ThePEG::MatcherBase::matchingParticles
private

The set of particle data objects matched by this matcher.

Definition at line 319 of file MatcherBase.h.

Referenced by matches(), and particles().

◆ theAntiPartner

tPMPtr ThePEG::MatcherBase::theAntiPartner
private

Pointer to a matcher object which matches all anti particles which are matched by this matcher.

Definition at line 375 of file MatcherBase.h.

Referenced by CC().

◆ theMaxMass

Energy ThePEG::MatcherBase::theMaxMass
private

The maximum mass of all matching particles.

Definition at line 329 of file MatcherBase.h.

Referenced by maxMass().

◆ theMinMass

Energy ThePEG::MatcherBase::theMinMass
private

The minimum mass of all matching particles.

Definition at line 334 of file MatcherBase.h.

Referenced by minMass().


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