]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
in event cuts added possibility to select TPConly or tracklets to calculate refmult...
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Oct 2010 22:29:53 +0000 (22:29 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Oct 2010 22:29:53 +0000 (22:29 +0000)
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEventCuts.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEventCuts.h
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.cxx
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.h

index 1ae0b6aa5294ebcf70a58b94109f4447d5f2ae16..7ab39bc8837e5f892f06b775e75ec3f77173bd7a 100644 (file)
@@ -279,7 +279,7 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
     fCutsPOI->SetMCevent( MCEvent() );
     flowEvent = new AliFlowEvent( InputEvent(), fCutsRP, fCutsPOI );
     if (myESD)
-      flowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity());
+      flowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent()));
     if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent);
   }
 
index 8ffa8da4cbc76301d82b8c4266e75f727a0f482f..87deee1e38ac4d911bef7c321747578a5f999287 100644 (file)
@@ -657,6 +657,7 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
       if (rp)
       {
         pTrack = rpCuts->MakeFlowTrack();
+      if (!pTrack) continue;
         pTrack->TagRP(); fNumberOfRPs++;
         if (poi) pTrack->TagPOI();
       }
@@ -664,6 +665,7 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
       if (poi)
       {
         pTrack = poiCuts->MakeFlowTrack();
+      if (!pTrack) continue;
         pTrack->TagPOI();
       }
 
@@ -687,6 +689,7 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
       Bool_t rp = rpCuts->IsSelected(particle,i);
       if (!rp) continue;
       pTrack = rpCuts->MakeFlowTrack();
+      if (!pTrack) continue;
       pTrack->TagRP(); fNumberOfRPs++;
       AddTrack(pTrack);
     }
@@ -702,6 +705,7 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
       Bool_t poi = poiCuts->IsSelected(particle,i);
       if (!poi) continue;
       pTrack = poiCuts->MakeFlowTrack();
+      if (!pTrack) continue;
       pTrack->TagPOI();
       AddTrack(pTrack);
     }
index ffc803aa1baec04b151b6fb1417dde413eeafb74..8ecee1469f821eaf5a18c3b4eda6a965ccc3c870 100644 (file)
 #include "TNamed.h"
 #include "AliVEvent.h"
 #include "AliESDEvent.h"
+#include "AliMultiplicity.h"
 #include "AliMCEvent.h"
 #include "AliFlowEventCuts.h"
-#include "AliESDtrackCuts.h"
+#include "AliFlowTrackCuts.h"
 
 ClassImp(AliFlowEventCuts)
 
@@ -38,9 +39,10 @@ AliFlowEventCuts::AliFlowEventCuts():
   fNumberOfTracksMax(INT_MAX),
   fNumberOfTracksMin(INT_MIN),
   fCutRefMult(kFALSE),
+  fRefMultMethod(kTPConly),
   fRefMultMax(INT_MAX),
   fRefMultMin(INT_MIN),
-  fReferenceMultiplicity(-1)
+  fRefMult(-1)
 {
   //constructor 
 }
@@ -52,16 +54,17 @@ AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title):
   fNumberOfTracksMax(INT_MAX),
   fNumberOfTracksMin(INT_MIN),
   fCutRefMult(kFALSE),
+  fRefMultMethod(kTPConly),
   fRefMultMax(INT_MAX),
   fRefMultMin(INT_MIN),
-  fReferenceMultiplicity(-1)
+  fRefMult(-1)
 {
   //constructor 
 }
 
 ////-----------------------------------------------------------------------
 //AliFlowEventCuts::AliFlowEventCuts(const AliFlowEventCuts& someCuts):
-//  TNamed(),
+//  TNamed(someCuts),
 //  fCutNumberOfTracks(that.fCutNumberOfTracks),
 //  fNumberOfTracksMax(that.fNumberOfTracksMax),
 //  fNumberOfTracksMin(that.fNumberOfTracksMin),
@@ -96,8 +99,8 @@ Bool_t AliFlowEventCuts::PassesCuts(const AliVEvent *event)
   if(fCutRefMult)
   {
     //reference multiplicity still to be defined
-    fReferenceMultiplicity = ReferenceMultiplicity(event);
-    if (fReferenceMultiplicity < fRefMultMin || fReferenceMultiplicity >= fRefMultMax )
+    fRefMult = RefMult(event);
+    if (fRefMult < fRefMultMin || fRefMult >= fRefMultMax )
       return kFALSE;
   }
   return kTRUE;
