]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added switch for noCut, geoCut, nclCut (default ncl threshold 60, but can be set...
authorMarco van Leeuwen <marco.van.leeuwen@cern.ch>
Mon, 9 Dec 2013 10:31:21 +0000 (11:31 +0100)
committerMarco van Leeuwen <marco.van.leeuwen@cern.ch>
Mon, 9 Dec 2013 10:31:21 +0000 (11:31 +0100)
PWGJE/UserTasks/AliAnalysisTaskIDFragmentationFunction.cxx
PWGJE/UserTasks/AliAnalysisTaskPID.cxx
PWGJE/UserTasks/AliAnalysisTaskPIDV0base.cxx
PWGJE/UserTasks/AliAnalysisTaskPIDV0base.h

index 0ab8e847b29ab6f8928358d0a8e5c297a47c282c..3d507fdedf6ed85c32b7166c22bd5336485b8798 100644 (file)
@@ -2749,6 +2749,7 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
               continue;
             
             Bool_t survivedTPCCutMIGeo = AliAnalysisTaskPID::TPCCutMIGeo(inclusiveaod, InputEvent());
+            Bool_t survivedTPCnclCut = AliAnalysisTaskPID::TPCnclCut(inclusiveaod);
             
             Int_t label = TMath::Abs(inclusiveaod->GetLabel());
             
@@ -2788,7 +2789,9 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
                                                                   centPercent,
                                                                   -1, -1, -1 };// no jet pT etc since inclusive spectrum 
               for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) {
-                if (survivedTPCCutMIGeo || !fInclusivePIDtask[i]->GetUseTPCCutMIGeo())
+                if ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) ||
+                    (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) ||
+                    (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))
                   fInclusivePIDtask[i]->FillEfficiencyContainer(value, AliAnalysisTaskPID::kStepRecWithGenCuts);
               }
                   
@@ -2796,7 +2799,9 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
                                                                       inclusiveaod->Charge(), centPercent,
                                                                       -1, -1, -1 };// no jet pT etc since inclusive spectrum 
               for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) {
-                if (survivedTPCCutMIGeo || !fInclusivePIDtask[i]->GetUseTPCCutMIGeo())
+                if ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) ||
+                    (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) ||
+                    (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))
                   fInclusivePIDtask[i]->FillEfficiencyContainer(valueMeas, AliAnalysisTaskPID::kStepRecWithGenCutsMeasuredObs);
               }
             }
@@ -2820,6 +2825,7 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
               continue;
             
             Bool_t survivedTPCCutMIGeo = AliAnalysisTaskPID::TPCCutMIGeo(inclusiveaod, InputEvent());
+            Bool_t survivedTPCnclCut = AliAnalysisTaskPID::TPCnclCut(inclusiveaod);
             
             Int_t label = TMath::Abs(inclusiveaod->GetLabel());
 
@@ -2831,7 +2837,9 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
               pdg = gentrack->GetPdgCode();
             
             for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) {
-              if (survivedTPCCutMIGeo || !fInclusivePIDtask[i]->GetUseTPCCutMIGeo())
+              if ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) ||
+                  (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) ||
+                  (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))
                 fInclusivePIDtask[i]->ProcessTrack(inclusiveaod, pdg, centPercent, -1); // no jet pT since inclusive spectrum 
             }
             
@@ -2841,13 +2849,17 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
                                                                             inclusiveaod->Charge(), centPercent,
                                                                             -1, -1, -1 };
               for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) {
-                if (survivedTPCCutMIGeo || !fInclusivePIDtask[i]->GetUseTPCCutMIGeo())
+                if ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) ||
+                    (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) ||
+                    (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))
                   fInclusivePIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObs);
               }
               
               Double_t weight = IsSecondaryWithStrangeMotherMC(gentrack) ? GetMCStrangenessFactorCMS(gentrack) : 1.0;
               for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) {
-                if (survivedTPCCutMIGeo || !fInclusivePIDtask[i]->GetUseTPCCutMIGeo())
+                if ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) ||
+                    (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) ||
+                    (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))
                   fInclusivePIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, 
                                                                 AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsStrangenessScaled,
                                                                 weight);
