]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCRecoParamPbPb.cxx
Coding conventions
[u/mrichter/AliRoot.git] / ZDC / AliZDCRecoParamPbPb.cxx
index 32192cf9bd0094cff2faa6ad498fb19c7fb9539d..6c7b085f3a7cd667951bd8574fb592ec73aaa4f4 100644 (file)
@@ -98,7 +98,7 @@ void AliZDCRecoParamPbPb::SetGlauberMCDist(Float_t beamEnergy)
   
   TFile *fileGlauberMC =  TFile::Open("$ALICE_ROOT/ZDC/GlauberMCDist.root");
   if(!fileGlauberMC) {
-    AliError((" Opening file $ALICE_ROOT/ZDC/SpectatorSignal.root failed\n"));
+    AliError((" Opening file $ALICE_ROOT/ZDC/GlauberMCDist.root failed\n"));
     return;
   }
   
@@ -107,18 +107,18 @@ void AliZDCRecoParamPbPb::SetGlauberMCDist(Float_t beamEnergy)
   if(TMath::Abs(sqrtS-5500) < 100.){
     AliDebug(2, " ZDC -> Looking for energy5500 in file $ALICE_ROOT/ZDC/GlauberMCDist.root");
     fileGlauberMC->cd("energy5500");
-    fileGlauberMC->GetObject("energy5500/hNpartGlauber;1", fhNpartDist);
-    if(!fhNpartDist) AliError("  PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
     fileGlauberMC->GetObject("energy5500/hbGlauber;1", fhbDist);
     if(!fhbDist) AliError("  PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
+    fileGlauberMC->GetObject("energy5500/hNpartGlauber;1", fhNpartDist);
+    if(!fhNpartDist) AliError("  PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
   }
   else if(TMath::Abs(sqrtS-2760) < 100.){
     AliDebug(2, " ZDC -> Looking for energy2760 in file $ALICE_ROOT/ZDC/GlauberMCDist.root");
     fileGlauberMC->cd("energy2760");
-    fileGlauberMC->GetObject("energy2760/hNpartGlauber;1", fhNpartDist);
-    if(!fhNpartDist) AliError("  PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
     fileGlauberMC->GetObject("energy2760/hbGlauber;1", fhbDist);
     if(!fhbDist) AliError("  PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
+    fileGlauberMC->GetObject("energy2760/hNpartGlauber;1", fhNpartDist);
+    if(!fhNpartDist) AliError("  PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
   }
   else AliError(Form(" No AliZDCRecoParam provided for Pb-Pb @ sqrt(s) = %1.0f GeV\n", sqrtS));
   //
@@ -138,22 +138,24 @@ AliZDCRecoParamPbPb *AliZDCRecoParamPbPb::GetHighFluxParam(Float_t beamEnergy)
   TFile *fileGlauberMC =  TFile::Open("$ALICE_ROOT/ZDC/GlauberMCDist.root");
   if(!fileGlauberMC) printf(" AliZDCRecoParamPbPb::GetHighFluxParam() ERROR opening file $ALICE_ROOT/ZDC/SpectatorSignal.root\n");
   
-  TH1D *hNpartDist, *hbDist;
-  if(TMath::Abs(beamEnergy-5500)<100.){
+  Float_t sqrtS = 2*beamEnergy;
+  
+  TH1D *hNpartDist=0x0, *hbDist=0x0;
+  if(TMath::Abs(sqrtS-5500)<100.){
     fileGlauberMC->cd("energy5500");
     fileGlauberMC->GetObject("energy5500/hNpartGlauber;1", hNpartDist);
     if(!hNpartDist) printf("  AliZDCRecoParamPbPb::GetHighFluxParam() PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
     fileGlauberMC->GetObject("energy5500/hbGlauber;1", hbDist);
     if(!hbDist) printf("  AliZDCRecoParamPbPb::GetHighFluxParam() PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
   }
-  else if(TMath::Abs(beamEnergy-2760)<100.){
+  else if(TMath::Abs(sqrtS-2760)<100.){
     fileGlauberMC->cd("energy2760");
     fileGlauberMC->GetObject("energy2760/hNpartGlauber;1", hNpartDist);
     if(!hNpartDist) printf("  PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
     fileGlauberMC->GetObject("energy2760/hbGlauber;1", hbDist);
     if(!hbDist) printf("  AliZDCRecoParamPbPb::GetHighFluxParam() PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
   }
-  else printf(" No AliZDCRecoParam provided for Pb-Pb @ sqrt(s) = %1.0f GeV\n", beamEnergy);
+  else printf(" No AliZDCRecoParam provided for Pb-Pb @ sqrt(s) = %1.0f GeV\n", sqrtS);
   //
   hNpartDist->SetDirectory(0);
   hbDist->SetDirectory(0);