Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:19:57

0001 /*******************************************************************************
0002  * Copyright (c) The JETSCAPE Collaboration, 2018
0003  *
0004  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
0005  * 
0006  * For the list of contributors see AUTHORS.
0007  *
0008  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
0009  *
0010  * or via email to bugs.jetscape@gmail.com
0011  *
0012  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
0013  * See COPYING for details.
0014  ******************************************************************************/
0015 
0016 #ifndef LIQUEFIERBASE_H
0017 #define LIQUEFIERBASE_H
0018 
0019 #include "JetClass.h"
0020 #include "sigslot.h"
0021 #include "FluidCellInfo.h"
0022 
0023 #include <array>
0024 #include <vector>
0025 #include "RealType.h"
0026 
0027 namespace Jetscape {
0028 
0029 class Droplet {
0030 private:
0031   std::array<Jetscape::real, 4> xmu;
0032   std::array<Jetscape::real, 4> pmu;
0033 
0034 public:
0035   Droplet() = default;
0036   Droplet(std::array<Jetscape::real, 4> x_in,
0037           std::array<Jetscape::real, 4> p_in) {
0038     xmu = x_in;
0039     pmu = p_in;
0040   }
0041   ~Droplet(){};
0042 
0043   std::array<Jetscape::real, 4> get_xmu() const { return (xmu); }
0044 
0045   std::array<Jetscape::real, 4> get_pmu() const { return (pmu); }
0046 };
0047 
0048 class LiquefierBase {
0049 private:
0050   std::vector<Droplet> dropletlist;
0051   bool GetHydroCellSignalConnected;
0052   const int drop_stat;
0053   const int miss_stat;
0054   const int neg_stat;
0055   const Jetscape::real hydro_source_abs_err;
0056 
0057 public:
0058   LiquefierBase();
0059   ~LiquefierBase() { Clear(); }
0060 
0061   void add_a_droplet(Droplet droplet_in) { dropletlist.push_back(droplet_in); }
0062 
0063   int get_drop_stat() const { return (drop_stat); }
0064   int get_miss_stat() const { return (miss_stat); }
0065   int get_neg_stat() const { return (neg_stat); }
0066 
0067   Droplet get_a_droplet(const int idx) const { return (dropletlist[idx]); }
0068 
0069   void check_energy_momentum_conservation(const std::vector<Parton> &pIn,
0070                                           std::vector<Parton> &pOut);
0071   void filter_partons(std::vector<Parton> &pOut);
0072   void add_hydro_sources(std::vector<Parton> &pIn, std::vector<Parton> &pOut);
0073 
0074   //! Core signal to receive information from the medium
0075   sigslot::signal5<double, double, double, double,
0076                    std::unique_ptr<FluidCellInfo> &,
0077                    sigslot::multi_threaded_local>
0078       GetHydroCellSignal;
0079 
0080   const bool get_GetHydroCellSignalConnected() {
0081     return GetHydroCellSignalConnected;
0082   }
0083 
0084   void set_GetHydroCellSignalConnected(bool m_GetHydroCellSignalConnected) {
0085     GetHydroCellSignalConnected = m_GetHydroCellSignalConnected;
0086   }
0087 
0088   int get_dropletlist_size() const { return (dropletlist.size()); }
0089 
0090   Jetscape::real get_dropletlist_total_energy() const;
0091 
0092   virtual void smearing_kernel(Jetscape::real tau, Jetscape::real x,
0093                                Jetscape::real y, Jetscape::real eta,
0094                                const Droplet drop_i,
0095                                std::array<Jetscape::real, 4> &jmu) const {
0096     jmu = {0, 0, 0, 0};
0097   }
0098 
0099   void get_source(Jetscape::real tau, Jetscape::real x, Jetscape::real y,
0100                   Jetscape::real eta, std::array<Jetscape::real, 4> &jmu) const;
0101 
0102   virtual void Clear();
0103 };
0104 
0105 }; // namespace Jetscape
0106 
0107 #endif // LIQUEFIERBASE_H