thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.2.1
PDT
MatcherBase.h
1
// -*- C++ -*-
2
//
3
// MatcherBase.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_MatcherBase_H
10
#define ThePEG_MatcherBase_H
11
// This is the declaration of the MatcherBase class.
12
13
14
#include "ParticleData.h"
15
#include "ThePEG/EventRecord/Particle.h"
16
17
namespace
ThePEG
{
18
29
class
MatcherBase
:
public
Interfaced
{
30
31
public
:
32
34
friend
class
Repository
;
35
39
typedef
set<tPDPtr>
tPDSet
;
40
44
typedef
set<tPMPtr>
tPMSet
;
45
46
public
:
47
53
MatcherBase
();
54
58
MatcherBase
(
const
MatcherBase
&);
59
63
virtual
~MatcherBase
();
65
66
public
:
67
73
virtual
bool
check
(
const
ParticleData
&)
const
= 0;
74
80
virtual
PMPtr
pmclone
()
const
= 0;
82
88
bool
checkp
(
const
Particle
& p)
const
{
return
check
(p.
data
()); }
89
96
bool
matches
(
const
ParticleData
& pd)
const
{
97
return
member
(
matchingParticles
,
PDPtr
(const_cast<ParticleData *>(&pd)));
98
}
99
100
107
bool
matches
(
const
Particle
& p)
const
{
return
matches
(p.
data
()); }
108
114
bool
matches
(
const
MatcherBase
& pm)
const
{
115
return
member
(
matchingMatchers
,
PMPtr
(const_cast<MatcherBase *>(&pm)));
116
}
118
124
const
tPDSet &
particles
()
const
{
return
matchingParticles
; }
128
const
tPMSet &
matchers
()
const
{
return
matchingMatchers
; }
130
136
Energy
minMass
()
const
{
return
theMinMass
; }
137
141
Energy
maxMass
()
const
{
return
theMaxMass
; }
142
147
Energy
mass
()
const
{
return
commonMass
; }
148
153
Energy
width
()
const
{
return
commonWidth
; }
154
160
Length
cTau
()
const
{
return
commonCTau
; }
161
169
PDT::Charge
iCharge
()
const
{
return
commonCharge
; }
170
175
bool
charged
()
const
{
return
PDT::charged
(
commonCharge
); }
176
181
bool
positive
()
const
{
return
PDT::positive
(
commonCharge
); }
182
187
bool
negative
()
const
{
return
PDT::negative
(
commonCharge
); }
188
194
PDT::Spin
iSpin
()
const
{
return
commonSpin
; }
195
201
PDT::Colour
iColour
()
const
{
return
commonColour
; }
202
207
bool
coloured
()
const
{
return
PDT::coloured
(
commonColour
); }
208
213
int
stable
()
const
{
return
commonStable
; }
215
220
tPMPtr
CC
()
const
{
return
theAntiPartner
; }
221
222
public
:
223
224
231
void
persistentOutput
(
PersistentOStream
& os)
const
;
232
238
void
persistentInput
(
PersistentIStream
& is,
int
version);
240
244
static
void
Init
();
245
246
protected
:
247
253
virtual
void
doupdate
();
255
256
protected
:
257
262
void
addPIfMatch
(
tPDPtr
);
263
268
void
addMIfMatch
(
tPMPtr
);
269
274
template
<
typename
Iterator>
275
void
addPIfMatch
(Iterator first, Iterator last) {
276
for
( ; first != last; ++first )
addPIfMatch
(*first);
277
}
278
283
template
<
typename
Cont>
284
void
addPIfMatchFrom
(
const
Cont & c) {
285
addPIfMatch
(c.begin(), c.end());
286
}
287
292
template
<
typename
Iterator>
293
void
addMIfMatch
(Iterator first, Iterator last) {
294
for
( ; first != last; ++first )
addMIfMatch
(*first);
295
}
296
301
template
<
typename
Cont>
302
void
addMIfMatchFrom
(
const
Cont & c) {
303
addMIfMatch
(c.begin(), c.end());
304
}
305
309
void
clear
();
310
314
static
void
setCC
(
tPMPtr
pm,
tPMPtr
apm) {
315
pm->theAntiPartner = apm;
316
apm->theAntiPartner = pm;
317
}
318
319
private
:
320
324
tPDSet
matchingParticles
;
325
329
tPMSet
matchingMatchers
;
330
334
Energy
theMaxMass
;
335
339
Energy
theMinMass
;
340
344
Energy
commonMass
;
345
349
Energy
commonWidth
;
350
354
Length
commonCTau
;
355
359
PDT::Charge
commonCharge
;
360
364
PDT::Spin
commonSpin
;
365
369
PDT::Colour
commonColour
;
370
374
int
commonStable
;
375
380
tPMPtr
theAntiPartner
;
381
382
private
:
383
388
static
AbstractClassDescription<MatcherBase>
initMatcherBase
;
389
393
MatcherBase
&
operator=
(
const
MatcherBase
&) =
delete
;
394
395
};
396
401
template
<>
402
struct
BaseClassTrait
<
MatcherBase
,1>:
public
ClassTraitsType
{
404
typedef
Interfaced
NthBase;
405
};
406
409
template
<>
410
struct
ClassTraits
<MatcherBase>:
411
public
ClassTraitsBase
<MatcherBase> {
413
static
string
className() {
return
"ThePEG::MatcherBase"
; }
414
};
415
418
}
419
420
#endif
/* ThePEG_MatcherBase_H */
ThePEG::MatcherBase::checkp
bool checkp(const Particle &p) const
Check if a Particle meets the criteria.
Definition:
MatcherBase.h:88
ThePEG::MatcherBase::commonMass
Energy commonMass
The common mass of all matching particles.
Definition:
MatcherBase.h:344
ThePEG::PersistentIStream
PersistentIStream is used to read persistent objects from a stream where they were previously written...
Definition:
PersistentIStream.h:48
ThePEG::MatcherBase::mass
Energy mass() const
Returns the common mass of the matching particles.
Definition:
MatcherBase.h:147
ThePEG::PMPtr
ThePEG::Ptr< MatcherBase >::pointer PMPtr
Alias for a reference counted pointer to MatcherBase .
Definition:
Pointers.h:65
ThePEG::MatcherBase::commonSpin
PDT::Spin commonSpin
The common spin of all matching particles.
Definition:
MatcherBase.h:364
ThePEG::MatcherBase::positive
bool positive() const
Are the particles positively charged? If all matching particles are positively charged, return true, otherwise false.
Definition:
MatcherBase.h:181
ThePEG::PDT::Charge
Charge
Definition of enumerated values used for charge information.
Definition:
PDT.h:51
ThePEG::MatcherBase::commonCTau
Length commonCTau
The common decay length of all matching particles.
Definition:
MatcherBase.h:354
ThePEG::Particle
The Particle class is used to describe an instance of a particle.
Definition:
Particle.h:83
ThePEG::MatcherBase::matchingParticles
tPDSet matchingParticles
The set of particle data objects matched by this matcher.
Definition:
MatcherBase.h:324
ThePEG::ClassTraitsType
ClassTraitsType is an empty, non-polymorphic, base class.
Definition:
ClassTraits.h:30
ThePEG::MatcherBase::iCharge
PDT::Charge iCharge() const
Return common charge.
Definition:
MatcherBase.h:169
ThePEG::PDT::coloured
static bool coloured(Colour c)
True if the argument corresponds to a non-zero colour charge.
Definition:
PDT.h:129
ThePEG::PDT::charged
static bool charged(Charge c)
True if the argument corresponds to a non-zero charge.
Definition:
PDT.h:108
ThePEG::MatcherBase::stable
int stable() const
Are the particles stable? Returns (0)1 if all matching particles are (un)stable.
Definition:
MatcherBase.h:213
ThePEG::MatcherBase::addMIfMatch
void addMIfMatch(Iterator first, Iterator last)
Add a number of particle matchers to the set of matching matchers if they meets the criteria...
Definition:
MatcherBase.h:293
ThePEG::MatcherBase::operator=
MatcherBase & operator=(const MatcherBase &)=delete
Private and non-existent assignment operator.
ThePEG::Particle::data
const ParticleDataClass & data() const
Access the ParticleData object of this particle type.
Definition:
Particle.h:277
ThePEG::member
bool member(const Container &c, const Key &k)
Check if a given object is a part of a container.
Definition:
std.h:125
ThePEG::MatcherBase
MatcherBase is an abstract base class to be used for objects representing groups of ParticleData obje...
Definition:
MatcherBase.h:29
ThePEG::MatcherBase::tPMSet
set< tPMPtr > tPMSet
Convenient typedef.
Definition:
MatcherBase.h:44
ThePEG::PDT::Colour
Colour
Definition of enumerated values used for colour information.
Definition:
PDT.h:92
ThePEG::PersistentOStream
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
Definition:
PersistentOStream.h:51
ThePEG::AbstractClassDescription
A concreate implementation of ClassDescriptionBase describing an abstract class with persistent data...
Definition:
ClassDescription.h:288
ThePEG::Pointer::TransientRCPtr
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition:
RCPtr.h:519
ThePEG::Repository
Repository inherits from the BaseRepository class.
Definition:
Repository.h:45
ThePEG::MatcherBase::iColour
PDT::Colour iColour() const
If all matching particles have the same colour, the common colour is returned.
Definition:
MatcherBase.h:201
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::MatcherBase::particles
const tPDSet & particles() const
Access to the set of matching particles.
Definition:
MatcherBase.h:124
ThePEG::MatcherBase::matches
bool matches(const Particle &p) const
Check if a given particle belongs to the set of matches.
Definition:
MatcherBase.h:107
ThePEG::ParticleData
ParticleData inherits from InterfacedBase and represents the properties of a particle type...
Definition:
ParticleData.h:36
ThePEG::MatcherBase::addPIfMatch
void addPIfMatch(tPDPtr)
Add a particle to the set of matching particles if it meets the criteria.
ThePEG::MatcherBase::negative
bool negative() const
Are the particles negatively charged? If all matching particles are negatively charged, return true, otherwise false.
Definition:
MatcherBase.h:187
ThePEG::MatcherBase::commonColour
PDT::Colour commonColour
The common colour of all matching particles.
Definition:
MatcherBase.h:369
ThePEG::MatcherBase::coloured
bool coloured() const
Are the particles coloured? If all matching particles are coloured, return true, otherwise false...
Definition:
MatcherBase.h:207
ThePEG::MatcherBase::commonStable
int commonStable
The common stability of all matching particles.
Definition:
MatcherBase.h:374
ThePEG::MatcherBase::charged
bool charged() const
Are the particles charged? If all matching particles are charged, return true, otherwise false...
Definition:
MatcherBase.h:175
ThePEG::MatcherBase::CC
tPMPtr CC() const
Get the matcher object matching the antiparticles of this.
Definition:
MatcherBase.h:220
ThePEG::PDT::Spin
Spin
Definition of enumerated values used for spin information.
Definition:
PDT.h:32
ThePEG::MatcherBase::check
virtual bool check(const ParticleData &) const =0
Check if a particle type meets the criteria.
ThePEG::MatcherBase::addPIfMatch
void addPIfMatch(Iterator first, Iterator last)
Add a number of particles to the set of matching particles if they meets the criteria.
Definition:
MatcherBase.h:275
ThePEG::MatcherBase::iSpin
PDT::Spin iSpin() const
Return common spin.
Definition:
MatcherBase.h:194
ThePEG::MatcherBase::matches
bool matches(const MatcherBase &pm) const
Check if a given particle matcher belongs to the set of matches.
Definition:
MatcherBase.h:114
ThePEG::MatcherBase::pmclone
virtual PMPtr pmclone() const =0
Specialized clone method for MatcherBase used by the Repository.
ThePEG::MatcherBase::theMinMass
Energy theMinMass
The minimum mass of all matching particles.
Definition:
MatcherBase.h:339
ThePEG::MatcherBase::theAntiPartner
tPMPtr theAntiPartner
Pointer to a matcher object which matches all anti particles which are matched by this matcher...
Definition:
MatcherBase.h:380
ThePEG::MatcherBase::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ThePEG::MatcherBase::theMaxMass
Energy theMaxMass
The maximum mass of all matching particles.
Definition:
MatcherBase.h:334
ThePEG::MatcherBase::minMass
Energy minMass() const
Returns the minimum mass of the matching particles.
Definition:
MatcherBase.h:136
ThePEG::MatcherBase::matches
bool matches(const ParticleData &pd) const
Check if a given particle type belongs to the set of matches.
Definition:
MatcherBase.h:96
ThePEG::PDT::negative
static bool negative(Charge c)
True if the argument corresponds to a negative charge.
Definition:
PDT.h:122
ThePEG::PDPtr
ThePEG::Ptr< ParticleData >::pointer PDPtr
Alias for a reference counted pointer to ParticleData .
Definition:
Pointers.h:64
ThePEG::MatcherBase::commonWidth
Energy commonWidth
The common width of all matching particles.
Definition:
MatcherBase.h:349
ThePEG::MatcherBase::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ThePEG::Pointer::RCPtr
RCPtr is a reference counted (smart) pointer.
Definition:
RCPtr.h:60
ThePEG::MatcherBase::cTau
Length cTau() const
Returns the common decay length of the matching particles.
Definition:
MatcherBase.h:160
ThePEG::MatcherBase::doupdate
virtual void doupdate()
Check sanity of the object during the setup phase.
ThePEG::Interfaced
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition:
Interfaced.h:38
ThePEG::MatcherBase::clear
void clear()
Clear information about matching particles and matchers.
ThePEG::MatcherBase::addMIfMatch
void addMIfMatch(tPMPtr)
Add a particle matcher to the set of matching matchers if it meets the criteria.
ThePEG::MatcherBase::addMIfMatchFrom
void addMIfMatchFrom(const Cont &c)
Add a number of particle matchers to the set of matching matchers if they meets the criteria...
Definition:
MatcherBase.h:302
ThePEG::MatcherBase::Init
static void Init()
Standard Init function used to initialize the interface.
ThePEG::PDT::positive
static bool positive(Charge c)
True if the argument corresponds to a positive charge.
Definition:
PDT.h:115
ThePEG::MatcherBase::setCC
static void setCC(tPMPtr pm, tPMPtr apm)
Set antipartner.
Definition:
MatcherBase.h:314
ThePEG::MatcherBase::matchers
const tPMSet & matchers() const
Access to the set of matching matchers.
Definition:
MatcherBase.h:128
ThePEG::MatcherBase::tPDSet
set< tPDPtr > tPDSet
Convenient typedef.
Definition:
MatcherBase.h:39
ThePEG::ClassTraits
The default concrete implementation of ClassTraitsBase.
Definition:
ClassTraits.h:134
ThePEG::MatcherBase::width
Energy width() const
Returns the common width of the matching particles.
Definition:
MatcherBase.h:153
ThePEG::MatcherBase::MatcherBase
MatcherBase()
Default constructor.
ThePEG::MatcherBase::maxMass
Energy maxMass() const
Returns the maximum mass of the matching particles.
Definition:
MatcherBase.h:141
ThePEG::MatcherBase::initMatcherBase
static AbstractClassDescription< MatcherBase > initMatcherBase
The static object used to initialize the description of this class.
Definition:
MatcherBase.h:388
ThePEG::Qty< 0, 1, 0 >
ThePEG::MatcherBase::addPIfMatchFrom
void addPIfMatchFrom(const Cont &c)
Add a number of particles to the set of matching particles if they meets the criteria.
Definition:
MatcherBase.h:284
ThePEG::BaseClassTrait
BaseClassTraits describes the base classes of the templated class.
Definition:
ClassTraits.h:156
ThePEG::MatcherBase::commonCharge
PDT::Charge commonCharge
The common charge of all matching particles.
Definition:
MatcherBase.h:359
ThePEG::MatcherBase::~MatcherBase
virtual ~MatcherBase()
Destructor.
ThePEG::MatcherBase::matchingMatchers
tPMSet matchingMatchers
A set of matchers which matches a subset of this matcher.
Definition:
MatcherBase.h:329
ThePEG::ClassTraitsBase
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition:
ClassTraits.h:52
Generated on Sat Apr 11 2020 14:31:17 for ThePEG by
1.8.13