]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adds tracklets to flow cuts, fixes for MC analysis + other fixes.
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2010 16:09:39 +0000 (16:09 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2010 16:09:39 +0000 (16:09 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimpleCuts.cxx
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimpleCuts.h
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.cxx
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.h
PWG2/FLOW/macros/AddTaskFlowCentrality.C

index 2128385b42128d4884a315552e1d5b7a4b9e231c..87fd274fa33bf6011bf810cda45315f7650f5da8 100644 (file)
@@ -94,7 +94,7 @@ AliFlowTrackSimpleCuts::AliFlowTrackSimpleCuts():
 //}
 
 //----------------------------------------------------------------------- 
-Bool_t AliFlowTrackSimpleCuts::IsSelected(TObject* obj)
+Bool_t AliFlowTrackSimpleCuts::IsSelected(TObject* obj, Int_t id)
 {
   //check cuts
   TParticle* p = dynamic_cast<TParticle*>(obj);
index 699c1d12e307613881e015587da9782eabb20d8f..6ef46ebd0549eb545c3b5684daf5edb52cf20dc5 100644 (file)
@@ -48,7 +48,7 @@ class AliFlowTrackSimpleCuts : public TNamed {
   Bool_t PassesCuts(const AliFlowTrackSimple *track) const;
   Bool_t PassesCuts(TParticle* p) const;
 
-  virtual Bool_t IsSelected(TObject* obj);
+  virtual Bool_t IsSelected(TObject* obj, Int_t id=-1);
 
  protected:
   Bool_t   fCutPt;
index 4c1511917ebf9b4c24ffc13905684417bebcb887..1ae0b6aa5294ebcf70a58b94109f4447d5f2ae16 100644 (file)
@@ -75,7 +75,7 @@ ClassImp(AliAnalysisTaskFlowEvent)
 AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() :
   AliAnalysisTaskSE(),
   //  fOutputFile(NULL),
-  fAnalysisType("MK"),
+  fAnalysisType("AUTOMATIC"),
   fRPType("Global"),
   fCFManager1(NULL),
   fCFManager2(NULL),
@@ -126,7 +126,7 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() :
 AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, TString RPtype, Bool_t on, UInt_t iseed) :
   AliAnalysisTaskSE(name),
   //  fOutputFile(NULL),
-  fAnalysisType("MK"),
+  fAnalysisType("AUTOMATIC"),
   fRPType(RPtype),
   fCFManager1(NULL),
   fCFManager2(NULL),
@@ -210,9 +210,9 @@ void AliAnalysisTaskFlowEvent::UserCreateOutputObjects()
   // Called at every worker node to initialize
   cout<<"AliAnalysisTaskFlowEvent::CreateOutputObjects()"<<endl;
 
-  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMCkineESD"  || fAnalysisType == "ESDMCkineMC" || fAnalysisType == "MC" || fAnalysisType == "MK"))
+  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMCkineESD"  || fAnalysisType == "ESDMCkineMC" || fAnalysisType == "MC" || fAnalysisType == "AUTOMATIC"))
   {
-    AliError("WRONG ANALYSIS TYPE! only ESD, ESDMCkineESD, ESDMCkineMC, AOD and MC are allowed.");
+    AliError("WRONG ANALYSIS TYPE! only ESD, ESDMCkineESD, ESDMCkineMC, AOD, MC and AUTOMATIC are allowed.");
     exit(1);
   }
 
@@ -263,7 +263,7 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   }
   
   //use the new and temporarily inclomplete way of doing things
-  if (fAnalysisType == "MK")
+  if (fAnalysisType == "AUTOMATIC")
   {
     if (!(fCutsRP&&fCutsPOI))
     {
index 0478c26c92bcf3f2e1f25ef3318daf3ed6b270b5..4be1c40469aa31ecaa534c21f2b5ef168ea521ec 100644 (file)
@@ -582,7 +582,7 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
 }
 
 //-----------------------------------------------------------------------
-AliFlowEvent::AliFlowEvent( AliVEvent* event,
+AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
                             AliFlowTrackCuts* rpCuts,
                             AliFlowTrackCuts* poiCuts ):
   AliFlowEventSimple(20)
@@ -591,50 +591,124 @@ AliFlowEvent::AliFlowEvent( AliVEvent* event,
 
   if (!rpCuts || !poiCuts) return;
 
-  //if input event empty try to do MC analysis
-  if (!event) event = rpCuts->GetMCevent();
-  if (!event) return;
+  AliFlowTrackCuts::trackParameterType sourceRP = rpCuts->GetParamType();
+  AliFlowTrackCuts::trackParameterType sourcePOI = poiCuts->GetParamType();
 
-  Int_t numberOfTracks = event->GetNumberOfTracks() ;
-
-  //loop over tracks
-  for (Int_t i=0; i<numberOfTracks; i++)
+  //MC case is special: handle it
+  //if input event empty do MC analysis
+  AliVEvent* eventRP = inputEvent;
+  AliVEvent* eventPOI = inputEvent;
+  if (!inputEvent)
   {
-    AliVParticle* particle = event->GetTrack(i);   //get input particle
+    eventRP = rpCuts->GetMCevent();
+    eventPOI = poiCuts->GetMCevent();
+  }
+  if (sourceRP==AliFlowTrackCuts::kMC) eventRP = rpCuts->GetMCevent();
+  if (sourcePOI==AliFlowTrackCuts::kMC) eventPOI = poiCuts->GetMCevent();
+  
+  //if we dont have input data return
+  if (!eventRP || !eventPOI) return;
+
+  //check if we want to use tracklets, TODO: const_casts to be somehow removed!
+  AliESDEvent* esdEvent = NULL; 
+  AliMultiplicity* trackletsRP=NULL;
+  AliMultiplicity* trackletsPOI=NULL;
+  if (sourceRP==AliFlowTrackCuts::kESD_SPDtracklet)
+  { 
+    esdEvent = dynamic_cast<AliESDEvent*>(eventRP);
+    if (!esdEvent) return;
+    trackletsRP=const_cast<AliMultiplicity*>(esdEvent->GetMultiplicity());
+  }
+  if (sourcePOI==AliFlowTrackCuts::kESD_SPDtracklet)
+  { 
+    esdEvent = dynamic_cast<AliESDEvent*>(eventPOI);
+    if (!esdEvent) return;
+    trackletsPOI=const_cast<AliMultiplicity*>(esdEvent->GetMultiplicity());
+  }
 
-    Bool_t rp = rpCuts->IsSelected(particle);
-    Bool_t poi = poiCuts->IsSelected(particle);
-    
-    if (!(rp||poi)) continue;
+  //we have two cases, if we're cutting the same collection of tracks
+  //(same param type) then we can have tracks that are both rp and poi
+  //in the other case we want to have two exclusive sets of rps and pois
+  //e.g. one tracklets, the other PMD or global - USER IS RESPOSIBLE
+  //FOR MAKING SURE THEY DONT OVERLAP OR ELSE THE SAME PARTICLE WILL BE
+  //TAKEN TWICE
+  if (sourceRP==sourcePOI)
+  {
+    //loop over tracks
+    //check the number of particles first
+    Int_t numberOfTracks = 0;
+    if (trackletsRP) numberOfTracks = trackletsRP->GetNumberOfTracklets();
+    else numberOfTracks = eventRP->GetNumberOfTracks();
 
-    //make new AliFLowTrack
-    //here we need to be careful: if selected particle passes both rp and poi cuts
-    //then both cuts should have been done on the same set of parameters, e.g. global
-    //or TPConly. Otherwise we would have to introduce the same particle twice.
-    //this means that in a sane scenario when we pass both rp and poi cuts we get our
-    //parameters from any one of them (here rp).
-    AliFlowTrack* pTrack = NULL;
-    if (rp&&poi)
+    for (Int_t i=0; i<numberOfTracks; i++)
     {
-      pTrack = rpCuts->MakeFlowTrack();
-      pTrack->TagRP(); fNumberOfRPs++;
-      pTrack->TagPOI();
-    }
-    else
-    if (rp)
+      //get input object (particle)
+      TObject* particle = NULL;
+      if (trackletsRP) particle = trackletsRP;
+      else particle = eventRP->GetTrack(i);
+
+      Bool_t rp = rpCuts->IsSelected(particle,i);
+      Bool_t poi = poiCuts->IsSelected(particle,i);
+      
+      if (!(rp||poi)) continue;
+
+      //make new AliFLowTrack
+      AliFlowTrack* pTrack = NULL;
+      if (rp&&poi)
+      {
+        pTrack = rpCuts->MakeFlowTrack();
+        pTrack->TagRP(); fNumberOfRPs++;
+        pTrack->TagPOI();
+      }
+      else
+      if (rp)
+      {
+        pTrack = rpCuts->MakeFlowTrack();
+        pTrack->TagRP(); fNumberOfRPs++;
+      }
+      else
+      if (poi)
+      {
+        pTrack = poiCuts->MakeFlowTrack();
+        pTrack->TagPOI();
+      }
+
+      AddTrack(pTrack);
+    }//end of while (i < numberOfTracks)
+  }
+  else if (sourceRP!=sourcePOI)
+  {
+    //here we have two different sources of particles, so we fill
+    //them independently
+    //RP
+    Int_t numberOfRPs = 0;
+    if (trackletsRP) numberOfRPs = trackletsRP->GetNumberOfTracklets();
+    else numberOfRPs = eventRP->GetNumberOfTracks();
+    for (Int_t i=0; i<numberOfRPs; i++)
     {
-      pTrack = rpCuts->MakeFlowTrack();
+      TObject* particle = NULL;
+      if (trackletsRP) particle = trackletsRP;
+      else particle = eventRP->GetTrack(i);
+      Bool_t rp = rpCuts->IsSelected(particle,i);
+      if (!rp) continue;
+      AliFlowTrack* pTrack = rpCuts->MakeFlowTrack();
       pTrack->TagRP(); fNumberOfRPs++;
     }
-    else
-    if (poi)
+    //POI
+    Int_t numberOfPOIs = 0;
+    if (trackletsPOI) numberOfPOIs = trackletsPOI->GetNumberOfTracklets();
+    else numberOfPOIs = eventPOI->GetNumberOfTracks();
+    for (Int_t i=0; i<numberOfPOIs; i++)
     {
-      pTrack = poiCuts->MakeFlowTrack();
+      TObject* particle = NULL;
+      if (trackletsPOI) particle = trackletsPOI;
+      else particle = eventPOI->GetTrack(i);
+      Bool_t poi = poiCuts->IsSelected(particle,i);
+      if (!poi) continue;
+      AliFlowTrack* pTrack = poiCuts->MakeFlowTrack();
       pTrack->TagPOI();
     }
-
-    AddTrack(pTrack);
-  }//end of while (i < numberOfTracks)
+  }
 }
 
 //-------------------------------------------------------------------//
index 92c8ccf7489fd1cd9d1fb2c0919e425accd85093..259b58d57dc2f0cec3b7865be3aedc77eabc02a2 100644 (file)
@@ -40,6 +40,7 @@
 #include "AliVParticle.h"
 #include "AliMCParticle.h"
 #include "AliESDtrack.h"
+#include "AliMultiplicity.h"
 #include "AliAODTrack.h"
 #include "AliFlowTrack.h"
 #include "AliFlowTrackCuts.h"
@@ -59,10 +60,13 @@ AliFlowTrackCuts::AliFlowTrackCuts():
   fMCisPrimary(kFALSE),
   fRequireCharge(kFALSE),
   fFakesAreOK(kTRUE),
-  fParamType(kESD_Global),
+  fParamType(kGlobal),
   fParamMix(kPure),
   fCleanupTrack(kFALSE),
   fTrack(NULL),
+  fTrackPhi(0.),
+  fTrackEta(0.),
+  fTrackWeight(0.),
   fTrackLabel(INT_MIN),
   fMCevent(NULL),
   fMCparticle(NULL)
@@ -86,6 +90,9 @@ AliFlowTrackCuts::AliFlowTrackCuts(const AliFlowTrackCuts& someCuts):
   fParamMix(someCuts.fParamMix),
   fCleanupTrack(kFALSE),
   fTrack(NULL),
+  fTrackPhi(someCuts.fTrackPhi),
+  fTrackEta(someCuts.fTrackEta),
+  fTrackWeight(someCuts.fTrackWeight),
   fTrackLabel(INT_MIN),
   fMCevent(NULL),
   fMCparticle(NULL)
@@ -112,6 +119,9 @@ AliFlowTrackCuts& AliFlowTrackCuts::operator=(const AliFlowTrackCuts& someCuts)
 
   fCleanupTrack=kFALSE;
   fTrack=NULL;
+  fTrackPhi=someCuts.fTrackPhi;
+  fTrackPhi=someCuts.fTrackPhi;
+  fTrackWeight=someCuts.fTrackWeight;
   fTrackLabel=INT_MIN;
   fMCevent=NULL;
   fMCparticle=NULL;
@@ -128,13 +138,15 @@ AliFlowTrackCuts::~AliFlowTrackCuts()
 }
 
 //-----------------------------------------------------------------------
