]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG/FLOW/Tasks/AliFlowEventCuts.cxx
initial checkin of the new flow development - from an OLD diff!
[u/mrichter/AliRoot.git] / PWG / FLOW / Tasks / AliFlowEventCuts.cxx
index 362cbafe673f2cf16104297965c27cc048f611f4..c0e4a661992754df640b56459b0f67f1e5c6fe81 100644 (file)
@@ -48,7 +48,7 @@ ClassImp(AliFlowEventCuts)
 
 //-----------------------------------------------------------------------
 AliFlowEventCuts::AliFlowEventCuts():
-  TNamed(),
+  AliFlowEventSimpleCuts(),
   fQA(NULL),
   fCutNumberOfTracks(kFALSE),
   fNumberOfTracksMax(INT_MAX),
@@ -81,11 +81,8 @@ AliFlowEventCuts::AliFlowEventCuts():
   fCutSPDvertexerAnomaly(kFALSE),
   fCutSPDTRKVtxZ(kFALSE),
   fCutTPCmultiplicityOutliers(kFALSE),
-  fCutCentralityPercentile(kFALSE),
   fUseCentralityUnchecked(kFALSE),
   fCentralityPercentileMethod(kTPConly),
-  fCentralityPercentileMax(100.),
-  fCentralityPercentileMin(0.),
   fCutZDCtiming(kFALSE),
   fTrigAna(),
   fCutImpactParameter(kFALSE),
@@ -99,7 +96,7 @@ AliFlowEventCuts::AliFlowEventCuts():
 
 //-----------------------------------------------------------------------
 AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title):
-  TNamed(name, title),
+  AliFlowEventSimpleCuts(name, title),
   fQA(NULL),
   fCutNumberOfTracks(kFALSE),
   fNumberOfTracksMax(INT_MAX),
@@ -132,11 +129,8 @@ AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title):
   fCutSPDvertexerAnomaly(kFALSE),
   fCutSPDTRKVtxZ(kFALSE),
   fCutTPCmultiplicityOutliers(kFALSE),
-  fCutCentralityPercentile(kFALSE),
   fUseCentralityUnchecked(kFALSE),
   fCentralityPercentileMethod(kTPConly),
-  fCentralityPercentileMax(100.),
-  fCentralityPercentileMin(0.),
   fCutZDCtiming(kFALSE),
   fTrigAna(),
   fCutImpactParameter(kFALSE),
@@ -150,7 +144,7 @@ AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title):
 
 ////-----------------------------------------------------------------------
 AliFlowEventCuts::AliFlowEventCuts(const AliFlowEventCuts& that):
-  TNamed(that),
+  AliFlowEventSimpleCuts(that),
   fQA(NULL),
   fCutNumberOfTracks(that.fCutNumberOfTracks),
   fNumberOfTracksMax(that.fNumberOfTracksMax),
@@ -183,11 +177,8 @@ AliFlowEventCuts::AliFlowEventCuts(const AliFlowEventCuts& that):
   fCutSPDvertexerAnomaly(that.fCutSPDvertexerAnomaly),
   fCutSPDTRKVtxZ(that.fCutSPDTRKVtxZ),
   fCutTPCmultiplicityOutliers(that.fCutTPCmultiplicityOutliers),
-  fCutCentralityPercentile(that.fCutCentralityPercentile),
   fUseCentralityUnchecked(that.fUseCentralityUnchecked),
   fCentralityPercentileMethod(that.fCentralityPercentileMethod),
-  fCentralityPercentileMax(that.fCentralityPercentileMax),
-  fCentralityPercentileMin(that.fCentralityPercentileMin),
   fCutZDCtiming(that.fCutZDCtiming),
   fTrigAna(),
   fCutImpactParameter(that.fCutImpactParameter),
@@ -473,6 +464,31 @@ Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event, AliMCEvent *mcevent)
   return pass;
 }
 
+//----------------------------------------------------------------------- 
+Float_t AliFlowEventCuts::GetCentrality(AliVEvent* event, AliMCEvent* /*mcEvent*/)
+{
+  //get the centrality percentile of the event
+  AliESDEvent* esdEvent = dynamic_cast<AliESDEvent*>(event);
+  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
+
+  Float_t centrality=-1.;
+
+  AliCentrality* centr = NULL;
+  if (esdEvent)
+    centr = esdEvent->GetCentrality();
+  if (aodEvent) 
+    centr = aodEvent->GetHeader()->GetCentralityP();
+  
+  if (!centr) return -1.;
+
+  if (fUseCentralityUnchecked) 
+    centrality=centr->GetCentralityPercentileUnchecked(CentrMethName(fCentralityPercentileMethod));
+  else 
+    centrality=centr->GetCentralityPercentile(CentrMethName(fCentralityPercentileMethod));
+
+  return centrality;
+}
+
 //----------------------------------------------------------------------- 
 const char* AliFlowEventCuts::CentrMethName(refMultMethod method) const
 {
@@ -486,7 +502,7 @@ const char* AliFlowEventCuts::CentrMethName(refMultMethod method) const
       return "CL1";
     case kTPConly:
       return "TRK";
-    case kV0:
+    case kVZERO:
       return "V0M";
     default:
       return "";
@@ -525,7 +541,7 @@ Int_t AliFlowEventCuts::RefMult(AliVEvent* event, AliMCEvent *mcEvent)
     fRefMultCuts->SetParamType(AliFlowTrackCuts::kSPDtracklet);
     fRefMultCuts->SetEtaRange(-0.8,0.8);
   }
-  else if (fRefMultMethod==kV0)
+  else if (fRefMultMethod==kVZERO)
   {
     if (!esdevent) return 0;
     vzero=esdevent->GetVZEROData();