]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixes for pA indenfication of events
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2012 13:50:31 +0000 (13:50 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2012 13:50:31 +0000 (13:50 +0000)
PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx
PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.cxx
PWGLF/FORWARD/analysis2/AliForwardUtil.cxx

index 006c3faa9553d891582119ec17c100db3cc5f48e..93f2de5520fbb9ac872b776a55458a052c32ca5c 100644 (file)
@@ -1050,21 +1050,29 @@ AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
   //          esd->GetBeamType(), 2*esd->GetBeamEnergy(), 
   //          esd->GetMagneticField()));
   DGUARD(fDebug,2,"Read the run details in AliFMDEventInspector");
   //          esd->GetBeamType(), 2*esd->GetBeamEnergy(), 
   //          esd->GetMagneticField()));
   DGUARD(fDebug,2,"Read the run details in AliFMDEventInspector");
-  fCollisionSystem = 
-    AliForwardUtil::ParseCollisionSystem(esd->GetBeamType());
-  fEnergy          = 
-    AliForwardUtil::ParseCenterOfMassEnergy(fCollisionSystem,  
-                                           2 * esd->GetBeamEnergy());
-  fField           = 
-    AliForwardUtil::ParseMagneticField(esd->GetMagneticField());
+  const char* sys  = esd->GetBeamType();
+  Float_t     cms  = 2 * esd->GetBeamEnergy();
+  Float_t     fld  = esd->GetMagneticField();
+  fCollisionSystem = AliForwardUtil::ParseCollisionSystem(sys);
+  fEnergy          = AliForwardUtil::ParseCenterOfMassEnergy(fCollisionSystem, 
+                                                            cms);
+  fField           = AliForwardUtil::ParseMagneticField(fld);
 
   StoreInformation(esd->GetRunNumber());
 
   StoreInformation(esd->GetRunNumber());
-  if (fCollisionSystem   == AliForwardUtil::kUnknown || 
-      fEnergy            <= 0                        || 
-      TMath::Abs(fField) >  10) 
-    return kFALSE;
+  if (fCollisionSystem   == AliForwardUtil::kUnknown) { 
+    AliWarningF("Unknown collision system: %s - please check", sys);
+    return false;
+  }
+  if (fEnergy            <= 0) {
+    AliWarningF("Unknown CMS energy: %f (%d) - please check", cms, fEnergy);
+    return false;
+  }
+  if (TMath::Abs(fField) >  10) {
+    AliWarningF("Unknown L3 field setting: %f (%d) - please check", fld,fField);
+    return false;
+  }
 
 
-  return kTRUE;
+  return true;
 }
 
 
 }
 
 
index 4013b514bba80c41f175d5e90ed564d93ac1bd56..fe5867842e349d98ea71888b8024cb1354210530 100644 (file)
@@ -348,6 +348,11 @@ AliFMDMCEventInspector::ProcessMC(AliMCEvent*       event,
             colGeometry->TargetParticipants());
     nbin  = colGeometry->NN();
   }
             colGeometry->TargetParticipants());
     nbin  = colGeometry->NN();
   }