-Bool_t AliFlowTrackCuts::IsSelected(TObject* obj)
+Bool_t AliFlowTrackCuts::IsSelected(TObject* obj, Int_t id)
 {
   //check cuts
   AliVParticle* vparticle = dynamic_cast<AliVParticle*>(obj);
   if (vparticle) return PassesCuts(vparticle);
   AliFlowTrackSimple* flowtrack = dynamic_cast<AliFlowTrackSimple*>(obj);
   if (flowtrack) return PassesCuts(flowtrack);
+  AliMultiplicity* tracklets = dynamic_cast<AliMultiplicity*>(obj);
+  if (tracklets) return PassesCuts(tracklets,id);
   return kFALSE;  //default when passed wrong type of object
 }
 
@@ -148,6 +160,53 @@ Bool_t AliFlowTrackCuts::PassesCuts(AliFlowTrackSimple* track)
   return AliFlowTrackSimpleCuts::PassesCuts(track);
 }
 
+//-----------------------------------------------------------------------
+Bool_t AliFlowTrackCuts::PassesCuts(AliMultiplicity* tracklet, Int_t id)
+{
+  //check cuts on a tracklets
+
+  //clean up from last iteration
+  if (fCleanupTrack) delete fTrack; fTrack = NULL;
+  fMCparticle=NULL;
+
+  fTrackPhi = tracklet->GetPhi(id);
+  fTrackEta = tracklet->GetEta(id);
+  fTrackWeight = 1.0;
+  if (fCutEta) {if (  fTrackEta < fEtaMin || fTrackEta >= fEtaMax ) return kFALSE;}
+  if (fCutPhi) {if ( fTrackPhi < fPhiMin || fTrackPhi >= fPhiMax ) return kFALSE;}
+
+  //check MC info if available
+  fTrackLabel = tracklet->GetLabel(id,1); //TODO: this can be improved
+  if (!PassesMCcuts()) return kFALSE;
+  return kTRUE;
+}
+
+//-----------------------------------------------------------------------
+Bool_t AliFlowTrackCuts::PassesMCcuts()
+{
+  //check the MC info
+  if (!fMCevent) {AliError("no MC info"); return kFALSE;}
+  fMCparticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(fTrackLabel));
+  if (!fMCparticle) {AliError("no MC info"); return kFALSE;}
+
+  if (fCutMCisPrimary)
+  {
+    if (IsPhysicalPrimary() != fMCisPrimary) return kFALSE;
+  }
+  if (fCutMCPID)
+  {
+    Int_t pdgCode = fMCparticle->PdgCode();
+    if (fMCPID != pdgCode) return kFALSE;
+  }
+  if ( fCutMCprocessType )
+  {
+    TParticle* particle = fMCparticle->Particle();
+    Int_t processID = particle->GetUniqueID();
+    if (processID != fMCprocessType ) return kFALSE;
+  }
+  return kTRUE;
+}
+
 //-----------------------------------------------------------------------
 Bool_t AliFlowTrackCuts::PassesCuts(AliVParticle* vparticle)
 {
@@ -192,24 +251,7 @@ Bool_t AliFlowTrackCuts::PassesCuts(AliVParticle* vparticle)
   //if(fCutPID) {if (fTrack->PID() != fPID) return kFALSE;}
 
   //when additionally MC info is required
-  if (fCutMCisPrimary)
-  {
-    if (!fMCevent) {AliError("no MC info"); return kFALSE;}
-    if (fMCevent->IsPhysicalPrimary(fTrackLabel) != fMCisPrimary) return kFALSE;
-  }
-  if (fCutMCPID)
-  {
-    if (!fMCparticle) {AliError("no MC info"); return kFALSE;}
-    Int_t pdgCode = fMCparticle->PdgCode();
-    if (fMCPID != pdgCode) return kFALSE;
-  }
-  if ( fCutMCprocessType )
-  {
-    if (!fMCparticle) {AliError("no MC info"); return kFALSE;}
-    TParticle* particle = fMCparticle->Particle();
-    Int_t processID = particle->GetUniqueID();
-    if (processID != fMCprocessType ) return kFALSE;
-  }
+  if (!PassesMCcuts()) return kFALSE;
 
   //check all else for ESDs using aliesdtrackcuts
   if (esdTrack && (fParamType!=kMC) ) return fAliESDtrackCuts->IsSelected(static_cast<AliESDtrack*>(fTrack));
@@ -223,10 +265,6 @@ void AliFlowTrackCuts::HandleVParticle(AliVParticle* track)
   //handle the general case
   switch (fParamType)
   {
-    case kMC:
-      fCleanupTrack = kFALSE;
-      fTrack = fMCparticle;
-      break;
     default:
       fCleanupTrack = kFALSE;
       fTrack = track;
@@ -239,7 +277,7 @@ void AliFlowTrackCuts::HandleESDtrack(AliESDtrack* track)
   //handle esd track
   switch (fParamType)
   {
-    case kESD_Global:
+    case kGlobal:
       fTrack = track;
       fCleanupTrack = kFALSE;
       break;
@@ -252,10 +290,6 @@ void AliFlowTrackCuts::HandleESDtrack(AliESDtrack* track)
       if (fMCevent) fMCparticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(fTrackLabel));
       else fMCparticle=NULL;
       break;
-    case kMC:
-      fCleanupTrack = kFALSE;
-      fTrack = fMCparticle;
-      break;
     default:
       fTrack = track;
       fCleanupTrack = kFALSE;
@@ -282,7 +316,7 @@ AliFlowTrackCuts* AliFlowTrackCuts::GetStandardITSTPCTrackCuts2009(Bool_t selPri
   cuts->SetName("standard global track cuts 2009");
   delete cuts->fAliESDtrackCuts;
   cuts->fAliESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2009(selPrimaries);
-  cuts->SetParamType(kESD_Global);
+  cuts->SetParamType(kGlobal);
   return cuts;
 }
 
@@ -292,24 +326,34 @@ AliFlowTrack* AliFlowTrackCuts::MakeFlowTrack() const
   //get a flow track constructed from whatever we applied cuts on
   //caller is resposible for deletion
   AliFlowTrack* flowtrack=NULL;
-  switch(fParamMix)
+  if (fParamType==kESD_SPDtracklet)
   {
-    case kPure:
-      flowtrack = new AliFlowTrack(fTrack);
-      break;
-    case kTrackWithMCkine:
-      flowtrack = new AliFlowTrack(fMCparticle);
-      break;
-    case kTrackWithMCPID:
-      flowtrack = new AliFlowTrack(fTrack);
-      break;
-    default:
-      flowtrack = new AliFlowTrack(fTrack);
+    flowtrack = new AliFlowTrack();
+    flowtrack->SetPhi(fTrackPhi);
+    flowtrack->SetEta(fTrackEta);
+    flowtrack->SetSource(AliFlowTrack::kFromTracklet);
+  }
+  else
+  {
+    switch(fParamMix)
+    {
+      case kPure:
+        flowtrack = new AliFlowTrack(fTrack);
+        break;
+      case kTrackWithMCkine:
+        flowtrack = new AliFlowTrack(fMCparticle);
+        break;
+      case kTrackWithMCPID:
+        flowtrack = new AliFlowTrack(fTrack);
+        break;
+      default:
+        flowtrack = new AliFlowTrack(fTrack);
+    }
+    if (fParamType==kMC) flowtrack->SetSource(AliFlowTrack::kFromMC);
+    else if (dynamic_cast<AliESDtrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromESD);
+    else if (dynamic_cast<AliAODTrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromAOD);
+    else if (dynamic_cast<AliMCParticle*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromMC);
   }
-  if (fParamType==kMC) flowtrack->SetSource(AliFlowTrack::kFromMC);
-  else if (dynamic_cast<AliMCParticle*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromMC);
-  else if (dynamic_cast<AliESDtrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromESD);
-  else if (dynamic_cast<AliAODTrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromAOD);
   return flowtrack;
 }
 
@@ -319,3 +363,23 @@ Bool_t AliFlowTrackCuts::IsPhysicalPrimary() const
   //check if current particle is a physical primary
   return fMCevent->IsPhysicalPrimary(fTrackLabel);
 }
