Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef PHASIC_Channels_Single_Channel_H
0002 #define PHASIC_Channels_Single_Channel_H
0003 
0004 #include "ATOOLS/Org/Message.H"
0005 #include "ATOOLS/Org/Exception.H"
0006 #include "PHASIC++/Selectors/Cut_Data.H"
0007 #include "ATOOLS/Phys/Flavour.H"
0008 #include "ATOOLS/Math/Vector.H"
0009 #include "ATOOLS/Org/Info_Key.H"
0010 
0011 namespace PHASIC {
0012 
0013   class Single_Channel {
0014   protected:
0015     size_t   m_nin, m_nout;
0016     double * p_ms;
0017     size_t   m_rannum;
0018     double * p_rans;
0019     double   m_res1, m_res2, m_mres1, m_mres2;
0020     double   m_alpha, m_alpha_save, m_weight;
0021     std::string m_name;
0022   public:
0023 
0024     // constructor
0025     Single_Channel();
0026     Single_Channel(Single_Channel *);
0027     Single_Channel(size_t,size_t,const ATOOLS::Flavour *);
0028     Single_Channel(size_t,size_t,const ATOOLS::Flavour *,ATOOLS::Integration_Info * const) {};
0029 
0030     // destructor
0031     virtual ~Single_Channel();
0032 
0033     virtual void AddPoint(double);
0034     virtual void Reset(double value);
0035     void ResetOpt();
0036 
0037     virtual void Reset() {}
0038 
0039     virtual void GeneratePoint(ATOOLS::Vec4D *,Cut_Data *,double *);
0040     virtual void GeneratePoint(ATOOLS::Vec4D *,Cut_Data *);
0041     virtual void GenerateWeight(ATOOLS::Vec4D *,Cut_Data *);
0042 
0043     virtual void GeneratePoint(const double * rns);
0044     virtual void GenerateWeight(const int & mode=0);
0045 
0046     virtual void CalculateLimits(ATOOLS::Info_Key &spkey,ATOOLS::Info_Key &ykey);
0047     virtual void CalculateLimits();
0048 
0049     virtual inline const size_t &      Nin() const       { return m_nin; }
0050     virtual inline const size_t &      Nout() const      { return m_nout; }
0051     virtual inline const size_t &      Dimension() const { return m_rannum; }
0052     virtual inline const size_t        NChannels() const { return 1; } 
0053     virtual inline const std::string & Name() const      { return m_name; }
0054     virtual inline const double &      Res1() const      { return m_res1; }
0055     virtual inline const double &      Res2() const      { return m_res2; }
0056     virtual inline const double &      MRes1() const     { return m_mres1; }
0057     virtual inline const double &      MRes2() const     { return m_mres2; }
0058     virtual inline const double &      Weight() const    { return m_weight; }
0059     virtual inline const double &      Alpha() const     { return m_alpha; }
0060     virtual inline const double &      AlphaSave() const { return m_alpha_save; }
0061     virtual inline const int           OType() const     { return 0; }
0062     const std::string ChID() const;
0063     
0064     
0065     virtual inline void SetRes1(double _r)          { m_res1       = _r; }
0066     virtual inline void SetRes2(double _r)          { m_res2       = _r; }
0067     inline void AddMPIVars(const double &r1,const double &r2) { m_mres1+=r1; m_mres2+=r2; }
0068     inline void SetMPIVars(const double &r1,const double &r2) { m_mres1=r1;  m_mres2=r2;  }
0069     virtual inline void SetName(std::string _name)  { m_name       = _name; }
0070     virtual inline void SetWeight(double _weight)   { m_weight     = _weight; }
0071     virtual inline void SetAlpha(double _alpha)     { m_alpha      = _alpha; }
0072     virtual inline void SetAlphaSave(double _alpha) { m_alpha_save = _alpha; }
0073     
0074     virtual inline void Optimize()              {}
0075     virtual inline void EndOptimize()           {}
0076     virtual inline void WriteOut(std::string)   {}
0077     virtual inline void ReadIn(std::string)     {}
0078     virtual inline bool OptimizationFinished()  { return false; }
0079         
0080     virtual void ISRInfo(int & type,double & mass,double & width) {
0081       type = 0; mass = width = 0.0;
0082     }
0083     virtual void ISRInfo(std::vector<int> &ts,
0084              std::vector<double> &ms,std::vector<double> &ws) const {}
0085     virtual int  ChNumber(); 
0086     virtual void SetChNumber(int);
0087 
0088 
0089 
0090     virtual void MPISync();
0091 
0092     inline virtual void CopyMPIValues() {
0093       m_res1 += m_mres1;
0094       m_res2 += m_mres2;
0095       m_mres1 = m_mres2 = 0.0;
0096     }
0097   };
0098 
0099   // end of class Single_Channel
0100   /*!
0101     This class is the mother class for all channels that
0102     are constructed depending on the process.
0103   */
0104   /*!
0105     Some basic ingredients for all channels :
0106     numbers of legs, their flavours and masses squared (not needed for isr)
0107     and the name of the channel. This name might be given explicitly 
0108     (for instance for ISR_Channels) or it may be constructed from amplitudes 
0109     in the Phase_Space/Channel_Generator.
0110   */
0111   /*!
0112     Stuff for the immediate integration 
0113   */
0114   /*!
0115     Specifics for isr and beamchannels
0116   */
0117   /*!
0118     Explicit constructor. 
0119     It initializes outgoing masses and the vector of random numbers :
0120     For them the following construction is applied :
0121     - two rans for the first pair of outgoing particles (orientation)
0122     - three rans for each new particle, one for the intermediate propagator,
0123       two for the orientation of the splitting
0124   */
0125   /*!
0126     Adding a value to the Single_Channel. It basically increments n,
0127     eventuall n_contrib, and the various result, result2, and res{i} in
0128     appropriate manners.
0129   */
0130   /*!
0131     Resetting the channels completely for a new integration.
0132   */
0133   /*!
0134     Resetting for the optimization involves a bit more. However, the accumulated
0135     results are kept. So this involves only what was accumulated between two iteration
0136     steps for the optimzation procedure. See the Multi_Channel for more information.
0137   */
0138   /*!
0139     Point and weight generation for fsr channels.
0140   */
0141   /*!
0142     Point and weight generation for isr channels.
0143   */
0144 
0145 }
0146 
0147 #endif
0148 
0149 
0150 
0151