@@ -2863,7 +2875,9 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
                                                                                   gentrack->Charge() / 3., centPercent };
               
                 for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) {
-                  if (survivedTPCCutMIGeo || !fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) {
+                  if ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) ||
+                      (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) ||
+                      (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut())) {
                     fInclusivePIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, 
                                                                   AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsPrimaries);
                     fInclusivePIDtask[i]->FillEfficiencyContainer(valueGenAllCuts, 
@@ -3133,6 +3147,7 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
           continue;
         
         Bool_t survivedTPCCutMIGeo = AliAnalysisTaskPID::TPCCutMIGeo(aodtrack, InputEvent());
+        Bool_t survivedTPCnclCut = AliAnalysisTaskPID::TPCnclCut(aodtrack);
             
         Int_t label = TMath::Abs(aodtrack->GetLabel());
 
@@ -3153,13 +3168,17 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
           Double_t valueRecAllCuts[AliAnalysisTaskPID::kEffNumAxes] = { mcID, pT, aodtrack->Eta(), aodtrack->Charge(),
                                                                         centPercent, jetPt, z, xi };
           for (Int_t i = 0; i < fNumJetPIDtasks; i++) {
-            if (survivedTPCCutMIGeo || !fJetPIDtask[i]->GetUseTPCCutMIGeo())
+            if ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) ||
+                (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) ||
+                (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))
               fJetPIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObs);
           }
           
           Double_t weight = IsSecondaryWithStrangeMotherMC(gentrack) ? GetMCStrangenessFactorCMS(gentrack) : 1.0;
           for (Int_t i = 0; i < fNumJetPIDtasks; i++) {
-            if (survivedTPCCutMIGeo || !fJetPIDtask[i]->GetUseTPCCutMIGeo())
+            if ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) ||
+                (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) ||
+                (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))
               fJetPIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, 
                                                       AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsStrangenessScaled,
                                                       weight);
@@ -3177,7 +3196,9 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
             Double_t valuePtResolution[AliAnalysisTaskPID::kPtResNumAxes] = { jetPt, genPt, pT, gentrack->Charge() / 3., centPercent };
             
             for (Int_t i = 0; i < fNumJetPIDtasks; i++) {
-              if (survivedTPCCutMIGeo || !fJetPIDtask[i]->GetUseTPCCutMIGeo()) {
+              if ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) ||
+                  (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) ||
+                  (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut())) {
                 fJetPIDtask[i]->FillEfficiencyContainer(valueRecAllCuts,
                                                         AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsPrimaries);
                 fJetPIDtask[i]->FillEfficiencyContainer(valueGenAllCuts,
@@ -3190,11 +3211,15 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
         }
         
         for (Int_t i = 0; i < fNumJetPIDtasks; i++) {
-          if (survivedTPCCutMIGeo || !fJetPIDtask[i]->GetUseTPCCutMIGeo())
+          if ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) ||
+              (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) ||
+              (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))
             fJetPIDtask[i]->ProcessTrack(aodtrack, pdg, centPercent, jetPt);
         }
         
