00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_ParticleData_H
00010 #define ThePEG_ParticleData_H
00011
00012
00013 #include "ThePEG/Config/ThePEG.h"
00014 #include "ThePEG/PDT/PDT.h"
00015 #include "ThePEG/Vectors/LorentzVector.h"
00016 #include "ThePEG/Vectors/ThreeVector.h"
00017 #include "ThePEG/Interface/Interfaced.h"
00018 #include "ThePEG/Utilities/Selector.h"
00019 #include "ThePEG/PDT/WidthGenerator.h"
00020 #include "ThePEG/PDT/MassGenerator.h"
00021 #include "ThePEG/PDT/DecayMode.fh"
00022 #include "ThePEG/Utilities/ClassTraits.h"
00023 #include "ThePEG/Utilities/ClassDescription.h"
00024
00025 namespace ThePEG {
00026
00035 class ParticleData: public Interfaced {
00036
00037 public:
00038
00040 friend class Repository;
00041
00043 friend class EventGenerator;
00044
00046 friend class DecayMode;
00047
00049 typedef Selector<tDMPtr> DecaySelector;
00050
00051 public:
00052
00058 ParticleData();
00059
00063 virtual ~ParticleData();
00065
00072 static PDPtr Create(long newId, const string & newPDGName);
00073
00077 static PDPair Create(long newId, const string & newPDGName, const string & newAntiPDGName);
00079
00080 public:
00081
00087 long id() const { return theId; }
00088
00093 const string & PDGName() const { return thePDGName; }
00094
00099 const string & genericName() const { return thePDGName; }
00101
00107 PPtr produceParticle(const Lorentz5Momentum &) const;
00108
00112 PPtr produceParticle(const LorentzMomentum &) const;
00113
00117 PPtr produceParticle(const LorentzMomentum &, Energy m) const;
00118
00122 PPtr produceParticle(const Momentum3 & pp = Momentum3()) const;
00123
00127 PPtr produceParticle(Energy m, const Momentum3 & pp = Momentum3()) const;
00128
00133 PPtr produceParticle(Energy plus, Energy minus, Energy px, Energy py) const;
00134
00138 Energy generateMass() const;
00139
00144 Energy generateWidth(Energy mass) const;
00145
00151 Length generateLifeTime(Energy mass, Energy width) const;
00152
00153
00155
00162 const DecaySelector & decaySelector() const { return theDecaySelector; }
00163
00170 tDMPtr selectMode(Particle & p) const;
00171
00176 const DecaySet & decayModes() const { return theDecayModes; }
00178
00182 Energy mass() const { return theMass; }
00183
00187 Energy massMax() const { return mass() + widthUpCut(); }
00188
00192 Energy massMin() const { return max(mass() - widthLoCut(), ZERO); }
00193
00198 virtual Energy constituentMass() const { return mass(); }
00199
00203 Energy width(Energy);
00204
00209 Energy width() const {
00210 return theWidth >= ZERO ? theWidth :
00211 ( theCTau > Length() ? hbarc/theCTau :
00212 ( theCTau == Length() ? Constants::MaxEnergy : ZERO ) );
00213 }
00214
00218 Energy widthCut(Energy wci) {
00219 widthUpCut(wci);
00220 return widthLoCut(wci);
00221 }
00222
00226 Energy widthCut() const { return max(widthUpCut(), widthLoCut()); }
00227
00231 Energy widthUpCut(Energy);
00232
00236 Energy widthUpCut() const {
00237 return theWidthUpCut >= ZERO? theWidthUpCut: Constants::MaxEnergy;
00238 }
00239
00243 Energy widthLoCut(Energy);
00244
00248 Energy widthLoCut() const {
00249 return theWidthLoCut >= ZERO? theWidthLoCut: Constants::MaxEnergy;
00250 }
00251
00255 Length cTau(Length);
00256
00261 Length cTau() const {
00262 return theCTau > Length() ? theCTau :
00263 ( theWidth > ZERO ? hbarc/theWidth :
00264 ( theWidth == ZERO ? Constants::MaxLength : Length() ) );
00265 }
00266
00271 PDT::Charge iCharge(PDT::Charge);
00272
00277 Charge charge() const { return eplus*double(theCharge)/3.0; }
00278
00282 PDT::Charge iCharge() const { return theCharge; }
00283
00287 bool charged() const { return PDT::charged(theCharge); }
00288
00292 bool positive() const { return PDT::positive(theCharge); }
00293
00297 bool negative() const { return PDT::negative(theCharge); }
00298
00303 PDT::Spin iSpin(PDT::Spin);
00304
00308 AngularMomentum spin() const { return hbar_Planck*double(theSpin-1)*0.5; }
00309
00313 PDT::Spin iSpin() const { return theSpin; }
00314
00318 PDT::Colour iColour(PDT::Colour);
00319
00323 PDT::Colour iColour() const { return theColour; }
00324
00328 bool coloured() const { return PDT::coloured(iColour()); }
00329
00333 bool hasColour(bool anti = false) const {
00334 return anti? hasAntiColour():
00335 ( iColour() == PDT::Colour3 || iColour() == PDT::Colour8 );
00336 }
00337
00341 bool hasAntiColour() const {
00342 return iColour() == PDT::Colour3bar || iColour() == PDT::Colour8;
00343 }
00344
00349 void stable(bool stab);
00350
00356 bool stable() const { return isStable || theDecayModes.empty(); }
00357
00361 tPDPtr CC() const { return theAntiPartner; }
00362
00367 void synchronized(bool sync);
00368
00373 bool synchronized() const { return syncAnti; }
00374
00379 void synchronize();
00380
00384 void massGenerator(tMassGenPtr);
00385
00389 tMassGenPtr massGenerator() const { return theMassGenerator; }
00390
00394 void widthGenerator(tWidthGeneratorPtr);
00395
00399 tWidthGeneratorPtr widthGenerator() const { return theWidthGenerator; }
00400
00405 void variableRatio(bool varRatio);
00406
00411 bool variableRatio() const { return theVariableRatio; }
00412
00413 public:
00414
00415
00422 void persistentOutput(PersistentOStream & os) const;
00423
00429 void persistentInput(PersistentIStream & is, int version);
00431
00432 static void Init();
00433
00434 protected:
00435
00436
00437 protected:
00438
00445 virtual IBPtr clone() const;
00446
00451 virtual IBPtr fullclone() const;
00453
00459 virtual PDPtr pdclone() const;
00460
00465 ParticleData(long newId, const string & newPDGName);
00466
00476 virtual void readSetup(istream & is);
00477
00482 static void antiSetup(const PDPair & pap);
00483
00484
00485 protected:
00486
00492 virtual void doupdate();
00493
00499 virtual void doinit();
00500
00510 virtual void rebind(const TranslationMap & trans)
00511 ;
00512
00518 virtual IVector getReferences();
00519
00524 virtual void doinitrun();
00526
00527 protected:
00528
00532 void addDecayMode(tDMPtr);
00533
00537 void removeDecayMode(tDMPtr);
00538
00539 private:
00540
00544 long theId;
00545
00549 string thePDGName;
00550
00554 Energy theMass;
00555
00559 Energy theWidth;
00560
00564 Energy theWidthUpCut;
00565
00569 Energy theWidthLoCut;
00570
00574 Length theCTau;
00575
00579 PDT::Charge theCharge;
00580
00584 PDT::Spin theSpin;
00585
00589 PDT::Colour theColour;
00590
00595 MassGenPtr theMassGenerator;
00596
00600 bool isStable;
00601
00606 DecaySelector theDecaySelector;
00607
00611 DecaySet theDecayModes;
00612
00620 WidthGeneratorPtr theWidthGenerator;
00621
00626 bool theVariableRatio;
00627
00632 tPDPtr theAntiPartner;
00633
00638 bool syncAnti;
00639
00643 Energy theDefMass;
00644
00648 Energy theDefWidth;
00649
00653 Energy theDefCut;
00654
00658 Length theDefCTau;
00659
00663 PDT::Charge theDefCharge;
00664
00668 PDT::Spin theDefSpin;
00669
00673 PDT::Colour theDefColour;
00674
00678 void setMass(Energy);
00679
00683 Energy defMass() const;
00684
00688 void setWidth(Energy);
00689
00693 Energy getWidth() const;
00694
00698 Energy defWidth() const;
00699
00703 void setCut(Energy);
00704
00708 Energy getCut() const;
00709
00713 Energy defCut() const;
00714
00718 void setUpCut(Energy);
00719
00723 Energy getUpCut() const;
00724
00728 void setLoCut(Energy);
00729
00733 Energy getLoCut() const;
00734
00738 void setCTau(Length);
00739
00743 Length getCTau() const;
00744
00748 Length defCTau() const;
00749
00753 void setStable(long);
00754
00758 long getStable() const;
00759
00763 void setSync(long);
00764
00768 long getSync() const;
00769
00773 void setVariableRatio(long);
00774
00778 long getVariableRatio() const;
00779
00783 string doSync(string);
00784
00788 void setMassGenerator(MassGenPtr);
00789
00793 void setWidthGenerator(WidthGeneratorPtr);
00794
00798 void setCharge(int);
00799
00803 string ssetCharge(string);
00804
00808 int getCharge() const;
00809
00813 int defCharge() const;
00814
00818 void setSpin(int);
00819
00823 int getSpin() const;
00824
00828 int defSpin() const;
00829
00833 void setColour(long);
00834
00838 long getColour() const;
00839
00843 long defColour() const;
00844
00848 void insDecayModes(DMPtr dm, int);
00849
00853 void delDecayModes(int i);
00854
00858 vector<DMPtr> getDecayModes() const;
00859
00863 static ClassDescription<ParticleData> initParticleData;
00864
00865 };
00866
00871 template <>
00872 struct BaseClassTrait<ParticleData,1>: public ClassTraitsType {
00874 typedef Interfaced NthBase;
00875 };
00876
00879 template <>
00880 struct ClassTraits<ParticleData>: public ClassTraitsBase<ParticleData> {
00882 static string className() { return "ThePEG::ParticleData"; }
00883 };
00884
00887 }
00888
00889 #endif