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_BEAM_GEN_LOADED
0021 #define LAGER_GEN_INITIAL_BEAM_GEN_LOADED
0022 
0023 #include <lager/core/generator.hh>
0024 #include <lager/core/particle.hh>
0025 #include <lager/gen/initial/data.hh>
0026 #include <lager/gen/initial/generator.hh>
0027 
0028 namespace lager {
0029 namespace initial {
0030 
0031 // =============================================================================
0032 // constant_beam: primary beam with constant energy
0033 //
0034 // constant 4-vector beam
0035 // =============================================================================
0036 class constant_beam : public beam_generator {
0037 public:
0038   constant_beam(const configuration& cf, const string_path& path,
0039                 std::shared_ptr<TRandom> r);
0040   virtual beam generate(const vertex& vx) {
0041     particle ret = beam_;
0042     ret.vertex() = vx;
0043     return {ret};
0044   }
0045   virtual double max_cross_section() const { return 1.; }
0046   virtual double phase_space() const { return 1.; }
0047 
0048 protected:
0049   particle get_beam(const configuration& cf, const string_path& path) const;
0050   const particle beam_;
0051 };
0052 
0053 } // namespace initial
0054 } // namespace lager
0055 
0056 #endif