Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:14:58

0001 // lAger: General Purpose l/A-event Generator
0002 // Copyright (C) 2016-2021 Sylvester Joosten <sjoosten@anl.gov>
0003 //
0004 // This file is part of lAger.
0005 //
0006 // lAger is free software: you can redistribute it and/or modify
0007 // it under the terms of the GNU General Public License as published by
0008 // the Free Shoftware Foundation, either version 3 of the License, or
0009 // (at your option) any later version.
0010 //
0011 // lAger is distributed in the hope that it will be useful,
0012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 // GNU General Public License for more details.
0015 //
0016 // You should have received a copy of the GNU General Public License
0017 // along with lAger.  If not, see <https://www.gnu.org/licenses/>.
0018 //
0019 
0020 #ifndef LAGER_GEN_INITIAL_PHOTON_GEN_LOADED
0021 #define LAGER_GEN_INITIAL_PHOTON_GEN_LOADED
0022 
0023 #include <TRandom.h>
0024 #include <lager/core/generator.hh>
0025 #include <lager/core/particle.hh>
0026 #include <lager/gen/initial/data.hh>
0027 #include <lager/gen/initial/fixed_target.hh>
0028 #include <lager/gen/initial/generator.hh>
0029 #include <lager/physics/photon.hh>
0030 #include <memory>
0031 
0032 namespace lager {
0033 namespace initial {
0034 
0035 // no_photon generator, useful for e.g. DVCS + BH
0036 class no_photon : public photon_generator {
0037 public:
0038   no_photon(const configuration&, const string_path&, std::shared_ptr<TRandom>);
0039 
0040   virtual photon generate(const beam&, const target&);
0041   virtual double max_cross_section() const { return 1.; };
0042   virtual double phase_space() const { return 1.; }
0043 };
0044 
0045 // Bremsstrahlung photons
0046 class bremsstrahlung : public photon_generator {
0047 public:
0048   enum class model { FLAT, PARAM, APPROX, EXACT };
0049 
0050   bremsstrahlung(const configuration& cf, const string_path& path,
0051                  std::shared_ptr<TRandom> r);
0052 
0053   virtual photon generate(const beam&, const target&);
0054   virtual double max_cross_section() const { return max_; }
0055   virtual double phase_space() const { return E_range_.width(); }
0056 
0057 protected:
0058   double intensity(const double E, const double beam) const;
0059 
0060 private:
0061   const model model_;   // bremsstrahlung model
0062   const double rl_;     // number of radiation lenghts (when using approx model,
0063                         // set to zero otherwise)
0064   const double E_beam_; // (maximum) electron beam energy
0065   const interval<double> E_range_; // photon energy range
0066   const double max_;               // the maximum intensity.
0067 };
0068 
0069 // Bremsstrahlung photons for a realistic (extended) target
0070 class bremsstrahlung_realistic_target : public photon_generator {
0071 public:
0072   bremsstrahlung_realistic_target(const configuration& cf,
0073                                   const string_path& path,
0074                                   std::shared_ptr<TRandom> r);
0075 
0076   virtual photon generate(const beam&, const target&);
0077   virtual double max_cross_section() const { return max_; }
0078   virtual double phase_space() const { return E_range_.width(); }
0079 
0080 protected:
0081   double intensity(const double E, const double beam, const double vz) const;
0082 
0083 private:
0084   const realistic_target target_;  // target RL info
0085   const double E_beam_;            // (maximum) electron beam energy
0086   const interval<double> E_range_; // photon energy range
0087   const double max_;               // the maximum intensity.
0088 };
0089 
0090 // virtual photons
0091 class vphoton : public photon_generator {
0092 public:
0093   vphoton(const configuration& cf, const string_path& path,
0094           std::shared_ptr<TRandom> r);
0095 
0096   virtual photon generate(const beam&, const target&);
0097   virtual double max_cross_section() const { return max_; }
0098   virtual double phase_space() const {
0099     return logy_range_.width() * logQ2_range_.width();
0100   }
0101 
0102 protected:
0103   double flux(const double Q2, const double y, const particle& beam,
0104               const particle& target) const {
0105     return physics::gamma_t_log(Q2, y, beam, target);
0106   }
0107 
0108 private:
0109   double calc_max_flux(const configuration& cf) const;
0110   interval<double> calc_max_Q2_range(const configuration& cf) const;
0111   interval<double> calc_max_W2_range(const configuration& cf) const;
0112 
0113   // primary kinematic boundaries
0114   const interval<double> y_range_;
0115   const interval<double> Q2_range_;
0116   // derived kinematic boundaries
0117   const interval<double> logy_range_;
0118   const interval<double> logQ2_range_;
0119   // additional cuts
0120   const interval<double> W2_range_;
0121 
0122   // maximum flux
0123   const double max_;
0124 };
0125 
0126 } // namespace initial
0127 } // namespace lager
0128 
0129 #endif