thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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

tPMPtr CC () const
 Get the matcher object matching the antiparticles of this. More...
 
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. More...
 
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. More...
 
bool matches (const Particle &p) const
 Check if a given particle belongs to the set of matches. More...
 
bool matches (const MatcherBase &pm) const
 Check if a given particle matcher belongs to the set of matches. More...
 
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. More...
 
Energy width () const
 Returns the common width of the matching particles. More...
 
Length cTau () const
 Returns the common decay length of the matching particles. More...
 
PDT::Charge iCharge () const
 Return common charge. More...
 
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. More...
 
PDT::Colour iColour () const
 If all matching particles have the same colour, the common colour is returned. More...
 
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. More...
 
Functions used by the persistent I/O system.
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently. More...
 
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently. More...
 
- 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. More...
 
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. More...
 
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently. More...
 
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently. More...
 
- 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. More...
 
string name () const
 Returns the name of this object, without the path.
 
string path () const
 Returns the path to this object including the trailing '/'. More...
 
string comment () const
 Returns a comment assigned to this object.
 
void setup (istream &is)
 Read setup info from a standard istream is. More...
 
virtual IBPtr fullclone () const
 Return a full clone of this object possibly doing things to the clone to make it sane.
 
virtual void debugme () const
 Print out debugging information for this object on std::cerr. More...
 
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). More...
 
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().
 
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently. More...
 
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently. More...
 
- 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. More...
 
- 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.
 

Static Public Member Functions

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

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.
 
Standard Interfaced functions.
virtual void doupdate ()
 Check sanity of the object during the setup phase.
 
- 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. More...
 
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 IBPtr clone () const =0
 Return a simple clone of this object. More...
 
 InterfacedBase ()
 Protected default constructor.
 
 InterfacedBase (string newName)
 Protected constructor with the name given as argument.
 
 InterfacedBase (const InterfacedBase &i)
 Protected copy-constructor.
 
virtual void readSetup (istream &is)
 Read setup info from a standard istream is. More...
 
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk. More...
 
virtual void doinitrun ()
 Initialize this object. More...
 
virtual void dofinish ()
 Finalize this object. More...
 
virtual IVector getReferences ()
 Return a vector of all pointers to Interfaced objects used in this object. More...
 
virtual void rebind (const TranslationMap &)
 Rebind pointer to other Interfaced objects. More...
 
- 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

static void setCC (tPMPtr pm, tPMPtr apm)
 Set antipartner.
 
- 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.
 

Private Member Functions

MatcherBaseoperator= (const MatcherBase &)=delete
 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< MatcherBaseinitMatcherBase
 The static object used to initialize the description of this class. More...
 

Friends

class Repository
 Repository needs to be a friend. More...
 

Additional Inherited Members

- Public Attributes inherited from ThePEG::Pointer::ReferenceCounted
const unsigned long uniqueId
 The unique ID. More...
 

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

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

References addMIfMatch(), addPIfMatch(), doupdate(), Init(), persistentInput(), persistentOutput(), and theAntiPartner.

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

References commonCTau.

◆ 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 169 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 201 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 194 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 147 of file MatcherBase.h.

References commonMass.

◆ matches() [1/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 96 of file MatcherBase.h.

References matchingParticles, 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 107 of file MatcherBase.h.

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

Referenced by matches().

◆ matches() [3/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 114 of file MatcherBase.h.

References matchingMatchers, and ThePEG::member().

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

Referenced by CC().

◆ persistentOutput()

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

Function used to write out object persistently.

Parameters
osthe persistent output stream written to.

Referenced by CC().

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

◆ 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 213 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 153 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

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


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