@@ -112,12 +115,54 @@ AliFlowEventCuts* AliFlowEventCuts::StandardCuts()
 }
 
 //----------------------------------------------------------------------- 
-Int_t AliFlowEventCuts::ReferenceMultiplicity(const AliVEvent* event)
+Int_t AliFlowEventCuts::RefMult(const AliVEvent* event, AliFlowTrackCuts* cuts)
 {
-  //calculate the reference multiplicity
+  //calculate the reference multiplicity, if all fails return 0
+  Int_t refmult=0;
+
+  //in the case of an ESD
   const AliESDEvent* esd=dynamic_cast<const AliESDEvent*>(event);
-  if (esd) return AliESDtrackCuts::GetReferenceMultiplicity(const_cast<AliESDEvent*>(esd),kTRUE);
+  if (esd) 
+  {
+    AliMultiplicity* tracklets=NULL;
+    switch (fRefMultMethod)
+    {
+      case kTPConly:
+        if (!cuts)
+        {
+          //if not explicitly passed, make default cuts
+          cuts = AliFlowTrackCuts::GetStandardTPCOnlyTrackCuts();
+          cuts->SetEtaRange(-0.8,0.8);
+          cuts->SetPtMin(0.15);
+        }
+        for (Int_t i=0; i<esd->GetNumberOfTracks();i++)
+        {
+          AliESDtrack* track = esd->GetTrack(i);
+          if (cuts->IsSelected(track)) refmult++;
+        }
+        break;
+      case kSPDtracklets:
+        if (!cuts)
+        {
+          //if not explicitly passed, make default cuts
+          cuts = new AliFlowTrackCuts();
+          cuts->SetEtaRange(-0.8,0.8);
+        }
+        tracklets = const_cast<AliMultiplicity*>(esd->GetMultiplicity());
+        for (Int_t i=0; i<tracklets->GetNumberOfTracklets(); i++)
+        {
+          if (cuts->IsSelected(tracklets,i)) refmult++;
+        }
+        break;
+      default:
+        return 0;
+    }
+    return refmult;
+  }
+
+  //in case of MC event
   AliMCEvent* mc=const_cast<AliMCEvent*>(dynamic_cast<const AliMCEvent*>(event));
   if (mc) return mc->GetNumberOfPrimaries();
-  return event->GetNumberOfTracks(); //default
+
+  return event->GetNumberOfTracks(); //default, at least returns some number
 }
index a3cceb0b724ae68662f31e877e4b53abb563b419..fca41e3988d6a544136972659d05ab566017eaad 100644 (file)
 #include <float.h>
 #include "TNamed.h"
 
