Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:24

0001 // HelicityMatrixElements.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 Philip Ilten, Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // Header file for a number of physics classes used in tau decays.
0007 
0008 #ifndef Pythia8_HelicityMatrixElements_H
0009 #define Pythia8_HelicityMatrixElements_H
0010 
0011 #include "Pythia8/Basics.h"
0012 #include "Pythia8/Event.h"
0013 #include "Pythia8/HelicityBasics.h"
0014 #include "Pythia8/PythiaComplex.h"
0015 #include "Pythia8/PythiaStdlib.h"
0016 #include "Pythia8/StandardModel.h"
0017 
0018 namespace Pythia8 {
0019 
0020 //==========================================================================
0021 
0022 // The helicity matrix element class.
0023 
0024 class HelicityMatrixElement {
0025 
0026 public:
0027 
0028   // Constructor and destructor.
0029   HelicityMatrixElement() : DECAYWEIGHTMAX(), particleDataPtr(),
0030     coupSMPtr(), settingsPtr() {};
0031   virtual ~HelicityMatrixElement() {};
0032 
0033   // Initialize the physics matrices and pointers.
0034   virtual void initPointers(ParticleData*, CoupSM* , Settings* = 0);
0035 
0036   // Initialize the channel.
0037   virtual HelicityMatrixElement* initChannel(vector<HelicityParticle>&);
0038 
0039   // Calculate the matrix element weight for a decay.
0040   virtual double decayWeight(vector<HelicityParticle>&);
0041 
0042   // Calculate the maximum matrix element decay weight.
0043   virtual double decayWeightMax(vector<HelicityParticle>&)
0044     {return DECAYWEIGHTMAX;}
0045 
0046   // Calculate the helicity matrix element.
0047   virtual complex calculateME(vector<int>){return complex(0,0);}
0048 
0049   // Calculate the decay matrix for a particle.
0050   virtual void calculateD(vector<HelicityParticle>&);
0051 
0052   // Calculate the density matrix for a particle.
0053   virtual void calculateRho(unsigned int, vector<HelicityParticle>&);
0054 
0055   // Set a fermion line.
0056   void setFermionLine(int, HelicityParticle&, HelicityParticle&);
0057 
0058   // Calculate Breit-Wigner's with running widths and fixed.
0059   virtual complex  breitWigner(double s, double M, double G);
0060   virtual complex sBreitWigner(double m0, double m1, double s,
0061     double M, double G);
0062   virtual complex pBreitWigner(double m0, double m1, double s,
0063     double M, double G);
0064   virtual complex dBreitWigner(double m0, double m1, double s,
0065     double M, double G);
0066 
0067 protected:
0068 
0069   // Maximum decay weight. WARNING: hardcoded constant.
0070   double DECAYWEIGHTMAX;
0071 
0072   // Physics matrices.
0073   vector< GammaMatrix > gamma;
0074 
0075   // Particle map vector.
0076   vector< int > pMap;
0077 
0078   // Particle ID vector.
0079   vector< int > pID;
0080 
0081   // Particle mass vector.
0082   vector< double > pM;
0083 
0084   // Wave functions.
0085   vector< vector< Wave4 > > u;
0086 
0087   // Initialize the constants for the matrix element (called by initChannel).
0088   virtual void initConstants() {};
0089 
0090   // Initialize the wave functions (called by decayWeight and calculateRho/D).
0091   virtual void initWaves(vector<HelicityParticle>&) {};
0092 
0093   // Pointer to particle data.
0094   ParticleData* particleDataPtr;
0095 
0096   // Pointer to Standard Model constants.
0097   CoupSM*       coupSMPtr;
0098 
0099   // Pointer to Settings.
0100   Settings*     settingsPtr;
0101 
0102 private:
0103 
0104   // Recursive sub-method to calculate the density matrix for a particle.
0105   void calculateRho(unsigned int, vector<HelicityParticle>&,
0106     vector<int>&, vector<int>&, unsigned int);
0107 
0108   // Recursive sub-method to calculate the decay matrix for a particle.
0109   void calculateD(vector<HelicityParticle>&, vector<int>&, vector<int>&,
0110     unsigned int);
0111 
0112   // Recursive sub-method to calculate the matrix element weight for a decay.
0113   void decayWeight(vector<HelicityParticle>&, vector<int>&, vector<int>&,
0114     complex&, unsigned int);
0115 
0116   // Calculate the product of the decay matrices for a hard process.
0117   complex calculateProductD(unsigned int, unsigned int,
0118     vector<HelicityParticle>&, vector<int>&, vector<int>&);
0119 
0120   // Calculate the product of the decay matrices for a decay process.
0121   complex calculateProductD(vector<HelicityParticle>&,
0122     vector<int>&, vector<int>&);
0123 
0124 };
0125 
0126 //==========================================================================
0127 
0128 // Helicity matrix element for the hard process of two fermions -> W/W' ->
0129 // two fermions.
0130 
0131 class HMETwoFermions2W2TwoFermions : public HelicityMatrixElement {
0132 
0133 public:
0134 
0135   HMETwoFermions2W2TwoFermions() : p0CA(), p2CA(), p0CV(), p2CV() {}
0136 
0137   void initConstants();
0138 
0139   void initWaves(vector<HelicityParticle>&);
0140 
0141   complex calculateME(vector<int>);
0142 
0143 private:
0144 
0145   // Vector and axial couplings.
0146   double p0CA, p2CA, p0CV, p2CV;
0147 
0148 };
0149 
0150 //==========================================================================
0151 
0152 // Helicity matrix element for the hard process of two fermions ->
0153 // photon/Z/Z' -> two fermions.
0154 
0155 class HMETwoFermions2GammaZ2TwoFermions : public HelicityMatrixElement {
0156 
0157 public:
0158 
0159   HMETwoFermions2GammaZ2TwoFermions() : p0CAZ(), p2CAZ(), p0CVZ(), p2CVZ(),
0160     p0CAZp(), p2CAZp(), p0CVZp(), p2CVZp(), cos2W(), sin2W(), zG(), zM(),
0161     zpG(), zpM(), s(), p0Q(), p2Q(), sMin(), zaxis(), includeGamma(),
0162     includeZ(), includeZp() {}
0163 
0164   void initConstants();
0165 
0166   void initWaves(vector<HelicityParticle>&);
0167 
0168   complex calculateME(vector<int>);
0169 
0170 private:
0171 
0172   // Return gamma element for the helicity matrix element.
0173   complex calculateGammaME(vector<int>);
0174 
0175   // Return Z/Z' element for helicity matrix element.
0176   complex calculateZME(vector<int>, double, double, double, double,
0177     double, double);
0178 
0179   // Return Z/Z' element, assuming massless fermions.
0180   complex calculateZMEMasslessFermions(vector<int>, double, double, double,
0181     double, double, double);
0182 
0183   // Return the Z' vector or axial coupling for a fermion.
0184   double zpCoupling(int id, string type);
0185 
0186   // Vector and axial couplings.
0187   double p0CAZ, p2CAZ, p0CVZ, p2CVZ, p0CAZp, p2CAZp, p0CVZp, p2CVZp;
0188 
0189   // Weinberg angle, Z/Z' width (on-shell), Z/Z' mass (on-shell), and s.
0190   double cos2W, sin2W, zG, zM, zpG, zpM, s;
0191 
0192   // Fermion line charge.
0193   double p0Q, p2Q;
0194 
0195   // Minimum s to use massless approximation.
0196   double sMin;
0197 
0198   // Bool whether the incoming fermions are oriented with the z-axis.
0199   bool zaxis, includeGamma, includeZ, includeZp;
0200 
0201 };
0202 
0203 //==========================================================================
0204 
0205 // Helicity matrix element for the hard process of two photons ->
0206 // two fermions.
0207 
0208 class HMETwoGammas2TwoFermions : public HelicityMatrixElement {
0209 
0210 public:
0211 
0212   void initWaves(vector<HelicityParticle>&);
0213 
0214   complex calculateME(vector<int>);
0215 
0216 private:
0217 
0218   double tm, um, m;
0219   Vec4 q0, q1;
0220 
0221 };
0222 
0223 //==========================================================================
0224 
0225 // Helicity matrix element for the hard process of X -> two fermions.
0226 
0227 class HMEX2TwoFermions : public HelicityMatrixElement {
0228 
0229 public:
0230 
0231   void initWaves(vector<HelicityParticle>&);
0232 
0233 };
0234 
0235 //==========================================================================
0236 
0237 // Helicity matrix element for the hard process of W/W' -> two fermions.
0238 
0239 class HMEW2TwoFermions : public HMEX2TwoFermions {
0240 
0241 public:
0242 
0243   HMEW2TwoFermions() : p2CA(), p2CV() {}
0244 
0245   void initConstants();
0246 
0247   complex calculateME(vector<int>);
0248 
0249 private:
0250 
0251   // Vector and axial couplings.
0252   double p2CA, p2CV;
0253 
0254 };
0255 
0256 //==========================================================================
0257 
0258 // Helicity matrix element for the hard process of photon -> two fermions.
0259 
0260 class HMEGamma2TwoFermions : public HMEX2TwoFermions {
0261 
0262 public:
0263 
0264   complex calculateME(vector<int>);
0265 
0266 };
0267 
0268 //==========================================================================
0269 
0270 // Helicity matrix element for the hard process of Z/Z' -> two fermions.
0271 
0272 class HMEZ2TwoFermions : public HMEX2TwoFermions {
0273 
0274 public:
0275 
0276   HMEZ2TwoFermions() : p2CA(), p2CV() {}
0277 
0278   void initConstants();
0279 
0280   complex calculateME(vector<int>);
0281 
0282 private:
0283 
0284   // Return the Z' vector or axial coupling for a fermion.
0285   double zpCoupling(int id, string type);
0286 
0287   // Vector and axial couplings.
0288   double p2CA, p2CV;
0289 
0290 };
0291 
0292 //==========================================================================
0293 
0294 // Helicity matrix element for the decay of a Higgs ->  two fermions.
0295 
0296 // Because the Higgs is spin zero the Higgs production mechanism is not
0297 // needed for calculating helicity density matrices. However, the CP mixing
0298 // is needed.
0299 
0300 class HMEHiggs2TwoFermions : public HelicityMatrixElement {
0301 
0302 public:
0303 
0304   void initConstants();
0305 
0306   void initWaves(vector<HelicityParticle>&);
0307 
0308   complex calculateME(vector<int>);
0309 
0310 private:
0311 
0312   // Coupling constants of the fermions with the Higgs.
0313   complex p2CA, p2CV;
0314 
0315 };
0316 
0317 //==========================================================================
0318 
0319 // Base class for all tau decay helicity matrix elements.
0320 
0321 class HMETauDecay : public HelicityMatrixElement {
0322 
0323 public:
0324 
0325   virtual void initWaves(vector<HelicityParticle>&);
0326 
0327   virtual complex calculateME(vector<int>);
0328 
0329   virtual double decayWeightMax(vector<HelicityParticle>&);
0330 
0331 protected:
0332 
0333   virtual void initHadronicCurrent(vector<HelicityParticle>&) {};
0334 
0335   virtual void calculateResonanceWeights(vector<double>&, vector<double>&,
0336     vector<complex>&);
0337 
0338 };
0339 
0340 //==========================================================================
0341 
0342 // Helicity matrix element for a tau decaying into a single scalar meson.
0343 
0344 class HMETau2Meson : public HMETauDecay {
0345 
0346 public:
0347 
0348   void initConstants();
0349 
0350   void initHadronicCurrent(vector<HelicityParticle>&);
0351 
0352 };
0353 
0354 //==========================================================================
0355 
0356 // Helicity matrix element for a tau decaying into two leptons.
0357 
0358 class HMETau2TwoLeptons : public HMETauDecay {
0359 
0360 public:
0361 
0362   void initConstants();
0363 
0364   void initWaves(vector<HelicityParticle>&);
0365 
0366   complex calculateME(vector<int>);
0367 
0368 };
0369 
0370 //==========================================================================
0371 
0372 // Helicity matrix element for a tau decaying into two mesons through a
0373 // vector meson resonance.
0374 
0375 class HMETau2TwoMesonsViaVector : public HMETauDecay {
0376 
0377 public:
0378 
0379   void initConstants();
0380 
0381   void initHadronicCurrent(vector<HelicityParticle>&);
0382 
0383 private:
0384 
0385   // Resonance masses, widths, and weights.
0386   vector<double>  vecM, vecG, vecP, vecA;
0387   vector<complex> vecW;
0388 
0389 };
0390 
0391 //==========================================================================
0392 
0393 // Helicity matrix element for a tau decay into two mesons through a vector
0394 // or scalar meson resonance.
0395 
0396 class HMETau2TwoMesonsViaVectorScalar : public HMETauDecay {
0397 
0398 public:
0399 
0400   HMETau2TwoMesonsViaVectorScalar() : scaC(), vecC() {}
0401 
0402   void initConstants();
0403 
0404   void initHadronicCurrent(vector<HelicityParticle>&);
0405 
0406 private:
0407 
0408   // Coupling to vector and scalar resonances.
0409   double scaC, vecC;
0410 
0411   // Resonance masses, widths, and weights.
0412   vector<double>  scaM, scaG, scaP, scaA, vecM, vecG, vecP, vecA;
0413   vector<complex> scaW, vecW;
0414 
0415 };
0416 
0417 //==========================================================================
0418 
0419 // Helicity matrix element for a tau decay into three mesons (base class).
0420 
0421 class HMETau2ThreeMesons : public HMETauDecay {
0422 
0423 public:
0424 
0425   HMETau2ThreeMesons() = default;
0426 
0427   void initConstants();
0428 
0429   void initHadronicCurrent(vector<HelicityParticle>&);
0430 
0431 protected:
0432 
0433   // Decay mode of the tau.
0434   enum Mode{Pi0Pi0Pim, PimPimPip, Pi0PimK0b, PimPipKm, Pi0PimEta, PimKmKp,
0435             Pi0K0Km, KlPimKs, Pi0Pi0Km, KlKlPim, PimKsKs, PimK0bK0, Uknown};
0436   Mode mode{};
0437 
0438   // Initialize decay mode and resonance constants (called by initConstants).
0439   virtual void initMode();
0440   virtual void initResonances() {;}
0441 
0442   // Initialize the momenta.
0443   virtual void initMomenta(vector<HelicityParticle>&);
0444 
0445   // Center of mass energies and momenta.
0446   double s1{}, s2{}, s3{}, s4{};
0447   Wave4  q{}, q2{}, q3{}, q4{};
0448 
0449   // Stored a1 Breit-Wigner (for speed).
0450   complex a1BW{};
0451 
0452   // Form factors.
0453   virtual complex F1() {return complex(0, 0);}
0454   virtual complex F2() {return complex(0, 0);}
0455   virtual complex F3() {return complex(0, 0);}
0456   virtual complex F4() {return complex(0, 0);}
0457 
0458   // Phase space and Breit-Wigner for the a1.
0459   virtual double  a1PhaseSpace(double);
0460   virtual complex a1BreitWigner(double);
0461 
0462   // Sum running p and fixed width Breit-Wigner resonances.
0463   complex T(double m0, double m1, double s,
0464             vector<double>& M, vector<double>& G, vector<double>& W);
0465   complex T(double s, vector<double>& M, vector<double>& G, vector<double>& W);
0466 
0467 };
0468 
0469 //==========================================================================
0470 
0471 // Helicity matrix element for a tau decay into three pions.
0472 
0473 class HMETau2ThreePions : public HMETau2ThreeMesons {
0474 
0475 public:
0476 
0477   HMETau2ThreePions() : f0M(), f0G(), f0P(), f0A(), f2M(), f2G(), f2P(),
0478     f2A(), sigM(), sigG(), sigP(), sigA() {}
0479 
0480 private:
0481 
0482   void initResonances();
0483 
0484   // Resonance masses, widths, and weights.
0485   vector<double>  rhoM, rhoG, rhoPp, rhoAp, rhoPd, rhoAd;
0486   double          f0M, f0G, f0P, f0A, f2M, f2G, f2P, f2A;
0487   double          sigM, sigG, sigP, sigA;
0488   vector<complex> rhoWp, rhoWd;
0489   complex         f0W, f2W, sigW;
0490 
0491   // Form factors.
0492   complex F1();
0493   complex F2();
0494   complex F3();
0495 
0496   // Running width and Breit-Wigner for the a1.
0497   double  a1PhaseSpace(double);
0498   complex a1BreitWigner(double);
0499 
0500 };
0501 
0502 //==========================================================================
0503 
0504 // Helicity matrix element for a tau decay into three mesons with kaons.
0505 
0506 class HMETau2ThreeMesonsWithKaons : public HMETau2ThreeMesons {
0507 
0508 public:
0509 
0510   HMETau2ThreeMesonsWithKaons() : kM(), piM(), piW() {}
0511 
0512 private:
0513 
0514   void initResonances();
0515 
0516   // Resonance masses, widths, and weights.
0517   vector<double> rhoMa, rhoGa, rhoWa, rhoMv, rhoGv, rhoWv;
0518   vector<double> kstarMa, kstarGa, kstarWa, kstarMv, kstarGv, kstarWv;
0519   vector<double> k1Ma, k1Ga, k1Wa, k1Mb, k1Gb, k1Wb;
0520   vector<double> omegaM, omegaG, omegaW;
0521   double kM, piM, piW;
0522 
0523   // Form factors.
0524   complex F1();
0525   complex F2();
0526   complex F4();
0527 
0528 };
0529 
0530 //==========================================================================
0531 
0532 // Helicity matrix element for a tau decay into generic three mesons.
0533 
0534 class HMETau2ThreeMesonsGeneric : public HMETau2ThreeMesons {
0535 
0536 public:
0537 
0538   HMETau2ThreeMesonsGeneric() : kM(), piM(), piW() {}
0539 
0540 private:
0541 
0542   void initResonances();
0543 
0544   // Resonance masses, widths, and weights.
0545   vector<double> rhoMa, rhoGa, rhoWa, rhoMv, rhoGv, rhoWv;
0546   vector<double> kstarM, kstarG, kstarW, k1M, k1G, k1W;
0547   double kM, piM, piW;
0548 
0549   // Form factors.
0550   complex F1();
0551   complex F2();
0552   complex F4();
0553 
0554 };
0555 
0556 //==========================================================================
0557 
0558 // Helicity matrix element for a tau decay into two pions and a photon.
0559 
0560 class HMETau2TwoPionsGamma : public HMETauDecay {
0561 
0562 public:
0563 
0564   HMETau2TwoPionsGamma() : piM() {}
0565 
0566   void initConstants();
0567 
0568   void initWaves(vector<HelicityParticle>&);
0569 
0570   complex calculateME(vector<int>);
0571 
0572 protected:
0573 
0574   // Resonance masses, widths, and weights.
0575   vector<double>  rhoM, rhoG, rhoW, omegaM, omegaG, omegaW;
0576   double piM;
0577 
0578   // Form factor.
0579   complex F(double s, vector<double> M, vector<double> G, vector<double> W);
0580 
0581 };
0582 
0583 //==========================================================================
0584 
0585 // Helicity matrix element for a tau decay into four pions.
0586 
0587 class HMETau2FourPions : public HMETauDecay {
0588 
0589 public:
0590 
0591   HMETau2FourPions() : a1M(), a1G(), rhoM(), rhoG(), sigM(), sigG(), omeM(),
0592     omeG(), picM(), pinM(), sigA(), sigP(), omeA(), omeP(), lambda2() {}
0593 
0594   void initConstants();
0595 
0596   void initHadronicCurrent(vector<HelicityParticle>& p);
0597 
0598 private:
0599 
0600   // G-function form factors (fits).
0601   double G(int i, double s);
0602 
0603   // T-vector functions.
0604   Wave4 t1(Wave4&, Wave4&, Wave4&, Wave4&, Wave4&);
0605   Wave4 t2(Wave4&, Wave4&, Wave4&, Wave4&, Wave4&);
0606   Wave4 t3(Wave4&, Wave4&, Wave4&, Wave4&, Wave4&);
0607 
0608   // Breit-Wigner denominators for the intermediate mesons.
0609   complex  a1D(double s);
0610   complex rhoD(double s);
0611   complex sigD(double s);
0612   complex omeD(double s);
0613 
0614   // Form factors needed for the a1, rho, and omega.
0615   double  a1FormFactor(double s);
0616   double rhoFormFactor1(double s);
0617   double rhoFormFactor2(double s);
0618   double omeFormFactor(double s);
0619 
0620   // Masses and widths of the intermediate mesons.
0621   double a1M, a1G, rhoM, rhoG, sigM, sigG, omeM, omeG;
0622 
0623   // Masses for the pions (charged and neutral).
0624   double picM, pinM;
0625 
0626   // Amplitude, phases, and weights for mixing.
0627   double  sigA, sigP, omeA, omeP;
0628   complex sigW, omeW;
0629 
0630   // Cut-off for a1 form factor.
0631   double lambda2;
0632 
0633 };
0634 
0635 //==========================================================================
0636 
0637 // Helicity matrix element for a tau decaying into five pions.
0638 
0639 class HMETau2FivePions : public HMETauDecay {
0640 
0641 public:
0642 
0643   HMETau2FivePions() : a1M(), a1G(), rhoM(), rhoG(), omegaM(), omegaG(),
0644     omegaW(), sigmaM(), sigmaG(), sigmaW() {}
0645 
0646   void initConstants();
0647 
0648   void initHadronicCurrent(vector<HelicityParticle>&);
0649 
0650 private:
0651 
0652   // Hadronic currents.
0653   Wave4 Ja(Wave4 &q, Wave4 &q1, Wave4 &q2, Wave4 &q3, Wave4 &q4, Wave4 &q5);
0654   Wave4 Jb(Wave4 &q, Wave4 &q1, Wave4 &q2, Wave4 &q3, Wave4 &q4, Wave4 &q5);
0655 
0656   // Simplified s-wave Breit-Wigner assuming massless products.
0657   complex breitWigner(double s, double M, double G);
0658 
0659   // Masses and widths of intermediates.
0660   double a1M, a1G, rhoM, rhoG, omegaM, omegaG, omegaW, sigmaM, sigmaG, sigmaW;
0661 
0662 };
0663 
0664 //==========================================================================
0665 
0666 // Helicity matrix element for a tau decay into flat phase space.
0667 
0668 class HMETau2PhaseSpace : public HMETauDecay {
0669 
0670 public:
0671 
0672   void initWaves(vector<HelicityParticle>&) {};
0673 
0674   complex calculateME(vector<int>) {return 1;}
0675 
0676   void calculateD(vector<HelicityParticle>&) {};
0677 
0678   void calculateRho(unsigned int, vector<HelicityParticle>&) {};
0679 
0680   double decayWeight(vector<HelicityParticle>&) {return 1.0;}
0681 
0682   double decayWeightMax(vector<HelicityParticle>&) {return 1.0;}
0683 
0684 };
0685 
0686 //==========================================================================
0687 
0688 } // end namespace Pythia8
0689 
0690 #endif // end Pythia8_HelicityMatrixElements_H