Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BEAM_Main_Beam_Spectra_Handler_H
0002 #define BEAM_Main_Beam_Spectra_Handler_H
0003 
0004 #include "BEAM/Main/Beam_Parameters.H"
0005 #include "BEAM/Main/Kinematics_Base.H"
0006 #include "BEAM/Main/Weight_Base.H"
0007 #include <array>
0008 
0009 namespace BEAM {
0010   class Beam_Spectra_Handler {
0011   private:
0012     std::array<Beam_Base *, 2> p_BeamBase;
0013     Kinematics_Base  * p_kinematics;
0014     Weight_Base      * p_weight;
0015     Beam_Parameters    m_parameters;
0016     beammode::code     m_beammode;
0017     collidermode::code m_collidermode;
0018     bool               m_on;
0019     int                m_mode,m_polarisation;
0020     std::string        m_name,m_type;
0021 
0022     bool InitTheBeams();
0023     bool InitTheKinematics();
0024     bool InitTheWeight();
0025   public:
0026     Beam_Spectra_Handler();
0027     ~Beam_Spectra_Handler();
0028 
0029     void FixPositions();
0030     inline const bool                 On()           const { return m_on; }
0031     inline const beammode::code     & BeamMode()     const { return m_beammode; }
0032     inline const collidermode::code & ColliderMode() const { return m_collidermode; }
0033     inline Beam_Base                * GetBeam(size_t i)    { return p_BeamBase[i]; }
0034 
0035     inline const double Upper1() { return p_BeamBase[0]->Xmax(); }
0036     inline const double Upper2() { return p_BeamBase[1]->Xmax(); }
0037     inline const double Peak()   { return p_BeamBase[0]->Peak()*p_BeamBase[1]->Peak(); }
0038 
0039     inline bool MakeBeams(ATOOLS::Vec4D_Vector& moms) { return (*p_kinematics)(moms); }
0040     inline void AssignKeys(ATOOLS::Integration_Info *const info) {
0041       p_kinematics->AssignKeys(info);
0042       p_weight->AssignKeys(info);
0043     }
0044     inline void SetLimits() { p_kinematics->SetLimits(); }
0045     inline void BoostInCMS(ATOOLS::Vec4D & p) { p_kinematics->BoostInCMS(p); }
0046     inline void BoostInLab(ATOOLS::Vec4D & p) { p_kinematics->BoostInLab(p); }
0047     inline void BoostBackLab(ATOOLS::Vec4D & p) { p_kinematics->BoostBackLab(p); }
0048     inline void BoostInCMS(ATOOLS::Vec4D_Vector& p) {
0049       p_kinematics->BoostInCMS(p);
0050     }
0051     inline void BoostInLab(ATOOLS::Vec4D_Vector& p) {
0052       p_kinematics->BoostInLab(p);
0053     }
0054 
0055     inline void SetType(const std::string & type) { m_type = type; }
0056     inline void SetSprimeMin(const double & smin) { p_kinematics->SetSprimeMin(smin); }
0057     inline void SetSprimeMax(const double & smax) { p_kinematics->SetSprimeMax(smax); }
0058     inline const double SprimeMin() const { return p_kinematics->SprimeMin(); }
0059     inline const double SprimeMax() const { return p_kinematics->SprimeMax(); }
0060     inline const double Sprime()          { return p_kinematics->Sprime(); }
0061     inline const double Y()               { return p_kinematics->Y(); }
0062     inline const double Exponent(const size_t & i) const {
0063       return p_kinematics->Exponent(i);
0064     }
0065     inline bool CalculateWeight(const double & scale) {
0066       return p_weight->Calculate(scale);
0067     }
0068     inline const double Weight() const {
0069       return (*p_weight)();
0070     }
0071 
0072     // possible deprecated methods
0073     int             Polarisation()        { return m_polarisation; }
0074     bool   CheckConsistency(ATOOLS::Flavour *,ATOOLS::Flavour *);
0075     bool   CheckConsistency(ATOOLS::Flavour *);
0076     void   BoostFixedTarget();
0077     double SqLam(double s,double s1,double s2);
0078   };
0079 
0080   /*!
0081     \namespace BEAM
0082     The namespace BEAM houses all classes that are employed to generate
0083     beam spectra. In the framework of both the SHERPA package and of the
0084     program AMEGIC the following nomenclature is assumed :
0085     - There are incoming beams at a certain energy, the nominal energy of the
0086       beam in the collider,
0087     - these beams then result in bunches of interacting particles which have
0088       an energy distribution, and, maybe, a \f$k_\perp\f$ distribution of
0089       transverse momenta w.r.t.the beam axis.
0090     - The bunch particles then can have a substructure, i.e. they might consist of
0091       partons, which then interact.
0092 
0093     As an illustrative example, consider the case of DIS of an electron on a photon.
0094     The incoming electron beam emits bunches of photons that might or might not
0095     resolved into partons during the interaction with the proton. In the BEAM
0096     namespace, the energy (and, maybe, virtuality) distribution of the photons
0097     is handled.
0098   */
0099   /*!
0100     \file
0101     \brief Contains the Beam_Spectra_Handler
0102   */
0103   /*!
0104     \class Beam_Spectra_Handler
0105     \brief Handler of all Beam related issues.
0106     This class manages the set-up of the incoming (bunch-)particles from the beams according to
0107     the strategy defined through the global Settings instance. Before coming
0108     into full effect during integration or event generation, this handler
0109     initalises a suitable Beam treatment (Beam_Bases) for both
0110     beams and uses them to generate corresponding weights, i.e. energy distributions. At the moment,
0111     all outgonig bunch particles are still collinear to the incoming beams, but this is going
0112     to change in the (near) future.
0113     \todo Allow for non-collinear bunches
0114   */
0115   /*!
0116     \var std::array<Beam_Base *, 2> Beam_Spectra_Handler::p_BeamBase
0117     Pointers to the two beam bases, one for each beam. They are initialized (through the method
0118     SpecifiySpectra) and owned by the Beam_Spectra_Handler which in turn has to delete them after
0119     the run. At the moment two types are supported, namely
0120     - monochromatic beams
0121     - photon beams stemming from electron through Laser backscattering.
0122     More types will be implemented soon, exmples include
0123     - Weizsaecker-Williams photons
0124     - electrons after Beamstrahlung
0125     - beams with a Gaussian energy-spread.
0126     \sa Beam_Base.
0127     \todo include more types of BeamBases
0128   */
0129   /*!
0130     \var int Beam_Spectra_Handler::m_mode
0131     Indicates the mode of the beam handling, or, better phrased, whether either or both of
0132     the beams are monochromatic:
0133     - 0 both beams are monochromatic, no beam handling needed.
0134     - 1 beam one is not monochromatic, beam two is.
0135     - 2 beam one is monochromatic, beam two is not.
0136     - 3 both beams are not monochromatic.
0137   */
0138   /*!
0139     var std::string Beam_Spectra_Handler::m_name
0140     Name of the Beam_Spectra_Handler.
0141   */
0142   /*!
0143     var std::string Beam_Spectra_Handler::m_type
0144     Type of the Beam_Spectra_Handler, it consists of the types of the BeamBases.
0145   */
0146   /*!
0147     \fn Beam_Spectra_Handler::Beam_Spectra_Handler()
0148     The explicit constructor managing the initialisation of the beams through calls to
0149     SpecifySpectra() and InitKinematics().
0150     Having succeeded in the initialization of the two Beam_Bases, m_mode is also
0151     determined. It is foreseen that at this point also the beam geometries - if
0152     necessary - will be fixed. Having read in the incoming energies also the c.m. energy
0153     of the collision is set in the Run_Paraemeters.
0154 
0155     \todo Enable beam geometries, especially for pile-up events etc.
0156   */
0157   /*!
0158     \fn bool Beam_Spectra_Handler::CheckConsistency(ATOOLS::Flavour *,ATOOLS::Flavour *)
0159     This checks whether the two sets of flavours match the flaovurs inherent to the
0160     two BeamBases. If this is the case, true is returned.
0161   */
0162   /*!
0163     \fn bool Beam_Spectra_Handler::CheckConsistency(ATOOLS::Flavour *)
0164     This checks whether the flavours match the bunches of the two BeamBases. If this is the case,
0165     true is returned.
0166   */
0167   /*!
0168     \fn bool Beam_Spectra_Handler::MakeBeams(ATOOLS::Vec4D *,double,double);
0169     Depending on the \f$s'\f$-value handed over as arguments, two matching vectors for the
0170     outgoing bunches in their c.m. frame (out) are constructed. Then the energy fractions in the
0171     c.m. system (in) of the incoming beams are determined with help of the other argument, the
0172     rapidity \f$y\f$ according to
0173     \f[
0174     \hat E^{(in)}_{1,2} = \exp\left(\pm y\right)
0175     \f]
0176     and the boost linking the two frames, CMBoost is initialized. This boost is then used
0177     to bring the c.m. vectors into the correct frame, i.e. the c.m. frame
0178     of the beams, i.e.
0179      \f[
0180      p^{(out)}_{1,2} \Longrightarrow p^{(in)}_{1,2}\,.
0181      \f]
0182   */
0183   /*!
0184     \fn bool Beam_Spectra_Handler::CalculateWeight(double)
0185     This method calculates the two beam densities, i.e their weights, according to the spectra
0186     depending on the relative energy fractions and - eventually - on a scale, which is passed as an
0187     argument. The weight calculation proceeds via calls to the specific methods
0188     Beam_Base::CalculateWeight(double,double),
0189     where the energy fractions and the scale are passed as arguments.
0190   */
0191   /*!
0192     \fn double Beam_Spectra_Handler::Weight(ATOOLS::Flavour * flin = NULL)
0193     The weight corresponding to CalculateWeight(double), basically the product of the two
0194     individual weights. This clearly depends on the flavours of the bunch particles here
0195     and might therefore allow to have, e.g., a spectrum of the outgoing electrons in
0196     laser backscattering. Such an option, however, has not been implemented yet.
0197   */
0198 }
0199 
0200 
0201 
0202 
0203 #endif