Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // InvertedTildeKinematics.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_InvertedTildeKinematics_H
0010 #define HERWIG_InvertedTildeKinematics_H
0011 //
0012 // This is the declaration of the InvertedTildeKinematics class.
0013 //
0014 
0015 #include "ThePEG/Handlers/HandlerBase.h"
0016 #include "ThePEG/Handlers/StandardXComb.h"
0017 #include "ThePEG/Repository/EventGenerator.h"
0018 #include "Herwig/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
0019 
0020 namespace Herwig {
0021 
0022 using namespace ThePEG;
0023 
0024 /**
0025  * \ingroup Matchbox
0026  * \author Simon Platzer
0027  *
0028  * \brief InvertedTildeKinematics is the base class for the inverted 'tilde'
0029  * kinematics being used for subtraction terms in the
0030  * formalism of Catani and Seymour.
0031  *
0032  */
0033 class InvertedTildeKinematics: public HandlerBase {
0034 
0035 public:
0036 
0037   /**
0038    * The default constructor.
0039    */
0040   InvertedTildeKinematics();
0041 
0042 public:
0043 
0044   /** @name Access to kinematic quantities. */
0045   //@{
0046   /**
0047    * Return the momentum of the emitter in the real emission process
0048    */
0049   const Lorentz5Momentum& realEmitterMomentum() const { return theRealEmitterMomentum; }
0050 
0051   /**
0052    * Return the momentum of the emission in the real emission process
0053    */
0054   const Lorentz5Momentum& realEmissionMomentum() const { return theRealEmissionMomentum; }
0055 
0056   /**
0057    * Return the momentum of the spectator in the real emission process
0058    */
0059   const Lorentz5Momentum& realSpectatorMomentum() const { return theRealSpectatorMomentum; }
0060 
0061   /**
0062    * Return the momentum of the emitter in the underlying Born process
0063    */
0064   const Lorentz5Momentum& bornEmitterMomentum() const { 
0065     return theBornXComb->meMomenta()[theDipole->bornEmitter()];
0066   }
0067 
0068   /**
0069    * Return the momentum of the spectator in the underlying Born process
0070    */
0071   const Lorentz5Momentum& bornSpectatorMomentum() const { 
0072     return theBornXComb->meMomenta()[theDipole->bornSpectator()];
0073   }
0074 
0075   /**
0076    * Return the momentum fraction of the emitter
0077    */
0078   double emitterX() const { 
0079     return 
0080       theDipole->bornEmitter() == 0 ?
0081       theBornXComb->lastX1() :
0082       theBornXComb->lastX2();
0083   }
0084 
0085   /**
0086    * Return the momentum fraction of the spectator
0087    */
0088   double spectatorX() const { 
0089     return 
0090       theDipole->bornSpectator() == 0 ?
0091       theBornXComb->lastX1() :
0092       theBornXComb->lastX2();
0093   }
0094 
0095   /**
0096    * Return the vector of dimensionless variables calculated
0097    */
0098   const vector<double>& subtractionParameters() const { return theDipole->subtractionParameters(); }
0099 
0100   /**
0101    * Return true, if this InvertedTildeKinematics object needs to transform
0102    * all other particles in the process except the emitter, emission and spectator
0103    */
0104   virtual bool doesTransform() const { return false; }
0105 
0106   /**
0107    * If this InvertedTildeKinematics object needs to transform all other particles
0108    * in the process except the emitter, emission and spectator, return the transformed
0109    * momentum.
0110    */
0111   virtual Lorentz5Momentum transform(const Lorentz5Momentum& p) const { return p; }
0112 
0113   /**
0114    * Return the centre of mass energy for the underlying Born configuration
0115    */
0116   Energy2 sHat() const { return theBornXComb->lastSHat(); }
0117   //@}
0118 
0119 public:
0120 
0121   /**
0122    * Clone this object
0123    */
0124   Ptr<InvertedTildeKinematics>::ptr cloneMe() const {
0125     return dynamic_ptr_cast<Ptr<InvertedTildeKinematics>::ptr>(clone());
0126   }
0127 
0128   /** @name Access to process data. */
0129   //@{
0130   /**
0131    * Prepare given a dipole, and XCombs describing the real emission
0132    * and underlying Born processes, respectively.
0133    */
0134   void prepare(tcStdXCombPtr newRealXComb,
0135            tcStdXCombPtr newBornXComb) {
0136     theRealXComb = newRealXComb; theBornXComb = newBornXComb;
0137   }
0138 
0139   /**
0140    * Return the real xcomb
0141    */
0142   tcStdXCombPtr realXComb() const { return theRealXComb; }
0143 
0144   /**
0145    * Return the Born xcomb
0146    */
0147   tcStdXCombPtr bornXComb() const { return theBornXComb; }
0148 
0149   /**
0150    * Set the current dipole
0151    */
0152   void dipole(Ptr<SubtractionDipole>::tptr dip) { theDipole = dip; }
0153 
0154   /**
0155    * Return the current dipole
0156    */
0157   Ptr<SubtractionDipole>::tptr dipole() { return theDipole; }
0158 
0159   /**
0160    * Return the current dipole
0161    */
0162   Ptr<SubtractionDipole>::tcptr dipole() const { return theDipole; }
0163 
0164   /**
0165    * Return the number of random numbers needed to generate
0166    * a real emission configuration off the underlying Born
0167    * configuration.
0168    */
0169   virtual int nDimRadiation() const { return 3; }
0170 
0171   /**
0172    * Perform the mapping of the tilde kinematics for the
0173    * last selected process and store all dimensionless
0174    * variables in the subtractionParameters() vector.
0175    * Return false, if the calculation of the real
0176    * kinematics was impossible for the selected configuration
0177    * and true on success.
0178    */
0179   virtual bool doMap(const double *) = 0;
0180 
0181   /**
0182    * Set an optional cutoff on the emission's
0183    * transverse momentum.
0184    */
0185   void ptCut(Energy pt) { thePtCut = pt; }
0186   
0187   /**
0188    * Return the optional cutoff on the emission's
0189    * transverse momentum.
0190    */
0191   Energy ptCut() const { return thePtCut; }
0192 
0193   /**
0194    * Return the random number index
0195    * corresponding to the evolution variable.
0196    */
0197   virtual int evolutionVariable() const { return 0; }
0198 
0199   /**
0200    * Return the cutoff on the evolution
0201    * random number corresponding to the pt cut.
0202    */
0203   virtual double evolutionCutoff() const { return 0.0; }
0204 
0205   /**
0206    * Return the pt associated to the last generated splitting.
0207    */
0208   virtual Energy lastPt() const = 0;
0209 
0210   /**
0211    * Return the momentum fraction associated to the last splitting.
0212    */
0213   virtual double lastZ() const = 0;
0214 
0215   /**
0216    * Return the relevant dipole scale
0217    */
0218   virtual Energy lastScale() const;
0219 
0220   /**
0221    * Return the upper bound on pt
0222    */
0223   virtual Energy ptMax() const = 0;
0224 
0225   /**
0226    * Given a pt and a hard pt, return the boundaries on z; if the hard
0227    * pt is zero, ptMax() will be used.
0228    */
0229   virtual pair<double,double> zBounds(Energy pt, Energy hardPt = ZERO) const = 0;
0230 
0231   /**
0232    * Generate pt and z
0233    */
0234   virtual pair<Energy,double> generatePtZ(double& jac, const double * r,
0235                       double power=1., vector<double>* values = NULL) const;
0236 
0237   /**
0238    * Return the single particle phase space weight in units
0239    * of sHat() for the last selected configuration.
0240    */
0241   double jacobian() const { return theJacobian; }
0242 
0243   /**
0244    * Return the particle type of the emitter in the real emission process
0245    */
0246   cPDPtr realEmitterData() const { 
0247     return 
0248       (theDipole && theRealXComb) ? 
0249       theRealXComb->mePartonData()[theDipole->realEmitter()] :
0250       cPDPtr();
0251   }
0252 
0253   /**
0254    * Return the particle type of the emission in the real emission process
0255    */
0256   cPDPtr realEmissionData() const { 
0257     return 
0258       (theDipole && theRealXComb) ? 
0259       theRealXComb->mePartonData()[theDipole->realEmission()] :
0260       cPDPtr();
0261   }
0262 
0263   /**
0264    * Return the particle type of the spectator in the real emission process
0265    */
0266   cPDPtr realSpectatorData() const { 
0267     return 
0268       (theDipole && theRealXComb) ? 
0269       theRealXComb->mePartonData()[theDipole->realSpectator()] :
0270       cPDPtr();
0271   }
0272 
0273   /**
0274    * Return the particle type of the emitter in the underlying Born process
0275    */
0276   cPDPtr bornEmitterData() const { 
0277     return 
0278       (theDipole && theBornXComb) ? 
0279       theBornXComb->mePartonData()[theDipole->bornEmitter()] :
0280       cPDPtr();
0281   }
0282 
0283   /**
0284    * Return the particle type of the spectator in the underlying Born process
0285    */
0286   cPDPtr bornSpectatorData() const { 
0287     return 
0288       (theDipole && theBornXComb) ? 
0289       theBornXComb->mePartonData()[theDipole->bornSpectator()] :
0290       cPDPtr();
0291   }
0292   //@}
0293 
0294 protected:
0295 
0296   /**
0297    * Access the momentum of the emitter in the real emission process
0298    */
0299   Lorentz5Momentum& realEmitterMomentum() { return theRealEmitterMomentum; }
0300 
0301   /**
0302    * Access the momentum of the emission in the real emission process
0303    */
0304   Lorentz5Momentum& realEmissionMomentum() { return theRealEmissionMomentum; }
0305 
0306   /**
0307    * Access the momentum of the spectator in the real emission process
0308    */
0309   Lorentz5Momentum& realSpectatorMomentum() { return theRealSpectatorMomentum; }
0310 
0311   /**
0312    * Access the vector of dimensionless variables calculated
0313    */
0314   vector<double>& subtractionParameters() { return theDipole->subtractionParameters(); }
0315 
0316   /**
0317    * Set the single particle phase space weight in units
0318    * of sHat() for the last selected configuration.
0319    */
0320   void jacobian(double w) { theJacobian = w; }
0321 
0322   /**
0323    * Calculate a transverse momentum for the given momenta,
0324    * invariant pt and azimuth.
0325    */
0326   Lorentz5Momentum getKt(const Lorentz5Momentum& p1,
0327              const Lorentz5Momentum& p2,
0328              Energy pt,
0329              double phi,
0330              bool spacelike = false) const;
0331 
0332 public:
0333 
0334   /** @name Functions used by the persistent I/O system. */
0335   //@{
0336   /**
0337    * Function used to write out object persistently.
0338    * @param os the persistent output stream written to.
0339    */
0340   void persistentOutput(PersistentOStream & os) const;
0341 
0342   /**
0343    * Function used to read in object persistently.
0344    * @param is the persistent input stream read from.
0345    * @param version the version number of the object when written.
0346    */
0347   void persistentInput(PersistentIStream & is, int version);
0348   //@}
0349 
0350   /**
0351    * The standard Init function used to initialize the interfaces.
0352    * Called exactly once for each class by the class description system
0353    * before the main function starts or
0354    * when this class is dynamically loaded.
0355    */
0356   static void Init();
0357 
0358 
0359 // If needed, insert declarations of virtual function defined in the
0360 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0361 
0362 protected:
0363 
0364   /** @name Standard Interfaced functions. */
0365   //@{
0366   /**
0367    * Rebind pointer to other Interfaced objects. Called in the setup phase
0368    * after all objects used in an EventGenerator has been cloned so that
0369    * the pointers will refer to the cloned objects afterwards.
0370    * @param trans a TranslationMap relating the original objects to
0371    * their respective clones.
0372    * @throws RebindException if no cloned object was found for a given
0373    * pointer.
0374    */
0375   virtual void rebind(const TranslationMap & trans);
0376 
0377   /**
0378    * Return a vector of all pointers to Interfaced objects used in this
0379    * object.
0380    * @return a vector of pointers.
0381    */
0382   virtual IVector getReferences();
0383   //@}
0384 
0385 
0386 private:
0387 
0388   /**
0389    * The last dipole this InvertedTildeKinematics has been selected for
0390    */
0391   Ptr<SubtractionDipole>::tptr theDipole;
0392 
0393   /**
0394    * The XComb object describing the real emission process
0395    */
0396   tcStdXCombPtr theRealXComb;
0397 
0398   /**
0399    * The XComb object describing the underlying Born process
0400    */
0401   tcStdXCombPtr theBornXComb;
0402 
0403   /**
0404    * The momentum of the emitter in the real emission process
0405    */
0406   Lorentz5Momentum theRealEmitterMomentum;
0407 
0408   /**
0409    * The momentum of the emission in the real emission process
0410    */
0411   Lorentz5Momentum theRealEmissionMomentum;
0412 
0413   /**
0414    * The momentum of the spectator in the real emission process
0415    */
0416   Lorentz5Momentum theRealSpectatorMomentum;
0417 
0418   /**
0419    * Return the single particle phase space weight in units
0420    * of sHat() for the last selected configuration.
0421    */
0422   double theJacobian;
0423 
0424   /**
0425    * The optional cutoff on the emission's
0426    * transverse momentum.
0427    */
0428   Energy thePtCut;
0429 
0430 private:
0431 
0432   /**
0433    * The assignment operator is private and must never be called.
0434    * In fact, it should not even be implemented.
0435    */
0436   InvertedTildeKinematics & operator=(const InvertedTildeKinematics &) = delete;
0437 
0438 };
0439 
0440 }
0441 
0442 #endif /* HERWIG_InvertedTildeKinematics_H */