+
+//-----------------------------------------------------------------------
+const char* AliFlowTrackCuts::GetParamTypeName(trackParameterType type) 
+{
+  //return the name of the selected parameter type
+  switch (type)
+  {
+    case kMC:
+      return "MC";
+    case kGlobal:
+      return "ESD global";
+    case kESD_TPConly:
+      return "TPC only";
+    case kESD_SPDtracklet:
+        return "SPD tracklet";
+    default:
+        return "unknown";
+  }
+  return "unknown";
+}
index a7d775a19f74285ee242bc4d003af5e6ddacfc2c..e9ef62f67450b962a847592f82831c79cf88a5d8 100644 (file)
@@ -18,6 +18,7 @@ class AliMCParticle;
 class AliFlowTrack;
 class AliMCEvent;
 class AliVEvent;
+class AliMultiplicity; 
 
 class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
 
@@ -30,7 +31,7 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   static AliFlowTrackCuts* GetStandardTPCOnlyTrackCuts();
   static AliFlowTrackCuts* GetStandardITSTPCTrackCuts2009(Bool_t selPrimaries=kTRUE);
 
-  enum trackParameterType { kMC, kESD_Global, kESD_TPConly };
+  enum trackParameterType { kMC, kGlobal, kESD_TPConly, kESD_SPDtracklet };
   enum trackParameterMix  { kPure, kTrackWithMCkine, kTrackWithMCPID };
 
   //setters (interface to AliESDtrackCuts)
