ThePEG 2.3.0
|
MatcherBase is an abstract base class to be used for objects representing groups of ParticleData objects. More...
#include <MatcherBase.h>
Public Types | |
typedef set< tPDPtr > | tPDSet |
Convenient typedef. | |
typedef set< tPMPtr > | tPMSet |
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 tPDSet & | particles () const |
Access to the set of matching particles. | |
const tPMSet & | matchers () 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< MatcherBase > | initMatcherBase |
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. | |
MatcherBase & | operator= (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. | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
Assignment. | |
Protected Member Functions inherited from ThePEG::Named | |
const Named & | operator= (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. | |
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.
Definition at line 29 of file MatcherBase.h.
typedef set<tPDPtr> ThePEG::MatcherBase::tPDSet |
Convenient typedef.
Definition at line 39 of file MatcherBase.h.
typedef set<tPMPtr> ThePEG::MatcherBase::tPMSet |
Convenient typedef.
Definition at line 44 of file MatcherBase.h.
|
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().
|
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().
|
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().
|
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().
|
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.
|
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.
|
pure virtual |
Check if a particle type meets the criteria.
Implemented in ThePEG::Matcher< T >.
Referenced by checkp().
|
inline |
Check if a Particle meets the criteria.
Definition at line 83 of file MatcherBase.h.
References check(), and ThePEG::Particle::data().
|
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.
|
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.
|
protectedvirtual |
Check sanity of the object during the setup phase.
Reimplemented from ThePEG::InterfacedBase.
|
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.
|
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.
|
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.
|
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.
|
inline |
Access to the set of matching matchers.
Definition at line 123 of file MatcherBase.h.
References matchingMatchers.
|
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().
|
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().
|
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().
|
inline |
Returns the maximum mass of the matching particles.
Definition at line 136 of file MatcherBase.h.
References theMaxMass.
|
inline |
Returns the minimum mass of the matching particles.
Definition at line 131 of file MatcherBase.h.
References theMinMass.
|
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().
|
inline |
Access to the set of matching particles.
Definition at line 119 of file MatcherBase.h.
References matchingParticles.
void ThePEG::MatcherBase::persistentInput | ( | PersistentIStream & | is, |
int | version | ||
) |
Function used to read in object persistently.
is | the persistent input stream read from. |
version | the version number of the object when written. |
void ThePEG::MatcherBase::persistentOutput | ( | PersistentOStream & | os | ) | const |
Function used to write out object persistently.
os | the persistent output stream written to. |
|
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 >.
|
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().
Set antipartner.
Definition at line 309 of file MatcherBase.h.
Referenced by ThePEG::Matcher< T >::setCC().
|
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.
|
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.
|
friend |
Repository needs to be a friend.
Definition at line 34 of file MatcherBase.h.
|
private |
The common charge of all matching particles.
Definition at line 354 of file MatcherBase.h.
Referenced by charged(), iCharge(), negative(), and positive().
|
private |
The common colour of all matching particles.
Definition at line 364 of file MatcherBase.h.
Referenced by coloured(), and iColour().
|
private |
The common decay length of all matching particles.
Definition at line 349 of file MatcherBase.h.
Referenced by cTau().
|
private |
The common mass of all matching particles.
Definition at line 339 of file MatcherBase.h.
Referenced by mass().
|
private |
The common spin of all matching particles.
Definition at line 359 of file MatcherBase.h.
Referenced by iSpin().
|
private |
The common stability of all matching particles.
Definition at line 369 of file MatcherBase.h.
Referenced by stable().
|
private |
The common width of all matching particles.
Definition at line 344 of file MatcherBase.h.
Referenced by width().
|
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.
|
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().
|
private |
The set of particle data objects matched by this matcher.
Definition at line 319 of file MatcherBase.h.
Referenced by matches(), and particles().
|
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().
|
private |
The maximum mass of all matching particles.
Definition at line 329 of file MatcherBase.h.
Referenced by maxMass().
|
private |
The minimum mass of all matching particles.
Definition at line 334 of file MatcherBase.h.
Referenced by minMass().