Browse Source

First commit

PeterParfenov 3 months ago
commit
e5502a46ec
4 changed files with 79 additions and 0 deletions
  1. 29 0
      CMToLab.C
  2. 22 0
      EkinToCM.C
  3. 22 0
      PlabToCM.C
  4. 6 0
      Tpass.C

+ 29 - 0
CMToLab.C

@@ -0,0 +1,29 @@
+
+constexpr double M_NUCL = 0.938;
+
+int CMToLab(double sNN = 4.5) {
+
+    double sN = sNN/2.;
+    double pN = TMath::Sqrt(sN*sN - M_NUCL*M_NUCL);
+
+    TLorentzVector tMom4(0, 0, -pN, sN);
+    TVector3 vBoost{tMom4.BoostVector()};
+
+    TLorentzVector pMom4(0, 0, pN, sN);
+    pMom4.Boost(-vBoost);
+    float yBeam = 0.25 * log ((pMom4.E() + pMom4.Pz()) / (pMom4.E() - pMom4.Pz()));
+    float beta = tanh(yBeam);
+    float gamma = cosh(yBeam);
+    float gammabeta = sinh(yBeam);
+
+    cout << "E_lab = " << pMom4.E() << "A GeV" << endl;
+    cout << "T_kin = " << pMom4.E() - pMom4.M() << "A GeV" << endl;
+    cout << "p_lab = " << pMom4.Pz() << "A GeV/c" << endl;
+    cout << "yBeam = " << yBeam << endl;
+    cout << "Beta = " << beta << endl;
+    cout << "Gamma = " << gamma << endl;
+    cout << "Gamma * Beta = " << gammabeta << endl;
+    
+
+    return 0;
+}

+ 22 - 0
EkinToCM.C

@@ -0,0 +1,22 @@
+void EkinToCM(float Ekin)
+{
+  float mp=0.938;
+  float El=Ekin+mp;
+  float pl=sqrt(El*El-mp*mp);
+  float pc=sqrt( ( mp*El-mp*mp )/2 );
+  float e_cm=sqrt( pc*pc + mp*mp );
+  float ss = sqrt( 4*(pc*pc + mp*mp) );
+  float yBeam = 0.25 * log ((El + pl) / (El - pl));
+  float beta = tanh(yBeam);
+  float gamma = cosh(yBeam);
+  float gammabeta = sinh(yBeam);
+  cout << "Elab = " << El << endl;
+  cout << "Plab = " << pl << endl;
+  cout << "P* = " << pc << endl;
+  cout << "E* = " << e_cm << endl;
+  cout << "sqrt(Snn) = " << ss << endl;
+  cout << "yBeam = " << yBeam << endl;
+  cout << "Beta = " << beta << endl;
+  cout << "Gamma = " << gamma << endl;
+  cout << "Gamma * Beta = " << gammabeta << endl;
+}

+ 22 - 0
PlabToCM.C

@@ -0,0 +1,22 @@
+void PlabToCM(float pl)
+{
+  float mp=0.938;
+  float El=sqrt(pl*pl+mp*mp);
+  float Ekin=El-mp;
+  float pc=sqrt( ( mp*El-mp*mp )/2 );
+  float e_cm=sqrt( pc*pc + mp*mp );
+  float ss = sqrt( 4*(pc*pc + mp*mp) );
+  float yBeam = 0.25 * log ((El + pl) / (El - pl));
+  float beta = tanh(yBeam);
+  float gamma = cosh(yBeam);
+  float gammabeta = sinh(yBeam);
+  cout << "Elab = " << El << endl;
+  cout << "Ekin = " << Ekin << endl;
+  cout << "P* = " << pc << endl;
+  cout << "E* = " << e_cm << endl;
+  cout << "sqrt(Snn) = " << ss << endl;
+  cout << "yBeam = " << yBeam << endl;
+  cout << "Beta = " << beta << endl;
+  cout << "Gamma = " << gamma << endl;
+  cout << "Gamma * Beta = " << gammabeta << endl;
+}

+ 6 - 0
Tpass.C

@@ -0,0 +1,6 @@
+void Tpass(float sqrtSNN, float R)
+{
+    float mp = 0.938;
+    float t_pass = 4*mp*R/sqrt(sqrtSNN*sqrtSNN - 4*mp*mp);
+    cout << "Tpass = " << t_pass << endl;
+}