]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenThermalPhotons.cxx
updates from Salvatore/Ruediger
[u/mrichter/AliRoot.git] / EVGEN / AliGenThermalPhotons.cxx
index c6ae64104a30253e690284f7fbcceb24da43f822..13d5b157a0ff8aabca90d4efb05e8a087319fd33 100644 (file)
@@ -86,7 +86,7 @@
 ClassImp(AliGenThermalPhotons)
 
 // -----------------------------------------------------------------------------------------------------
-static Double_t rateQGP(Double_t *x, Double_t *par) {
+static Double_t rateQGP(const Double_t *x, const Double_t *par) {
 //---------------------------------------------------
 // input:
 // x[0] - tau (fm), proper time
@@ -139,7 +139,7 @@ static Double_t rateQGP(Double_t *x, Double_t *par) {
 }   
 
 // -----------------------------------------------------------------------------------------------------
-static Double_t fromQGP(Double_t *x, Double_t *par) {
+static Double_t fromQGP(const Double_t *x, const Double_t *par) {
 //---------------------------------------------------
 // input:
 // x[0] - p_T (GeV), photon p_T
@@ -165,7 +165,7 @@ static Double_t fromQGP(Double_t *x, Double_t *par) {
 }   
          
 // -----------------------------------------------------------------------------------------------------
-static Double_t rateMixQ(Double_t *x, Double_t *par) {
+static Double_t rateMixQ(const Double_t *x, const Double_t *par) {
 //---------------------------------------------------
 // input:
 // x[0] - yprime, space rapidity
@@ -215,7 +215,7 @@ static Double_t rateMixQ(Double_t *x, Double_t *par) {
 }   
 
 // -----------------------------------------------------------------------------------------------------
-static Double_t fromMixQ(Double_t *x, Double_t *par) {
+static Double_t fromMixQ(const Double_t *x, const Double_t *par) {
 //---------------------------------------------------
 // input:
 // x[0] - p_T (GeV), photon p_T
@@ -239,7 +239,7 @@ static Double_t fromMixQ(Double_t *x, Double_t *par) {
 }   
          
 // -----------------------------------------------------------------------------------------------------
-static Double_t rateMixH(Double_t *x, Double_t *par) {
+static Double_t rateMixH(const Double_t *x, const Double_t *par) {
 //---------------------------------------------------
 // input:
 // x[0] - yprime, space rapidity
@@ -297,7 +297,7 @@ static Double_t rateMixH(Double_t *x, Double_t *par) {
 }   
 
 // -----------------------------------------------------------------------------------------------------
-static Double_t fromMixH(Double_t *x, Double_t *par) {
+static Double_t fromMixH(const Double_t *x, const Double_t *par) {
 //---------------------------------------------------
 // input:
 // x[0] - p_T (GeV), photon p_T
@@ -321,7 +321,7 @@ static Double_t fromMixH(Double_t *x, Double_t *par) {
 }   
          
 // -----------------------------------------------------------------------------------------------------
-static Double_t rateHHG(Double_t *x, Double_t *par) {
+static Double_t rateHHG(const Double_t *x, const Double_t *par) {
 //---------------------------------------------------
 // input:
 // x[0] - tau (fm), proper time
@@ -380,7 +380,7 @@ static Double_t rateHHG(Double_t *x, Double_t *par) {
 }   
 
 // -----------------------------------------------------------------------------------------------------
-static Double_t fromHHG(Double_t *x, Double_t *par) {
+static Double_t fromHHG(const Double_t *x, const Double_t *par) {
 // Thermal photon spectrum from Hot Hadron Gas (HHG)
 //  F.D.Steffen, nucl-th/9909035
 //  T.Peitzmann and M.H.Thoma, Phys.Rep., 364, 175 (2002), section 2.2.2 
@@ -407,7 +407,7 @@ static Double_t fromHHG(Double_t *x, Double_t *par) {
 }   
 
 // -----------------------------------------------------------------------------------------------------
-static Double_t fOverlapAB(Double_t *x, Double_t *par)
+static Double_t fOverlapAB(const Double_t *x, const Double_t *par)
 {
 //-------------------------------------------------------------------------
 // overlap area at the impact parameter b
@@ -499,7 +499,7 @@ AliGenThermalPhotons::~AliGenThermalPhotons()
 //_____________________________________________________________________________
 void AliGenThermalPhotons::Init()
 {
-
+    // Initialisation
   const Double_t step=0.1; 
   Int_t nPt=Int_t((fPtMax-fPtMin)/step);
 
@@ -573,15 +573,18 @@ void AliGenThermalPhotons::Generate()
 
     Float_t polar[3]= {0,0,0};
     Float_t origin[3];
+    Float_t time;
     Float_t p[3];
     Float_t random[6];
     Int_t nt;
 
     for (Int_t j=0;j<3;j++) origin[j]=fOrigin[j];
+    time = fTimeOrigin;
 /*
     if(fVertexSmear==kPerEvent) {
       Vertex();
       for (j=0;j<3;j++) origin[j]=fVertex[j];
+      time = fTime;
     }
 */
     TArrayF eventVertex;
@@ -589,6 +592,7 @@ void AliGenThermalPhotons::Generate()
     eventVertex[0] = origin[0];
     eventVertex[1] = origin[1];
     eventVertex[2] = origin[2];
+    Float_t eventTime = time;
 
     Int_t nGam;
     Float_t impPar,area,pt,rapidity,phi,ww;
@@ -621,9 +625,13 @@ void AliGenThermalPhotons::Generate()
              origin[j]=fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
              TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
            }
+           Rndm(random,2);
+           time = fTimeOrigin + fOsigma[2]/TMath::Ccgs()*
+             TMath::Cos(2*random[0]*TMath::Pi())*
+             TMath::Sqrt(-2*TMath::Log(random[1]));
          }
 
-         PushTrack(fTrackIt,-1,22,p,origin,polar,0,kPPrimary,nt,1.);
+         PushTrack(fTrackIt,-1,22,p,origin,polar,time,kPPrimary,nt,1.);
         }
       }
 
@@ -632,6 +640,7 @@ void AliGenThermalPhotons::Generate()
     AliGenEventHeader* header = new AliGenEventHeader("ThermalPhotons");
 // Event Vertex
     header->SetPrimaryVertex(eventVertex);
+    header->SetInteractionTime(eventTime);
     header->SetNProduced(fNpart);
     gAlice->SetGenEventHeader(header);