Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Matter.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Matter.h
1 /*******************************************************************************
2  * Copyright (c) The JETSCAPE Collaboration, 2018
3  *
4  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
5  *
6  * For the list of contributors see AUTHORS.
7  *
8  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
9  *
10  * or via email to bugs.jetscape@gmail.com
11  *
12  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
13  * See COPYING for details.
14  ******************************************************************************/
15 
16 #ifndef MATTER_H
17 #define MATTER_H
18 
19 #include "JetEnergyLossModule.h"
20 #include "Pythia8/Pythia.h"
21 
22 using namespace Jetscape;
23 
24 class Matter : public JetEnergyLossModule<
25  Matter> //, public std::enable_shared_from_this<Matter>
26 {
27 public:
28  Matter();
29  virtual ~Matter();
30 
31  void Init();
32  //void Exec();
33  //void DoEnergyLoss(double deltaT, double Q2, const vector<Parton>& pIn, vector<Parton>& pOut);
34  void DoEnergyLoss(double deltaT, double time, double Q2, vector<Parton> &pIn,
35  vector<Parton> &pOut);
36  void WriteTask(weak_ptr<JetScapeWriter> w);
37  void Dump_pIn_info(int i, vector<Parton> &pIn);
38 
39  double generate_L(double form_time);
40  double sudakov_Pgg(double g0, double g1, double loc_c, double E);
41  double sud_val_GG(double h0, double h1, double h2, double loc_d, double E1);
42  double sud_z_GG(double cg, double cg1, double loc_e, double l_fac, double E2);
43  double P_z_gg_int(double cg, double cg1, double loc_e, double cg3,
44  double l_fac, double E2);
45  double sudakov_Pqg(double g0, double g1, double loc_c, double E);
46  double sud_val_QG(double h0, double h1, double h2, double loc_d, double E1);
47  double sud_z_QG(double cg, double cg1, double loc_e, double l_fac, double E2);
48  double P_z_qg_int(double cg, double cg1, double loc_e, double cg3,
49  double l_fac, double E2);
50  double sudakov_Pqg_w_M(double M, double g0, double g1, double loc_c,
51  double E);
52  double sud_val_QG_w_M(double M, double h0, double h1, double h2, double loc_d,
53  double E1);
54  double sud_z_QG_w_M(double M, double cg, double cg1, double loc_e,
55  double l_fac, double E2);
56  double P_z_qg_int_w_M(double M, double cg, double cg1, double loc_e,
57  double cg3, double l_fac, double E2);
58  double sudakov_Pqq(double q0, double q1, double loc_c, double E);
59 
60  double sud_val_QQ(double h0, double h1, double h2, double loc_d, double E1);
61  double sud_z_QQ(double cg, double cg1, double loc_e, double l_fac, double E2);
62  double P_z_qq_int(double cg, double cg1, double loc_e, double cg3,
63  double l_fac, double E2);
64  double P_z_qp_int(double cg, double cg1, double loc_e, double cg3,
65  double l_fac, double E2);
66  double sud_z_QP(double cg, double cg1, double loc_e, double l_fac, double E2);
67  double sud_val_QP(double h0, double h1, double h2, double loc_d, double E1);
68  double sudakov_Pqp(double g0, double g1, double loc_c, double E);
69 
70  double sudakov_Pqq_w_M_vac_only(double M, double q0, double q1, double loc_c,
71  double E);
72  double sud_val_QQ_w_M_vac_only(double M, double h0, double h1, double h2,
73  double loc_d, double E1);
74  double sud_z_QQ_w_M_vac_only(double M, double cg, double cg1, double loc_e,
75  double l_fac, double E2);
76  double P_z_qq_int_w_M_vac_only(double M, double cg, double cg1, double loc_e,
77  double cg3, double l_fac, double E2);
78 
79  // void shower_vac( int line, int pid, double nu_in, double t0_in, double t_in, double kx, double ky, double loc, bool is_lead);
80  double generate_vac_t(int p_id, double nu, double t0, double t, double loc_a,
81  int isp);
82  double generate_vac_t_w_M(int p_id, double M, double nu, double t0, double t,
83  double loc_a, int is);
84  double generate_vac_z(int p_id, double t0, double t, double loc_b, double nu,
85  int is);
86  double generate_vac_z_w_M(int p_id, double M, double t0, double t,
87  double loc_b, double nu, int is);
88  double alpha_s(double q2);
89  double profile(double zeta);
90 
91  double generate_angle();
92  double generate_kt(double local_qhat, double dzeta);
93 
94  double qhat = 0.0;
95  double ehat = 0.0;
96  double e2hat = 0.0;
97  double length = 0.0;
98 
99  unsigned int MaxColor = 0;
100 
101  //SC: for interface with hydro
102  double fillQhatTab(double y);
103  double fncQhat(double zeta);
104  double fncAvrQhat(double zeta, double tau);
105 
106  bool matter_on, in_vac, brick_med, recoil_on, broadening_on;
107  double hydro_Tc, qhat0, alphas, brick_length, vir_factor;
108  double initR0, initRx, initRy, initRz, initVx, initVy, initVz, initRdotV,
109  initVdotV, initEner;
110  double Q00, Q0, T0;
111 
112  static const int dimQhatTab = 151;
113  double qhatTab1D[dimQhatTab] = {0.0};
114  double qhatTab2D[dimQhatTab][dimQhatTab] = {{0.0}};
115 
116  double tStart;// = 0.6;
117  int iEvent;
118  bool debug_flag = 0;
119  long NUM1;
120 
121  // Variables for HQ 2->2
122  static const int N_p1 = 500;
123  static const int N_T = 60;
124  static const int N_e2 = 75;
125  static double distFncB[N_T][N_p1][N_e2], distFncF[N_T][N_p1][N_e2],
126  distMaxB[N_T][N_p1][N_e2], distMaxF[N_T][N_p1][N_e2];
127  static double distFncBM[N_T][N_p1], distFncFM[N_T][N_p1];
128  double min_p1 = 0.0;
129  double max_p1 = 1000.0;
130  double bin_p1 = (max_p1 - min_p1) / N_p1;
131  double min_T = 0.1;
132  double max_T = 0.7;
133  double bin_T = (max_T - min_T) / N_T;
134  double min_e2 = 0.0;
135  double max_e2 = 15.0;
136  double bin_e2 = (max_e2 - min_e2) / N_e2;
137 
138  static double RHQ[60][20]; //total scattering rate for heavy quark
139  static double RHQ11[60][20]; //Qq->Qq
140  static double RHQ12[60][20]; //Qg->Qg
141  static double qhatHQ[60][20]; //qhat of heavy quark
142 
143  // flag to make sure initialize only once
144  static bool flag_init;
145 
146 
147  //qhat related functions
149  double GeneralQhatFunction(int QhatParametrization, double Temperature, double EntropyDensity, double FixAlphas, double Qhat0, double E, double muSquare);
150  double RunningAlphaS(double muSquare);
151  double VirtualityQhatFunction(int QhatParametrization, double enerLoc, double muSquare);
152  double ModifiedProbability(int QhatParametrization, double tempLoc, double sdLoc, double enerLoc, double muSquare);
153  double IntegralPDF(double xB, double a, double b);
154  double qhatA, qhatB, qhatC, qhatD;
155 
156  //SC: for elastic scattering
157  void flavor(int &CT, int &KATT0, int &KATT2, int &KATT3,
158  unsigned int &max_color, unsigned int &color0,
159  unsigned int &anti_color0, unsigned int &color2,
160  unsigned int &anti_color2, unsigned int &color3,
161  unsigned int &anti_color3);
162  void colljet22(int CT, double temp, double qhat0ud, double v0[4],
163  double p0[4], double p2[4], double p3[4], double p4[4],
164  double &qt);
165  void trans(double v[4], double p[4]);
166  void transback(double v[4], double p[4]);
167  void rotate(double px, double py, double pz, double pr[4], int icc);
168  float ran0(long *idum);
169  double solve_alphas(double var_qhat, double var_ener, double var_temp);
170  double fnc0_alphas(double var_alphas, double var_qhat, double var_ener,
171  double var_temp);
172  double fnc0_derivative_alphas(double var_alphas, double var_qhat,
173  double var_ener, double var_temp);
174 
175  void read_tables();
176  double Mgc2gc(double s, double t, double M);
177  double Mqc2qc(double s, double t, double M);
178  void collHQ22(int CT, double temp, double qhat0ud, double v0[4], double p0[4],
179  double p2[4], double p3[4], double p4[4], double &qt);
180 
181 protected:
182  uniform_real_distribution<double> ZeroOneDistribution;
183 
184 private:
185  // Allows the registration of the module so that it is available to be used by the Jetscape framework.
187  double tscale;
188 };
189 
190 #endif // MATTER_H