File indexing completed on 2025-04-19 09:09:46
0001 #ifndef AMEGIC_Main_Helicity_H
0002 #define AMEGIC_Main_Helicity_H
0003
0004 #include "ATOOLS/Phys/Flavour.H"
0005 #include <iostream>
0006 #include "ATOOLS/Math/MyComplex.H"
0007 #include "AMEGIC++/Amplitude/Zfunctions/Basic_Sfuncs.H"
0008 #include "ATOOLS/Math/Matrix.H"
0009
0010 namespace AMEGIC {
0011
0012 class Pol_Info;
0013
0014
0015 struct Sign_List {
0016
0017 int *s;
0018
0019 int on;
0020
0021 int multi;
0022 double polfactor;
0023 int partner;
0024
0025 Sign_List(): s(NULL),on(1),multi(1),polfactor(1.),partner(-1) {}
0026 ~Sign_List() {
0027
0028 }
0029 };
0030
0031
0032 class Helicity {
0033 std::vector<ATOOLS::Flavour> m_flavours;
0034 std::vector<int> m_nPols;
0035
0036
0037 Sign_List* p_slist;
0038 size_t m_nsign;
0039
0040
0041
0042
0043
0044
0045
0046 char * p_pol_types;
0047
0048 double * p_angles;
0049
0050 bool m_allowTrafo;
0051 bool m_needsTrafo;
0052 std::vector<int> m_trafoList;
0053 std::vector<ATOOLS::CMatrix> m_trafoMatrices;
0054
0055 int m_spos;
0056
0057 public:
0058
0059
0060
0061
0062
0063
0064
0065
0066 Helicity(int,int,ATOOLS::Flavour*,Pol_Info*);
0067
0068 size_t MaxHel() {return m_nsign;}
0069
0070 size_t MaxHel(size_t i);
0071
0072
0073
0074 int* operator[] (int i) {return p_slist[i].s;}
0075
0076 void SwitchOff(int i) { if (m_trafoList.size()==0) p_slist[i].on = 0;}
0077 int GetPartnerPol(const int heli,const int flav, int& lambda);
0078 void SetPartner(int i,int j) {if (m_trafoList.size()==0) p_slist[j].partner = i;}
0079 inline const int& Partner(const int i) const {return p_slist[i].partner;}
0080
0081 int On(int i) {return p_slist[i].on;}
0082
0083 void IncMultiplicity(int i,int add=1) {if (m_trafoList.size()==0) (p_slist[i].multi)+=add;}
0084
0085 int Multiplicity(int i) {return p_slist[i].multi;}
0086
0087 double PolarizationFactor(int i) {return p_slist[i].polfactor;}
0088
0089
0090
0091 char * PolTypes() { return p_pol_types; }
0092 double * PolAngles() { return p_angles; }
0093 bool IsContrib(int,int*,int);
0094 int Compare(Helicity*,int);
0095
0096 void SpinorTransformation(std::vector<Complex>& helAmpls);
0097 void InitializeSpinorTransformation(Basic_Sfuncs * BS);
0098
0099 inline void ForceNoTransformation() { m_allowTrafo = false; }
0100 inline void AllowTransformation() { m_allowTrafo = true; }
0101 inline bool UseTransformation() { return m_needsTrafo && m_allowTrafo; }
0102
0103
0104 int GetPol(const int& flav, const int& hNumber);
0105
0106 size_t GetAmplitudeNumber(std::vector<int> *Helis);
0107 size_t Nflavs() { return m_flavours.size(); }
0108 ATOOLS::Flavour GetFlav(size_t i) { return m_flavours[i]; }
0109 inline const ATOOLS::Flavour_Vector& GetFlavs() const { return m_flavours; }
0110 ~Helicity();
0111
0112 int GetEPol(int hNumber) { if (m_spos<0) return 90; return GetPol(m_spos,hNumber); }
0113 int GetSPos() { return m_spos; }
0114 };
0115 }
0116 #endif