ThePEG
1.8.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
PDT
ParticleData.h
1
// -*- C++ -*-
2
//
3
// ParticleData.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2011 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_ParticleData_H
10
#define ThePEG_ParticleData_H
11
// This is the declaration of the ParticleData class.
12
13
#include "ThePEG/Config/ThePEG.h"
14
#include "ThePEG/PDT/PDT.h"
15
#include "ThePEG/PDT/PID.h"
16
#include "ThePEG/Vectors/LorentzVector.h"
17
#include "ThePEG/Vectors/ThreeVector.h"
18
#include "ThePEG/Interface/Interfaced.h"
19
#include "ThePEG/Utilities/Selector.h"
20
#include "ThePEG/PDT/WidthGenerator.h"
21
#include "ThePEG/PDT/MassGenerator.h"
22
#include "ThePEG/PDT/DecayMode.fh"
23
#include "ThePEG/Utilities/ClassTraits.h"
24
#include "ThePEG/Utilities/ClassDescription.h"
25
26
namespace
ThePEG {
27
36
class
ParticleData
:
public
Interfaced
{
37
38
public
:
39
41
friend
class
Repository
;
42
44
friend
class
EventGenerator
;
45
47
friend
class
DecayMode
;
48
50
typedef
Selector<tDMPtr>
DecaySelector
;
51
52
public
:
53
59
ParticleData
();
60
64
virtual
~ParticleData
();
66
73
static
PDPtr
Create
(
PID
newId,
const
string
& newPDGName);
74
78
static
PDPair
Create
(
PID
newId,
const
string
& newPDGName,
const
string
& newAntiPDGName);
80
81
public
:
82
88
long
id
()
const
{
return
theId
; }
89
94
const
string
&
PDGName
()
const
{
return
thePDGName
; }
95
100
const
string
&
genericName
()
const
{
return
thePDGName
; }
102
108
PPtr
produceParticle
(
const
Lorentz5Momentum
&)
const
;
109
113
PPtr
produceParticle
(
const
LorentzMomentum
&)
const
;
114
118
PPtr
produceParticle
(
const
LorentzMomentum
&,
Energy
m)
const
;
119
123
PPtr
produceParticle
(
const
Momentum3
& pp =
Momentum3
())
const
;
124
128
PPtr
produceParticle
(
Energy
m,
const
Momentum3
& pp =
Momentum3
())
const
;
129
134
PPtr
produceParticle
(
Energy
plus,
Energy
minus,
Energy
px,
Energy
py)
const
;
135
139
Energy
generateMass
()
const
;
140
145
Energy
generateWidth
(
Energy
mass
)
const
;
146
152
Length
generateLifeTime
(
Energy
mass
,
Energy
width
)
const
;
153
// Given a mass and a width of an instance of this particle type,
154
// generate a life time.
156
163
const
DecaySelector
&
decaySelector
()
const
{
return
theDecaySelector
; }
164
171
tDMPtr
selectMode
(
Particle
& p)
const
;
172
177
const
DecaySet &
decayModes
()
const
{
return
theDecayModes
; }
179
183
Energy
mass
()
const
{
return
theMass
; }
184
188
Energy
massMax
()
const
{
return
mass
() +
widthUpCut
(); }
189
193
Energy
massMin
()
const
{
return
max(
mass
() -
widthLoCut
(),
ZERO
); }
194
199
virtual
Energy
constituentMass
()
const
{
return
mass
(); }
200
204
Energy
width
(
Energy
);
205
210
Energy
width
()
const
{
211
return
theWidth
>=
ZERO
?
theWidth
:
212
(
theCTau
>
Length
() ?
hbarc
/
theCTau
:
213
(
theCTau
==
Length
() ?
Constants::MaxEnergy
:
ZERO
) );
214
}
215
219
Energy
widthCut
(
Energy
wci) {
220
widthUpCut
(wci);
221
return
widthLoCut
(wci);
222
}
223
227
Energy
widthCut
()
const
{
return
max(
widthUpCut
(),
widthLoCut
()); }
228
232
Energy
widthUpCut
(
Energy
);
233
237
Energy
widthUpCut
()
const
{
238
return
theWidthUpCut
>=
ZERO
?
theWidthUpCut
:
Constants::MaxEnergy
;
239
}
240
244
Energy
widthLoCut
(
Energy
);
245
249
Energy
widthLoCut
()
const
{
250
return
theWidthLoCut
>=
ZERO
?
theWidthLoCut
:
Constants::MaxEnergy
;
251
}
252
256
Length
cTau
(
Length
);
257
264
Length
cTau
()
const
{
265
return
theCTau
>
Length
() ?
theCTau
:
266
(
theWidth
>
ZERO
?
hbarc
/
theWidth
:
267
(
stable
() ?
Constants::MaxLength
:
Length
() ) );
268
}
269
274
PDT::Charge
iCharge
(
PDT::Charge
);
275
280
Charge
charge
()
const
{
return
eplus*double(
theCharge
)/3.0; }
281
285
PDT::Charge
iCharge
()
const
{
return
theCharge
; }
286
290
bool
charged
()
const
{
return
PDT::charged
(
theCharge
); }
291
295
bool
positive
()
const
{
return
PDT::positive
(
theCharge
); }
296
300
bool
negative
()
const
{
return
PDT::negative
(
theCharge
); }
301
306
PDT::Spin
iSpin
(
PDT::Spin
);
307
311
AngularMomentum
spin
()
const
{
return
hbar_Planck
*double(
theSpin
-1)*0.5; }
312
316
PDT::Spin
iSpin
()
const
{
return
theSpin
; }
317
321
PDT::Colour
iColour
(
PDT::Colour
);
322
326
PDT::Colour
iColour
()
const
{
return
theColour
; }
327
331
bool
coloured
()
const
{
return
PDT::coloured
(
iColour
()); }
332
336
bool
hasColour
(
bool
anti =
false
)
const
{
337
return
anti?
hasAntiColour
():
338
(
iColour
() ==
PDT::Colour3
||
iColour
() ==
PDT::Colour6
||
339
iColour
() ==
PDT::Colour8
);
340
}
341
345
bool
hasAntiColour
()
const
{
346
return
iColour
() ==
PDT::Colour3bar
||
iColour
() ==
PDT::Colour6bar
||
347
iColour
() ==
PDT::Colour8
;
348
}
349
354
void
stable
(
bool
stab);
355
361
bool
stable
()
const
{
return
isStable
||
theDecayModes
.empty(); }
362
366
tPDPtr
CC
()
const
{
return
theAntiPartner
; }
367
372
void
synchronized
(
bool
sync);
373
378
bool
synchronized
()
const
{
return
syncAnti
; }
379
384
void
synchronize
();
385
389
void
massGenerator
(
tMassGenPtr
);
390
394
tMassGenPtr
massGenerator
()
const
{
return
theMassGenerator
; }
395
399
void
widthGenerator
(
tWidthGeneratorPtr
);
400
404
tWidthGeneratorPtr
widthGenerator
()
const
{
return
theWidthGenerator
; }
405
410
void
variableRatio
(
bool
varRatio);
411
416
bool
variableRatio
()
const
{
return
theVariableRatio
; }
417
418
public
:
419
420
427
void
persistentOutput
(
PersistentOStream
& os)
const
;
428
434
void
persistentInput
(
PersistentIStream
& is,
int
version);
436
437
static
void
Init
();
438
439
protected
:
440
447
virtual
IBPtr
clone
()
const
;
448
453
virtual
IBPtr
fullclone
()
const
;
455
461
virtual
PDPtr
pdclone
()
const
;
462
467
ParticleData
(
PID
newId,
const
string
& newPDGName);
468
478
virtual
void
readSetup
(istream & is);
479
484
static
void
antiSetup
(
const
PDPair
& pap);
485
486
487
protected
:
488
494
virtual
void
doupdate
();
495
501
virtual
void
doinit
();
502
512
virtual
void
rebind
(
const
TranslationMap
& trans)
513
;
514
520
virtual
IVector
getReferences
();
521
526
virtual
void
doinitrun
();
528
529
protected
:
530
534
void
addDecayMode
(
tDMPtr
);
535
539
void
removeDecayMode
(
tDMPtr
);
540
541
private
:
542
546
PID
theId
;
547
551
string
thePDGName
;
552
556
Energy
theMass
;
557
561
Energy
theWidth
;
562
566
Energy
theWidthUpCut
;
567
571
Energy
theWidthLoCut
;
572
576
Length
theCTau
;
577
581
PDT::Charge
theCharge
;
582
586
PDT::Spin
theSpin
;
587
591
PDT::Colour
theColour
;
592
597
MassGenPtr
theMassGenerator
;
598
602
bool
isStable
;
603
608
DecaySelector
theDecaySelector
;
609
613
DecaySet
theDecayModes
;
614
622
WidthGeneratorPtr
theWidthGenerator
;
623
628
bool
theVariableRatio
;
629
634
tPDPtr
theAntiPartner
;
635
640
bool
syncAnti
;
641
645
Energy
theDefMass
;
646
650
Energy
theDefWidth
;
651
655
Energy
theDefCut
;
656
660
Length
theDefCTau
;
661
665
PDT::Charge
theDefCharge
;
666
670
PDT::Spin
theDefSpin
;
671
675
PDT::Colour
theDefColour
;
676
680
void
setMass
(
Energy
);
681
685
Energy
defMass
()
const
;
686
690
void
setWidth
(
Energy
);
691
695
Energy
getWidth
()
const
;
696
700
Energy
defWidth
()
const
;
701
705
void
setCut
(
Energy
);
706
710
Energy
getCut
()
const
;
711
715
Energy
defCut
()
const
;
716
720
void
setUpCut
(
Energy
);
721
725
Energy
getUpCut
()
const
;
726
730
void
setLoCut
(
Energy
);
731
735
Energy
getLoCut
()
const
;
736
740
void
setCTau
(
Length
);
741
745
Length
getCTau
()
const
;
746
750
Length
defCTau
()
const
;
751
755
void
setStable
(
long
);
756
760
long
getStable
()
const
;
761
765
void
setSync
(
long
);
766
770
long
getSync
()
const
;
771
775
void
setVariableRatio
(
long
);
776
780
long
getVariableRatio
()
const
;
781
785
string
doSync
(
string
);
786
790
void
setMassGenerator
(
MassGenPtr
);
791
795
void
setWidthGenerator
(
WidthGeneratorPtr
);
796
800
void
setCharge
(
int
);
801
805
string
ssetCharge
(
string
);
806
810
int
getCharge
()
const
;
811
815
int
defCharge
()
const
;
816
820
void
setSpin
(
int
);
821
825
int
getSpin
()
const
;
826
830
int
defSpin
()
const
;
831
835
void
setColour
(
long
);
836
840
long
getColour
()
const
;
841
845
long
defColour
()
const
;
846
850
void
insDecayModes
(
DMPtr
dm,
int
);
851
855
void
delDecayModes
(
int
i);
856
860
vector<DMPtr>
getDecayModes
()
const
;
861
865
string
doSelectDecayModes
(
string
);
866
870
string
doPrintDecayModes
(
string
);
871
875
static
ClassDescription<ParticleData>
initParticleData
;
876
877
};
878
883
template
<>
884
struct
BaseClassTrait
<
ParticleData
,1>:
public
ClassTraitsType
{
886
typedef
Interfaced
NthBase
;
887
};
888
891
template
<>
892
struct
ClassTraits<ParticleData>:
public
ClassTraitsBase<ParticleData> {
894
static
string
className
() {
return
"ThePEG::ParticleData"
; }
895
};
896
899
}
900
901
#endif
/* ThePEG_ParticleData_H */
Generated on Sat Jun 16 2012 16:51:04 for ThePEG by
1.8.1.1