-        if (fIDFFMode && (survivedTPCCutMIGeo || !fJetPIDtask[0]->GetUseTPCCutMIGeo())) {
+        if (fIDFFMode && ((!fJetPIDtask[0]->GetUseTPCCutMIGeo() && !fJetPIDtask[0]->GetUseTPCnclCut()) ||
+            (survivedTPCCutMIGeo && fJetPIDtask[0]->GetUseTPCCutMIGeo()) ||
+            (survivedTPCnclCut && fJetPIDtask[0]->GetUseTPCnclCut()))) {
           // NOTE: Just take particle fraction from first task (should anyway be the same for all tasks)
           Int_t pidWeightedSpecies = fJetPIDtask[0]->GetRandomParticleTypeAccordingToParticleFractions(pT, jetPt,
                                                                                                        centPercent, kTRUE);
@@ -3242,14 +3267,18 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
           Double_t value[AliAnalysisTaskPID::kEffNumAxes] = { mcID, genPt, gentrack->Eta(), gentrack->Charge() / 3.,
                                                               centPercent, jetPt, genZ, genXi };
           for (Int_t i = 0; i < fNumJetPIDtasks; i++) {
-            if (survivedTPCCutMIGeo || !fJetPIDtask[i]->GetUseTPCCutMIGeo())
+            if ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) ||
+                (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) ||
+                (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))
               fJetPIDtask[i]->FillEfficiencyContainer(value, AliAnalysisTaskPID::kStepRecWithGenCuts);
           }
           
           Double_t valueMeas[AliAnalysisTaskPID::kEffNumAxes] = { mcID, measPt, aodtrack->Eta(), aodtrack->Charge(),
                                                                   centPercent, jetPt, measZ, measXi };
           for (Int_t i = 0; i < fNumJetPIDtasks; i++) {
-            if (survivedTPCCutMIGeo || !fJetPIDtask[i]->GetUseTPCCutMIGeo())
+            if ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) ||
+                (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) ||
+                (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))
               fJetPIDtask[i]->FillEfficiencyContainer(valueMeas, AliAnalysisTaskPID::kStepRecWithGenCutsMeasuredObs);
           }
         }
index 64b6f8bc698a4db47a24f5a5de85b1ff684dba47..2ad8b6ecc958bcc33cb0664977657b742ab2233b 100644 (file)
@@ -905,9 +905,6 @@ void AliAnalysisTaskPID::UserExec(Option_t *)
     
     
     // Apply detector level track cuts
-    //if (track->GetTPCsignalN() < 60)
-    //  continue;
-    
     Double_t dEdxTPC = fPIDResponse->IsTunedOnData() ? fPIDResponse->GetTPCsignalTunedOnData(track) : track->GetTPCsignal();
     if (dEdxTPC <= 0)
       continue;
@@ -915,10 +912,14 @@ void AliAnalysisTaskPID::UserExec(Option_t *)
     if(fTrackFilter && !fTrackFilter->IsSelected(track))
       continue;
     
