Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // RemnantParticle.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_RemnantParticle_H
0010 #define THEPEG_RemnantParticle_H
0011 //
0012 // This is the declaration of the RemnantParticle class.
0013 //
0014 
0015 #include "ThePEG/EventRecord/Particle.h"
0016 #include "RemnantParticle.fh"
0017 #include "ThePEG/PDT/RemnantData.fh"
0018 #include "ThePEG/PDT/RemnantDecayer.fh"
0019 
0020 namespace ThePEG {
0021 
0022 /**
0023  * Here is the documentation of the RemnantParticle class.
0024  */
0025 class RemnantParticle: public Particle {
0026 
0027 public:
0028 
0029   /**
0030    * RemnantDecayer is a friend.
0031    */
0032   friend class RemnantDecayer;
0033 
0034 public:
0035 
0036   /** @name Standard constructors and destructors. */
0037   //@{
0038   /**
0039    * The standard constructor takes as argument the \a particle for
0040    * which this is the remnant and a \a decayer capable of performing
0041    * the decay. Optionally a \a parton that has been extracted. Note
0042    * that if the parton is given, the extraction may silently fail.
0043    */
0044   RemnantParticle(const Particle & particle, RemDecPtr decayer,
0045           tPPtr parton = tPPtr());
0046 
0047 public:
0048 
0049   /**
0050    * Modify the properties to reflect that the given \a parton was
0051    * extracted. If \a fixcolour is true a colour line is drawn from
0052    * the remnant to the extracted parton.
0053    */
0054   bool extract(tPPtr parton, bool fixcolour = false);
0055 
0056   /**
0057    * Modify the properties to reflect that the previously extracted
0058    * parton, \a oldp, was evolved backwards to the the parton \a
0059    * newp. If \a fixcolour is true a colour line is drawn from the
0060    * remnant to the extracted parton.
0061    */
0062   bool reextract(tPPtr oldp, tPPtr newp, bool fixcolour = false);
0063 
0064   /**
0065    * Modify the properties to reflect that the given \a parton which
0066    * was previously extracted is removed.
0067    */
0068   bool remove(tPPtr parton);
0069 
0070   /**
0071    * Acces the extracted partons.
0072    */
0073   const PVector & extracted() const {
0074     return theExtracted;
0075   }
0076 
0077 public:
0078 
0079   /** @name Functions used by the persistent I/O system. */
0080   //@{
0081   /**
0082    * Function used to write out object persistently.
0083    * @param os the persistent output stream written to.
0084    */
0085   void persistentOutput(PersistentOStream & os) const;
0086 
0087   /**
0088    * Function used to read in object persistently.
0089    * @param is the persistent input stream read from.
0090    * @param version the version number of the object when written.
0091    */
0092   void persistentInput(PersistentIStream & is, int version);
0093   //@}
0094 
0095   /**
0096    * The standard Init function used to initialize the interfaces.
0097    * Called exactly once for each class by the class description system
0098    * before the main function starts or
0099    * when this class is dynamically loaded.
0100    */
0101   static void Init();
0102 
0103 protected:
0104 
0105   /**
0106    * If necessary, colour-connect this remnant to the given \a parton.
0107    */
0108   void fixColourLines(tPPtr parton);
0109 
0110 private:
0111 
0112   /**
0113    * The RemnantData object associated to this remnant.
0114    */
0115   RemPDPtr remData;
0116 
0117   /**
0118    * The parent from which this remnant resulted.
0119    */
0120   tcPPtr parent;
0121 
0122   /**
0123    * The set of extracted partons.
0124    */
0125   PVector theExtracted;
0126 
0127 protected:
0128 
0129   /**
0130    * Private default constructor must only be used by the
0131    * PersistentIStream class via the ClassTraits<RemnantParticle> class.
0132    */
0133   RemnantParticle() {}
0134 
0135   /**
0136    * The ClassTraits<RemnantParticle> class must be a friend to be able to
0137    * use the private default constructor.
0138    */
0139   friend struct ClassTraits<RemnantParticle>;
0140 
0141 private:
0142 
0143   /**
0144    * The static object used to initialize the description of this class.
0145    * Indicates that this is a concrete class with persistent data.
0146    */
0147   static ClassDescription<RemnantParticle> initRemnantParticle;
0148 
0149   /**
0150    * The assignment operator is private and must never be called.
0151    * In fact, it should not even be implemented.
0152    */
0153   RemnantParticle & operator=(const RemnantParticle &) = delete;
0154 
0155 };
0156 
0157 }
0158 
0159 #include "ThePEG/Utilities/ClassTraits.h"
0160 
0161 namespace ThePEG {
0162 
0163 /** @cond TRAITSPECIALIZATIONS */
0164 
0165 /** This template specialization informs ThePEG about the
0166  *  base classes of RemnantParticle. */
0167 template <>
0168 struct BaseClassTrait<RemnantParticle,1> {
0169   /** Typedef of the first base class of RemnantParticle. */
0170   typedef Particle NthBase;
0171 };
0172 
0173 /** This template specialization informs ThePEG about the name of
0174  *  the RemnantParticle class and the shared object where it is defined. */
0175 template <>
0176 struct ClassTraits<RemnantParticle>
0177   : public ClassTraitsBase<RemnantParticle> {
0178   /** Return a platform-independent class name */
0179   static string className() { return "ThePEG::RemnantParticle"; }
0180   /** Create a Particle object. */
0181   static TPtr create() { return TPtr::Create(RemnantParticle()); }
0182 };
0183 
0184 /** @endcond */
0185 
0186 }
0187 
0188 #endif /* THEPEG_RemnantParticle_H */