Back to home page

EIC code displayed by LXR

 
 

    


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   //! A list of signs, i.e. helicities.(ready)
0015   struct Sign_List {
0016     //! The list of signs
0017     int *s;
0018     //! Switching certain combinations on/off.
0019     int on;
0020     //! The multiplicity of the helicity combination, used when reducing the list to independent helicities. 
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       //      if (s) delete [] s;
0028     }
0029   };
0030   
0031  
0032 class Helicity {
0033     std::vector<ATOOLS::Flavour> m_flavours; // list of the external particles
0034     std::vector<int> m_nPols;  // the number of possible polarisation states for each flavour
0035 
0036  
0037     Sign_List* p_slist;    
0038     size_t m_nsign;               // the number of polarisation combinations
0039   //    size_t m_nPhysHel;            // the relevant number of helicity combinations
0040 
0041 
0042   //    Sign_List* p_fslist;
0043   //    int m_fnsign;
0044 
0045     //! type of polarisation: 'c'=circular, 'l'=linear, 'h'=helicity state and '+'/'-'  for polarised particles
0046     char   * p_pol_types;
0047     //! angle for linear polarisation
0048     double * p_angles;
0049 
0050     bool m_allowTrafo;
0051     bool m_needsTrafo;            // is a trafo to the helicity base nessecary
0052     std::vector<int> m_trafoList; // list of the flavours that are polarized spinors
0053     std::vector<ATOOLS::CMatrix> m_trafoMatrices; // trafo matrices for pol->hel
0054 
0055     int m_spos;
0056 
0057   public:
0058     //! The constructor determines all helicity combinations
0059     /*!
0060       The helicity combinations are determined using a loop over loop technique.
0061       Having at hand all possible helicity combinations, the second helicity for 
0062       scalar particles (which have no helicity at all) and massive vector bosons
0063       (where the sum over the polarizations is carried out differently to the 
0064       massless vector bosons).
0065     */
0066     Helicity(int,int,ATOOLS::Flavour*,Pol_Info*);
0067     //! Returns the maximum number of helicities.
0068     size_t MaxHel() {return m_nsign;}
0069     //! Returns the number of possible spin-orientations for particle i.
0070     size_t MaxHel(size_t i);
0071     //! Returns the maximum number of helicities for calculation of physical fermion helicities.
0072   //    int MaxFHel() {return m_fnsign;}
0073     //! Returns a certain helicity combination.
0074   int* operator[] (int i) {return p_slist[i].s;} // was fslist!!
0075     //! Switches a certain helicity combination off.
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     //! Returns the status of a certain helicity combination.
0081     int  On(int i) {return p_slist[i].on;}
0082     //! Increases the multiplicity of a combination by one.
0083     void IncMultiplicity(int i,int add=1) {if (m_trafoList.size()==0) (p_slist[i].multi)+=add;}  
0084     //! Returns the multiplicity of a certain helicity combination.
0085     int  Multiplicity(int i) {return p_slist[i].multi;}  
0086     //! Polarization factors
0087     double PolarizationFactor(int i) {return p_slist[i].polfactor;}  
0088     //! Returns true when physical fermion helicities should be calculated
0089     //  int IsCalcFerm() {return m_fermion_hels;}
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   //! Returns the polarisation state of particle "flav" in the helicity combination "hNumber"
0104   int GetPol(const int& flav, const int& hNumber);
0105     //! Return the amplitude number for the given helicity combination
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