MC upgrades to displaced vertices
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Mar 2012 13:59:00 +0000 (13:59 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Mar 2012 13:59:00 +0000 (13:59 +0000)
PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.cxx
PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx

index 3e64b651df92d29339405c068ad6b9381ea1c885..8c6f9f1551ace3bcc54c026ce8be50f6dbe34839 100644 (file)
@@ -29,6 +29,8 @@
 #include "AliGenEposEventHeader.h"
 #include "AliGenHerwigEventHeader.h"
 #include "AliGenGeVSimEventHeader.h"
+#include "AliAnalysisManager.h"
+#include "AliMCEventHandler.h"
 #include "AliHeader.h"
 #include <TList.h>
 #include <TH2F.h>
@@ -544,13 +546,44 @@ AliFMDMCEventInspector::ReadCentrality(const AliESDEvent* esd,
   qual = 0;
   AliCentrality* centObj = const_cast<AliESDEvent*>(esd)->GetCentrality();
   if (!centObj) return true;
-
-  qual = centObj->GetQuality();
-  if (qual == 0x8) // Ignore ZDC outliers 
-    cent = centObj->GetCentralityPercentileUnchecked("V0M");  
-  else
-    cent = centObj->GetCentralityPercentile("V0M");        
-
+AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
+  Bool_t isMC = am->GetMCtruthEventHandler() != 0;
+  
+  //std::cout<<fUseDisplacedVertices<<"  "<<isMC<<std::endl;
+  
+  if(fUseDisplacedVertices && isMC) {
+    
+    
+    AliMCEventHandler* mchandler = static_cast<AliMCEventHandler*>(am->GetMCtruthEventHandler());
+    AliMCEvent* mcevent          = mchandler->MCEvent();
+    
+    AliHeader*               header          = mcevent->Header();
+    AliGenEventHeader*       genHeader       = header->GenEventHeader();
+    AliCollisionGeometry*    colGeometry     = 
+      dynamic_cast<AliCollisionGeometry*>(genHeader);
+    Double_t b              = -1;
+    if (colGeometry)  
+      b     = colGeometry->ImpactParameter();
+    //std::cout<<"Hallo!!  "<<b<<std::endl;
+    cent = -1;
+    if(b<3.5 && b >0) cent = 2.5; //0-5%
+    if(b>3.5 && b<4.95) cent = 7.5; //5-10%
+    if(b>4.95 && b<6.98) cent = 15; //10-20%
+    if(b>6.98 && b<8.55) cent = 25; //20-30%
+    if(b>8.55 && b<9.88) cent = 35; //30-40%
+    if(b>9.88 && b<11.04) cent = 45; //40-50%
+    if(b>11.04) cent = 55; //50-60%
+    //cent = 10;
+    qual = 0;
+  }
+  else {
+    
+    qual = centObj->GetQuality();
+    if (qual == 0x8) // Ignore ZDC outliers 
+      cent = centObj->GetCentralityPercentileUnchecked("V0M");  
+    else
+      cent = centObj->GetCentralityPercentile("V0M");        
+  }
   return true;
 }
 
index 520b54bb459bda66f721bc8caa455916b29d6bdb..9a1328233ea465c507d47d2eb03236008e442885 100644 (file)
@@ -402,7 +402,7 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*)
   fSharingFilter.CompareResults(fESDFMD, fMCESDFMD);
 
   // Calculate the inclusive charged particle density 
-  if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux, cent)) { 
+  if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux, cent, vz)) { 
     AliWarning("Density calculator failed!");
     return;
   }