-class AliVEvent;;
+class AliVEvent;
+class AliFlowTrackCuts;
 
 class AliFlowEventCuts : public TNamed {
 
  public:
+  enum refMultMethod { kTPConly, kSPDtracklets };
+
   AliFlowEventCuts();
   AliFlowEventCuts(const char* name, const char* title = "AliFlowEventCuts");
   //AliFlowEventCuts(const AliFlowEventCuts& someCuts);
@@ -40,19 +43,23 @@ class AliFlowEventCuts : public TNamed {
   Int_t GetNumberOfTracksMin() const {return fNumberOfTracksMin;}
   Int_t GetRefMultMax() const {return fRefMultMax;}
   Int_t GetRefMultMin() const {return fRefMultMin;}
+  void SetRefMultMethod(refMultMethod m) {fRefMultMethod=m;}
+  refMultMethod GetRefMultMethod() const {return fRefMultMethod;}
 
-  static Int_t ReferenceMultiplicity(const AliVEvent* event);
-  Int_t GetReferenceMultiplicity() {return fReferenceMultiplicity;}
+  Int_t RefMult(const AliVEvent* event, AliFlowTrackCuts* cuts=NULL);
+  //Int_t GetRefMult() {return fRefMult;}
+  Int_t GetReferenceMultiplicity(const AliVEvent* event) {return RefMult(event);}
 
  private:
   Bool_t fCutNumberOfTracks;//cut on # of tracks
   Int_t fNumberOfTracksMax;  //limits
   Int_t fNumberOfTracksMin;  //limits
   Bool_t fCutRefMult; //cut on refmult
+  refMultMethod fRefMultMethod; //how do we calculate refmult?
   Int_t fRefMultMax; //max refmult
   Int_t fRefMultMin; //min refmult
 
-  Int_t fReferenceMultiplicity; //store the reference multiplicity
+  Int_t fRefMult; //store the reference multiplicity
 
   ClassDef(AliFlowEventCuts,1)
 };
index 4e948d7e26ed73a2165b1cba303ee89b35db7a8d..63c8f7a34010e1339acc08d0276e3cb79e52a06f 100644 (file)
 
 #include <limits.h>
 #include <float.h>
+#include "TParticle.h"
+#include "AliStack.h"
 #include "AliMCEvent.h"
+#include "AliESDEvent.h"
 #include "AliVParticle.h"
 #include "AliMCParticle.h"
 #include "AliESDtrack.h"
@@ -61,6 +64,9 @@ AliFlowTrackCuts::AliFlowTrackCuts():
   fMCisPrimary(kFALSE),
   fRequireCharge(kFALSE),
   fFakesAreOK(kTRUE),
+  fCutSPDtrackletDeltaPhi(kFALSE),
+  fSPDtrackletDeltaPhiMax(FLT_MAX),
+  fSPDtrackletDeltaPhiMin(-FLT_MAX),
   fParamType(kGlobal),
   fParamMix(kPure),
   fCleanupTrack(kFALSE),
@@ -70,7 +76,8 @@ AliFlowTrackCuts::AliFlowTrackCuts():
   fTrackWeight(0.),
   fTrackLabel(INT_MIN),
   fMCevent(NULL),
-  fMCparticle(NULL)
+  fMCparticle(NULL),
+  fEvent(NULL)
 {
   //constructor 
 }
@@ -88,6 +95,9 @@ AliFlowTrackCuts::AliFlowTrackCuts(const AliFlowTrackCuts& someCuts):
   fMCisPrimary(someCuts.fMCisPrimary),
   fRequireCharge(someCuts.fRequireCharge),
   fFakesAreOK(someCuts.fFakesAreOK),
+  fCutSPDtrackletDeltaPhi(someCuts.fCutSPDtrackletDeltaPhi),
+  fSPDtrackletDeltaPhiMax(someCuts.fSPDtrackletDeltaPhiMax),
+  fSPDtrackletDeltaPhiMin(someCuts.fSPDtrackletDeltaPhiMin),
   fParamType(someCuts.fParamType),
   fParamMix(someCuts.fParamMix),
   fCleanupTrack(kFALSE),
@@ -97,7 +107,8 @@ AliFlowTrackCuts::AliFlowTrackCuts(const AliFlowTrackCuts& someCuts):
   fTrackWeight(someCuts.fTrackWeight),
   fTrackLabel(INT_MIN),
   fMCevent(NULL),
-  fMCparticle(NULL)
+  fMCparticle(NULL),
+  fEvent(NULL)
 {
   //copy constructor
 }
@@ -117,6 +128,9 @@ AliFlowTrackCuts& AliFlowTrackCuts::operator=(const AliFlowTrackCuts& someCuts)
   fMCisPrimary=someCuts.fMCisPrimary;
   fRequireCharge=someCuts.fRequireCharge;
   fFakesAreOK=someCuts.fFakesAreOK;
+  fCutSPDtrackletDeltaPhi=someCuts.fCutSPDtrackletDeltaPhi;
+  fSPDtrackletDeltaPhiMax=someCuts.fSPDtrackletDeltaPhiMax;
+  fSPDtrackletDeltaPhiMin=someCuts.fSPDtrackletDeltaPhiMin;
   fParamType=someCuts.fParamType;
   fParamMix=someCuts.fParamMix;
 
@@ -128,6 +142,7 @@ AliFlowTrackCuts& AliFlowTrackCuts::operator=(const AliFlowTrackCuts& someCuts)
   fTrackLabel=INT_MIN;
   fMCevent=NULL;
   fMCparticle=NULL;
+  fEvent=NULL;
 
   return *this;
 }
