ThePEG  1.8.0
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 
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 
146 
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 
205 
210  Energy width() const {
211  return theWidth >= ZERO ? theWidth :
212  ( theCTau > Length() ? hbarc/theCTau :
213  ( theCTau == Length() ? Constants::MaxEnergy : ZERO ) );
214  }
215 
220  widthUpCut(wci);
221  return widthLoCut(wci);
222  }
223 
227  Energy widthCut() const { return max(widthUpCut(), widthLoCut()); }
228 
233 
237  Energy widthUpCut() const {
239  }
240 
245 
249  Energy widthLoCut() const {
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 
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 
307 
311  AngularMomentum spin() const { return hbar_Planck*double(theSpin-1)*0.5; }
312 
316  PDT::Spin iSpin() const { return theSpin; }
317 
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 
390 
395 
400 
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 
547 
551  string thePDGName;
552 
557 
562 
567 
572 
577 
582 
587 
592 
598 
602  bool isStable;
603 
609 
613  DecaySet theDecayModes;
614 
623 
629 
635 
640  bool syncAnti;
641 
646 
651 
656 
661 
666 
671 
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 
791 
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 
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 */