File indexing completed on 2025-08-03 08:20:02
0001 #ifndef THERMPTNSAMPLER_H
0002 #define THERMPTNSAMPLER_H
0003
0004 #include "JetScapeLogger.h"
0005 #include <vector>
0006 #include <random>
0007
0008
0009 using namespace Jetscape;
0010
0011 class ThermalPartonSampler
0012 {
0013 public:
0014
0015 ThermalPartonSampler(unsigned int ran_seed);
0016
0017
0018 void samplebrick();
0019 void sample_2p1d(double eta_max);
0020 void sample_3p1d(bool Cartesian_hydro=false);
0021
0022
0023 void set_hypersurface(std::vector<std::vector<double>> surf_in){surface = surf_in;}
0024
0025
0026 void brick_length_width(double len_bri, double wid_bri){L = 2.*len_bri + 4.; W = 2.*wid_bri + 4.; Time = len_bri;}
0027 void brick_flow(double vx_in, double vy_in, double vz_in){Vx = vx_in; Vy = vy_in; Vz = vz_in;}
0028 void brick_Tc(double brick_Tc){T = brick_Tc/GEVFM;}
0029
0030
0031 int nTot( ){return Plist.size();}
0032 int th_Evnum(int i){return (int)Plist[i][0];}
0033 int th_pid( int i){return (int)Plist[i][1];}
0034 int th_orig( int i){return (int)Plist[i][2];}
0035 int th_stat( int i){return (int)Plist[i][11];}
0036 double th_px(int i){return Plist[i][3];}
0037 double th_py(int i){return Plist[i][4];}
0038 double th_pz(int i){return Plist[i][5];}
0039 double th_e( int i){return Plist[i][6];}
0040 double th_x( int i){return Plist[i][7];}
0041 double th_y( int i){return Plist[i][8];}
0042 double th_z( int i){return Plist[i][9];}
0043 double th_t( int i){return Plist[i][10];}
0044 int th_nL(){return num_ud;}
0045 int th_nS(){return num_s;}
0046
0047
0048 private:
0049
0050
0051 std::vector<std::vector<double>> Plist;
0052
0053
0054
0055 bool SplitSort (double goal, int floor, int ceiling, int quark);
0056 void MCSampler(double Temp, int quark);
0057 double FermiPDF (double Pc, double Mc, double Tc, double muc);
0058 void CDFGenerator(double Temp, double M, int quark);
0059
0060
0061 std::mt19937_64 rng_engine;
0062 std::uniform_real_distribution<double> distribution{0.0, 1.0};
0063
0064 double ran() {return distribution(rng_engine);}
0065
0066 std::mt19937_64& getRandomGenerator() {return rng_engine;}
0067
0068
0069 const double PI = 3.141592653589793;
0070 double muPi0 = 0.;
0071 const double GEVFM = 0.197327053;
0072
0073
0074 double xmq, xms, T, NUMSTEP;
0075 double CellDX, CellDY, CellDZ, CellDT;
0076
0077
0078
0079 int GPoints = 50;
0080 double GWeight[50];
0081 double GAbs[50];
0082
0083
0084 bool SetNum, SetNumLight, SetNumStrange, ShuffleList;
0085
0086
0087 double NewX, NewY, NewZ, NewP;
0088 int num_ud, num_s;
0089 std::vector<std::vector<double>> CDFTabLight;
0090 std::vector<std::vector<double>> CDFTabStrange;
0091
0092
0093
0094
0095
0096 double L, W, Time, Vx, Vy, Vz;
0097
0098
0099 std::vector<std::vector<double>> surface;
0100 };
0101
0102
0103 #endif