]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenKrypton.cxx
Add new global configuration for prod shuttle.
[u/mrichter/AliRoot.git] / EVGEN / AliGenKrypton.cxx
index d9a7c06c9ca3d580824899abda55e61ddfac3193..bafcf2df2ba684c7dd57f7f8662f2cb2864fe167 100644 (file)
 
 /*
 $Log$
+Revision 1.2  2007/10/23 09:27:16  hristov
+Adding dependence on the dip angle (Marek)
+
+Revision 1.1  2007/06/24 20:53:11  hristov
+New generator for the krypton runs of TPC (Marek)
+
 */ 
 
 //
@@ -71,12 +77,13 @@ void AliGenKrypton::Generate(){
   //
   for(Int_t i=0;i<nelectron;i++){
     rnd=gRandom->Rndm();
-    phi=TMath::TwoPi()*rnd;    
-    ptot=TMath::Sqrt(eelectron[i]*(eelectron[i]+2.*me));
-    p[0]=ptot*TMath::Cos(phi);
-    p[1]=ptot*TMath::Sin(phi);
+    phi=TMath::TwoPi()*rnd; 
     rnd=gRandom->Rndm();
-    p[2]=ptot*TMath::Cos(TMath::Pi()*rnd);
+    Double_t theta = TMath::Pi()*rnd;   
+    ptot=TMath::Sqrt(eelectron[i]*(eelectron[i]+2.*me));
+    p[0]=ptot*TMath::Cos(phi)*TMath::Sin(theta);
+    p[1]=ptot*TMath::Sin(phi)*TMath::Sin(theta);    
+    p[2]=ptot*TMath::Cos(theta);
     //
     // her push particle
     //
@@ -86,13 +93,14 @@ void AliGenKrypton::Generate(){
   // gammas
   //
   for(Int_t i=0;i<ngamma;i++){
+    rnd=gRandom->Rndm();
+    Double_t theta = TMath::Pi()*rnd;
     rnd=gRandom->Rndm();
     phi=TMath::TwoPi()*rnd;    
     ptot=egamma[i];
-    p[0]=ptot*TMath::Cos(phi);
-    p[1]=ptot*TMath::Sin(phi);
-    rnd=gRandom->Rndm();
-    p[2]=ptot*TMath::Cos(TMath::Pi()*rnd);
+    p[0]=ptot*TMath::Cos(phi)*TMath::Sin(theta);
+    p[1]=ptot*TMath::Sin(phi)*TMath::Sin(theta);
+    p[2]=ptot*TMath::Cos(theta);
     //
     // her push particle
     //
@@ -113,7 +121,7 @@ void AliGenKrypton::KrDecay(Int_t &nelectron, Int_t &ngamma, Double_t *eelectron
   //
   // first decay - 32 keV
   //
-  if(rnd < prob1[0]) {
+   if(rnd < prob1[0]) {
     // 2 electrons
     nelectron = 2;
     eelectron[0]=30.e-6;
@@ -150,5 +158,7 @@ void AliGenKrypton::KrDecay(Int_t &nelectron, Int_t &ngamma, Double_t *eelectron
     ngamma++;
     egamma[ngamma-1]=9.e-6;
   }
+  
+
 }
 //________________________________________________________________________