Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:10:10

0001 #ifndef PHASIC_Main_Helicity_Integrator_H
0002 #define PHASIC_Main_Helicity_Integrator_H
0003 
0004 #include "ATOOLS/Phys/Flavour.H"
0005 #include <vector>
0006 
0007 namespace PHASIC {
0008 
0009   struct hls {
0010 
0011     enum scheme {
0012       unknown   = 0,
0013       sum       = 1,
0014       sample    = 2
0015     };
0016 
0017     static std::map<std::string,std::string> HelicitySchemeTags();
0018 
0019   };// end of struct hls
0020 
0021   std::ostream &operator<<(std::ostream &str,const hls::scheme &s);
0022 
0023   typedef std::vector<int>    Int_Vector;
0024   typedef std::vector<double> Double_Vector;
0025 
0026   class Helicity_Integrator {
0027   private:
0028 
0029     Int_Vector     m_chirs, m_n;
0030     Double_Vector  m_weights, m_asum, m_sum, m_sum2;
0031 
0032     ATOOLS::Flavour_Vector m_flavs;
0033 
0034     size_t m_valid, m_id, m_iter;
0035     double m_weight;
0036     bool   m_new, m_on;
0037 
0038     bool CheckChirs(const Int_Vector &chirs);
0039     void Construct(Int_Vector chirs,const size_t i);
0040 
0041   public:
0042 
0043     // constructor
0044     Helicity_Integrator();
0045 
0046     // destructor
0047     ~Helicity_Integrator();
0048 
0049     // member functions
0050     bool Construct(const ATOOLS::Flavour_Vector &flavs);
0051 
0052     bool   GeneratePoint();
0053     double Weight();
0054     
0055     void AddPoint(const double &weight);
0056 
0057     void Optimize();
0058     void WriteOut(const std::string &pid);
0059     void ReadIn(const std::string &pid);
0060 
0061     size_t     MakeId(const Int_Vector &ids) const;
0062     Int_Vector MakeId(const size_t &id) const;
0063 
0064     // inline functions
0065     inline const std::vector<int> &Chiralities() const 
0066     { return m_chirs; }
0067 
0068     inline void SetOn(const bool on) { m_on=on; }
0069 
0070     inline bool On() const { return m_on; }
0071 
0072   };// end of class Helicity_Integrator
0073 
0074 }// end of namespace PHASIC
0075 
0076 #endif