Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:28

0001 // -*- C++ -*-
0002 //
0003 // ConstituentParticleData.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef ThePEG_ConstituentParticleData_H
0010 #define ThePEG_ConstituentParticleData_H
0011 // This is the declaration of the ConstituentParticleData class.
0012 
0013 #include "ThePEG/PDT/ParticleData.h"
0014 
0015 namespace ThePEG {
0016 
0017 /**
0018  * ConstituentParticleData inherits from the ParticleData class and is
0019  * used for quarks, diquarks and gluons to store information about
0020  * their constituent mass.
0021  *
0022  * @see \ref ConstituentParticleDataInterfaces "The interfaces"
0023  * defined for ConstituentParticleData.
0024  */
0025 class ConstituentParticleData: public virtual ParticleData {
0026 
0027 public:
0028 
0029   /** @name Standard constructors and destructors. */
0030   //@{
0031   /**
0032    * Default constructor.
0033    */
0034   ConstituentParticleData()
0035     : theConstituentMass(ZERO), theDefaultConstituentMass(ZERO) {}
0036   //@}
0037 
0038   /** @name The Create methods are special interfaces for ParticleData
0039       classes. */
0040   //@{
0041   /**
0042    * Create a Particle which is its own anti-particle.
0043    */
0044   static PDPtr Create(long newId, string newPDGName);
0045 
0046   /**
0047    * Create a particle - anti particle pair.
0048    */
0049   static PDPair Create(long newId, string newPDGName, string newAntiPDGName);
0050   //@}
0051 
0052 public:
0053 
0054   /**
0055    * Return the constituent mass of this parton.
0056    */
0057   virtual Energy constituentMass() const { return theConstituentMass; }
0058 
0059 public:
0060 
0061   /** @name Functions used by the persistent I/O system. */
0062   //@{
0063   /**
0064    * Function used to write out object persistently.
0065    * @param os the persistent output stream written to.
0066    */
0067   void persistentOutput(PersistentOStream & os) const;
0068 
0069   /**
0070    * Function used to read in object persistently.
0071    * @param is the persistent input stream read from.
0072    * @param version the version number of the object when written.
0073    */
0074   void persistentInput(PersistentIStream & is, int version);
0075   //@}
0076 
0077   /**
0078    * Standard Init function used to initialize the interface.
0079    */
0080   static void Init();
0081 
0082 protected:
0083 
0084   /**
0085    * Protected constructor only to be used by subclasses or by the
0086    * Create method.
0087    */
0088   ConstituentParticleData(long newId, string newPDGName);
0089 
0090   /**
0091    * Read setup info from a standard stream. The information that must
0092    * be supplied is the same as for ParticleData::readSetup with an
0093    * additional constituent mass (in GeV) added in the end.
0094    */
0095   virtual void readSetup(istream & is);
0096 
0097   /**
0098    * ParticleData clone method
0099    */
0100   virtual PDPtr pdclone() const;
0101 
0102 private:
0103 
0104   /**
0105    * Utility function for the interface.
0106    */
0107   void setConstituentMass(Energy m);
0108 
0109   /**
0110    * Utility function for the interface.
0111    */
0112   Energy defConstituentMass() const;
0113 
0114 private:
0115 
0116   /**
0117    * The constituent mass of this parton.
0118    */
0119   Energy theConstituentMass;
0120 
0121   /**
0122    * The default constituent mass of this parton.
0123    */
0124   Energy theDefaultConstituentMass;
0125 
0126 private:
0127 
0128   /**
0129    * Describe a concrete class with persistent data.
0130    */
0131   static ClassDescription<ConstituentParticleData> initConstituentParticleData;
0132 
0133   /**
0134    *  Private and non-existent assignment operator.
0135    */
0136   ConstituentParticleData & operator=(const ConstituentParticleData &) = delete;
0137 
0138 };
0139 
0140 /** @cond TRAITSPECIALIZATIONS */
0141 
0142 /** This template specialization informs ThePEG about the
0143  *  base classes of ConstituentParticleData. */
0144 template <>
0145 struct BaseClassTrait<ConstituentParticleData,1>: public ClassTraitsType {
0146   /** Typedef of the first base class of ConstituentParticleData. */
0147   typedef ParticleData NthBase;
0148 };
0149 
0150 /** This template specialization informs ThePEG about the name of the
0151  *  ConstituentParticleData class. */
0152 template <>
0153 struct ClassTraits<ConstituentParticleData>:
0154     public ClassTraitsBase<ConstituentParticleData> {
0155   /** Return a platform-independent class name */
0156   static string className() { return "ThePEG::ConstituentParticleData"; }
0157 };
0158 
0159 /** @endcond */
0160 
0161 }
0162 
0163 #endif /* ThePEG_ConstituentParticleData_H */