@@ -86,10 +87,11 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
 
   void SetParamType(trackParameterType paramType) {fParamType=paramType;}
   trackParameterType GetParamType() const {return fParamType;}
+  static const char* GetParamTypeName(trackParameterType type);
   void SetParamMix(trackParameterMix paramMix) {fParamMix=paramMix;}
   trackParameterMix GetParamMix() const {return fParamMix;}
 
-  virtual Bool_t IsSelected(TObject* obj);
+  virtual Bool_t IsSelected(TObject* obj, Int_t id=-1);
   AliVParticle* GetTrack() const {return fTrack;}
   AliMCParticle* GetMCparticle() const {return fMCparticle;}
   AliFlowTrack* MakeFlowTrack() const;
@@ -101,6 +103,8 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
  protected:
   Bool_t PassesCuts(AliVParticle* track);
   Bool_t PassesCuts(AliFlowTrackSimple* track);
+  Bool_t PassesCuts(AliMultiplicity* track, Int_t id);
+  Bool_t PassesMCcuts();
   void HandleESDtrack(AliESDtrack* track);
   void HandleVParticle(AliVParticle* track);
 
@@ -116,8 +120,11 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
 
   trackParameterType fParamType;     //parameter type tu cut on
   trackParameterMix fParamMix;       //parameter mixing
