]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bug in binary collision eccentricity calculation in glauberMC, extended macro.
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 25 Oct 2010 14:14:30 +0000 (14:14 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 25 Oct 2010 14:14:30 +0000 (14:14 +0000)
PWG2/FLOW/AliFlowTools/glauberMC/AliGlauberMC.cxx
PWG2/FLOW/Documentation/examples/runGlauberMCexample.C

index 1e5bb93be242146aedc0602f74581e05512c4c88..deb6526937886f4b52f1ab64867e24117d5a7bd0 100644 (file)
@@ -271,6 +271,11 @@ Bool_t AliGlauberMC::CalcResults(Double_t bgen)
   fMeanXY=0;
   fMeanXParts=0;
   fMeanYParts=0;
+  fMeanXColl=0;
+  fMeanYColl=0;
+  fMeanX2Coll=0;
+  fMeanY2Coll=0;
+  fMeanXYColl=0;
   fMeanXSystem=0;
   fMeanYSystem=0;
   fMeanX_A=0;
@@ -620,6 +625,7 @@ Double_t AliGlauberMC::GetdNdEtaTwoNBD ( Int_t k1,
 Double_t AliGlauberMC::GetEccentricityPart() const
 {
   //get participant eccentricity of participants
+  if (fNpart<2) return 0.0;
   return (TMath::Sqrt((fSy2-fSx2)*(fSy2-fSx2)+4*fSxy*fSxy)/(fSy2+fSx2));
 }
 
@@ -627,6 +633,9 @@ Double_t AliGlauberMC::GetEccentricityPart() const
 Double_t AliGlauberMC::GetEccentricityPartColl() const
 {
   //get participant eccentricity of binary collisions
+  if (fNcoll<2) return 0.0;
+  printf("fSx2Coll: %.10f\n",fSx2Coll);
+  printf("fSy2Coll: %.10f\n",fSy2Coll);
   return (TMath::Sqrt((fSy2Coll-fSx2Coll)*(fSy2Coll-fSx2Coll)+4*fSxyColl*fSxyColl)/(fSy2Coll+fSx2Coll));
 }
 
@@ -682,6 +691,7 @@ void AliGlauberMC::Run(Int_t nevents)
       u++;
       continue;
     }
+
     q++;
     Float_t v[25];
     v[0]  = GetNpart();
index c10a5b2ac71f73c7c24a9091cfec9437135abaef..d131c3a9c803e9cfb1abf5aec6a4a62d8cbabeb6 100644 (file)
@@ -6,6 +6,11 @@
  //  gROOT->LoadMacro("$ALICE_ROOT/PWG2/FLOW/AliFlowTools/glauberMC/AliGlauberNucleus.cxx+");
  //  gROOT->LoadMacro("$ALICE_ROOT/PWG2/FLOW/AliFlowTools/glauberMC/AliGlauberMC.cxx+");
 
+  //set the random seed from current time
+  TTimeStamp time;
+  Int_t seed = time->GetSec();
+  gRandom->SetSeed(seed);
+
   Int_t nevents = 10000; // number of events to simulate 
   // supported systems are e.g. "p", "d", "Si", "Au", "Pb", "U" 
   Option_t *sysA="Pb";