Add AliCentrality support
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Mar 2011 08:25:57 +0000 (08:25 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Mar 2011 08:25:57 +0000 (08:25 +0000)
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h

index 4cf0a1c..c55ea1c 100644 (file)
@@ -14,6 +14,8 @@
 #include "AliESDtrack.h"
 #include "AliESDVertex.h"
 #include "AliMultiplicity.h"
+#include "AliCentrality.h"
+#include "AliESDVZERO.h"
 
 #include "AliFmPhysicalHelixD.h"
 #include "AliFmThreeVectorF.h"
@@ -519,7 +521,10 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
        else if (fTrackType == kTPCOnly) {
          if (esdtrack->GetTPCInnerParam())
            esdtrack->GetTPCInnerParam()->GetPxPyPz(pxyz);
-         else continue;
+         else {
+           delete trackCopy;
+           continue;
+         }
        }
        else if (fTrackType == kITSOnly) {
          if (fConstrained==true)                   
@@ -614,6 +619,17 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
     }
 
   hbtEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event  
+
+  AliCentrality *cent = fEvent->GetCentrality();
+  if (cent) {
+    hbtEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M"));
+    //    hbtEvent->SetCentralityFMD(cent->GetCentralityPercentile("FMD"));
+    hbtEvent->SetCentralitySPD1(cent->GetCentralityPercentile("CL1"));
+    //    hbtEvent->SetCentralityTrk(cent->GetCentralityPercentile("TRK"));
+
+    printf("  FemtoReader Got Event with %f %f %f %f\n", cent->GetCentralityPercentile("V0M"), 0.0, cent->GetCentralityPercentile("CL1"), 0.0);
+  }
+
   if (fEstEventMult == kGlobalCount) 
     hbtEvent->SetNormalizedMult(tNormMult);
   else if (fEstEventMult == kTracklet)
@@ -624,6 +640,18 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
     hbtEvent->SetNormalizedMult(tITSPure);
   else if (fEstEventMult == kSPDLayer1)
     hbtEvent->SetNormalizedMult(fEvent->GetMultiplicity()->GetNumberOfITSClusters(1));
+  else if (fEstEventMult == kV0Centrality) {
+    // centrality between 0 (central) and 1 (very peripheral)
+
+    if (cent) {
+      if (cent->GetCentralityPercentile("V0M") < 0.0)
+       hbtEvent->SetNormalizedMult(-1);
+      else
+       hbtEvent->SetNormalizedMult(lrint(10.0*cent->GetCentralityPercentile("V0M")));
+      printf ("Set Centrality %i %f %li\n", hbtEvent->UncorrectedNumberOfPrimaries(), 
+             10.0*cent->GetCentralityPercentile("V0M"), lrint(10.0*cent->GetCentralityPercentile("V0M")));
+    }
+  }
 
   if (tNormMultPos > tNormMultNeg)
     hbtEvent->SetZDCParticipants(tNormMultPos);
index 559d8f1..a100e6f 100644 (file)
@@ -15,6 +15,7 @@
 #include <string>
 #include <vector>
 #include "TTree.h"
+#include "TGraph.h"
 #include "AliESDEvent.h"
 #include "AliESDfriend.h"
 #include "AliPhysicsSelection.h"
@@ -28,7 +29,7 @@ class AliFemtoEventReaderESDChain : public AliFemtoEventReader
   enum TrackType {kGlobal=0, kTPCOnly=1, kITSOnly=2, kSPDTracklet=3};
   typedef enum TrackType ReadTrackType;
 
-  enum EventMult {kTracklet=0, kITSTPC=1, kITSPure=2, kGlobalCount=3, kSPDLayer1=4 };
+  enum EventMult {kTracklet=0, kITSTPC=1, kITSPure=2, kGlobalCount=3, kSPDLayer1=4, kV0Centrality=5 };
   typedef enum EventMult EstEventMult;
 
   AliFemtoEventReaderESDChain();