-  Bool_t fCleanupTrack;              //check if we need to delete
+  Bool_t fCleanupTrack;              //check if we need to delete the track
   AliVParticle* fTrack;              //!the track to apply cuts on
+  Double_t fTrackPhi;                //!track phi
+  Double_t fTrackEta;                //!track eta
+  Double_t fTrackWeight;             //!track weight
   Int_t fTrackLabel;                 //!track label, or its absolute value if FakesAreOK
   AliMCEvent* fMCevent;              //!mc event
   AliMCParticle* fMCparticle;        //!mc particle
index be2eb1dfbf2265686abed74b25ab4952e0637e56..cacedcc67b6070db21d85ddf7d4e78e42bc82699 100644 (file)
@@ -55,11 +55,12 @@ Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta)
 // SETTING THE CUTS
 
 //----------For RP selection----------
-//kMC, kESD_Global, kESD_TPConly
-const TString rptype = "kMC";
-const TString poitype = "kMC";
+//kMC, kGlobal, kESD_TPConly, kESD_SPDtracklet
+AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal;
+AliFlowTrackCuts::trackParameterType poitype = AliFlowTrackCuts::kGlobal;
 
-const TString type = "MK";
+const char* rptypestr = AliFlowTrackCuts::GetParamTypeName(rptype)
+const char* poitypestr = AliFlowTrackCuts::GetParamTypeName(poitype)
 
 void AddTaskFlowCentrality( Int_t refMultMin=0,
                             Int_t refMultMax=1e10,
@@ -168,7 +169,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
     if (LYZ2SUM){  
       // read the output directory from LYZ1SUM 
       TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis" ;
-      inputFileNameLYZ2SUM += type;
+      inputFileNameLYZ2SUM += rptypestr;
       cout<<"The input directory is "<<inputFileNameLYZ2SUM.Data()<<endl;
       TFile* fInputFileLYZ2SUM = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2SUM.Data());
       if(!fInputFileLYZ2SUM || fInputFileLYZ2SUM->IsZombie()) { 
@@ -185,7 +186,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
     if (LYZ2PROD){  
       // read the output directory from LYZ1PROD 
       TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis" ;
-      inputFileNameLYZ2PROD += type;
+      inputFileNameLYZ2PROD += rptypestr;
       cout<<"The input directory is "<<inputFileNameLYZ2PROD.Data()<<endl;
       TFile* fInputFileLYZ2PROD = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2PROD.Data());
       if(!fInputFileLYZ2PROD || fInputFileLYZ2PROD->IsZombie()) { 
@@ -217,7 +218,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
     
     // read the output file from LYZ2SUM
     TString inputFileNameLYZEP = "outputLYZ2SUManalysis" ;
-    inputFileNameLYZEP += type;
+    inputFileNameLYZEP += rptypestr;
     cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl;
     TFile* fInputFileLYZEP = (TFile*)outputFile->FindObjectAny(inputFileNameLYZEP.Data());
     if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) { 
@@ -234,9 +235,9 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   
   // Create the FMD task and add it to the manager
   //===========================================================================
-  if (rptype == "FMD") {
+  if (rptypestr == "FMD") {
     AliFMDAnalysisTaskSE *taskfmd = NULL;
-    if (rptype == "FMD") {
+    if (rptypestr == "FMD") {
       taskfmd = new AliFMDAnalysisTaskSE("TaskFMD");
       mgr->AddTask(taskfmd);
       
@@ -256,12 +257,12 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
 
   if(useAfterBurner)
     { 
-      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE,1);
+      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent","",kFALSE,1);
       taskFE->SetFlow(v1,v2,v3,v4); 
       taskFE->SetNonFlowNumberOfTrackClones(numberOfTrackClones);
       taskFE->SetAfterburnerOn();
     }
-  else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE); }
+  else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent","",kFALSE); }
   if (ExcludeRegion) {
     taskFE->DefineDeadZone(excludeEtaMin, excludeEtaMax, excludePhiMin, excludePhiMax); 
   }
@@ -372,7 +373,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   //===========================================================================
   AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
   
-  if (rptype == "FMD") {
+  if (rptypestr == "FMD") {
     AliAnalysisDataContainer *coutputFMD = 
       mgr->CreateContainer(Form("BackgroundCorrected_%s",fileName.Data()), TList::Class(), AliAnalysisManager::kExchangeContainer);
     //input and output taskFMD     
@@ -399,7 +400,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(SP) {
     TString outputSP = fileName;
     outputSP += ":outputSPanalysis";
-    outputSP+= type;
+    outputSP+= rptypestr;
     AliAnalysisDataContainer *coutputSP = mgr->CreateContainer(Form("cobjSP_%s",fileName.Data()), 
                                                               TList::Class(),AliAnalysisManager::kOutputContainer,outputSP); 
     mgr->ConnectInput(taskSP,0,coutputFE); 
@@ -412,7 +413,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(LYZ1SUM) {
     TString outputLYZ1SUM = fileName;
     outputLYZ1SUM += ":outputLYZ1SUManalysis";
-    outputLYZ1SUM+= type;
+    outputLYZ1SUM+= rptypestr;
     AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer(Form("cobjLYZ1SUM_%s",fileName.Data()), 
                                                                    TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1SUM); 
     mgr->ConnectInput(taskLYZ1SUM,0,coutputFE);
@@ -421,7 +422,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(LYZ1PROD) {
     TString outputLYZ1PROD = fileName;
     outputLYZ1PROD += ":outputLYZ1PRODanalysis";
-    outputLYZ1PROD+= type;
+    outputLYZ1PROD+= rptypestr;
     AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer(Form("cobjLYZ1PROD_%s",fileName.Data()), 
                                                                     TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1PROD); 
     mgr->ConnectInput(taskLYZ1PROD,0,coutputFE); 
@@ -432,7 +433,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
                                                                   TList::Class(),AliAnalysisManager::kInputContainer);
     TString outputLYZ2SUM = fileName;
     outputLYZ2SUM += ":outputLYZ2SUManalysis";
-    outputLYZ2SUM+= type;
+    outputLYZ2SUM+= rptypestr;
     
     AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer(Form("cobjLYZ2SUM_%s",fileName.Data()), 
                                                                    TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2SUM); 
@@ -446,7 +447,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
                                                                    TList::Class(),AliAnalysisManager::kInputContainer);
     TString outputLYZ2PROD = fileName;
     outputLYZ2PROD += ":outputLYZ2PRODanalysis";
-    outputLYZ2PROD+= type;
+    outputLYZ2PROD+= rptypestr;
     
     AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer(Form("cobjLYZ2PROD_%s",fileName.Data()), 
                                                                     TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2PROD); 
@@ -460,7 +461,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
                                                                 TList::Class(),AliAnalysisManager::kInputContainer);
     TString outputLYZEP = fileName;
     outputLYZEP += ":outputLYZEPanalysis";
-    outputLYZEP+= type;
+    outputLYZEP+= rptypestr;
     
     AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer(Form("cobjLYZEP_%s",fileName.Data()), 
                                                                  TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP); 
@@ -472,7 +473,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(GFC) {
     TString outputGFC = fileName;
     outputGFC += ":outputGFCanalysis";
-    outputGFC+= type;
+    outputGFC+= rptypestr;
     
     AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer(Form("cobjGFC_%s",fileName.Data()), 
                                                                TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC); 
@@ -486,7 +487,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(QC) {
     TString outputQC = fileName;
     outputQC += ":outputQCanalysis";
-    outputQC+= type;
+    outputQC+= rptypestr;
 
     AliAnalysisDataContainer *coutputQC = mgr->CreateContainer(Form("cobjQC_%s",fileName.Data()), 
                                                               TList::Class(),AliAnalysisManager::kOutputContainer,outputQC); 
@@ -500,7 +501,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(FQD) {
     TString outputFQD = fileName;
     outputFQD += ":outputFQDanalysis";
-    outputFQD+= type;
+    outputFQD+= rptypestr;
     
     AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer(Form("cobjFQD_%s",fileName.Data()), 
                                                                TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD); 
@@ -514,7 +515,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(MCEP) {
     TString outputMCEP = fileName;
     outputMCEP += ":outputMCEPanalysis";
-    outputMCEP+= type;
+    outputMCEP+= rptypestr;
     
     AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer(Form("cobjMCEP_%s",fileName.Data()), 
                                                                 TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP); 
@@ -524,7 +525,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(MH) {
     TString outputMH = fileName;
     outputMH += ":outputMHanalysis";
-    outputMH += type;
+    outputMH += rptypestr;
         
     AliAnalysisDataContainer *coutputMH = mgr->CreateContainer(Form("cobjMH_%s",fileName.Data()), 
                                                               TList::Class(),AliAnalysisManager::kOutputContainer,outputMH); 
@@ -538,7 +539,7 @@ void AddTaskFlowCentrality( Int_t refMultMin=0,
   if(NL) {
     TString outputNL = fileName;
     outputNL += ":outputNLanalysis";
-    outputNL += type;
+    outputNL += rptypestr;
 
     AliAnalysisDataContainer *coutputNL = mgr->CreateContainer(Form("cobjNL_%s",fileName.Data()), 
                                                               TList::Class(),AliAnalysisManager::kOutputContainer,outputNL);