+  if (fDebug && !colGeometry) { 
+    AliWarningF("Collision header of class %s is not a CollisionHeader", 
+               genHeader->ClassName());
+  }
+    
   if(pythiaHeader) {
     Int_t pythiaType = pythiaHeader->ProcessType();
     // 92 and 93 are SD 
   if(pythiaHeader) {
     Int_t pythiaType = pythiaHeader->ProcessType();
     // 92 and 93 are SD 
@@ -420,6 +425,10 @@ AliFMDMCEventInspector::ProcessMC(AliMCEvent*       event,
   genHeader->PrimaryVertex(vtx);
   vz = vtx[2];
 
   genHeader->PrimaryVertex(vtx);
   vz = vtx[2];
 
+  if (fDebug) { 
+    AliInfoF("vz=%f, phiR=%f, b=%f, npart=%d, nbin=%d", 
+            vz, phiR, b, npart, nbin);
+  }
   fHVertex->Fill(vz);
   fHPhiR->Fill(phiR);
   fHB->Fill(b);
   fHVertex->Fill(vz);
   fHPhiR->Fill(phiR);
   fHB->Fill(b);
@@ -542,8 +551,8 @@ AliFMDMCEventInspector::IsSingleDiffractive(AliStack* stack,
     return false;
   
   // Rapidity shift
     return false;
   
   // Rapidity shift
-  Double_t m02s = 1 - 2 * p1->Energy() / fEnergy
-  Double_t m12s = 1 - 2 * p2->Energy() / fEnergy;
+  Double_t m02s = (fEnergy > 0 ? 1 - 2 * p1->Energy() / fEnergy : 0)
+  Double_t m12s = (fEnergy > 0 ? 1 - 2 * p2->Energy() / fEnergy : 0);
   
   if (arm == 0 && m02s > xiMin && m02s < xiMax) return true;
   if (arm == 1 && m12s > xiMin && m12s < xiMax) return true;
   
   if (arm == 0 && m02s > xiMin && m02s < xiMax) return true;
   if (arm == 1 && m12s > xiMin && m12s < xiMax) return true;
index cdcb8f863066f16591f68d9faa09596b1d9dcd7f..182f33a0762d7d1800b00704633adc1ebb6a5dc1 100644 (file)
@@ -47,6 +47,7 @@ AliForwardUtil::ParseCollisionSystem(const char* sys)
   // we do pA first to avoid pp catch on ppb string (AH)
   if (s.Contains("p-pb")  || s.Contains("ppb"))   return AliForwardUtil::kPPb;
   if (s.Contains("p-a")   || s.Contains("pa"))    return AliForwardUtil::kPPb;
   // we do pA first to avoid pp catch on ppb string (AH)
   if (s.Contains("p-pb")  || s.Contains("ppb"))   return AliForwardUtil::kPPb;
   if (s.Contains("p-a")   || s.Contains("pa"))    return AliForwardUtil::kPPb;
+  if (s.Contains("a-p")   || s.Contains("ap"))    return AliForwardUtil::kPPb;
   if (s.Contains("p-p")   || s.Contains("pp"))    return AliForwardUtil::kPP; 
   if (s.Contains("pb-pb") || s.Contains("pbpb"))  return AliForwardUtil::kPbPb;
   if (s.Contains("a-a")   || s.Contains("aa"))    return AliForwardUtil::kPbPb;
   if (s.Contains("p-p")   || s.Contains("pp"))    return AliForwardUtil::kPP; 
   if (s.Contains("pb-pb") || s.Contains("pbpb"))  return AliForwardUtil::kPbPb;
   if (s.Contains("a-a")   || s.Contains("aa"))    return AliForwardUtil::kPbPb;
@@ -97,6 +98,7 @@ AliForwardUtil::ParseCenterOfMassEnergy(UShort_t /* sys */, Float_t v)
   if (TMath::Abs(energy - 2400.)  < 10)  return 2400;
   if (TMath::Abs(energy - 2750.)  < 20)  return 2750;
   if (TMath::Abs(energy - 4400.)  < 10)  return 4400;
   if (TMath::Abs(energy - 2400.)  < 10)  return 2400;
   if (TMath::Abs(energy - 2750.)  < 20)  return 2750;
   if (TMath::Abs(energy - 4400.)  < 10)  return 4400;
+  if (TMath::Abs(energy - 5022.)  < 10)  return 5000;
   if (TMath::Abs(energy - 5500.)  < 40)  return 5500;
   if (TMath::Abs(energy - 7000.)  < 10)  return 7000;
   if (TMath::Abs(energy - 8000.)  < 10)  return 8000;
   if (TMath::Abs(energy - 5500.)  < 40)  return 5500;
   if (TMath::Abs(energy - 7000.)  < 10)  return 7000;
   if (TMath::Abs(energy - 8000.)  < 10)  return 8000;