Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:25

0001 // -*- C++ -*-
0002 //
0003 // ShowerParticle.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig 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 HERWIG_ShowerParticle_H
0010 #define HERWIG_ShowerParticle_H
0011 //
0012 // This is the declaration of the ShowerParticle class.
0013 //
0014 
0015 #include "ThePEG/EventRecord/Particle.h"
0016 #include "Herwig/Shower/QTilde/SplittingFunctions/SplittingFunction.fh"
0017 #include "Herwig/Shower/QTilde/ShowerConfig.h"
0018 #include "Herwig/Shower/QTilde/Kinematics/ShowerBasis.h"
0019 #include "Herwig/Shower/QTilde/Kinematics/ShowerKinematics.h"
0020 #include "ShowerParticle.fh"
0021 #include <iosfwd>
0022 
0023 namespace Herwig {
0024 
0025 using namespace ThePEG;
0026 
0027   /** \ingroup Shower
0028    *  This class represents a particle in the showering process.
0029    *  It inherits from the Particle class of ThePEG and has some  
0030    *  specifics information useful only during the showering process.
0031    * 
0032    *  Notice that: 
0033    *    - for forward evolution, it is clear what is meant by parent/child; 
0034    *      for backward evolution, however, it depends whether we want 
0035    *      to keep a physical picture or a Monte-Carlo effective one. 
0036    *      In the former case, an incoming particle (emitting particle)  
0037    *      splits into an emitted particle and the emitting particle after 
0038    *      the emission: the latter two are then children of the 
0039    *      emitting particle, the parent. In the Monte-Carlo effective  
0040    *      picture, we have that the particle close to the hard subprocess, 
0041    *      with higher (space-like) virtuality, splits into an emitted particle 
0042    *      and the emitting particle at lower virtuality: the latter two are, 
0043    *      in this case, the children of the first one, the parent. However we
0044    *      choose a more physical picture where the new emitting particle is the
0045    *      parented of the emitted final-state particle and the original emitting
0046    *      particle.
0047    *    - the pointer to a SplitFun object is set only in the case 
0048    *      that the particle has undergone a shower emission. This is similar to
0049    *      the case of the decay of a normal Particle where 
0050    *      the pointer to a Decayer object is set only in the case 
0051    *      that the particle has undergone to a decay. 
0052    *      In the case of particle connected directly to the hard subprocess, 
0053    *      there is no pointer to the hard subprocess, but there is a method 
0054    *      isFromHardSubprocess() which returns true only in this case.
0055    *
0056    *  @see Particle
0057    *  @see ShowerConfig
0058    *  @see ShowerKinematics
0059    */
0060 class ShowerParticle: public Particle {
0061 
0062 public:
0063 
0064   /**
0065    *  Struct for all the info on an evolution partner
0066    */
0067   struct EvolutionPartner {
0068 
0069     /**
0070      *  Constructor
0071      */
0072     EvolutionPartner(tShowerParticlePtr p,double w, ShowerPartnerType t,
0073              Energy s) : partner(p), weight(w), type(t), scale(s)
0074     {}
0075 
0076     /**
0077      * The partner
0078      */
0079     tShowerParticlePtr partner;
0080     
0081     /**
0082      *  Weight
0083      */
0084     double weight;
0085 
0086     /**
0087      *  Type
0088      */
0089     ShowerPartnerType type;
0090 
0091     /**
0092      *  The assoicated evolution scale
0093      */
0094     Energy scale;
0095   };
0096 
0097   /**
0098    *  Struct to store the evolution scales
0099    */
0100   struct EvolutionScales {
0101 
0102     /**
0103      *  Constructor
0104      */
0105     EvolutionScales() : QED(),QCD_c(),QCD_ac(),
0106             QED_noAO(),QCD_c_noAO(),QCD_ac_noAO()
0107     {}
0108 
0109     /**
0110      *  QED scale
0111      */
0112     Energy QED;
0113 
0114     /**
0115      * QCD colour scale
0116      */
0117     Energy QCD_c;
0118 
0119     /**
0120      *  QCD anticolour scale
0121      */
0122     Energy QCD_ac;
0123 
0124     /**
0125      *  QED scale
0126      */
0127     Energy QED_noAO;
0128 
0129     /**
0130      * QCD colour scale
0131      */
0132     Energy QCD_c_noAO;
0133 
0134     /**
0135      *  QCD anticolour scale
0136      */
0137     Energy QCD_ac_noAO;
0138 
0139     /**
0140      *   EW scales
0141      */
0142     Energy EW;
0143     
0144   };
0145 
0146 
0147   /** @name Construction and descruction functions. */
0148   //@{
0149 
0150   /**
0151    * Standard Constructor. Note that the default constructor is
0152    * private - there is no particle without a pointer to a
0153    * ParticleData object.
0154    * @param x the ParticleData object
0155    * @param fs  Whether or not the particle is an inital or final-state particle
0156    * @param tls Whether or not the particle initiates a time-like shower
0157    */
0158   ShowerParticle(tcEventPDPtr x, bool fs, bool tls=false) 
0159     : Particle(x), _isFinalState(fs),
0160       _perturbative(0), _initiatesTLS(tls), _x(1.0), _showerKinematics(),
0161       _vMass(ZERO), _thePEGBase() {}
0162 
0163   /**
0164    * Copy constructor from a ThePEG Particle
0165    * @param x ThePEG particle
0166    * @param pert Where the particle came from
0167    * @param fs Whether or not the particle is an inital or final-state particle
0168    * @param tls Whether or not the particle initiates a time-like shower
0169    */
0170   ShowerParticle(const Particle & x, unsigned int pert, bool fs, bool tls=false)
0171     : Particle(x), _isFinalState(fs),
0172     _perturbative(pert), _initiatesTLS(tls), _x(1.0), _showerKinematics(),
0173     _vMass(ZERO), _thePEGBase(&x) {}
0174   //@}
0175 
0176 public:
0177 
0178   /**
0179    *  Set a preliminary momentum for the particle
0180    */
0181   void setShowerMomentum(bool timelike);
0182 
0183   /**
0184    *  Construct the spin info object for a shower particle
0185    */
0186   void constructSpinInfo(bool timelike);
0187 
0188   /**
0189    * Perform any initial calculations needed after the branching has been selected
0190    */
0191   void initializeDecay();
0192 
0193   /**
0194    * Perform any initial calculations needed after the branching has been selected
0195    * @param parent The beam particle
0196    */
0197   void initializeInitialState(PPtr parent);
0198 
0199   /**
0200    * Perform any initial calculations needed after the branching has been selected
0201    */
0202   void initializeFinalState();
0203 
0204   /**
0205    *   Access/Set various flags about the state of the particle
0206    */
0207   //@{
0208   /**
0209    * Access the flag that tells if the particle is final state
0210    * or initial state.
0211    */
0212   bool isFinalState() const { return _isFinalState; }
0213 
0214   /**
0215    * Access the flag that tells if the particle is initiating a
0216    * time like shower when it has been emitted in an initial state shower.
0217    */
0218   bool initiatesTLS() const { return _initiatesTLS; }
0219 
0220   /**
0221    * Access the flag which tells us where the particle came from
0222    * This is 0 for a particle produced in the shower, 1 if the particle came
0223    * from the hard sub-process and 2 is it came from a decay.
0224    */
0225   unsigned int perturbative() const { return _perturbative; }
0226   //@}
0227 
0228   /**
0229    * Set/Get the momentum fraction for initial-state particles
0230    */
0231   //@{
0232   /**
0233    *  For an initial state particle get the fraction of the beam momentum
0234    */
0235   void x(double x) { _x = x; }
0236 
0237   /**
0238    *  For an initial state particle set the fraction of the beam momentum
0239    */
0240   double x() const { return _x; }
0241   //@}
0242 
0243   /**
0244    * Set/Get methods for the ShowerKinematics objects
0245    */
0246   //@{
0247   /**
0248    * Access/ the ShowerKinematics object.
0249    */
0250   const ShoKinPtr & showerKinematics() const { return _showerKinematics; }
0251 
0252 
0253   /**
0254    * Set the ShowerKinematics object.
0255    */
0256   void showerKinematics(const ShoKinPtr in) { _showerKinematics = in; }
0257   //@}
0258 
0259   /**
0260    * Set/Get methods for the ShowerBasis objects
0261    */
0262   //@{
0263   /**
0264    * Access/ the ShowerBasis object.
0265    */
0266   const ShowerBasisPtr & showerBasis() const { return _showerBasis; }
0267 
0268 
0269   /**
0270    * Set the ShowerBasis object.
0271    */
0272   void showerBasis(const ShowerBasisPtr in, bool copy) {
0273     if(!copy) 
0274       _showerBasis = in;
0275     else {
0276       _showerBasis = new_ptr(ShowerBasis());
0277       _showerBasis->setBasis(in->pVector(),in->nVector(),in->frame());
0278     } 
0279   }
0280   //@}
0281 
0282   /**
0283    *  Members relating to the initial evolution scale and partner for the particle
0284    */
0285   //@{
0286   /**
0287    *  Veto emission at a given scale 
0288    */
0289   void vetoEmission(ShowerPartnerType type, Energy scale);
0290 
0291   /**
0292    *  Access to the evolution scales
0293    */
0294   const EvolutionScales & scales() const {return scales_;} 
0295 
0296   /**
0297    *  Access to the evolution scales
0298    */
0299   EvolutionScales & scales() {return scales_;} 
0300 
0301   /**
0302    * Return the virtual mass\f$
0303    */
0304   Energy virtualMass() const { return _vMass; }
0305 
0306   /**
0307    *  Set the virtual mass
0308    */
0309   void virtualMass(Energy mass) { _vMass = mass; }
0310 
0311   /** 
0312    * Return the partner
0313    */
0314   tShowerParticlePtr partner() const { return _partner; }
0315 
0316   /**
0317    * Set the partner
0318    */
0319   void partner(const tShowerParticlePtr partner) { _partner = partner; } 
0320 
0321   /**
0322    *  Get the possible partners 
0323    */
0324   vector<EvolutionPartner> & partners() { return partners_; }
0325 
0326   /**
0327    *  Add a possible partners 
0328    */
0329   void addPartner(EvolutionPartner in );
0330 
0331   /**
0332    *  Clear the evolution partners
0333    */
0334   void clearPartners() { partners_.clear(); }
0335     
0336   /** 
0337    * Return the progenitor of the shower
0338    */
0339   tShowerParticlePtr progenitor() const { return _progenitor; }
0340 
0341   /**
0342    * Set the progenitor of the shower
0343    */
0344   void progenitor(const tShowerParticlePtr progenitor) { _progenitor = progenitor; } 
0345   //@}
0346 
0347 
0348   /**
0349    *  Members to store and provide access to variables for a specific
0350    *  shower evolution scheme
0351    */
0352   //@{
0353   struct Parameters {
0354     Parameters() : alpha(1.), beta(), ptx(), pty(), pt() {}
0355     double alpha;
0356     double beta;
0357     Energy ptx;
0358     Energy pty;
0359     Energy pt;
0360   };
0361 
0362 
0363   /**
0364    *  Set the vector containing dimensionless variables
0365    */
0366   Parameters & showerParameters() { return _parameters; }
0367   //@}
0368 
0369   /**
0370    *  If this particle came from the hard process get a pointer to ThePEG particle
0371    *  it came from
0372    */
0373   const tcPPtr thePEGBase() const { return _thePEGBase; }
0374  
0375 public:
0376 
0377   /**
0378    *  Extract the rho matrix including mapping needed in the shower
0379    */
0380   RhoDMatrix extractRhoMatrix(bool forward);
0381 
0382   /**
0383    * For a particle which came from the hard process get the spin density and
0384    * the mapping required to the basis used in the Shower
0385    * @param rho The \f$\rho\f$ matrix
0386    * @param mapping The mapping
0387    * @param showerkin The ShowerKinematics object
0388    */
0389   bool getMapping(SpinPtr &, RhoDMatrix & map);
0390 
0391 protected:
0392 
0393   /**
0394    * Standard clone function.
0395    */
0396   virtual PPtr clone() const;
0397 
0398   /**
0399    * Standard clone function.
0400    */
0401   virtual PPtr fullclone() const;
0402 
0403 private:
0404 
0405   /**
0406    * The static object used to initialize the description of this class.
0407    * Indicates that this is a concrete class with persistent data.
0408    */
0409   static ClassDescription<ShowerParticle> initShowerParticle;
0410 
0411   /**
0412    * The assignment operator is private and must never be called.
0413    * In fact, it should not even be implemented.
0414    */
0415   ShowerParticle & operator=(const ShowerParticle &) = delete;
0416 
0417 private:
0418 
0419   /**
0420    *  Whether the particle is in the final or initial state
0421    */
0422   bool _isFinalState;
0423 
0424   /**
0425    *  Whether the particle came from 
0426    */
0427   unsigned int _perturbative;
0428 
0429   /**
0430    *  Does a particle produced in the backward shower initiate a time-like shower 
0431    */
0432   bool _initiatesTLS;
0433 
0434   /**
0435    * Dimensionless parameters
0436    */
0437   Parameters _parameters;
0438 
0439   /**
0440    *  The beam energy fraction for particle's in the initial state
0441    */
0442   double _x;
0443 
0444   /**
0445    *  The shower kinematics for the particle
0446    */
0447   ShoKinPtr _showerKinematics;
0448 
0449   /**
0450    *  The shower basis for the particle
0451    */
0452   ShowerBasisPtr _showerBasis;
0453 
0454   /**
0455    *  Storage of the evolution scales
0456    */
0457   EvolutionScales scales_;
0458 
0459   /**
0460    *  Virtual mass
0461    */
0462   Energy _vMass;
0463 
0464   /**
0465    *  Partners
0466    */
0467   tShowerParticlePtr _partner;
0468 
0469   /**
0470    *  Pointer to ThePEG Particle this ShowerParticle was created from
0471    */
0472   const tcPPtr _thePEGBase;
0473   
0474   /**
0475    *  Progenitor
0476    */   
0477   tShowerParticlePtr _progenitor;
0478 
0479   /**
0480    *  Partners
0481    */
0482   vector<EvolutionPartner> partners_;
0483     
0484 };
0485 
0486 inline ostream & operator<<(ostream & os, const ShowerParticle::EvolutionScales & es) {
0487   os << "Scales: QED=" << es.QED / GeV
0488      << " QCD_c=" << es.QCD_c / GeV
0489      << " QCD_ac=" << es.QCD_ac / GeV
0490      << " EW=" << es.EW / GeV
0491      << " QED_noAO=" << es.QED_noAO / GeV
0492      << " QCD_c_noAO=" << es.QCD_c_noAO / GeV
0493      << " QCD_ac_noAO=" << es.QCD_ac_noAO / GeV
0494      << '\n';
0495   return os;
0496 }
0497 
0498 }
0499 
0500 #include "ThePEG/Utilities/ClassTraits.h"
0501 
0502 namespace ThePEG {
0503 
0504 /** @cond TRAITSPECIALIZATIONS */
0505 
0506 /** This template specialization informs ThePEG about the
0507  *  base classes of ShowerParticle. */
0508 template <>
0509 struct BaseClassTrait<Herwig::ShowerParticle,1> {
0510   /** Typedef of the first base class of ShowerParticle. */
0511   typedef Particle NthBase;
0512 };
0513 
0514 /** This template specialization informs ThePEG about the name of
0515  *  the ShowerParticle class and the shared object where it is defined. */
0516 template <>
0517 struct ClassTraits<Herwig::ShowerParticle>
0518   : public ClassTraitsBase<Herwig::ShowerParticle> {
0519   /** Return a platform-independent class name */
0520   static string className() { return "Herwig::ShowerParticle"; }
0521   /** Create a Event object. */
0522   static TPtr create() { return TPtr::Create(Herwig::ShowerParticle(tcEventPDPtr(),true)); }
0523 };
0524 
0525 /** @endcond */
0526 
0527 }
0528 
0529 #endif /* HERWIG_ShowerParticle_H */