@@ -168,9 +183,10 @@ Bool_t AliFlowTrackCuts::PassesCuts(AliMultiplicity* tracklet, Int_t id)
 {
   //check cuts on a tracklets
 
-  //clean up from last iteration
+  //clean up from last iteration, and init label
   if (fCleanupTrack) delete fTrack; fTrack = NULL;
   fMCparticle=NULL;
+  fTrackLabel=-1;
 
   fTrackPhi = tracklet->GetPhi(id);
   fTrackEta = tracklet->GetEta(id);
@@ -179,7 +195,11 @@ Bool_t AliFlowTrackCuts::PassesCuts(AliMultiplicity* tracklet, Int_t id)
   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 the 2 clusters have different label track cannot be good
+  //and should therefore not pass the mc cuts
+  Int_t label0 = tracklet->GetLabel(id,0);
+  Int_t label1 = tracklet->GetLabel(id,1);
+  fTrackLabel = (label0==label1)?tracklet->GetLabel(id,1):-1;
   if (!PassesMCcuts()) return kFALSE;
   return kTRUE;
 }
@@ -188,13 +208,14 @@ Bool_t AliFlowTrackCuts::PassesCuts(AliMultiplicity* tracklet, Int_t id)
 Bool_t AliFlowTrackCuts::PassesMCcuts()
 {
   //check the MC info
-  if (!fMCevent) {AliError("no MC info"); return kFALSE;}
+  if (!fMCevent) {AliWarning("no MC info"); return kFALSE;}
+  if (fTrackLabel<0) return kFALSE;//otherwise AliCMevent prints a warning before returning NULL
   fMCparticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(fTrackLabel));
   if (!fMCparticle) {AliError("no MC info"); return kFALSE;}
 
   if (fCutMCisPrimary)
   {
-    if (IsPhysicalPrimary() != fMCisPrimary) return kFALSE;
+    if (IsPhysicalPrimary(fMCevent,fTrackLabel) != fMCisPrimary) return kFALSE;
   }
   if (fCutMCPID)
   {
@@ -240,7 +261,7 @@ Bool_t AliFlowTrackCuts::PassesCuts(AliVParticle* vparticle)
   ////////////////////////////////////////////////////////////////
 
   Bool_t pass=kTRUE;
-  //check the common cuts for the current particle (MC,AOD,ESD)
+  //check the common cuts for the current particle fTrack (MC,AOD,ESD)
   if (fCutPt) {if (fTrack->Pt() < fPtMin || fTrack->Pt() >= fPtMax ) pass=kFALSE;}
   if (fCutEta) {if (fTrack->Eta() < fEtaMin || fTrack->Eta() >= fEtaMax ) pass=kFALSE;}
   if (fCutPhi) {if (fTrack->Phi() < fPhiMin || fTrack->Phi() >= fPhiMax ) pass=kFALSE;}
@@ -330,12 +351,33 @@ AliFlowTrack* AliFlowTrackCuts::MakeFlowTrack() const
 {
   //get a flow track constructed from whatever we applied cuts on
   //caller is resposible for deletion
+  //if construction fails return NULL
   AliFlowTrack* flowtrack=NULL;
   if (fParamType==kESD_SPDtracklet)
   {
     flowtrack = new AliFlowTrack();
-    flowtrack->SetPhi(fTrackPhi);
-    flowtrack->SetEta(fTrackEta);
+    switch (fParamMix)
+    {
+      case kPure:
+        flowtrack->SetPhi(fTrackPhi);
+        flowtrack->SetEta(fTrackEta);
+        break;
+      case kTrackWithMCkine:
+        if (!fMCparticle) return NULL;
+        flowtrack->SetPhi( fMCparticle->Phi() );
+        flowtrack->SetEta( fMCparticle->Eta() );
+        flowtrack->SetPt( fMCparticle->Pt() );
+        break;
+      case kTrackWithMCpt:
+        if (!fMCparticle) return NULL;
+        flowtrack->SetPhi(fTrackPhi);
+        flowtrack->SetEta(fTrackEta);
+        flowtrack->SetPt(fMCparticle->Pt());
+        break;
+      default:
+        flowtrack->SetPhi(fTrackPhi);
+        flowtrack->SetEta(fTrackEta);
+    }
     flowtrack->SetSource(AliFlowTrack::kFromTracklet);
   }
   else
@@ -350,7 +392,12 @@ AliFlowTrack* AliFlowTrackCuts::MakeFlowTrack() const
         break;
       case kTrackWithMCPID:
         flowtrack = new AliFlowTrack(fTrack);
+        //flowtrack->setPID(...) from mc, when implemented
         break;
+      case kTrackWithMCpt:
+        if (!fMCparticle) return NULL;
+        flowtrack = new AliFlowTrack(fTrack);
+        flowtrack->SetPt(fMCparticle->Pt());
       default:
         flowtrack = new AliFlowTrack(fTrack);
     }
@@ -366,7 +413,23 @@ AliFlowTrack* AliFlowTrackCuts::MakeFlowTrack() const
 Bool_t AliFlowTrackCuts::IsPhysicalPrimary() const
 {
   //check if current particle is a physical primary
-  return fMCevent->IsPhysicalPrimary(fTrackLabel);
+  if (!fMCevent) return kFALSE;
+  if (fTrackLabel<0) return kFALSE;
+  return IsPhysicalPrimary(fMCevent, fTrackLabel);
+}
+
+//-----------------------------------------------------------------------
+Bool_t AliFlowTrackCuts::IsPhysicalPrimary(AliMCEvent* mcEvent, Int_t label)
+{
+  //check if current particle is a physical primary
+  Bool_t physprim=mcEvent->IsPhysicalPrimary(label);
+  if (!physprim) return kFALSE;
+  AliMCParticle* track = static_cast<AliMCParticle*>(mcEvent->GetTrack(label));
+  if (!track) return kFALSE;
+  TParticle* particle = track->Particle();
+  Bool_t transported = particle->TestBit(kTransportBit);
+  //printf("prim: %s, transp: %s\n",(physprim)?"YES":"NO ",(transported)?"YES":"NO ");
+  return (physprim && transported);
 }
 
 //-----------------------------------------------------------------------
@@ -393,3 +456,46 @@ const char* AliFlowTrackCuts::GetParamTypeName(trackParameterType type)
 void AliFlowTrackCuts::DefineHistograms()
 {
 }
+
+//-----------------------------------------------------------------------
+Int_t AliFlowTrackCuts::GetNumberOfInputObjects() const
+{
+  //get the number of tracks in the input event according source
+  //selection (ESD tracks, tracklets, MC particles etc.)
+  AliESDEvent* esd=NULL;
+  switch (fParamType)
+  {
+    case kESD_SPDtracklet:
+      esd = dynamic_cast<AliESDEvent*>(fEvent);
+      if (!esd) return 0;
+      return esd->GetMultiplicity()->GetNumberOfTracklets();
+    case kMC:
+      if (!fMCevent) return 0;
+      return fMCevent->GetNumberOfTracks();
+    default:
+      if (!fEvent) return 0;
+      return fEvent->GetNumberOfTracks();
+  }
+  return 0;
+}
+
+//-----------------------------------------------------------------------
+TObject* AliFlowTrackCuts::GetInputObject(Int_t i)
+{
+  //get the input object according the data source selection:
+  //(esd tracks, traclets, mc particles,etc...)
+  AliESDEvent* esd=NULL;
+  switch (fParamType)
+  {
+    case kESD_SPDtracklet:
+      esd = dynamic_cast<AliESDEvent*>(fEvent);
+      if (!esd) return NULL;
+      return const_cast<AliMultiplicity*>(esd->GetMultiplicity());
+    case kMC:
+      if (!fMCevent) return NULL;
+      return fMCevent->GetTrack(i);
+    default:
+      if (!fEvent) return NULL;
+      return fEvent->GetTrack(i);
+  }
+}
index b617cf4818ad4f82c4560721e5b97c3ae99ca166..4c0e972738e4eaebdf499a28d1769ae83af117dc 100644 (file)
@@ -33,7 +33,7 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   static AliFlowTrackCuts* GetStandardITSTPCTrackCuts2009(Bool_t selPrimaries=kTRUE);
 
   enum trackParameterType { kMC, kGlobal, kESD_TPConly, kESD_SPDtracklet };
-  enum trackParameterMix  { kPure, kTrackWithMCkine, kTrackWithMCPID };
+  enum trackParameterMix  { kPure, kTrackWithMCkine, kTrackWithMCPID, kTrackWithMCpt };
 
   //setters (interface to AliESDtrackCuts)
   void SetMinNClustersTPC( Int_t a ) {fAliESDtrackCuts->SetMinNClustersTPC(a);}
@@ -58,6 +58,8 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   void SetPtRange( Float_t r1, Float_t r2 ) { SetPtMin(r1); SetPtMax(r2); }
   void SetRequireCharge( Bool_t r ) {fRequireCharge=r;}
   void SetFakesAreOK( Bool_t b ) {fFakesAreOK=b;}
+  void SetSPDtrackletDeltaPhiMax( Double_t m ) {fSPDtrackletDeltaPhiMax=m; fCutSPDtrackletDeltaPhi=kTRUE;}
+  void SetSPDtrackletDeltaPhiMin( Double_t m ) {fSPDtrackletDeltaPhiMin=m; fCutSPDtrackletDeltaPhi=kTRUE;}
 
   Int_t GetMinNClustersTPC() const {return fAliESDtrackCuts->GetMinNClusterTPC();}
   Int_t GetMinNClustersITS() const {return fAliESDtrackCuts->GetMinNClustersITS();}
@@ -79,6 +81,9 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   void GetEtaRange( Float_t& r1, Float_t& r2 ) const { r1=GetEtaMin(); r2=GetEtaMax(); }
   void GetPtRange( Float_t& r1, Float_t& r2 ) const { r1=GetPtMin(); r2=GetPtMax(); }
   Bool_t GetRequireCharge() const {return fRequireCharge;}
+  Bool_t GetFakesAreOK() const {return fFakesAreOK;}
+  Double_t GetSPDtrackletDeltaPhiMax() const {return fSPDtrackletDeltaPhiMax;}
+  Double_t GetSPDtrackletDeltaPhiMin() const {return fSPDtrackletDeltaPhiMin;}
 
   void SetQA(const char* dirname);
   TDirectory* GetQA() const {return fQA;}
@@ -95,14 +100,19 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   void SetParamMix(trackParameterMix paramMix) {fParamMix=paramMix;}
   trackParameterMix GetParamMix() const {return fParamMix;}
 
-  virtual Bool_t IsSelected(TObject* obj, Int_t id=-1);
+  virtual Bool_t IsSelected(TObject* obj, Int_t id=-666);
   AliVParticle* GetTrack() const {return fTrack;}
   AliMCParticle* GetMCparticle() const {return fMCparticle;}
   AliFlowTrack* MakeFlowTrack() const;
   Bool_t IsPhysicalPrimary() const; 
+  static Bool_t IsPhysicalPrimary(AliMCEvent* p, Int_t label); 
   
   void SetMCevent(AliMCEvent* mcEvent) {fMCevent=mcEvent;}
   AliMCEvent* GetMCevent() const {return fMCevent;}
+  void SetEvent(AliVEvent* event) {fEvent=event;}
+  AliVEvent* GetEvent() const {return fEvent;}
+  Int_t GetNumberOfInputObjects() const;
+  TObject* GetInputObject(Int_t i);
 
  protected:
   Bool_t PassesCuts(AliVParticle* track);
@@ -113,6 +123,7 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   void HandleVParticle(AliVParticle* track);
   void DefineHistograms();
 
+  //the cuts
   AliESDtrackCuts* fAliESDtrackCuts; //alianalysis cuts
   TDirectory* fQA;                   //qa histograms go here
   Bool_t fCutMCprocessType;          //do we cut on mc process type?
@@ -123,6 +134,9 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   Bool_t fMCisPrimary;               //is MC primary
   Bool_t fRequireCharge;          //is charged?
   Bool_t fFakesAreOK;             //are fakes (negative labels) ok?
+  Bool_t fCutSPDtrackletDeltaPhi; //are we cutting on the trcklet deltaphi?
+  Double_t fSPDtrackletDeltaPhiMax; //maximal deltaphi for tracklets
+  Double_t fSPDtrackletDeltaPhiMin; //minimal deltaphi for tracklets
 
   trackParameterType fParamType;     //parameter type tu cut on
   trackParameterMix fParamMix;       //parameter mixing
@@ -134,6 +148,7 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   Int_t fTrackLabel;                 //!track label, or its absolute value if FakesAreOK
   AliMCEvent* fMCevent;              //!mc event
   AliMCParticle* fMCparticle;        //!mc particle
+  AliVEvent* fEvent;                 //!placeholder for current event
 
   ClassDef(AliFlowTrackCuts,1)
 };