]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.cxx
This commit has two major parts:
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDMCEventInspector.cxx
index 99e2d388bfd61be4f0942bfef24f7c543366da61..44d913089d94805294162a6b37044f0e28690c28 100644 (file)
@@ -141,7 +141,13 @@ AliFMDMCEventInspector::SetupForData(const TAxis& vtxAxis)
   // Parameters:
   //   vtxAxis Vertex axis in use 
   //
+
+  // We temporary disable the displaced vertices so we can initialize
+  // the routine ourselves.
+  Bool_t saveDisplaced  = fUseDisplacedVertices;
+  fUseDisplacedVertices = false;
   AliFMDEventInspector::SetupForData(vtxAxis);
+  fUseDisplacedVertices = saveDisplaced;
 
   Int_t    maxPart = 450;
   Int_t    maxBin  = 225;
@@ -245,6 +251,8 @@ AliFMDMCEventInspector::SetupForData(const TAxis& vtxAxis)
   fHCentVsMcC->SetYTitle("Centralty derived from Impact Par. [%]");
   fHCentVsMcC->SetZTitle("Events");
   fList->Add(fHCentVsMcC);
+
+  if (fUseDisplacedVertices) fDisplacedVertex.SetupForData(fList, "", true);
 }
 
 //____________________________________________________________________
@@ -462,6 +470,7 @@ AliFMDMCEventInspector::ProcessMC(AliMCEvent*       event,
   fHBvsBin->Fill(b, nbin);
 
   if(fUseDisplacedVertices) {
+#if 0
     // Put the vertex at fixed locations 
     Double_t zvtx  = vz;
     Double_t ratio = zvtx/37.5;
@@ -471,6 +480,11 @@ AliFMDMCEventInspector::ProcessMC(AliMCEvent*       event,
     zvtx = 37.5*((Double_t)ratioInt);
     if(TMath::Abs(zvtx) > 999) 
       return kBadVertex;
+#endif
+    if (!fDisplacedVertex.ProcessMC(event)) 
+      return kBadVertex;
+    if (fDisplacedVertex.IsSatellite())
+      vz = fDisplacedVertex.GetVertexZ();
   }
 
   // Check for the vertex bin