-    if (fUseTPCCutMIGeo) {
+    if (GetUseTPCCutMIGeo()) {
       if (!TPCCutMIGeo(track, fEvent))
         continue;
     }
+    else if (GetUseTPCnclCut()) {
+      if (!TPCnclCut(track))
+        continue;
+    }
     
     if(fUsePhiCut) {
       if (!PhiPrimeCut(track, magField))
@@ -1877,6 +1878,15 @@ void AliAnalysisTaskPID::PrintSettings(Bool_t printSystematicsSettings) const
   printf("Eta cut: %.2f <= |eta| <= %.2f\n", GetEtaAbsCutLow(), GetEtaAbsCutUp());
   printf("Phi' cut: %d\n", GetUsePhiCut());
   printf("TPCCutMIGeo: %d\n", GetUseTPCCutMIGeo());
+  if (GetUseTPCCutMIGeo()) {
+    printf("GetCutGeo: %f\n", GetCutGeo());
+    printf("GetCutNcr: %f\n", GetCutNcr());
+    printf("GetCutNcl: %f\n", GetCutNcl());
+  }
+  printf("TPCnclCut: %d\n", GetUseTPCnclCut());
+  if (GetUseTPCnclCut()) {
+    printf("GetCutPureNcl: %d\n", GetCutPureNcl());
+  }
   
   printf("\n");
   
index 49e0341eed0454447f870c76d60456514e2bc979..577900cd84b99c9cffbb0f3dbb063290df885962 100644 (file)
@@ -40,6 +40,8 @@ Double_t AliAnalysisTaskPIDV0base::fgCutGeo = 1.;
 Double_t AliAnalysisTaskPIDV0base::fgCutNcr = 0.85; 
 Double_t AliAnalysisTaskPIDV0base::fgCutNcl = 0.7;  
 
+UShort_t AliAnalysisTaskPIDV0base::fgCutPureNcl = 60;
+
 //________________________________________________________________________
 AliAnalysisTaskPIDV0base::AliAnalysisTaskPIDV0base()
   : AliAnalysisTaskSE()
@@ -50,7 +52,7 @@ AliAnalysisTaskPIDV0base::AliAnalysisTaskPIDV0base()
   , fV0KineCuts(0x0)
   , fIsPbpOrpPb(kFALSE)
   , fUsePhiCut(kFALSE)
-  , fUseTPCCutMIGeo(kFALSE)
+  , fTPCcutType(kNoCut)
   , fZvtxCutEvent(10.0)
   , fEtaCut(0.9)
   , fPhiCutLow(0x0)
@@ -84,7 +86,7 @@ AliAnalysisTaskPIDV0base::AliAnalysisTaskPIDV0base(const char *name)
   , fV0KineCuts(0x0)
   , fIsPbpOrpPb(kFALSE)
   , fUsePhiCut(kFALSE)
-  , fUseTPCCutMIGeo(kFALSE)
+  , fTPCcutType(kNoCut)
   , fZvtxCutEvent(10.0)
   , fEtaCut(0.9)
   , fPhiCutLow(0x0)
@@ -498,3 +500,17 @@ Bool_t AliAnalysisTaskPIDV0base::TPCCutMIGeo(const AliVTrack* track, const AliVE
   
   return kout;
 }
+
+
+//________________________________________________________________________
+Bool_t AliAnalysisTaskPIDV0base::TPCnclCut(const AliVTrack* track)
+{
+  //
+  // TPC Cut on TPCsignalN() only
+  //
+
+  if (!track)
+    return kFALSE;
+  
+  return (track->GetTPCsignalN() >= fgCutPureNcl);
+}
index 019b79675b70be0bf0953446876e6d87cda401b2..e0a64448a072e55f6e6f5fe56314270cea2813e0 100644 (file)
-#ifndef ALIANALYSISTASKPIDV0BASE_H\r
-#define ALIANALYSISTASKPIDV0BASE_H\r
-\r
-/*\r
-This class is a base class for all other\r
-analysis tasks that use V0's.\r
-It provides basics for V0 identification.\r
-In addition, some further basic functions are provided.\r
-\r
-Class written by Benjamin Hess.\r
-Contact: bhess@cern.ch\r
-*/\r
-\r
-class TF1;\r
-class TRandom3;\r
-class TObjArray;\r
-class AliVEvent;\r
-class AliESDEvent;\r
-class AliMCEvent;\r
-class AliPIDResponse;\r
-class AliESDv0KineCuts;\r
-class AliPID;\r
-class AliAnalysisFilter;\r
-class AliVTrack;\r
-\r
-#include <TTreeStream.h>\r
-#include "AliInputEventHandler.h"\r
-#include "AliTOFPIDResponse.h"\r
-#include "AliAnalysisTaskSE.h"\r
-\r
-class AliAnalysisTaskPIDV0base : public AliAnalysisTaskSE {\r
- public:\r
-  AliAnalysisTaskPIDV0base();\r
-  AliAnalysisTaskPIDV0base(const char *name);\r
-  virtual ~AliAnalysisTaskPIDV0base();\r
-  \r
-  virtual void   UserCreateOutputObjects();\r
-  virtual void   UserExec(Option_t *option);\r
-  virtual void   Terminate(const Option_t*);\r
-  \r
-  virtual Bool_t GetVertexIsOk(AliVEvent* event) const;\r
-  \r
-  virtual Bool_t GetIsPbpOrpPb() const { return fIsPbpOrpPb; };\r
-  virtual void SetIsPbpOrpPb(Bool_t newValue) { fIsPbpOrpPb = newValue; };\r
-  \r
-  virtual Double_t GetZvtxCutEvent() const { return fZvtxCutEvent; };\r
-  virtual void SetZvtxCutEvent(Double_t newValue) { fZvtxCutEvent = newValue; };\r
-  \r
-  virtual Bool_t GetUsePhiCut() const { return fUsePhiCut; };\r
-  virtual void SetUsePhiCut(Bool_t newValue) { fUsePhiCut = newValue; };\r
-  \r
-  virtual Bool_t GetUseTPCCutMIGeo() const { return fUseTPCCutMIGeo; };\r
-  virtual void SetUseTPCCutMIGeo(Bool_t newValue) { fUseTPCCutMIGeo = newValue; };\r
-  \r
-  virtual Double_t GetEtaCut() const { return fEtaCut; };     \r
-  virtual void  SetEtaCut(Double_t etaCut){ fEtaCut = etaCut; };\r
-  \r
-  virtual const AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; };\r
-  virtual void  SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}\r
-  \r
-  virtual Char_t GetV0tag(Int_t trackIndex) const;\r
-  \r
-  virtual Bool_t GetStoreMotherIndex() const { return fStoreMotherIndex; };\r
-  virtual void SetStoreMotherIndex(Bool_t newValue) { fStoreMotherIndex = newValue; };\r
-  \r
-  virtual Int_t GetV0motherIndex(Int_t trackIndex) const;\r
-  \r
-  virtual Double_t GetPhiPrime(Double_t phi, Double_t magField, Int_t charge) const;\r
-  virtual Bool_t PhiPrimeCut(const AliVTrack* track, Double_t magField) const;\r
-  virtual Bool_t PhiPrimeCut(Double_t trackPt, Double_t trackPhi, Short_t trackCharge, Double_t magField) const;\r
-  virtual Float_t GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse, const Double_t* times, \r
-                              AliPID::EParticleType type) const;\r
-  \r
-  static Double_t GetCutGeo() { return fgCutGeo; };\r
-  static Double_t GetCutNcr() { return fgCutNcr; };\r
-  static Double_t GetCutNcl() { return fgCutNcl; };\r
-  \r
-  static void SetCutGeo(Double_t value) { fgCutGeo = value; };\r
-  static void SetCutNcr(Double_t value) { fgCutNcr = value; };\r
-  static void SetCutNcl(Double_t value) { fgCutNcl = value; };\r
-  \r
-  static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliVEvent* evt, TTreeStream* streamer = 0x0);\r
-  static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliInputEventHandler* evtHandler, TTreeStream* streamer = 0x0)\r
-    { if (!evtHandler) return kFALSE; return TPCCutMIGeo(track, evtHandler->GetEvent(), streamer); };\r
-  \r
- protected:\r
-  static Double_t fgCutGeo;   // Cut variable for TPCCutMIGeo concerning geometry\r
-  static Double_t fgCutNcr; // Cut variable for TPCCutMIGeo concerning num crossed rows\r
-  static Double_t fgCutNcl;  // Cut variable for TPCCutMIGeo concerning num clusters\r
-  \r
-  AliVEvent   *fEvent;    //! VEvent object\r
-  AliESDEvent *fESD;      //! ESDEvent object, if ESD\r
-  AliMCEvent  *fMC;       //! MC object\r
-\r
-  AliPIDResponse *fPIDResponse;    //! PID response Handler\r
-  AliESDv0KineCuts *fV0KineCuts;       //! ESD V0 kine cuts\r
-  \r
-  Bool_t fIsPbpOrpPb;       // Pbp/pPb collision or something else?\r
-  Bool_t fUsePhiCut;        // Use cut on phi (useful for TPC)\r
-  Bool_t fUseTPCCutMIGeo;   // Use geometrical cut for TPC \r
-  Double_t fZvtxCutEvent;   // Vertex z cut for the event (cm)\r
-  Double_t fEtaCut;         // Eta cut\r
-  \r
-  TF1* fPhiCutLow;          // phi prime cut, low\r
-  TF1* fPhiCutHigh;         // phi prime cut, high\r
-  \r
-  TRandom3* fRandom;        //! Can be used to statistically determine the shape in the pt bins e.g.\r
-  \r
-  AliAnalysisFilter* fTrackFilter; // Track Filter\r
-  \r
-\r
-  Int_t fNumTagsStored;     // Number of entries of fV0tags\r
-  Char_t* fV0tags;         //! Pointer to array with tags for identified particles from V0 decays\r
-  \r
-  Bool_t fStoreMotherIndex; // Switch on/off storing the mother indices of V0 daughters\r
-  Int_t* fV0motherIndex; //! Pointer to array with index of the mother V0\r
-  \r
- private:\r
-  void FillV0PIDlist(AliESDEvent* esdEvent = 0x0);\r
-  void ClearV0PIDlist();\r
-  \r
-  AliAnalysisTaskPIDV0base(const AliAnalysisTaskPIDV0base&); // not implemented\r
-  AliAnalysisTaskPIDV0base& operator=(const AliAnalysisTaskPIDV0base&); // not implemented\r
-  \r
-  ClassDef(AliAnalysisTaskPIDV0base, 1);\r
-};\r
-\r
-\r
-\r
-inline Float_t AliAnalysisTaskPIDV0base::GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse,\r
-                                                     const Double_t* times, AliPID::EParticleType type) const\r
-{\r
-  return (track->GetTOFsignal() - tofPIDresponse->GetStartTime(track->P()) - times[type]);\r
-}\r
-\r
-#endif\r
+#ifndef ALIANALYSISTASKPIDV0BASE_H
+#define ALIANALYSISTASKPIDV0BASE_H
+
+/*
+This class is a base class for all other
+analysis tasks that use V0's.
+It provides basics for V0 identification.
+In addition, some further basic functions are provided.
+
+Class written by Benjamin Hess.
+Contact: bhess@cern.ch
+*/
+
+class TF1;
+class TRandom3;
+class TObjArray;
+class AliVEvent;
+class AliESDEvent;
+class AliMCEvent;
+class AliPIDResponse;
+class AliESDv0KineCuts;
+class AliPID;
+class AliAnalysisFilter;
+class AliVTrack;
+
+#include <TTreeStream.h>
+#include "AliInputEventHandler.h"
+#include "AliTOFPIDResponse.h"
+#include "AliAnalysisTaskSE.h"
+
+class AliAnalysisTaskPIDV0base : public AliAnalysisTaskSE {
+ public:
+  enum TPCcutType { kNoCut = 0, kTPCCutMIGeo = 1, kTPCnclCut = 2 };
+  AliAnalysisTaskPIDV0base();
+  AliAnalysisTaskPIDV0base(const char *name);
+  virtual ~AliAnalysisTaskPIDV0base();
+  
+  virtual void   UserCreateOutputObjects();
+  virtual void   UserExec(Option_t *option);
+  virtual void   Terminate(const Option_t*);
+  
+  virtual Bool_t GetVertexIsOk(AliVEvent* event) const;
+  
+  virtual Bool_t GetIsPbpOrpPb() const { return fIsPbpOrpPb; };
+  virtual void SetIsPbpOrpPb(Bool_t newValue) { fIsPbpOrpPb = newValue; };
+  
+  virtual Double_t GetZvtxCutEvent() const { return fZvtxCutEvent; };
+  virtual void SetZvtxCutEvent(Double_t newValue) { fZvtxCutEvent = newValue; };
+  
+  virtual Bool_t GetUsePhiCut() const { return fUsePhiCut; };
+  virtual void SetUsePhiCut(Bool_t newValue) { fUsePhiCut = newValue; };
+  
+  virtual TPCcutType GetTPCcutType() const { return fTPCcutType; };
+  virtual Bool_t GetUseTPCCutMIGeo() const { return (fTPCcutType == kTPCCutMIGeo); };
+  virtual Bool_t GetUseTPCnclCut() const { return (fTPCcutType == kTPCnclCut); };
+  
+  virtual void SetTPCcutType(TPCcutType newType) { fTPCcutType = newType; };
+  
+  virtual Double_t GetEtaCut() const { return fEtaCut; };     
+  virtual void  SetEtaCut(Double_t etaCut){ fEtaCut = etaCut; };
+  
+  virtual const AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; };
+  virtual void  SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}
+  
+  virtual Char_t GetV0tag(Int_t trackIndex) const;
+  
+  virtual Bool_t GetStoreMotherIndex() const { return fStoreMotherIndex; };
+  virtual void SetStoreMotherIndex(Bool_t newValue) { fStoreMotherIndex = newValue; };
+  
+  virtual Int_t GetV0motherIndex(Int_t trackIndex) const;
+  
+  virtual Double_t GetPhiPrime(Double_t phi, Double_t magField, Int_t charge) const;
+  virtual Bool_t PhiPrimeCut(const AliVTrack* track, Double_t magField) const;
+  virtual Bool_t PhiPrimeCut(Double_t trackPt, Double_t trackPhi, Short_t trackCharge, Double_t magField) const;
+  virtual Float_t GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse, const Double_t* times, 
+                              AliPID::EParticleType type) const;
+  
+  static Double_t GetCutGeo() { return fgCutGeo; };
+  static Double_t GetCutNcr() { return fgCutNcr; };
+  static Double_t GetCutNcl() { return fgCutNcl; };
+  
+  static void SetCutGeo(Double_t value) { fgCutGeo = value; };
+  static void SetCutNcr(Double_t value) { fgCutNcr = value; };
+  static void SetCutNcl(Double_t value) { fgCutNcl = value; };
+  
+  static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliVEvent* evt, TTreeStream* streamer = 0x0);
+  static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliInputEventHandler* evtHandler, TTreeStream* streamer = 0x0)
+    { if (!evtHandler) return kFALSE; return TPCCutMIGeo(track, evtHandler->GetEvent(), streamer); };
+  
+  static UShort_t GetCutPureNcl() { return fgCutPureNcl; };
+  static void SetCutPureNcl(UShort_t value) { fgCutPureNcl = value; };
+  
+  static Bool_t TPCnclCut(const AliVTrack* track);
+  
+ protected:
+  static Double_t fgCutGeo;   // Cut variable for TPCCutMIGeo concerning geometry
+  static Double_t fgCutNcr; // Cut variable for TPCCutMIGeo concerning num crossed rows
+  static Double_t fgCutNcl;  // Cut variable for TPCCutMIGeo concerning num clusters
+  
+  static UShort_t fgCutPureNcl; // Cut variable for TPCnclCut
+  
+  AliVEvent   *fEvent;    //! VEvent object
+  AliESDEvent *fESD;      //! ESDEvent object, if ESD
+  AliMCEvent  *fMC;       //! MC object
+
+  AliPIDResponse *fPIDResponse;    //! PID response Handler
+  AliESDv0KineCuts *fV0KineCuts;       //! ESD V0 kine cuts
+  
+  Bool_t fIsPbpOrpPb;       // Pbp/pPb collision or something else?
+  Bool_t fUsePhiCut;        // Use cut on phi (useful for TPC)
+  TPCcutType fTPCcutType;   // Type of TPC cut to be used
+  Double_t fZvtxCutEvent;   // Vertex z cut for the event (cm)
+  Double_t fEtaCut;         // Eta cut
+  
+  TF1* fPhiCutLow;          // phi prime cut, low
+  TF1* fPhiCutHigh;         // phi prime cut, high
+  
+  TRandom3* fRandom;        //! Can be used to statistically determine the shape in the pt bins e.g.
+  
+  AliAnalysisFilter* fTrackFilter; // Track Filter
+  
+
+  Int_t fNumTagsStored;     // Number of entries of fV0tags
+  Char_t* fV0tags;         //! Pointer to array with tags for identified particles from V0 decays
+  
+  Bool_t fStoreMotherIndex; // Switch on/off storing the mother indices of V0 daughters
+  Int_t* fV0motherIndex; //! Pointer to array with index of the mother V0
+  
+ private:
+  void FillV0PIDlist(AliESDEvent* esdEvent = 0x0);
+  void ClearV0PIDlist();
+  
+  AliAnalysisTaskPIDV0base(const AliAnalysisTaskPIDV0base&); // not implemented
+  AliAnalysisTaskPIDV0base& operator=(const AliAnalysisTaskPIDV0base&); // not implemented
+  
+  ClassDef(AliAnalysisTaskPIDV0base, 1);
+};
+
+
+
+inline Float_t AliAnalysisTaskPIDV0base::GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse,
+                                                     const Double_t* times, AliPID::EParticleType type) const
+{
+  return (track->GetTOFsignal() - tofPIDresponse->GetStartTime(track->P()) - times[type]);
+}
+
+#endif