Updates in LC->Kos+proton code (Annalisa)
authorfprino <prino@to.infn.it>
Thu, 13 Feb 2014 17:06:45 +0000 (18:06 +0100)
committerfprino <prino@to.infn.it>
Thu, 13 Feb 2014 17:06:45 +0000 (18:06 +0100)
13 files changed:
PWGHF/vertexingHF/AliAODRecoCascadeHF.cxx
PWGHF/vertexingHF/AliAnalysisTaskSEHFQA.cxx
PWGHF/vertexingHF/AliAnalysisTaskSELc2V0bachelor.cxx
PWGHF/vertexingHF/AliAnalysisTaskSELc2V0bachelor.h
PWGHF/vertexingHF/AliCFTaskVertexingHF.cxx
PWGHF/vertexingHF/AliCFVertexingHFLctoV0bachelor.cxx
PWGHF/vertexingHF/AliHFSystErr.cxx
PWGHF/vertexingHF/AliHFSystErr.h
PWGHF/vertexingHF/AliRDHFCutsLctoV0.cxx
PWGHF/vertexingHF/AliRDHFCutsLctoV0.h
PWGHF/vertexingHF/macros/AddTaskCFVertexingHFLctoV0bachelor.C
PWGHF/vertexingHF/macros/HFPtSpectrum.C
PWGHF/vertexingHF/macros/makeTFile4CutsLctoV0bachelor.C

index 44d5ea7..ddfe39c 100644 (file)
@@ -122,7 +122,7 @@ Int_t AliAODRecoCascadeHF::MatchToMC(Int_t pdgabs,Int_t pdgabs2prong,
   // 
 
   Int_t ndg=GetNDaughters();
-  if(!ndg) {
+  if(ndg==0) {
     AliError("No daughters available");
     return -1;
   }
index d06c56f..df8a100 100644 (file)
@@ -1063,23 +1063,6 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     fOutputFlowObs->Add(hCentVsMultRPS);
   }
 
-  /*
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
-  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
-  if (fCuts->GetIsUsePID() && fDecayChannel==kLambdactoV0) {
-    fCuts->GetPidHF()->SetPidResponse(pidResp);
-    AliRDHFCutsLctoV0* lccuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
-    if(lccuts){
-      lccuts->GetPidV0pos()->SetPidResponse(pidResp);
-      lccuts->GetPidV0neg()->SetPidResponse(pidResp);
-      fCuts->GetPidHF()->SetOldPid(kFALSE);
-      lccuts->GetPidV0pos()->SetOldPid(kFALSE);
-      lccuts->GetPidV0neg()->SetOldPid(kFALSE);
-    }
-  }
-  */
-
   // Post the data
   PostData(1,fNEntries);
 
index ec8d1f2..692881f 100644 (file)
@@ -66,8 +66,6 @@
 #include "AliAnalysisTaskSELc2V0bachelor.h"
 #include "AliNormalizationCounter.h"
 #include "AliAODPidHF.h"
-#include "AliPIDResponse.h"
-#include "AliTOFPIDResponse.h"
 #include "AliInputEventHandler.h"
 #include "AliESDtrackCuts.h"
 #include "AliNeutralTrackParam.h"
@@ -84,7 +82,6 @@ AliAnalysisTaskSELc2V0bachelor::AliAnalysisTaskSELc2V0bachelor() : AliAnalysisTa
   fOutputAll(0),
   fOutputPIDBach(0),
   fCEvents(0),
-  fPIDResponse(0),
   fIsK0SAnalysis(kFALSE),
   fCounter(0),
   fAnalCuts(0),
@@ -111,7 +108,6 @@ AliAnalysisTaskSELc2V0bachelor::AliAnalysisTaskSELc2V0bachelor(const Char_t* nam
   fOutputAll(0),
   fOutputPIDBach(0),
   fCEvents(0),
-  fPIDResponse(0),
   fIsK0SAnalysis(kFALSE),
   fCounter(0),
   fAnalCuts(analCuts),
@@ -164,10 +160,6 @@ AliAnalysisTaskSELc2V0bachelor::~AliAnalysisTaskSELc2V0bachelor() {
     fOutputPIDBach = 0;
   }
 
-  if (fPIDResponse) {
-    delete  fPIDResponse;
-  }
-
   if (fCounter) {
     delete fCounter;
     fCounter = 0;
@@ -278,6 +270,14 @@ void AliAnalysisTaskSELc2V0bachelor::UserExec(Option_t *)
       return;
     }
     fCEvents->Fill(5); // in case of MC events
+
+    Double_t zMCVertex = mcHeader->GetVtxZ();
+    if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
+      AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
+      return;
+    } else {
+      fCEvents->Fill(17); // in case of MC events
+    }
   }
 
   fCounter->StoreEvent(aodEvent,fAnalCuts,fUseMCInfo); // it is very important that it stays BEFORE any other event selection
@@ -351,19 +351,6 @@ void AliAnalysisTaskSELc2V0bachelor::Terminate(Option_t*)
 void AliAnalysisTaskSELc2V0bachelor::UserCreateOutputObjects() { 
   // output
   AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
-  
-  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
-  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
-  fPIDResponse = inputHandler->GetPIDResponse();
-
-  if (fAnalCuts->GetIsUsePID()){
-    fAnalCuts->GetPidHF()->SetPidResponse(fPIDResponse);
-    fAnalCuts->GetPidV0pos()->SetPidResponse(fPIDResponse);
-    fAnalCuts->GetPidV0neg()->SetPidResponse(fPIDResponse);
-    fAnalCuts->GetPidHF()->SetOldPid(kFALSE);
-    fAnalCuts->GetPidV0pos()->SetOldPid(kFALSE);
-    fAnalCuts->GetPidV0neg()->SetOldPid(kFALSE);
-  }
 
   fOutput = new TList();
   fOutput->SetOwner();
@@ -429,6 +416,12 @@ void AliAnalysisTaskSELc2V0bachelor::MakeAnalysisForLc2prK0S(TClonesArray *array
       continue;
     }
 
+    Bool_t unsetvtx=kFALSE;
+    if (!lcK0Spr->GetOwnPrimaryVtx()) {
+      lcK0Spr->SetOwnPrimaryVtx(fVtx1);
+      unsetvtx=kTRUE;
+    }
+
     if (!lcK0Spr->GetSecondaryVtx()) {
       AliInfo("No secondary vertex"); // it will be done in AliRDHFCutsLctoV0::IsSelected
       continue;
@@ -488,7 +481,7 @@ void AliAnalysisTaskSELc2V0bachelor::MakeAnalysisForLc2prK0S(TClonesArray *array
          isLc = 1;
        }
       } else {
-       AliDebug(2,Form("No candidate (cascade number %d -total cascade number = %d -)", iLctopK0S,nCascades));
+       AliDebug(2,Form("No MC candidate (cascade number %d -total cascade number = %d -)", iLctopK0S,nCascades));
        pdgCode=-1;
       }
     }
@@ -496,6 +489,9 @@ void AliAnalysisTaskSELc2V0bachelor::MakeAnalysisForLc2prK0S(TClonesArray *array
     FillLc2pK0Sspectrum(lcK0Spr, isLc,
                        nSelectedAnal, cutsAnal,
                        mcArray);
+
+    if (unsetvtx) lcK0Spr->UnsetOwnPrimaryVtx();
+
   }
 
   AliDebug(2, Form("Found %d Reco particles that are Lc!!", nSelectedAnal));
@@ -532,10 +528,10 @@ void AliAnalysisTaskSELc2V0bachelor::FillLc2pK0Sspectrum(AliAODRecoCascadeHF *pa
 
   if (fAdditionalChecks) CheckCandidatesAtDifferentLevels(part,cutsAnal);
 
-  if ( !( ( (cutsAnal->IsSelected(part,AliRDHFCuts::kTracks))&(AliRDHFCutsLctoV0::kLcToK0Spr)) == (AliRDHFCutsLctoV0::kLcToK0Spr) ) ) return;
-
   if ( !(cutsAnal->IsInFiducialAcceptance(part->Pt(),part->Y(4122))) ) return;
 
+  if ( !( ( (cutsAnal->IsSelected(part,AliRDHFCuts::kTracks))&(AliRDHFCutsLctoV0::kLcToK0Spr)) == (AliRDHFCutsLctoV0::kLcToK0Spr) ) ) return;
+
   if ( ( ( (cutsAnal->IsSelected(part,AliRDHFCuts::kAll))&(AliRDHFCutsLctoV0::kLcToK0Spr)) == (AliRDHFCutsLctoV0::kLcToK0Spr) ) ) nSelectedAnal++;
 
   // Fill candidate variable Tree (track selection, V0 invMass selection)
@@ -1532,7 +1528,21 @@ void AliAnalysisTaskSELc2V0bachelor::FillTheTree(AliAODRecoCascadeHF *part, AliR
   Int_t isDp2K0Spi=0, isDs2K0SK=0;
   Int_t mcLabel2 = -1;
   Int_t mcLabel3 = -1;
+  Double_t ptCandByMC = 0.;//fmcPartCandidate->Pt();
+  Double_t yCandByMC  = 0.;//fmcPartCandidate->Y() ;
   if (fUseMCInfo) {
+    if (isLc) {
+      Int_t pdgCand0 = 4122;
+      Int_t pdgDgLctoV0bachelor0[2]={2212,310};
+      Int_t pdgDgV0toDaughters0[2]={211,211};
+      Int_t mcLabelLc2pK0S = part->MatchToMC(pdgCand0,pdgDgLctoV0bachelor0[1],pdgDgLctoV0bachelor0,pdgDgV0toDaughters0,mcArray,kTRUE);
+      AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabelLc2pK0S);
+      if (lambdaCpartMC) {
+       ptCandByMC = lambdaCpartMC->Pt();
+       yCandByMC  = lambdaCpartMC->Y() ;
+      }
+    }
+
     Int_t pdgCand = 4122;
     Int_t pdgDgLctoV0bachelor[2]={211,3122};
     Int_t pdgDgV0toDaughters[2]={2212,211};
@@ -1540,6 +1550,11 @@ void AliAnalysisTaskSELc2V0bachelor::FillTheTree(AliAODRecoCascadeHF *part, AliR
     if (mcLabel!=-1) {
       if (bachelor->Charge()==-1) isLc2LBarpi=1;
       if (bachelor->Charge()==+1) isLc2Lpi=1;
+      AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel);
+      if (lambdaCpartMC) {
+       ptCandByMC = lambdaCpartMC->Pt();
+       yCandByMC  = lambdaCpartMC->Y() ;
+      }
     }
 
     Int_t pdgCand2 = 411; // D+ -> pi+ K0S
@@ -1550,12 +1565,31 @@ void AliAnalysisTaskSELc2V0bachelor::FillTheTree(AliAODRecoCascadeHF *part, AliR
     pdgDgV0toDaughters[1]=211;
     mcLabel2 = part->MatchToMC(pdgCand2,pdgDgCand2[1],pdgDgCand2,pdgDgV0toDaughters,mcArray,kTRUE);
     mcLabel3 = part->MatchToMC(pdgCand3,pdgDgCand3[1],pdgDgCand3,pdgDgV0toDaughters,mcArray,kTRUE);
-    if (mcLabel2!=-1) isDp2K0Spi=1;
-    if (mcLabel3!=-1) isDs2K0SK=1;
+    if (mcLabel2!=-1) {
+      isDp2K0Spi=1;
+      AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel2);
+      if (lambdaCpartMC) {
+       ptCandByMC = lambdaCpartMC->Pt();
+       yCandByMC  = lambdaCpartMC->Y() ;
+      }
+    }
+    if (mcLabel3!=-1) {
+      isDs2K0SK=1;
+      AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel3);
+      if (lambdaCpartMC) {
+       ptCandByMC = lambdaCpartMC->Pt();
+       yCandByMC  = lambdaCpartMC->Y() ;
+      }
+    }
   }
 
   Int_t isLcByMC = isLc+isLc2LBarpi*2+isLc2Lpi*4+isDp2K0Spi*8+isDs2K0SK*16;
 
+  Bool_t isMCparticleInFiducialAcceptance = kTRUE;
+  if (isLc || isLc2LBarpi || isLc2Lpi || isDp2K0Spi || isDs2K0SK) {
+    isMCparticleInFiducialAcceptance = cutsAnal->IsInFiducialAcceptance(ptCandByMC,yCandByMC);
+  }
+
   Int_t isK0S = 0;
   Int_t isLambda = 0;
   Int_t isLambdaBar = 0;
@@ -1785,6 +1819,18 @@ void AliAnalysisTaskSELc2V0bachelor::FillTheTree(AliAODRecoCascadeHF *part, AliR
   fCandidateVariables[77]=v0part->Y(310);
   fCandidateVariables[78]=pzVtxBachelor;
   fCandidateVariables[79]=v0part->Pz();
+  fCandidateVariables[80]=bachelor->Charge();
+  fCandidateVariables[81]=isMCparticleInFiducialAcceptance;
+  if (fUseMCInfo) {
+    if (bachelor->GetLabel()!=-1) {
+      AliAODMCParticle *partBachelor = dynamic_cast<AliAODMCParticle*>(mcArray->At(TMath::Abs(bachelor->GetLabel())));
+      fCandidateVariables[82]=partBachelor->GetPdgCode();
+    } else {
+      fCandidateVariables[82]=0;
+    }
+  } else {
+    fCandidateVariables[82]=-1;
+  }
 
   //fCandidateVariables[65] = bachelor->Px();
   //fCandidateVariables[66] = bachelor->Py();
@@ -1823,7 +1869,7 @@ void AliAnalysisTaskSELc2V0bachelor::DefineTreeVariables() {
 
   const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
   fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
-  Int_t nVar = 80;
+  Int_t nVar = 83;
   fCandidateVariables = new Float_t [nVar];
   TString * fCandidateVariableNames = new TString[nVar];
   fCandidateVariableNames[ 0]="isLcByMC";
@@ -1906,6 +1952,9 @@ void AliAnalysisTaskSELc2V0bachelor::DefineTreeVariables() {
   fCandidateVariableNames[77]="yV0";
   fCandidateVariableNames[78]="pzVtxBachelorGood";
   fCandidateVariableNames[79]="pzVtxV0";
+  fCandidateVariableNames[80]="bachelorCharge";
+  fCandidateVariableNames[81]="isMCparticleInFiducialAcceptance";
+  fCandidateVariableNames[82]="pdgCodeBachelor";
 
   //fCandidateVariableNames[65]="bachelorPx";
   //fCandidateVariableNames[66]="bachelorPy";
@@ -1944,7 +1993,7 @@ void  AliAnalysisTaskSELc2V0bachelor::DefineGeneralHistograms() {
   // This is to define general histograms
   //
 
-  fCEvents = new TH1F("fCEvents","conter",17,0,17);
+  fCEvents = new TH1F("fCEvents","conter",18,0,18);
   fCEvents->SetStats(kTRUE);
   fCEvents->GetXaxis()->SetBinLabel(1,"X1");
   fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
@@ -1963,6 +2012,7 @@ void  AliAnalysisTaskSELc2V0bachelor::DefineGeneralHistograms() {
   fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
   fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
   fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
+  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
   //fCEvents->GetXaxis()->SetTitle("");
   fCEvents->GetYaxis()->SetTitle("counts");
 
@@ -2340,3 +2390,56 @@ Double_t AliAnalysisTaskSELc2V0bachelor::Det(Double_t a00,Double_t a01,Double_t
   return  a00*Det(a11,a12,a21,a22)-a01*Det(a10,a12,a20,a22)+a02*Det(a10,a11,a20,a21);
 }
 
+//----------------------------------------------------------------------------
+Int_t AliAnalysisTaskSELc2V0bachelor::MatchToMClabelC(AliAODRecoCascadeHF *candidate,
+                                                     TClonesArray *mcArray)
+{
+  //
+  // Check if this candidate is matched to a MC signal  Lc -> p K0S + X
+  // If no, return -1
+  // If yes, return label (>=0) of the AliAODMCParticle
+  // 
+
+  AliAODv0 *theV0 = dynamic_cast<AliAODv0*>(candidate->Getv0()); // the V0
+  AliVTrack *trk = dynamic_cast<AliVTrack*>(candidate->GetBachelor()); // the bachelor
+  if (!trk || !theV0) return -1;
+
+  if (trk->GetLabel()==-1) return -1;
+  Int_t bachLabels = TMath::Abs(trk->GetLabel());
+  AliAODMCParticle*bachelorMC = dynamic_cast<AliAODMCParticle*>(mcArray->At(bachLabels));
+  if (!bachelorMC) return -1;
+  if (TMath::Abs(bachelorMC->GetPdgCode())!=2212) return -1;
+  Int_t indexMotherBach = bachelorMC->GetMother();
+  if (indexMotherBach==-1) return -1;
+
+  Int_t pdgDg2prong[2] = {211,211};
+  Int_t lab2Prong = theV0->MatchToMC(310,mcArray,2,pdgDg2prong); // the V0
+  if(lab2Prong<0) return -1;
+  AliAODMCParticle*partK0S = dynamic_cast<AliAODMCParticle*>(mcArray->At(lab2Prong));
+  if (!partK0S) return -1;
+  Int_t indexMotherK0S = partK0S->GetMother();
+  if (indexMotherK0S==-1) return -1;
+  AliAODMCParticle*partK0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(indexMotherK0S));
+  if (!partK0) return -1;
+  Int_t indexMotherK0 = partK0->GetMother();
+  if (indexMotherK0==-1) return -1;
+
+  if (indexMotherBach!=indexMotherK0) return -1; // p e K0S sono fratelli
+
+  AliAODMCParticle*partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(indexMotherK0));
+  if (!partLc) return -1;
+  Int_t ndg2 = partLc->GetDaughter(1)-partLc->GetDaughter(0)+1;
+  if (ndg2==2) return -1;
+
+  Char_t stringaCheck[100];
+  sprintf(stringaCheck,">>>>>>>> %d -> ",partLc->GetPdgCode());
+  for(Int_t ii=0; ii<ndg2; ii++) {
+    AliAODMCParticle* partDau=(AliAODMCParticle*)(mcArray->At(partLc->GetDaughter(0)+ii));
+    sprintf(stringaCheck," %s %d",stringaCheck,partDau->GetPdgCode());
+  }
+  printf("%s \n",stringaCheck);
+
+  return indexMotherBach;
+
+}
+//-----------------------------------------------------------------------------
index 7448551..423023e 100644 (file)
 #include "AliAODEvent.h"
 #include "AliPID.h"
 #include "AliAODTrack.h"
-#include "AliPIDResponse.h"
-#include "AliTPCPIDResponse.h"
 #include "AliRDHFCutsLctoV0.h"
 #include "AliNormalizationCounter.h"
 
 class TH1F;
+class TClonesArray;
+class AliAODRecoCascade;
 
 class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE 
 {
@@ -73,6 +73,8 @@ class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE
   void SetUseOnTheFlyV0(Bool_t a) { fUseOnTheFlyV0=a; }
   Bool_t GetUseOnTheFlyV0() { return fUseOnTheFlyV0; }
 
+  Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate,TClonesArray *mcArray);
+
  private:
   
   void CheckEventSelection(AliAODEvent *aodEvent);
@@ -90,7 +92,7 @@ class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE
   void DefineGeneralHistograms();
   void DefineAnalysisHistograms();
   void DefineK0SHistos();
-  void  FillAnalysisHistograms(AliAODRecoCascadeHF *part, Bool_t isBachelorID, TString appendthis);
+  void FillAnalysisHistograms(AliAODRecoCascadeHF *part, Bool_t isBachelorID, TString appendthis);
 
   AliAnalysisTaskSELc2V0bachelor(const AliAnalysisTaskSELc2V0bachelor &source);
   AliAnalysisTaskSELc2V0bachelor& operator=(const AliAnalysisTaskSELc2V0bachelor& source); 
@@ -112,7 +114,6 @@ class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE
   TList *fOutputPIDBach;      // User output slot 5 // histos with PID on Bachelor
 
   TH1F *fCEvents;                    // Histogram to check selected events
-  AliPIDResponse *fPIDResponse;      //! PID response object
   Bool_t fIsK0SAnalysis;             // switch between Lpi and K0Sp
   AliNormalizationCounter *fCounter; // AliNormalizationCounter on output slot 2
   AliRDHFCutsLctoV0 *fAnalCuts;      // Cuts - sent to output slot 3
@@ -127,7 +128,7 @@ class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE
   Float_t fBzkG;                      // magnetic field value [kG]
   Bool_t fAdditionalChecks;           // flag to fill additional histograms
 
-  ClassDef(AliAnalysisTaskSELc2V0bachelor,4); // class for Lc->p K0
+  ClassDef(AliAnalysisTaskSELc2V0bachelor,5); // class for Lc->p K0
 };
 
 #endif
index 816bfd7..5d27965 100644 (file)
@@ -1153,22 +1153,25 @@ void AliCFTaskVertexingHF::Terminate(Option_t*)
     } else if (fDecayChannel==22) {
       //nvarToPlot = 16;
       titles = new TString[nvarToPlot];
-      titles[0]="pT_Lc (GeV/c)";
-      titles[1]="rapidity";
-      titles[2]="phi (rad)";
-      titles[3]="cosPAV0";
-      titles[4]="onTheFlyStatusV0";
+      titles[0]="p_{T}(#Lambda_{c}) [GeV/c]";
+      titles[1]="y(#Lambda_{c})";
+      titles[2]="#varphi(#Lambda_{c}) [rad]";
+      titles[3]="onTheFlyStatusV0";
+      titles[4]="z_{vtx} [cm]";
       titles[5]="centrality";
       titles[6]="fake";
       titles[7]="multiplicity";
-      titles[8]="pT_bachelor (GeV/c)";
-      titles[9]="pT_V0pos (GeV/c)";
-      titles[10]="pT_V0neg (GeV/c)";
-      titles[11]="invMassV0 (GeV/c2)";
-      titles[12]="dcaV0 (nSigma)";
-      titles[13]="c#tauV0 (#mum)";
-      titles[14]="c#tau (#mum)";
-      titles[15]="cosPA";
+      //titles[8]="pT(bachelor) [GeV/c]";
+      titles[8]="p(bachelor) [GeV/c]";
+      titles[9]="p_{T}(V0) [GeV/c]";
+      titles[10]="y(V0)";
+      titles[11]="#varphi(V0) [rad]";
+      titles[12]="m_{inv}(#pi^{+}#pi^{+}) [GeV/c^{2}]";
+      titles[13]="dcaV0 (nSigma)";
+      titles[14]="cosine pointing angle (V0)";
+      titles[15]="cosine pointing angle (#Lambda_{c})";
+      //titles[16]="c#tauV0 (#mum)";
+      //titles[17]="c#tau (#mum)";
     } else {
       //nvarToPlot = 12;
       titles = new TString[nvarToPlot];
@@ -1190,11 +1193,11 @@ void AliCFTaskVertexingHF::Terminate(Option_t*)
     //nvarToPlot = 8;
     titles = new TString[nvarToPlot];
     if (fDecayChannel==22) {
-      titles[0]="pT_candidate (GeV/c)";
-      titles[1]="rapidity";
-      titles[2]="phi (rad)";
-      titles[3]="cosPAV0";
-      titles[4]="onTheFlyStatusV0";
+      titles[0]="p_{T}(#Lambda_{c}) [GeV/c]";
+      titles[1]="y(#Lambda_{c})";
+      titles[2]="#varphi(#Lambda_{c}) [rad]";
+      titles[3]="onTheFlyStatusV0";
+      titles[4]="z_{vtx} [cm]";
       titles[5]="centrality";
       titles[6]="fake";
       titles[7]="multiplicity";
@@ -1319,23 +1322,6 @@ void AliCFTaskVertexingHF::UserCreateOutputObjects()
   //TO BE SET BEFORE THE EXECUTION OF THE TASK
   //
   Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName());
-       
-  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
-  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
-  AliPIDResponse *localPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
-
-  if (fCuts->GetIsUsePID() && fDecayChannel==22) {
-         
-    fCuts->GetPidHF()->SetPidResponse(localPIDResponse);
-    fCuts->GetPidHF()->SetOldPid(kFALSE);
-    AliRDHFCutsLctoV0* lcv0Cuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
-    if(lcv0Cuts){
-      lcv0Cuts->GetPidV0pos()->SetPidResponse(localPIDResponse);
-      lcv0Cuts->GetPidV0neg()->SetPidResponse(localPIDResponse);
-      lcv0Cuts->GetPidV0pos()->SetOldPid(kFALSE);
-      lcv0Cuts->GetPidV0neg()->SetOldPid(kFALSE);
-    }
-  }
 
   //slot #1
   OpenFile(1);
index 01bdb23..fc877cc 100644 (file)
@@ -343,15 +343,17 @@ Bool_t AliCFVertexingHFLctoV0bachelor::GetRecoValuesFromCandidate(Double_t *vect
 
   Double_t cosPAwrtPrimVtxV0 = lcV0bachelor->CosV0PointingAngle();
 
-  Double_t pTbachelor = bachelor->Pt();
-  Double_t pTV0pos = v0positiveTrack->Pt();
-  Double_t pTV0neg = v0negativeTrack->Pt();
+  //Double_t pTbachelor = bachelor->Pt();
+  Double_t pbachelor = bachelor->P();
+  //Double_t pTV0pos = v0positiveTrack->Pt();
+  //Double_t pTV0neg = v0negativeTrack->Pt();
   Double_t phi = lcV0bachelor->Phi();
   Double_t dcaV0 = v0toDaughters->GetDCA();
-  Double_t cTLc = lcV0bachelor->Ct(4122); // wrt PrimVtx
+  //Double_t cTLc = lcV0bachelor->Ct(4122); // wrt PrimVtx
   //Double_t dcaLc = lcV0bachelor->GetDCA();
   Double_t cosPointingAngleLc = lcV0bachelor->CosPointingAngle();
 
+  /*
   Double_t cTV0 = 0.;
   AliAODVertex *vtx0 = (AliAODVertex*)lcV0bachelor->GetPrimaryVtx();
   if (!vtx0) {
@@ -364,6 +366,7 @@ Bool_t AliCFVertexingHFLctoV0bachelor::GetRecoValuesFromCandidate(Double_t *vect
       cTV0 = v0toDaughters->Ct(3122,primVtxPos);
     }
   }
+  */
 
   Double_t invMassV0 = 0.;
   if (fGenLcOption==kCountLambdapi) {
@@ -384,21 +387,28 @@ Bool_t AliCFVertexingHFLctoV0bachelor::GetRecoValuesFromCandidate(Double_t *vect
   vectorReco[0]  = pt;
   vectorReco[1]  = rapidity;
   vectorReco[2]  = phi;
-  vectorReco[3]  = cosPAwrtPrimVtxV0;
-  vectorReco[4]  = onTheFlyStatus;
+  vectorReco[3]  = onTheFlyStatus;
+  vectorReco[4]  = fzPrimVertex;
   vectorReco[5]  = fCentValue;
   vectorReco[6]  = fFake; // whether the reconstructed candidate was a fake (fFake = 0) or not (fFake = 2) 
   vectorReco[7]  = fMultiplicity;
 
   if (fConfiguration==AliCFTaskVertexingHF::kSnail) {
-    vectorReco[8]  = pTbachelor;
-    vectorReco[9]  = pTV0pos;
-    vectorReco[10] = pTV0neg;
-    vectorReco[11] = invMassV0;
-    vectorReco[12] = dcaV0;
-    vectorReco[13] = cTV0*1.E4; // in micron
-    vectorReco[14] = cTLc*1.E4; // in micron
+    //vectorReco[8]  = pTbachelor;
+    vectorReco[8]  = pbachelor;
+    vectorReco[9]  = v0toDaughters->Pt();
+    if (fGenLcOption==kCountLambdapi) {
+      vectorReco[10] = v0toDaughters->Y(3122);
+    } else if (fGenLcOption==kCountK0Sp) {
+      vectorReco[10] = v0toDaughters->Y(310);
+    }
+    vectorReco[11] = v0toDaughters->Phi();
+    vectorReco[12] = invMassV0;
+    vectorReco[13] = dcaV0;
+    vectorReco[14] = cosPAwrtPrimVtxV0;
     vectorReco[15] = cosPointingAngleLc;
+    //vectorReco[16] = cTV0*1.E4; // in micron
+    //vectorReco[17] = cTLc*1.E4; // in micron
   }
 
   bFillRecoValues = kTRUE;
@@ -497,6 +507,11 @@ Bool_t AliCFVertexingHFLctoV0bachelor::CheckMCChannelDecay() const
       return checkCD;
     }
 
+    if (mcPartDaughter1->GetNDaughters()!=1) {
+      AliDebug(2, "The K0/K0bar MC particle doesn't decay in 1 particles, skipping!!");
+      return checkCD;
+    }
+
     Int_t daughter = mcPartDaughter1->GetDaughter(0);
     if (daughter<=0) {
       AliDebug(2, Form("The K0/K0bar MC particle doesn't have correct daughter, skipping!!"));
@@ -929,8 +944,9 @@ Bool_t AliCFVertexingHFLctoV0bachelor::FillVectorFromMCarray(AliAODMCParticle *m
     return bGenValues;
   }
 
-  Double_t cTLc = Ctau(fmcPartCandidate); // by default wrt Primary Vtx
-  Double_t pTbach = mcPartDaughterBachelor->Pt(); // get the bachelor pT
+  //Double_t cTLc = Ctau(fmcPartCandidate); // by default wrt Primary Vtx
+  //Double_t pTbach = mcPartDaughterBachelor->Pt(); // get the bachelor pT
+  Double_t pbach = mcPartDaughterBachelor->P(); // get the bachelor p
 
   Double_t vtx1[3] = {0,0,0};   // primary vertex              
   Bool_t hasPrimVtx = fmcPartCandidate->XvYvZv(vtx1);  // cm
@@ -990,12 +1006,14 @@ Bool_t AliCFVertexingHFLctoV0bachelor::FillVectorFromMCarray(AliAODMCParticle *m
   charge = 0;
   AliAODRecoDecayHF* decay = new AliAODRecoDecayHF(vtx1,vtx2daughter0,nprongs,charge,px,py,pz,d0);
   Double_t cosPAwrtPrimVtxV0 = decay->CosPointingAngle();
+  /*
   Double_t cTV0 = 0.; //ct
   if (fGenLcOption==kCountK0Sp) {
     cTV0 = decay->Ct(310); // by default wrt Primary Vtx
   } else if (fGenLcOption==kCountLambdapi) {
     cTV0 = decay->Ct(3122); // by default wrt Primary Vtx
   }
+  */
 
   Double_t invMass = 0.; //invMass
   if (fGenLcOption==kCountK0Sp) {
@@ -1011,21 +1029,24 @@ Bool_t AliCFVertexingHFLctoV0bachelor::FillVectorFromMCarray(AliAODMCParticle *m
   vectorMC[0]  = fmcPartCandidate->Pt();
   vectorMC[1]  = fmcPartCandidate->Y() ;
   vectorMC[2]  = fmcPartCandidate->Phi();
-  vectorMC[3]  = cosPAwrtPrimVtxV0;
-  vectorMC[4]  = 0; // dummy value x MC, onTheFlyStatus
+  vectorMC[3]  = 0; // dummy value x MC, onTheFlyStatus
+  vectorMC[4]  = fzMCVertex;
   vectorMC[5]  = fCentValue; // reconstructed centrality
   vectorMC[6]  = 1; // dummy value x MC, fFake
   vectorMC[7]  = fMultiplicity; // reconstructed multiplicity
 
   if (fConfiguration==AliCFTaskVertexingHF::kSnail) {
-    vectorMC[8]  = pTbach;
-    vectorMC[9]  = mcPartV0DaughterPos->Pt();
-    vectorMC[10] = mcPartV0DaughterNeg->Pt();
-    vectorMC[11] = invMass;
-    vectorMC[12] = 0; // dummy value x MC, V0 DCA
-    vectorMC[13] = cTV0*1.E4; // in micron
-    vectorMC[14] = cTLc*1.E4; // in micron
+    //vectorMC[8]  = pTbach;
+    vectorMC[8]  = pbach;
+    vectorMC[9]  = mcPartDaughterV0->Pt();
+    vectorMC[10] = mcPartDaughterV0->Y();
+    vectorMC[11] = mcPartDaughterV0->Phi();
+    vectorMC[12] = invMass;
+    vectorMC[13] = 0; // dummy value x MC, V0 DCA
+    vectorMC[14] = cosPAwrtPrimVtxV0;
     vectorMC[15] = cosPAwrtPrimVtxLc;
+    //vectorMC[16] = cTV0*1.E4; // in micron
+    //vectorMC[17] = cTLc*1.E4; // in micron
   }
 
   bGenValues = kTRUE;
index a251fd6..b0c3ba8 100644 (file)
@@ -21,7 +21,7 @@
 // Class to handle systematic errors for charm hadrons
 //
 // Usage:
-// AliHFSystEff syst;           // DECAY = 1 for D0, 2, for D+, 3 for D* 
+// AliHFSystEff syst;           // DECAY = 1 for D0, 2, for D+, 3 for D*, 5 for Lc->pKp, 6 for Lc->pK0S
 // syst.SetRunNumber(YEAR);     // YEAR = two last numbers of the year (is 10 for 2010)
 // syst.SetCollisionType(TYPE);  // TYPE =  0 is pp, 1 is PbPb
 // syst.SetCentrality(CENT);     // CENT is centrality, 0100 for MB, 020 (4080) for 0-20 (40-80) CC...
@@ -235,6 +235,10 @@ void AliHFSystErr::Init(Int_t decay){
     if (fCollisionType==0) InitLctopKpi2010pp();
     else AliFatal("Not yet implemented");
     break;
+  case 6: // Lc->pK0S
+    if (fCollisionType==0) InitLctopK0S2010pp();
+    else AliFatal("Not yet implemented");
+    break;
     
   default:
     printf("Invalid decay type: %d\n",decay);
@@ -2248,6 +2252,41 @@ void AliHFSystErr::InitLctopKpi2010pp() {
 }
 
 //--------------------------------------------------------------------------
+void AliHFSystErr::InitLctopK0S2010pp() {
+  //
+  // Lc->pK0S syst errors. Responsible: A. De Caro
+  //  2010 pp sample
+  //  Only tool preparation: no physical mean for these values!
+  //
+
+  // Normalization
+  fNorm = new TH1F("fNorm","fNorm",12,0.,12.);
+  for(Int_t i=1;i<=12;i++) fNorm->SetBinContent(i,0.05); // 5% error on sigmaV0and // only a try
+
+  // Tracking efficiency
+  fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",12,0.,12.);
+  for(Int_t i=1;i<=12;i++) fTrackingEff->SetBinContent(i,0.1); // 10% (4% per track) // only a try
+
+  // Raw yield extraction
+  fRawYield = new TH1F("fRawYield","fRawYield",12,0.,12.);
+  for(Int_t i=1;i<=2;i++) fRawYield->SetBinContent(i,1.); // only a try
+  for(Int_t i=3;i<=12;i++) fRawYield->SetBinContent(i,0.1); // only a try
+
+  fCutsEff = new TH1F("fCutsEff","fCutsEff",12,0.,12.);
+  for(Int_t i=1;i<=12;i++) fCutsEff->SetBinContent(i,0.1); // only a try
+
+  // PID efficiency (from PID/noPID)
+  fPIDEff = new TH1F("fPIDEff","fPIDEff",12,0.,12.);
+  for(Int_t i=1;i<=12;i++) fPIDEff->SetBinContent(i,0.1); // only a try
+
+  // MC dN/dpt 
+  fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",12,0.,12.);
+  for(Int_t i=1; i<=2;i++) fMCPtShape->SetBinContent(i,1.); // only a try
+  for(Int_t i=3; i<=12;i++) fMCPtShape->SetBinContent(i,0.1); // only a try
+
+}
+
+//--------------------------------------------------------------------------
 Double_t AliHFSystErr::GetCutsEffErr(Double_t pt) const {
   // 
   // Get error
index 8c6ad7b..19b744f 100644 (file)
@@ -177,6 +177,7 @@ class AliHFSystErr : public TNamed
   void InitDplustoKpipi2013pPb0100();
   void InitDstartoD0pi2013pPb0100();
   void InitDstoKKpi2013pPb0100();
+  void InitLctopK0S2010pp();
 
 
   TH1F* ReflectHisto(TH1F *hin) const;
index 3673cb0..f25bf25 100644 (file)
@@ -46,13 +46,13 @@ using std::endl;
 ClassImp(AliRDHFCutsLctoV0)
 
 //--------------------------------------------------------------------------
-  AliRDHFCutsLctoV0::AliRDHFCutsLctoV0(const char* name, Short_t /*v0channel*/) :
-  AliRDHFCuts(name),
+AliRDHFCutsLctoV0::AliRDHFCutsLctoV0(const char* name, Short_t /*v0channel*/) :
+AliRDHFCuts(name),
   fPidSelectionFlag(0),
-  fPidHFV0pos(0),
-  fPidHFV0neg(0),
   fV0daughtersCuts(0),
-  fV0Type(0)
+  fV0Type(0),
+  fHighPtCut(2.5),
+  fLowPtCut(1.0)
 {
   //
   // Default Constructor
@@ -122,17 +122,17 @@ ClassImp(AliRDHFCutsLctoV0)
   SetPtBins(2,limits);
 
   /*
-  switch (v0channel) {
-  case 0:
+    switch (v0channel) {
+    case 0:
     fV0channel = 0x0001;
     break;
-  case 1:
+    case 1:
     fV0channel = 0x0002;
     break;
-  case 2:
+    case 2:
     fV0channel = 0x0004;
     break;
-  }
+    }
   */
 
 }
@@ -140,21 +140,16 @@ ClassImp(AliRDHFCutsLctoV0)
 AliRDHFCutsLctoV0::AliRDHFCutsLctoV0(const AliRDHFCutsLctoV0 &source) :
   AliRDHFCuts(source),
   fPidSelectionFlag(source.fPidSelectionFlag),
-  fPidHFV0pos(0),
-  fPidHFV0neg(0),
   fV0daughtersCuts(0),
-  fV0Type(source.fV0Type)
-    /*fV0channel(source.fV0channel)*/
+  fV0Type(source.fV0Type),
+  fHighPtCut(source.fHighPtCut),
+  fLowPtCut(source.fLowPtCut)
+  /*fV0channel(source.fV0channel)*/
 {
   //
   // Copy constructor
   //
 
-  if (source.fPidHFV0pos) fPidHFV0pos = new AliAODPidHF(*(source.fPidHFV0pos));
-  else fPidHFV0pos = new AliAODPidHF();
-  if (source.fPidHFV0neg) fPidHFV0neg = new AliAODPidHF(*(source.fPidHFV0neg));
-  else fPidHFV0neg = new AliAODPidHF();
-
   if (source.fV0daughtersCuts) AddTrackCutsV0daughters(source.fV0daughtersCuts);
   else fV0daughtersCuts = new AliESDtrackCuts();
 
@@ -170,16 +165,15 @@ AliRDHFCutsLctoV0 &AliRDHFCutsLctoV0::operator=(const AliRDHFCutsLctoV0 &source)
 
     AliRDHFCuts::operator=(source);
     fPidSelectionFlag = source.fPidSelectionFlag;
-    delete fPidHFV0pos;
-    fPidHFV0pos = new AliAODPidHF(*(source.fPidHFV0pos));
-    delete fPidHFV0neg;
-    fPidHFV0neg = new AliAODPidHF(*(source.fPidHFV0neg));
 
     delete fV0daughtersCuts;
     fV0daughtersCuts = new AliESDtrackCuts(*(source.fV0daughtersCuts));
 
     fV0Type  = source.fV0Type;
 
+    fHighPtCut = source.fHighPtCut;
+    fLowPtCut = source.fLowPtCut;
+
   }
 
   return *this;
@@ -188,23 +182,14 @@ AliRDHFCutsLctoV0 &AliRDHFCutsLctoV0::operator=(const AliRDHFCutsLctoV0 &source)
 
 //---------------------------------------------------------------------------
 AliRDHFCutsLctoV0::~AliRDHFCutsLctoV0() {
- //
- //  Default Destructor
- //
-
- if (fPidHFV0pos) {
-  delete fPidHFV0pos;
-  fPidHFV0pos=0;
- }
- if (fPidHFV0neg) {
-  delete fPidHFV0neg;
-  fPidHFV0neg=0;
- }
-
- if (fV0daughtersCuts) {
-  delete fV0daughtersCuts;
-  fV0daughtersCuts=0;
- }
+  //
+  //  Default Destructor
+  //
+
+  if (fV0daughtersCuts) {
+    delete fV0daughtersCuts;
+    fV0daughtersCuts=0;
+  }
 
 }
 
@@ -496,7 +481,7 @@ Int_t AliRDHFCutsLctoV0::IsSelected(TObject* obj,Int_t selectionLevel) {
       isNotLambda=kFALSE;
       //return 0;
     }
-      if (TMath::Abs(v0->MassAntiLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] ) { // LambdaBar invariant mass veto
+    if (TMath::Abs(v0->MassAntiLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] ) { // LambdaBar invariant mass veto
       AliDebug(4,Form(" veto on LambdaBar invariant mass doesn't pass the cut"));
       isNotLambdaBar=kFALSE;
       //return 0;
@@ -570,13 +555,13 @@ Int_t AliRDHFCutsLctoV0::IsSelected(TObject* obj,Int_t selectionLevel) {
   Int_t returnvalue = okLck0sp+2*okLcLBarpi+4*okLcLpi;
   /*
     retvalue case
-          1  Lc->K0S + p
-          2  Lc->LambdaBar + pi
-          3  Lc->K0S + p AND Lc->LambdaBar + pi
-          4  Lc->Lambda + pi
-          5  Lc->K0S + p AND Lc->Lambda + pi
-          6  Lc->LambdaBar + pi AND Lc->Lambda + pi
-          7  Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
+    1  Lc->K0S + p
+    2  Lc->LambdaBar + pi
+    3  Lc->K0S + p AND Lc->LambdaBar + pi
+    4  Lc->Lambda + pi
+    5  Lc->K0S + p AND Lc->Lambda + pi
+    6  Lc->LambdaBar + pi AND Lc->Lambda + pi
+    7  Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
   */
 
   Int_t returnvaluePID = 7;
@@ -602,42 +587,14 @@ Int_t AliRDHFCutsLctoV0::IsSelected(TObject* obj,Int_t selectionLevel) {
 Int_t AliRDHFCutsLctoV0::IsSelectedPID(AliAODRecoDecayHF* obj) {
 
   // fPidHF -> PID object for bachelor
-  // fPidHFV0pos -> PID object for positive V0 daughter
-  // fPidHFV0neg -> PID object for negative V0 daughter
 
   if (!fUsePID || !obj) {
     AliDebug(2,"PID selection inactive. Candidate accepted.");
     return 7; // all hypothesis are valid
   }
 
-  if (fPidHF->GetPidResponse()==0x0 ||
-      fPidHFV0pos->GetPidResponse()==0x0 ||
-      fPidHFV0neg->GetPidResponse()==0x0) {
-    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-    AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
-    AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
-    fPidHF->SetPidResponse(pidResp);
-    fPidHFV0pos->SetPidResponse(pidResp);
-    fPidHFV0neg->SetPidResponse(pidResp);
-    fPidHF->SetOldPid(kFALSE);
-    fPidHFV0pos->SetOldPid(kFALSE);
-    fPidHFV0neg->SetOldPid(kFALSE);
-  }
-
   AliAODRecoCascadeHF *objD = (AliAODRecoCascadeHF*)obj;
 
-  Bool_t isPeriodd = fPidHF->GetOnePad();
-  Bool_t isMC = fPidHF->GetMC();
-
-  if (isPeriodd) {
-    fPidHFV0pos->SetOnePad(kTRUE);
-    fPidHFV0neg->SetOnePad(kTRUE);
-  }
-  if (isMC) {
-    fPidHFV0neg->SetMC(kTRUE);
-    fPidHFV0pos->SetMC(kTRUE);
-  }
-
   AliAODTrack *bachelor = (AliAODTrack*)objD->GetBachelor();
   AliAODTrack *v0Pos = (AliAODTrack*)objD->Getv0PositiveTrack();
   AliAODTrack *v0Neg = (AliAODTrack*)objD->Getv0NegativeTrack();
@@ -655,169 +612,165 @@ Int_t AliRDHFCutsLctoV0::IsSelectedPID(AliAODRecoDecayHF* obj) {
   return returnvalue;
 }
 //-----------------------
-void AliRDHFCutsLctoV0::CheckPID(AliAODTrack *bachelor, AliAODTrack *v0Neg, AliAODTrack *v0Pos,
-                                Bool_t &isBachelorID1, Bool_t &isV0NegID2, Bool_t &isV0PosID4) {
+void AliRDHFCutsLctoV0::CheckPID(AliAODTrack *bachelor,
+                                AliAODTrack * /*v0Neg*/, AliAODTrack * /*v0Pos*/,
+                                Bool_t &isBachelorID1, Bool_t &isBachelorID2, Bool_t &isBachelorID4) {
   // identification strategy
 
-  Int_t trackIDtof = -1;
-  Int_t trackIDtpc = -1;
-
-  Bool_t dummy1 = kFALSE;
-  Bool_t dummy2 = kFALSE;
-  Bool_t dummy4 = kFALSE;
+  Int_t idxIDbyTOF = -1;
+  Int_t idxIDbyTPC = -1;
 
   Int_t tpcID = -1;
   Int_t tofID = -1;
-  Double_t nTPCsigmasPr = -999;
-  Double_t nTOFsigmasPr = -999;
+  Double_t nTPCsigmas = -999;
+  Double_t nTOFsigmas = -999;
 
-  Bool_t trackIDtofB = -1;
-  Bool_t trackIDtpcB = -1;
+  Bool_t trackIDByTOF = -1;
+  Bool_t trackIDByTPC = -1;
+
+  Bool_t dummy = kFALSE;
 
   switch (fPidSelectionFlag) {
 
   case 0:
 
     // identify bachelor
-    trackIDtof = fPidHF->ApplyPidTOFRaw(bachelor,4);
-    trackIDtpc = fPidHF->ApplyPidTPCRaw(bachelor,4);
-    AliDebug(1,Form(" fPidHF->ApplyPidTOFRaw(bachelor,4)=%d fPidHF->ApplyPidTPCRaw(bachelor,4)=%d",trackIDtof,trackIDtpc));
-    isBachelorID1 = (trackIDtof==4) && (trackIDtpc==4); // K0S case
-    //isBachelorID2 = (fPidHF->ApplyPidTPCRaw(bachelor,2)==2) && (fPidHF->ApplyPidTOFRaw(bachelor,2)==2); // LambdaBar case
-    //isBachelorID4 = isBachelorID2; // Lambda case
-
-    // identify V0neg
-    trackIDtof = fPidHFV0neg->ApplyPidTOFRaw(v0Neg,4);
-    trackIDtpc = fPidHFV0neg->ApplyPidTPCRaw(v0Neg,4);
-    AliDebug(1,Form(" fPidHFV0neg->ApplyPidTOFRaw(v0Neg,4)=%d fPidHFV0neg->ApplyPidTPCRaw(v0Neg,4)=%d",trackIDtof,trackIDtpc));
-    //isV0NegID1 = (fPidHFV0neg->ApplyPidTPCRaw(v0Neg,2)==2) && (fPidHFV0neg->ApplyPidTOFRaw(v0Neg,2)==2); // K0S case
-    isV0NegID2 = (trackIDtof==4) && (trackIDtpc==4); // LambdaBar case
-    //isV0NegID4 = isV0NegID1; // Lambda case
-
-    // identify V0pos
-    trackIDtof = fPidHFV0pos->ApplyPidTOFRaw(v0Pos,4);
-    trackIDtpc = fPidHFV0pos->ApplyPidTPCRaw(v0Pos,4);
-    AliDebug(1,Form(" fPidHFV0pos->ApplyPidTOFRaw(v0Pos,4)=%d fPidHFV0pos->ApplyPidTPCRaw(v0POS,4)=%d",trackIDtof,trackIDtpc));
-    //isV0PosID1 = (fPidHFV0pos->ApplyPidTPCRaw(v0Pos,2)==2) && (fPidHFV0pos->ApplyPidTOFRaw(v0Pos,2)==2); // K0S case
-    //isV0PosID2 = isV0PosID1; // LambdaBar case
-    isV0PosID4 = (trackIDtof==4) && (trackIDtpc==4); // Lambda case
+    idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,4);
+    idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,4);
+    isBachelorID1 = (idxIDbyTOF==4) && (idxIDbyTPC==4); // K0S case
+
+    idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,2);
+    idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,2);
+    isBachelorID2 = (idxIDbyTOF==2) && (idxIDbyTPC==2); // LambdaBar case
+
+    isBachelorID4 = isBachelorID2; // Lambda case
 
     break;
+
   case 1:
 
     // identify bachelor
-    trackIDtof = fPidHF->ApplyPidTOFRaw(bachelor,4);
-    trackIDtpc = fPidHF->ApplyPidTPCRaw(bachelor,4);
-    AliDebug(1,Form(" fPidHF->ApplyPidTOFRaw(bachelor,4)=%d fPidHFV0->ApplyPidTPCRaw(bachelor,4)=%d",trackIDtof,trackIDtpc));
-    isBachelorID1 = ( trackIDtof==4 );
-    dummy1 = ( !(fPidHF->CheckTOFPIDStatus(bachelor)) && (trackIDtpc==4) &&
-              fPidHF->IsExcluded(bachelor,2,2.,"TPC") && fPidHF->IsExcluded(bachelor,3,2.,"TPC") ); // K0S case
-    isBachelorID1 = isBachelorID1 || dummy1;
-
-
-    // identify V0neg
-    trackIDtof = fPidHFV0neg->ApplyPidTOFRaw(v0Neg,4);
-    trackIDtpc = fPidHFV0neg->ApplyPidTPCRaw(v0Neg,4);
-    AliDebug(1,Form(" fPidHFV0neg->ApplyPidTOFRaw(v0Neg,4)=%d fPidHFV0neg->ApplyPidTPCRaw(v0Neg,4)=%d",trackIDtof,trackIDtpc));
-    isV0NegID2    = ( trackIDtof==4 );
-    dummy2 = ( !(fPidHFV0neg->CheckTOFPIDStatus(v0Neg)) && (trackIDtpc==4) &&
-              fPidHFV0neg->IsExcluded(v0Neg,2,2.,"TPC") && fPidHFV0neg->IsExcluded(v0Neg,3,2.,"TPC") ); // LambdaBar case
-    isV0NegID2 = isV0NegID2 || dummy2;
-
-
-    // identify V0pos
-    trackIDtof = fPidHFV0pos->ApplyPidTOFRaw(v0Pos,4);
-    trackIDtpc = fPidHFV0pos->ApplyPidTPCRaw(v0Pos,4);
-    AliDebug(1,Form(" fPidHFV0pos->ApplyPidTOFRaw(v0Pos,4)=%d fPidHFV0pos->ApplyPidTPCRaw(v0Pos,4)=%d",trackIDtof,trackIDtpc));
-    isV0PosID4    = ( trackIDtof==4 );
-    dummy4 = ( !(fPidHFV0pos->CheckTOFPIDStatus(v0Pos)) && (trackIDtpc==4) &&
-              fPidHFV0pos->IsExcluded(v0Pos,2,2.,"TPC") && fPidHFV0pos->IsExcluded(v0Pos,3,2.,"TPC") ); // Lambda case
-    isV0PosID4 = isV0PosID4 || dummy4;
+    idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,4);
+    idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,4);
+    dummy = ( !(fPidHF->CheckTOFPIDStatus(bachelor)) && (idxIDbyTPC==4) &&
+             fPidHF->IsExcluded(bachelor,2,2.,"TPC") && fPidHF->IsExcluded(bachelor,3,2.,"TPC") ); // K0S case
+    isBachelorID1 = ( (idxIDbyTOF==4) || dummy );
+
+    idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,2);
+    idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,2);
+    dummy = ( !(fPidHF->CheckTOFPIDStatus(bachelor)) && (idxIDbyTPC==2) &&
+             fPidHF->IsExcluded(bachelor,3,2.,"TPC") && fPidHF->IsExcluded(bachelor,4,2.,"TPC") ); // LambdaBar case
+    isBachelorID2 = ( (idxIDbyTOF==2) || dummy );
 
+    isBachelorID4 = isBachelorID2; // Lambda case
 
     break;
+
   case 2:
 
     // identify bachelor
-    nTOFsigmasPr = -999;
-    tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmasPr);
-    nTPCsigmasPr = -999;
-    tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmasPr);
-    trackIDtofB = (tofID==1) && ( (bachelor->P()>=1.0 && bachelor->P()<2.5 && TMath::Abs(nTOFsigmasPr)<3) ||
-                                 (bachelor->P()>=2.5 && nTOFsigmasPr>-2 && nTOFsigmasPr<3) );
-    trackIDtpcB = (tpcID==1) && ( (bachelor->P()<1.0 && TMath::Abs(nTPCsigmasPr)<2) ||
-                                 (bachelor->P()>=1.0 && TMath::Abs(nTPCsigmasPr)<3) );
-    AliDebug(1,Form(" trackIDtofB=%d trackIDtpcB=%d",trackIDtofB,trackIDtpcB));
-    isBachelorID1 = (bachelor->P()<1 && trackIDtpcB) || (bachelor->P()>=1 && trackIDtpcB && trackIDtofB); // K0S case
-
-    // identify V0neg
-    nTOFsigmasPr = -999;
-    tofID = fPidHFV0neg->GetnSigmaTOF(v0Neg,4,nTOFsigmasPr);
-    nTPCsigmasPr = -999;
-    tpcID = fPidHFV0neg->GetnSigmaTPC(v0Neg,4,nTPCsigmasPr);
-    trackIDtofB = (tofID==1) && ( (v0Neg->P()>=1.0 && v0Neg->P()<2.5 && TMath::Abs(nTOFsigmasPr)<3) ||
-                                 (v0Neg->P()>=2.5 && nTOFsigmasPr>-2 && nTOFsigmasPr<3) );
-    trackIDtpcB = (tpcID==1) && ( (v0Neg->P()<1.0 && TMath::Abs(nTPCsigmasPr)<2) ||
-                                 (v0Neg->P()>=1.0 && TMath::Abs(nTPCsigmasPr)<3) );
-    AliDebug(1,Form(" trackIDtofB=%d trackIDtpcB=%d",trackIDtofB,trackIDtpcB));
-    isV0NegID2 = (v0Neg->P()<1 && trackIDtpcB) || (v0Neg->P()>=1 && trackIDtpcB && trackIDtofB); // LambdaBar case
-    
-    // identify V0pos
-    nTOFsigmasPr = -999;
-    tofID = fPidHFV0pos->GetnSigmaTOF(v0Pos,4,nTOFsigmasPr);
-    nTPCsigmasPr = -999;
-    tpcID = fPidHFV0pos->GetnSigmaTPC(v0Pos,4,nTPCsigmasPr);
-    trackIDtofB = (tofID==1) && ( (v0Pos->P()>=1.0 && v0Pos->P()<2.5 && TMath::Abs(nTOFsigmasPr)<3) ||
-                                 (v0Pos->P()>=2.5 && nTOFsigmasPr>-2 && nTOFsigmasPr<3) );
-    trackIDtpcB = (tpcID==1) && ( (v0Pos->P()<1.0 && TMath::Abs(nTPCsigmasPr)<2) ||
-                                 (v0Pos->P()>=1.0 && TMath::Abs(nTPCsigmasPr)<3) );
-    AliDebug(1,Form(" trackIDtofB=%d trackIDtpcB=%d",trackIDtofB,trackIDtpcB));
-    isV0PosID4 = (v0Pos->P()<1 && trackIDtpcB) || (v0Pos->P()>=1 && trackIDtpcB && trackIDtofB); // Lambda case
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
+                                    (bachelor->P()>=fLowPtCut && TMath::Abs(nTPCsigmas)<3) ) );
+    isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // K0S case
+
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
+                                    (bachelor->P()>=fLowPtCut && TMath::Abs(nTPCsigmas)<3) ) );
+    isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // LambdaBar case
+
+    isBachelorID4 = isBachelorID2; // Lambda case
 
     break;
+
   case 3:
 
     // identify bachelor
-    nTOFsigmasPr = -999;
-    tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmasPr);
-    nTPCsigmasPr = -999;
-    tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmasPr);
-    trackIDtofB = (tofID==1) && ( (bachelor->P()>=1.0 && bachelor->P()<2.5 && TMath::Abs(nTOFsigmasPr)<3) ||
-                                 (bachelor->P()>=2.5 && nTOFsigmasPr>-2 && nTOFsigmasPr<3) );
-    trackIDtpcB = (tpcID==1) && ( (bachelor->P()<1.0 && TMath::Abs(nTPCsigmasPr)<2) ||
-                                 (bachelor->P()>=1.0 && bachelor->P()<3.0 && TMath::Abs(nTPCsigmasPr)<3) ||
-                                 (bachelor->P()>=3.0 && nTPCsigmasPr>-3 && nTPCsigmasPr<2) );
-    AliDebug(1,Form(" trackIDtofB=%d trackIDtpcB=%d",trackIDtofB,trackIDtpcB));
-    isBachelorID1 = (bachelor->P()<1 && trackIDtpcB) || (bachelor->P()>=1 && trackIDtpcB && trackIDtofB); // K0S case
-
-    // identify V0neg
-    nTOFsigmasPr = -999;
-    tofID = fPidHFV0neg->GetnSigmaTOF(v0Neg,4,nTOFsigmasPr);
-    nTPCsigmasPr = -999;
-    tpcID = fPidHFV0neg->GetnSigmaTPC(v0Neg,4,nTPCsigmasPr);
-    trackIDtofB = (tofID==1) && ( (v0Neg->P()>=1.0 && v0Neg->P()<2.5 && TMath::Abs(nTOFsigmasPr)<3) ||
-                                 (v0Neg->P()>=2.5 && nTOFsigmasPr>-2 && nTOFsigmasPr<3) );
-    trackIDtpcB = (tpcID==1) && ( (v0Neg->P()<1.0 && TMath::Abs(nTPCsigmasPr)<2) ||
-                                 (v0Neg->P()>=1.0 && v0Neg->P()<3.0 && TMath::Abs(nTPCsigmasPr)<3) ||
-                                 (v0Neg->P()>=3.0 && nTPCsigmasPr>-3 && nTPCsigmasPr<2) );
-    AliDebug(1,Form(" trackIDtofB=%d trackIDtpcB=%d",trackIDtofB,trackIDtpcB));
-    isV0NegID2 = (v0Neg->P()<1 && trackIDtpcB) || (v0Neg->P()>=1 && trackIDtpcB && trackIDtofB); // LambdaBar case
-
-    // identify V0pos
-    nTOFsigmasPr = -999;
-    tofID = fPidHFV0pos->GetnSigmaTOF(v0Pos,4,nTOFsigmasPr);
-    nTPCsigmasPr = -999;
-    tpcID = fPidHFV0pos->GetnSigmaTPC(v0Pos,4,nTPCsigmasPr);
-    trackIDtofB = (tofID==1) && ( (v0Pos->P()>=1.0 && v0Pos->P()<2.5 && TMath::Abs(nTOFsigmasPr)<3) ||
-                                 (v0Pos->P()>=2.5 && nTOFsigmasPr>-2 && nTOFsigmasPr<3) );
-    trackIDtpcB = (tpcID==1) && ( (v0Pos->P()<1.0 && TMath::Abs(nTPCsigmasPr)<2) ||
-                                 (v0Pos->P()>=1.0 && v0Pos->P()<3.0 && TMath::Abs(nTPCsigmasPr)<3) ||
-                                 (v0Pos->P()>=3.0 && nTPCsigmasPr>-3 && nTPCsigmasPr<2) );
-    AliDebug(1,Form(" trackIDtofB=%d trackIDtpcB=%d",trackIDtofB,trackIDtpcB));
-    isV0PosID4 = (v0Pos->P()<1 && trackIDtpcB) || (v0Pos->P()>=1 && trackIDtpcB && trackIDtofB); // Lambda case
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
+                                    (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTPCsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTPCsigmas>-3 && nTPCsigmas<2) ) );
+    isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // K0S case
+
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
+                                    (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTPCsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTPCsigmas>-3 && nTPCsigmas<2) ) );
+    isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // LambdaBar case
+
+    isBachelorID4 = isBachelorID2; // Lambda case
+
+    break;
+
+  case 4:
+
+    // identify bachelor
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && (TMath::Abs(nTPCsigmas)<2) );
+    isBachelorID1 = ( (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTOF) ); // K0S case
+
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && (TMath::Abs(nTPCsigmas)<2) );
+    isBachelorID2 = ( (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTOF) ); // LambdaBar case
+
+    isBachelorID4 = isBachelorID2; // Lambda case
 
     break;
 
+  case 5:
+
+    // identify bachelor
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && !trackIDByTOF && TMath::Abs(nTPCsigmas)<3) ) );
+    isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
+
+    nTOFsigmas = -999;
+    tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
+    nTPCsigmas = -999;
+    tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
+    trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
+                                    (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
+    trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && !trackIDByTOF && TMath::Abs(nTPCsigmas)<3) ) );
+    isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
+
+    isBachelorID4 = isBachelorID2; // Lambda case
+
+    break;
   }
 
 }
@@ -827,10 +780,10 @@ Int_t AliRDHFCutsLctoV0::CombineCuts(Int_t returnvalueTrack, Int_t returnvalue,
   // combine track selection, topological cuts and PID
   //
 
- Int_t returnvalueTot=returnvalueTrack&returnvalue;
- returnvalueTot=returnvalueTot&returnvaluePID;
+  Int_t returnvalueTot=returnvalueTrack&returnvalue;
+  returnvalueTot=returnvalueTot&returnvaluePID;
 
- return returnvalueTot;
+  return returnvalueTot;
 }
 
 //----------------------------------
@@ -1036,23 +989,23 @@ Int_t AliRDHFCutsLctoV0::IsSelectedSingleCut(TObject* obj, Int_t selectionLevel,
   Int_t returnvalue = okLck0sp+2*okLcLBarpi+4*okLcLpi;
   /*
     retvalue case
-          1  Lc->K0S + p
-          2  Lc->LambdaBar + pi
-          3  Lc->K0S + p AND Lc->LambdaBar + pi
-          4  Lc->Lambda + pi
-          5  Lc->K0S + p AND Lc->Lambda + pi
-          6  Lc->LambdaBar + pi AND Lc->Lambda + pi
-          7  Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
+    1  Lc->K0S + p
+    2  Lc->LambdaBar + pi
+    3  Lc->K0S + p AND Lc->LambdaBar + pi
+    4  Lc->Lambda + pi
+    5  Lc->K0S + p AND Lc->Lambda + pi
+    6  Lc->LambdaBar + pi AND Lc->Lambda + pi
+    7  Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
   */
 
 
   /*
-  Int_t returnvaluePID = 7;
+    Int_t returnvaluePID = 7;
 
-  // selection on PID
-  if (selectionLevel==AliRDHFCuts::kAll ||
-      selectionLevel==AliRDHFCuts::kCandidate ||
-      selectionLevel==AliRDHFCuts::kPID )
+    // selection on PID
+    if (selectionLevel==AliRDHFCuts::kAll ||
+    selectionLevel==AliRDHFCuts::kCandidate ||
+    selectionLevel==AliRDHFCuts::kPID )
     returnvaluePID = IsSelectedPID(d);
   */
 
@@ -1068,8 +1021,8 @@ Int_t AliRDHFCutsLctoV0::IsSelectedSingleCut(TObject* obj, Int_t selectionLevel,
 //----------------------------------
 void AliRDHFCutsLctoV0::SetStandardCutsPP2010() {
 
- SetName("LctoV0ProductionCuts");
- SetTitle("Production cuts for Lc->V0+bachelor analysis");
+  SetName("LctoV0ProductionCuts");
+  SetTitle("Production cuts for Lc->V0+bachelor analysis");
 
   AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
   esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
@@ -1118,23 +1071,23 @@ void AliRDHFCutsLctoV0::SetStandardCutsPP2010() {
   prodcutsval=new Float_t*[nvars];
   for(Int_t ic=0;ic<nvars;ic++){prodcutsval[ic]=new Float_t[nptbins];}
   for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
-   prodcutsval[0][ipt2]=1.;    // inv. mass if K0S [GeV/c2]
-   prodcutsval[1][ipt2]=1.;    // inv. mass if Lambda [GeV/c2]
-   prodcutsval[2][ipt2]=0.05;  // inv. mass V0 if K0S [GeV/c2]
-   prodcutsval[3][ipt2]=0.05;  // inv. mass V0 if Lambda [GeV/c2]
-   prodcutsval[4][ipt2]=0.3;   // pT min bachelor track [GeV/c] // AOD by construction
-   prodcutsval[5][ipt2]=0.;    // pT min V0-positive track [GeV/c]
-   prodcutsval[6][ipt2]=0.;    // pT min V0-negative track [GeV/c]
-   prodcutsval[7][ipt2]=1000.; // dca cascade cut [cm]
-   prodcutsval[8][ipt2]=1.5;   // dca V0 cut [nSigma] // it's 1.5 x offline V0s
-   prodcutsval[9][ipt2]=-1.;   // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
-   prodcutsval[10][ipt2]=3.;   // d0 max bachelor wrt PV [cm]
-   prodcutsval[11][ipt2]=1000.;// d0 max V0 wrt PV [cm]
-   prodcutsval[12][ipt2]=0.;   // mass K0S veto [GeV/c2]
-   prodcutsval[13][ipt2]=0.;   // mass Lambda/LambdaBar veto [GeV/c2]
-   prodcutsval[14][ipt2]=0.;   // mass Gamma veto [GeV/c2]
-   prodcutsval[15][ipt2]=0.;   // pT min V0 track [GeV/c]
-   prodcutsval[16][ipt2]=0.;   // V0 type cut
+    prodcutsval[0][ipt2]=1.;    // inv. mass if K0S [GeV/c2]
+    prodcutsval[1][ipt2]=1.;    // inv. mass if Lambda [GeV/c2]
+    prodcutsval[2][ipt2]=0.05;  // inv. mass V0 if K0S [GeV/c2]
+    prodcutsval[3][ipt2]=0.05;  // inv. mass V0 if Lambda [GeV/c2]
+    prodcutsval[4][ipt2]=0.3;   // pT min bachelor track [GeV/c] // AOD by construction
+    prodcutsval[5][ipt2]=0.;    // pT min V0-positive track [GeV/c]
+    prodcutsval[6][ipt2]=0.;    // pT min V0-negative track [GeV/c]
+    prodcutsval[7][ipt2]=1000.; // dca cascade cut [cm]
+    prodcutsval[8][ipt2]=1.5;   // dca V0 cut [nSigma] // it's 1.5 x offline V0s
+    prodcutsval[9][ipt2]=-1.;   // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
+    prodcutsval[10][ipt2]=3.;   // d0 max bachelor wrt PV [cm]
+    prodcutsval[11][ipt2]=1000.;// d0 max V0 wrt PV [cm]
+    prodcutsval[12][ipt2]=0.;   // mass K0S veto [GeV/c2]
+    prodcutsval[13][ipt2]=0.;   // mass Lambda/LambdaBar veto [GeV/c2]
+    prodcutsval[14][ipt2]=0.;   // mass Gamma veto [GeV/c2]
+    prodcutsval[15][ipt2]=0.;   // pT min V0 track [GeV/c]
+    prodcutsval[16][ipt2]=0.;   // V0 type cut
   }
   SetCuts(nvars,nptbins,prodcutsval);
 
@@ -1154,61 +1107,33 @@ void AliRDHFCutsLctoV0::SetStandardCutsPP2010() {
   pidObjBachelor->SetTOFdecide(kFALSE);
   SetPidHF(pidObjBachelor);
 
-  //2. V0pos
-  AliAODPidHF* pidObjV0pos = new AliAODPidHF();
-  Double_t sigmasV0pos[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
-  pidObjV0pos->SetSigma(sigmasV0pos);
-  pidObjV0pos->SetAsym(kFALSE);
-  pidObjV0pos->SetMatch(1);
-  pidObjV0pos->SetTPC(kTRUE);
-  pidObjV0pos->SetTOF(kTRUE);
-  pidObjV0pos->SetTOFdecide(kFALSE);
-  SetPidV0pos(pidObjV0pos);
-
-  //2. V0neg
-  AliAODPidHF* pidObjV0neg = new AliAODPidHF();
-  Double_t sigmasV0neg[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
-  pidObjV0neg->SetSigma(sigmasV0neg);
-  pidObjV0neg->SetAsym(kFALSE);
-  pidObjV0neg->SetMatch(1);
-  pidObjV0neg->SetTPC(kTRUE);
-  pidObjV0neg->SetTOF(kTRUE);
-  pidObjV0neg->SetTOFdecide(kFALSE);
-  SetPidV0neg(pidObjV0neg);
-
   SetUsePID(kFALSE);//(kTRUE);
 
   //PrintAll();
 
- for(Int_t iiv=0;iiv<nvars;iiv++){
-  delete [] prodcutsval[iiv];
- }
- delete [] prodcutsval;
- prodcutsval=NULL;
- delete [] ptbins;
- ptbins=NULL;
-
-
- delete pidObjBachelor;
- pidObjBachelor=NULL;
+  for(Int_t iiv=0;iiv<nvars;iiv++){
+    delete [] prodcutsval[iiv];
+  }
+  delete [] prodcutsval;
+  prodcutsval=NULL;
+  delete [] ptbins;
+  ptbins=NULL;
 
- delete pidObjV0pos;
- pidObjV0pos=NULL;
 
- delete pidObjV0neg;
- pidObjV0neg=NULL;
+  delete pidObjBachelor;
+  pidObjBachelor=NULL;
 
- return;
+  return;
 }
 //------------------
 void AliRDHFCutsLctoV0::SetStandardCutsPbPb2010() {
 
- SetName("LctoV0ProductionCuts");
- SetTitle("Production cuts for Lc->V0+bachelor analysis");
+  SetName("LctoV0ProductionCuts");
+  SetTitle("Production cuts for Lc->V0+bachelor analysis");
 
- SetStandardCutsPP2010();
+  SetStandardCutsPP2010();
 
- return;
+  return;
 }
 //------------------
 void AliRDHFCutsLctoV0::SetStandardCutsPbPb2011() {
@@ -1250,6 +1175,8 @@ void AliRDHFCutsLctoV0::PrintAll() const {
   printf("Max vtx red chi2 %f\n",fMaxVtxRedChi2);
   printf("Min SPD mult %d\n",fMinSPDMultiplicity);
   printf("Use PID %d (PID selection flag = %d) OldPid=%d\n",(Int_t)fUsePID,(Int_t)fPidSelectionFlag,fPidHF ? fPidHF->GetOldPid() : -1);
+  printf("High value for pT %f\n",fHighPtCut);
+  printf("Low and high values for pT cuts: %f %f\n",fLowPtCut,fHighPtCut);
   printf("Remove daughters from vtx %d\n",(Int_t)fRemoveDaughtersFromPrimary);
   printf("Recompute primary vertex %d\n",(Int_t)fRecomputePrimVertex);
   printf("Physics selection: %s\n",fUsePhysicsSelection ? "Yes" : "No");
@@ -1284,10 +1211,10 @@ void AliRDHFCutsLctoV0::PrintAll() const {
   }
   if(fIsUpperCut){
     cout<<"Array of upper/lower cut"<<endl;
-   for(Int_t iv=0;iv<fnVars;iv++){
-     cout<<fIsUpperCut[iv]<<"\t";
-   }
-   cout<<endl;
+    for(Int_t iv=0;iv<fnVars;iv++){
+      cout<<fIsUpperCut[iv]<<"\t";
+    }
+    cout<<endl;
   }
   if(fPtBinLimits){
     cout<<"Array of ptbin limits"<<endl;
@@ -1298,13 +1225,13 @@ void AliRDHFCutsLctoV0::PrintAll() const {
   }
   if(fCutsRD){
     cout<<"Matrix of cuts"<<endl;
-   for(Int_t iv=0;iv<fnVars;iv++){
-     for(Int_t ib=0;ib<fnPtBins;ib++){
-       cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<"\t";
-     } 
-     cout<<endl;
-   }
-   cout<<endl;
+    for(Int_t iv=0;iv<fnVars;iv++){
+      for(Int_t ib=0;ib<fnPtBins;ib++){
+       cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<"\t";
+      } 
+      cout<<endl;
+    }
+    cout<<endl;
   }
 
   if (fTrackCuts) {
@@ -1369,7 +1296,7 @@ Bool_t AliRDHFCutsLctoV0::AreLctoV0DaughtersSelected(AliAODRecoDecayHF *dd) cons
   if (!bachelorTrack) return kFALSE;
 
   if (fIsCandTrackSPDFirst && d->Pt()<fMaxPtCandTrackSPDFirst) {
-      if(!bachelorTrack->HasPointOnITSLayer(0)) return kFALSE;
+    if(!bachelorTrack->HasPointOnITSLayer(0)) return kFALSE;
   }
 
   if (fKinkReject != (!(fTrackCuts->GetAcceptKinkDaughters())) ) {
index 939ec68..52db13b 100644 (file)
@@ -10,7 +10,6 @@
 // class for cuts on AOD reconstructed Lc-> V0 + bachelor
 //***********************************************************
 
-#include "AliAODPidHF.h"
 #include "AliRDHFCuts.h"
 
 class AliRDHFCutsLctoV0 : public AliRDHFCuts
@@ -27,7 +26,9 @@ class AliRDHFCutsLctoV0 : public AliRDHFCuts
   kTOFandTPC=0,
   kTOForTPCveto=1,
   kTOFandTPCasym1=2,
-  kTOFandTPCasym2=3
+  kTOFandTPCasym2=3,
+  kTPClowTOFhigh=4,
+  kTPClowTOFintermediateTOForTPChigh=5
  };
 
   AliRDHFCutsLctoV0(const char* name="CutsLctoV0", Short_t v0channel=0);
@@ -60,24 +61,18 @@ class AliRDHFCutsLctoV0 : public AliRDHFCuts
 
   Int_t GetV0Type();
 
+  void SetHighPtCut(Float_t highPtCut) {fHighPtCut=highPtCut;};
+  Float_t GetHighPtCut() const {return fHighPtCut;};
+
+  void SetLowPtCut(Float_t lowPtCut) {fLowPtCut=lowPtCut;};
+  Float_t GetLowPtCut() const {return fLowPtCut;};
+
   virtual void SetStandardCutsPP2010();
   virtual void SetStandardCutsPbPb2010();
   virtual void SetStandardCutsPbPb2011();
 
   virtual Bool_t IsInFiducialAcceptance(Double_t pt,Double_t y) const;
 
-  void SetPidV0pos(AliAODPidHF* pidV0pos) {
-    if (fPidHFV0pos) delete fPidHFV0pos;
-    fPidHFV0pos = new AliAODPidHF(*pidV0pos);
-  }
-  void SetPidV0neg(AliAODPidHF* pidV0neg) {
-    if (fPidHFV0neg) delete fPidHFV0neg;
-    fPidHFV0neg = new AliAODPidHF(*pidV0neg);
-  }
-
-  AliAODPidHF * GetPidV0pos() { return fPidHFV0pos; }
-  AliAODPidHF * GetPidV0neg() { return fPidHFV0neg; }
-
   void AddTrackCutsV0daughters(AliESDtrackCuts* v0daug)
   { delete fV0daughtersCuts; fV0daughtersCuts = new AliESDtrackCuts(*v0daug); }
   virtual AliESDtrackCuts *GetTrackCutsV0daughters() const {return fV0daughtersCuts;}
@@ -85,20 +80,20 @@ class AliRDHFCutsLctoV0 : public AliRDHFCuts
   virtual void PrintAll() const;
  protected:
 
-  void CheckPID(AliAODTrack *bachelor, AliAODTrack *v0Neg, AliAODTrack *v0Pos,
-               Bool_t &isBachelorID1, Bool_t &isV0NegID2, Bool_t &isV0PosID4);
+  void CheckPID(AliAODTrack *bachelor, AliAODTrack * /*v0Neg*/, AliAODTrack * /*v0Pos*/,
+               Bool_t &isBachelorID1, Bool_t &isBachelorID2, Bool_t &isBachelorID4);
 
  private:
 
   Int_t fPidSelectionFlag;
-  AliAODPidHF *fPidHFV0pos;
-  AliAODPidHF *fPidHFV0neg;
   AliESDtrackCuts *fV0daughtersCuts; // cuts for v0 daughters (AOD converted to ESD on the flight!)
   Float_t     fV0Type; // V0 type -- should be defined as in AliRDHFCuts.h
+  Float_t fHighPtCut;  // high pT cut separation for proton identification
+  Float_t fLowPtCut;   // low pT cut separation for proton identification
 
   //UShort_t fV0channel;
 
-  ClassDef(AliRDHFCutsLctoV0,4);  // class for cuts on AOD reconstructed Lc->V0+bachelor
+  ClassDef(AliRDHFCutsLctoV0,5);  // class for cuts on AOD reconstructed Lc->V0+bachelor
 };
 
 #endif
index 198c88e..bf1340c 100644 (file)
@@ -5,25 +5,28 @@ const Double_t etamin = -0.9;
 const Double_t etamax =  0.9;
 const Double_t ymin  = -1.2 ;
 const Double_t ymax  =  1.2 ;
-const Double_t cosPAV0min = -1.05;
-const Double_t cosPAV0max = +1.05;
-const Float_t onFlymin = -0.5;
-const Float_t onFlymax =  1.5;
-const Float_t centmin =   0.;
+
+const Double_t zmin   = -15.;
+const Double_t zmax   =  15.;
+const Float_t centmin =-999.;
 const Float_t centmax = 100.;
 const Float_t fakemin = -0.5;
 const Float_t fakemax =  2.5;
 const Float_t multmin =   0.;
 const Float_t multmax = 102.;
 
-const Double_t ptBachmin  =  0.0;
-const Double_t ptBachmax  = 30.0;
-const Double_t ptV0posmin =  0.0;
-const Double_t ptV0posmax = 30.0;
-const Double_t ptV0negmin =  0.0;
-const Double_t ptV0negmax = 30.0;
-const Double_t dcaV0min   =  0.; // nSigma
-const Double_t dcaV0max   = 15.; // nSigma
+const Double_t cosPAV0min = 0.985;
+const Double_t cosPAV0max = 1.005;
+const Float_t onFlymin = -0.5;
+const Float_t onFlymax =  1.5;
+const Double_t pBachmin   =  0.0;
+const Double_t pBachmax   = 30.0;
+const Double_t ptV0min    =  0.0;
+const Double_t ptV0max    = 30.0;
+const Double_t yV0min     =-1.2;
+const Double_t yV0max     = 1.2;
+const Double_t dcaV0min   = 0.0; // nSigma
+const Double_t dcaV0max   = 1.5; // nSigma
 const Double_t cTV0min    = 0.0; // micron
 const Double_t cTV0max    = 300; // micron
 const Double_t cTmin      = 0.0; // micron
@@ -31,6 +34,7 @@ const Double_t cTmax      = 300; // micron
 const Float_t cosPAmin    =-1.05;
 const Float_t cosPAmax    = 1.05;
 
+
 //----------------------------------------------------
 
 AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "./LctoV0bachelorCuts.root",
@@ -93,27 +97,32 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
     massV0max = 1.14;
   }
 
-  const Double_t phimin = 0.0;
+  const Double_t phimin = 0.;
   const Double_t phimax = 2.*TMath::Pi();
-
-  const Int_t nbinpt          =  11; //bins in pt from 0,1,2,3,4,5,6,8,12,17,25,35 GeV
-  const Int_t nbiny           =  24; //bins in y
-  const Int_t nbininvMassV0   =  60; //bins in invMassV0
-  const Int_t nbinpointingV0  =  42; //bins in cosPointingAngleV0
-  const Int_t nbinonFly       =   2; //bins in onFlyStatus x V0
-
-  const Int_t nbincent        = 18; //bins in centrality (total number)
-  const Int_t nbinfake        =  3; //bins in fake
-  const Int_t nbinmult        = 48; //bins in multiplicity (total number)
-
-  const Int_t nbinptBach      = 300; //bins in pt from 0 to 30 GeV
-  const Int_t nbinptV0pos     = 300; //bins in pt from 0 to 30 GeV
-  const Int_t nbinptV0neg     = 300; //bins in pt from 0 to 30 GeV
-  const Int_t nbinphi         =  18; //bins in Phi
-  const Int_t nbindcaV0       = 150; //bins in dcaV0
-  const Int_t nbincTV0        =  15; //bins in cTV0
-  const Int_t nbincT          =  15; //bins in cT
-  const Int_t nbinpointing    =  42; //bins in cosPointingAngle
+  const Double_t phiV0min = 0.;
+  const Double_t phiV0max = 2.*TMath::Pi();
+
+  const Int_t nbinZvtx       =  30; //bins in centrality (total number)
+  const Int_t nbincent       =18+1; //bins in centrality (total number)
+  const Int_t nbinfake       =   3; //bins in fake
+  const Int_t nbinmult       =  48; //bins in multiplicity (total number)
+
+  const Int_t nbinpt         =  11; //bins in pt from 0,1,2,3,4,5,6,8,12,17,25,35 GeV
+  const Int_t nbiny          =  24; //bins in y Lc
+  const Int_t nbinphi        =  18; //bins in phi Lc
+  const Int_t nbinonFly      =   2; //bins in onFlyStatus x V0
+
+  const Int_t nbinpBach      = 300; //bins in pt from 0 to 30 GeV
+  const Int_t nbinptV0       = 300; //bins in pt from 0 to 30 GeV
+  const Int_t nbinyV0        =  24; //bins in y V0
+  const Int_t nbinphiV0      =  18; //bins in phi V0
+  const Int_t nbindcaV0      = 150; //bins in dcaV0
+  const Int_t nbininvMassV0  =  60; //bins in invMassV0
+  const Int_t nbinpointingV0 =  42; //bins in cosPointingAngleV0
+  const Int_t nbinpointing   =  42; //bins in cosPointingAngle
+
+  //const Int_t nbincTV0      =  15; //bins in cTV0
+  //const Int_t nbincT        =  15; //bins in cT
 
   //the sensitive variables, their indices
 
@@ -121,29 +130,31 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
   const UInt_t ipT        = 0;
   const UInt_t iy         = 1;
   const UInt_t iphi       = 2;
-  const UInt_t icosPAxV0  = 3;
-  const UInt_t ionFly     = 4;
+  const UInt_t ionFly     = 3;
+  const UInt_t iZvtx      = 4;
   const UInt_t icent      = 5;
   const UInt_t ifake      = 6;
   const UInt_t imult      = 7;
 
-  const UInt_t ipTbach   =  8;
-  const UInt_t ipTposV0  =  9;
-  const UInt_t ipTnegV0  = 10;
-  const UInt_t iinvMassV0= 11;
-  const UInt_t idcaV0    = 12;
-  const UInt_t icTv0     = 13;
-  const UInt_t icT       = 14;
+  const UInt_t ipbach    =  8;
+  const UInt_t ipTV0     =  9;
+  const UInt_t iyV0      = 10;
+  const UInt_t iphiV0    = 11;
+  const UInt_t iinvMassV0= 12;
+  const UInt_t idcaV0    = 13;
+  const UInt_t icosPAxV0 = 14;
   const UInt_t icosPA    = 15;
+  //const UInt_t icTv0     = 16;
+  //const UInt_t icT       = 17;
 
   //Setting the bins: pt, ptPi, and ptK are considered seprately because for them you can either define the binning by hand, or using the cuts file
 
   //arrays for the number of bins in each dimension
 
   //if ( configuration ==AliCFTaskVertexingHF::kSnail)
-  const Int_t nvarTot   = 16 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi, z, centrality, fake, cosPointingAngleXY, normDecayLengthXY, multiplicity
+  const Int_t nvarTot   = 16 ; //number of variables on the grid
   //if ( configuration ==AliCFTaskVertexingHF::kCheetah)
-  //const Int_t nvarTot   =  8 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi, z, centrality, fake, cosPointingAngleXY, normDecayLengthXY, multiplicity
+  //const Int_t nvarTot =  8 ; //number of variables on the grid
 
   Int_t iBin[nvarTot];
 
@@ -151,94 +162,112 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
   iBin[ipT]=nbinpt;
   iBin[iy]=nbiny;
   iBin[iphi]=nbinphi;
-  iBin[icosPAxV0]=nbinpointingV0;
   iBin[ionFly]=nbinonFly;
+  iBin[iZvtx]=nbinZvtx;
   iBin[icent]=nbincent;
   iBin[ifake]=nbinfake;
   iBin[imult]=nbinmult;
 
-  iBin[ipTbach]=nbinptBach;
-  iBin[ipTposV0]=nbinptV0pos;
-  iBin[ipTnegV0]=nbinptV0neg;
+  iBin[ipbach]=nbinpBach;
+  iBin[ipTV0]=nbinptV0;
+  iBin[iyV0]=nbinyV0;
+  iBin[iphiV0]=nbinphiV0;
   iBin[iinvMassV0]=nbininvMassV0;
   iBin[idcaV0]=nbindcaV0;
-  iBin[icTv0]=nbincTV0;
-  iBin[icT]=nbincT;
+  iBin[icosPAxV0]=nbinpointingV0;
   iBin[icosPA]=nbinpointing;
+  //iBin[icTv0]=nbincTV0;
+  //iBin[icT]=nbincT;
 
   // values for bin lower bounds
 
   // pt
-  Double_t *binLimpT=new Double_t[iBin[0]+1];
-  Double_t pTminCand =  0.;
-  Double_t pTmaxCand = 35.;
-  for(Int_t ii=0; ii<=iBin[0]-6; ii++) binLimpT[ii]=(Double_t)pTminCand + (Double_t)ii;
-  binLimpT[iBin[0]-5]= 6.;
-  binLimpT[iBin[0]-4]= 8.;
-  binLimpT[iBin[0]-3]=12.;
-  binLimpT[iBin[0]-2]=17.;
-  binLimpT[iBin[0]-1]=25.;
-  binLimpT[iBin[0]]=35.;
+  Double_t *binLimpT=new Double_t[iBin[ipT]+1];
+  binLimpT[ 0]= 0.;
+  binLimpT[ 1]= 1.;
+  binLimpT[ 2]= 2.;
+  binLimpT[ 3]= 3.;
+  binLimpT[ 4]= 4.;
+  binLimpT[ 5]= 5.;
+  binLimpT[ 6]= 6.;
+  binLimpT[ 7]= 8.;
+  binLimpT[ 8]=12.;
+  binLimpT[ 9]=17.;
+  binLimpT[10]=25.;
+  binLimpT[11]=35.;
 
   // y
-  Double_t *binLimy=new Double_t[iBin[1]+1];
-  for(Int_t i=0; i<=iBin[1]; i++) binLimy[i]=(Double_t)ymin + (ymax-ymin)/iBin[1]*(Double_t)i ;
+  Double_t *binLimy=new Double_t[iBin[iy]+1];
+  for(Int_t i=0; i<=iBin[iy]; i++) binLimy[i]=(Double_t)ymin + (ymax-ymin)/iBin[iy]*(Double_t)i ;
 
   // phi
-  Double_t *binLimphi=new Double_t[iBin[2]+1];
-  for(Int_t i=0; i<=iBin[2]; i++) binLimphi[i]=(Double_t)phimin  + (phimax-phimin)/iBin[2]*(Double_t)i ;
-
-  // cosPointingAngleV0
-  Double_t *binLimcosPAV0=new Double_t[iBin[3]+1];
-  for(Int_t i=0; i<=iBin[3]; i++) binLimcosPAV0[i]=(Double_t)cosPAV0min + (cosPAV0max-cosPAV0min)/iBin[3]*(Double_t)i ;
+  Double_t *binLimphi=new Double_t[iBin[iphi]+1];
+  for(Int_t i=0; i<=iBin[iphi]; i++) binLimphi[i]=(Double_t)phimin + (phimax-phimin)/iBin[iphi]*(Double_t)i ;
 
   // onTheFlyV0
-  Double_t *binLimonFlyV0=new Double_t[iBin[4]+1];
-  for(Int_t i=0; i<=iBin[4]; i++) binLimonFlyV0[i]=(Double_t)onFlymin + (onFlymax-onFlymin)/iBin[4]*(Double_t)i ;
+  Double_t *binLimonFlyV0=new Double_t[iBin[ionFly]+1];
+  for(Int_t i=0; i<=iBin[ionFly]; i++) binLimonFlyV0[i]=(Double_t)onFlymin + (onFlymax-onFlymin)/iBin[ionFly]*(Double_t)i ;
+
+  // z Primary Vertex
+  Double_t *binLimzvtx=new Double_t[iBin[iZvtx]+1];
+  for(Int_t i=0; i<=nbinZvtx; i++) binLimzvtx[i]=(Double_t)zmin  + (zmax-zmin)/iBin[iZvtx]*(Double_t)i ;
 
   // centrality
-  Double_t *binLimcent=new Double_t[iBin[5]+1];
-  for(Int_t i=0; i<=iBin[5]; i++) binLimcent[i]=(Double_t)centmin + (centmax-centmin)/iBin[5]*(Double_t)i ; 
-        
+  Double_t *binLimcent=new Double_t[iBin[icent]+1];
+  binLimcent[0]=centmin;
+  for(Int_t i=1; i<=iBin[icent]; i++) binLimcent[i]=centmax/iBin[icent]*(Double_t)(i-1);
+
   // fake
-  Double_t *binLimfake=new Double_t[iBin[6]+1];
-  for(Int_t i=0; i<=iBin[6]; i++) binLimfake[i]=(Double_t)fakemin  + (fakemax-fakemin)/iBin[6] * (Double_t)i;
+  Double_t *binLimfake=new Double_t[iBin[ifake]+1];
+  for(Int_t i=0; i<=iBin[ifake]; i++) binLimfake[i]=(Double_t)fakemin  + (fakemax-fakemin)/iBin[ifake] * (Double_t)i;
 
   // multiplicity
-  Double_t *binLimmult=new Double_t[iBin[7]+1];
-  for(Int_t i=0; i<=iBin[7]; i++) binLimmult[i]=(Double_t)multmin + (multmax-multmin)/iBin[7]*(Double_t)i ; 
+  Double_t *binLimmult=new Double_t[iBin[imult]+1];
+  for(Int_t i=0; i<=iBin[imult]; i++) binLimmult[i]=(Double_t)multmin + (multmax-multmin)/iBin[imult]*(Double_t)i ; 
+
+
+  // pBach
+  Double_t *binLimpbach=new Double_t[iBin[ipbach]+1];
+  for(Int_t i=0; i<=iBin[ipbach]; i++) binLimpbach[i]=(Double_t)pBachmin + (pBachmax-pBachmin)/iBin[ipbach]*(Double_t)i ; 
 
-  // ptBach
-  Double_t *binLimpTbach=new Double_t[iBin[8]+1];
-  for(Int_t i=0; i<=iBin[8]; i++) binLimpTbach[i]=(Double_t)ptBachmin + (ptBachmax-ptBachmin)/iBin[8]*(Double_t)i ; 
+  // ptV0
+  Double_t *binLimpTV0=new Double_t[iBin[ipTV0]+1];
+  for(Int_t i=0; i<=iBin[ipTV0]; i++) binLimpTV0[i]=(Double_t)ptV0min + (ptV0max-ptV0min)/iBin[ipTV0]*(Double_t)i ; 
 
-  // ptV0pos
-  Double_t *binLimpTV0pos=new Double_t[iBin[9]+1];
-  for(Int_t i=0; i<=iBin[9]; i++) binLimpTV0pos[i]=(Double_t)ptV0posmin + (ptV0posmax-ptV0posmin)/iBin[9]*(Double_t)i ; 
+  // yV0
+  Double_t *binLimyV0=new Double_t[iBin[iyV0]+1];
+  for(Int_t i=0; i<=iBin[iyV0]; i++) binLimyV0[i]=(Double_t)yV0min + (yV0max-yV0min)/iBin[iyV0]*(Double_t)i ; 
 
-  // ptV0neg
-  Double_t *binLimpTV0neg=new Double_t[iBin[10]+1];
-  for(Int_t i=0; i<=iBin[10]; i++) binLimpTV0neg[i]=(Double_t)ptV0negmin + (ptV0negmax-ptV0negmin)/iBin[10]*(Double_t)i ; 
+  // phiV0
+  Double_t *binLimphiV0=new Double_t[iBin[iphiV0]+1];
+  for(Int_t i=0; i<=iBin[iphiV0]; i++) binLimphiV0[i]=(Double_t)phiV0min + (phiV0max-phiV0min)/iBin[iphiV0]*(Double_t)i ; 
 
   // invMassV0
-  Double_t *binLimInvMassV0=new Double_t[iBin[11]+1];
-  for(Int_t i=0; i<=iBin[11]; i++) binLimInvMassV0[i]=(Double_t)massV0min + (massV0max-massV0min)/iBin[11]*(Double_t)i ;
+  Double_t *binLimInvMassV0=new Double_t[iBin[iinvMassV0]+1];
+  for(Int_t i=0; i<=iBin[iinvMassV0]; i++) binLimInvMassV0[i]=(Double_t)massV0min + (massV0max-massV0min)/iBin[iinvMassV0]*(Double_t)i ;
 
   // dcaV0
-  Double_t *binLimdcaV0=new Double_t[iBin[12]+1];
-  for(Int_t i=0; i<=iBin[12]; i++) binLimdcaV0[i]=(Double_t)dcaV0min + (dcaV0max-dcaV0min)/iBin[12]*(Double_t)i ; 
+  Double_t *binLimdcaV0=new Double_t[iBin[idcaV0]+1];
+  for(Int_t i=0; i<=iBin[idcaV0]; i++) binLimdcaV0[i]=(Double_t)dcaV0min + (dcaV0max-dcaV0min)/iBin[idcaV0]*(Double_t)i ; 
 
+  // cosPointingAngleV0
+  Double_t *binLimcosPAV0=new Double_t[iBin[icosPAxV0]+1];
+  for(Int_t i=0; i<=iBin[icosPAxV0]; i++) binLimcosPAV0[i]=(Double_t)cosPAV0min + (cosPAV0max-cosPAV0min)/iBin[icosPAxV0]*(Double_t)i ;
+
+  // cosPointingAngle
+  Double_t *binLimcosPA=new Double_t[iBin[icosPA]+1];
+  for(Int_t i=0; i<=iBin[icosPA]; i++) binLimcosPA[i]=(Double_t)cosPAmin + (cosPAmax-cosPAmin)/iBin[icosPA]*(Double_t)i ;
+
+  /*
   // cTV0
-  Double_t *binLimcTV0=new Double_t[iBin[13]+1];
-  for(Int_t i=0; i<=iBin[13]; i++) binLimcTV0[i]=(Double_t)cTV0min + (cTV0max-cTV0min)/iBin[13]*(Double_t)i ; 
+  Double_t *binLimcTV0=new Double_t[iBin[icTv0]+1];
+  for(Int_t i=0; i<=iBin[icTv0]; i++) binLimcTV0[i]=(Double_t)cTV0min + (cTV0max-cTV0min)/iBin[icTv0]*(Double_t)i ; 
 
   // cT
-  Double_t *binLimcT=new Double_t[iBin[14]+1];
-  for(Int_t i=0; i<=iBin[14]; i++) binLimcT[i]=(Double_t)cTmin + (cTmax-cTmin)/iBin[14]*(Double_t)i ;
+  Double_t *binLimcT=new Double_t[iBin[icT]+1];
+  for(Int_t i=0; i<=iBin[icT]; i++) binLimcT[i]=(Double_t)cTmin + (cTmax-cTmin)/iBin[icT]*(Double_t)i ;
+  */
 
-  // cosPointingAngle
-  Double_t *binLimcosPA=new Double_t[iBin[15]+1];
-  for(Int_t i=0; i<=iBin[15]; i++) binLimcosPA[i]=(Double_t)cosPAmin + (cosPAmax-cosPAmin)/iBin[15]*(Double_t)i ;
 
   //one "container" for MC
   TString nameContainer="";
@@ -267,42 +296,46 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
   }
 
   //setting the bin limits
-  container -> SetBinLimits(0,binLimpT);
-  container -> SetBinLimits(1,binLimy);
-  container -> SetBinLimits(2,binLimphi);
-  container -> SetBinLimits(3,binLimcosPAV0);
-  container -> SetBinLimits(4,binLimonFlyV0);
-  container -> SetBinLimits(5,binLimcent);
-  container -> SetBinLimits(6,binLimfake);
-  container -> SetBinLimits(7,binLimmult);
-
-  container -> SetVarTitle(0,"pt");
-  container -> SetVarTitle(1,"y");
-  container -> SetVarTitle(2,"phi");
-  container -> SetVarTitle(3,"cosPA -V0-");
-  container -> SetVarTitle(4,"onFlyV0");
-  container -> SetVarTitle(5,"centrality");
-  container -> SetVarTitle(6,"fake");
-  container -> SetVarTitle(7,"multiplicity");
+  container -> SetBinLimits(ipT,binLimpT);
+  container -> SetBinLimits(iy,binLimy);
+  container -> SetBinLimits(iphi,binLimphi);
+  container -> SetBinLimits(ionFly,binLimonFlyV0);
+  container -> SetBinLimits(iZvtx,binLimzvtx);
+  container -> SetBinLimits(icent,binLimcent);
+  container -> SetBinLimits(ifake,binLimfake);
+  container -> SetBinLimits(imult,binLimmult);
+
+  container -> SetVarTitle(ipT,"p_{T}(#Lambda_{c}) [GeV/c]");
+  container -> SetVarTitle(iy,"y(#Lambda_{c})");
+  container -> SetVarTitle(iphi,"#phi(#Lambda_{c}) [rad]");
+  container -> SetVarTitle(ionFly,"onTheFlyStatusV0");
+  container -> SetVarTitle(iZvtx,"z_{vtx} [cm]");
+  container -> SetVarTitle(icent,"centrality");
+  container -> SetVarTitle(ifake,"fake");
+  container -> SetVarTitle(imult,"multiplicity");
 
   if (configuration == AliCFTaskVertexingHF::kSnail) {
-    container -> SetBinLimits(8,binLimpTbach);
-    container -> SetBinLimits(9,binLimpTV0pos);
-    container -> SetBinLimits(10,binLimpTV0neg);
-    container -> SetBinLimits(11,binLimInvMassV0);
-    container -> SetBinLimits(12,binLimdcaV0);
-    container -> SetBinLimits(13,binLimcTV0);
-    container -> SetBinLimits(14,binLimcT);
-    container -> SetBinLimits(15,binLimcosPA);
-
-    container -> SetVarTitle(8,"ptBachelor");
-    container -> SetVarTitle(9,"ptV0pos");
-    container -> SetVarTitle(10,"ptV0neg");
-    container -> SetVarTitle(11,"mV0");
-    container -> SetVarTitle(12,"DCA -V0-");
-    container -> SetVarTitle(13,"c#tau -V0-");
-    container -> SetVarTitle(14,"c#tau");
-    container -> SetVarTitle(15,"cosPA");
+    container -> SetBinLimits(ipbach,binLimpbach);
+    container -> SetBinLimits(ipTV0,binLimpTV0);
+    container -> SetBinLimits(iyV0,binLimyV0);
+    container -> SetBinLimits(iphiV0,binLimphiV0);
+    container -> SetBinLimits(iinvMassV0,binLimInvMassV0);
+    container -> SetBinLimits(idcaV0,binLimdcaV0);
+    container -> SetBinLimits(icosPAxV0,binLimcosPAV0);
+    container -> SetBinLimits(icosPA,binLimcosPA);
+    //container -> SetBinLimits(,binLimcTV0);
+    //container -> SetBinLimits(,binLimcT);
+
+    container -> SetVarTitle(ipbach,"p(bachelor) [GeV/c]");
+    container -> SetVarTitle(ipTV0,"p_{T}(V0) [GeV/c]");
+    container -> SetVarTitle(iyV0,"y(V0)");
+    container -> SetVarTitle(iphiV0,"#varphi(V0) [rad]");
+    container -> SetVarTitle(iinvMassV0,"m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]");
+    container -> SetVarTitle(idcaV0,"DCA(V0) [n#sigma]");
+    container -> SetVarTitle(icosPAxV0,"cosine pointing angle(V0)");
+    container -> SetVarTitle(icosPA,"cosine pointing angle (#Lambda_{c})");
+    //container -> SetVarTitle(,"c#tau -V0-");
+    //container -> SetVarTitle(,"c#tau");
   }
 
   container -> SetStepTitle(0, "MCLimAcc");
@@ -454,10 +487,10 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
   //first half  : reconstructed 
   //second half : MC
 
-  thnDim[0] = iBin[0];
-  thnDim[2] = iBin[0];
-  thnDim[1] = iBin[1];
-  thnDim[3] = iBin[1];
+  thnDim[0] = iBin[ipT];
+  thnDim[2] = iBin[ipT];
+  thnDim[1] = iBin[iy];
+  thnDim[3] = iBin[iy];
 
   TString nameCorr="";
   if (!isKeepDfromB) {
@@ -499,29 +532,24 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
   // ----- output data -----
 
   TString outputfile = AliAnalysisManager::GetCommonFileName();
-  TString output1name="", output2name="", output3name="", output4name="", output5name="";
+  TString output1name="", output2name="", output3name="",output4name="";
   output2name=nameContainer;
   output3name=nameCorr;
-  output5name= "coutProfLcV0";
   if (!isKeepDfromB) {
     outputfile += ":PWG3_D2H_CFtaskLctoK0Sp_CommonFramework_"+usercomment;
     output1name="CFHFchist0_CommonFramework_"+usercomment;
     output4name= "Cuts_CommonFramework_"+usercomment;
-    output5name+="_cOnly";
   }
   else  if (isKeepDfromBOnly) {
     outputfile += ":PWG3_D2H_CFtaskLctoK0SpKeepDfromBOnly_CommonFramework_"+usercomment;
     output1name="CFHFchist0DfromB_CommonFramework_"+usercomment;
     output4name= "Cuts_CommonFramework_DfromB_"+usercomment;
-    output5name+="_bOnly";
   }
   else {
     outputfile += ":PWG3_D2H_CFtaskLctoK0SpKeepDfromB_CommonFramework_"+usercomment;
     output1name="CFHFchist0allLc_CommonFramework_"+usercomment;
     output4name= "Cuts_CommonFramework_allLc_"+usercomment;
-    output5name+="_all";
   }
-  output5name+=usercomment;
 
   //now comes user's output objects :
   // output TH1I for event counting
@@ -532,8 +560,6 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
   AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(output3name, THnSparseD::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
   // cuts
   AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(output4name, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
-  // estimators list
-  AliAnalysisDataContainer *coutput5 = mgr->CreateContainer(output5name, TList::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
 
   mgr->AddTask(task);
        
@@ -542,7 +568,6 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "
   mgr->ConnectOutput(task,2,coutput2);
   mgr->ConnectOutput(task,3,coutput3);
   mgr->ConnectOutput(task,4,coutput4);
-  mgr->ConnectOutput(task,5,coutput5);
   return task;
 
 }
index 1cee18a..44d7e4c 100644 (file)
@@ -58,14 +58,24 @@ void HFPtSpectrum ( const char *mcfilename="FeedDownCorrectionMC.root",
   //  Set if calculation considers asymmetric uncertainties or not 
   Bool_t asym = true;
 
-  // Set the meson and decay
-  // (only D0 -> K pi, D+--> K pi pi & D* --> D0 pi & D+s -->KKpi implemented here)
+  // Set the meson/baryon and decay
+  // (only D0 -> K pi, D+--> K pi pi, D* --> D0 pi, D+s -->KKpi, Lc+ --> pKpi & Lc+ --> pK0S implemented here)
   Bool_t isD0Kpi = true;
   Bool_t isDplusKpipi = false;
   Bool_t isDstarD0pi = false;
   Bool_t isDsKKpi = false;
   Bool_t isLctopKpi = false;
-  if (isD0Kpi && isDplusKpipi && isDstarD0pi && isDsKKpi) {
+  Bool_t isLcK0Sp = false;
+
+  Int_t shouldBeOne=0;
+  if(isD0Kpi) shouldBeOne++;
+  if(isDplusKpipi) shouldBeOne++;
+  if(isDstarD0pi) shouldBeOne++;
+  if(isDsKKpi) shouldBeOne++;
+  if(isLctopKpi) shouldBeOne++;
+  if(isLcK0Sp) shouldBeOne++;
+  
+  if (shouldBeOne!=1) {
     cout << "Sorry, can not deal with more than one correction at the same time"<<endl;
     return;
   }
@@ -196,6 +206,15 @@ void HFPtSpectrum ( const char *mcfilename="FeedDownCorrectionMC.root",
     hFeedDownMCptMax = (TH1D*)mcfile->Get("hLcpkpifromBpred_max_corr");
     hFeedDownMCptMin = (TH1D*)mcfile->Get("hLcpkpifromBpred_min_corr");
   }
+  else if (isLcK0Sp){
+    decay = 6;
+    hDirectMCpt = (TH1D*)mcfile->Get("hLcK0sppred_central");
+    hFeedDownMCpt = (TH1D*)mcfile->Get("hLcK0spfromBpred_central_corr");
+    hDirectMCptMax = (TH1D*)mcfile->Get("hLcK0sppred_max");
+    hDirectMCptMin = (TH1D*)mcfile->Get("hLcK0sppred_min");
+    hFeedDownMCptMax = (TH1D*)mcfile->Get("hLcK0spfromBpred_max_corr");
+    hFeedDownMCptMin = (TH1D*)mcfile->Get("hLcK0spfromBpred_min_corr");
+  }
   //
   hDirectMCpt->SetNameTitle("hDirectMCpt","direct MC spectra");
   hFeedDownMCpt->SetNameTitle("hFeedDownMCpt","feed-down MC spectra");
@@ -362,6 +381,7 @@ void HFPtSpectrum ( const char *mcfilename="FeedDownCorrectionMC.root",
   cout << "   ended the calculation, getting the histograms back " << endl;
 
   // Set the systematics externally
+  
   Bool_t combineFeedDown = true;
   AliHFSystErr *systematics = new AliHFSystErr();
   if( cc==kpp276 ) {
index b4998ac..34b513f 100644 (file)
@@ -57,11 +57,15 @@ void makeInputAliAnalysisTaskSELctoV0bachelor(){
   RDHFLctoV0An->SetKinkRejection(!esdTrackCuts->GetAcceptKinkDaughters());
   RDHFLctoV0An->AddTrackCuts(esdTrackCuts);
   RDHFLctoV0An->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
-  RDHFLctoV0An->SetUseTrackSelectionWithFilterBits(kTRUE);
-  RDHFLctoV0An->SetPidSelectionFlag(2); // 0 -> TOF AND TPC
+  RDHFLctoV0An->SetUseTrackSelectionWithFilterBits(kFALSE);//(kTRUE);
+  RDHFLctoV0An->SetLowPtCut(1.0); // default value 1.0 GeV/c
+  RDHFLctoV0An->SetHighPtCut(3.0); // default value 2.5 GeV/c
+  RDHFLctoV0An->SetPidSelectionFlag(4); // 0 -> TOF AND TPC
                                         // 1 -> if (TOF) TOF else TPC w veto
-                                        // 2 -> if (p>1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s AND TPC@3s}
-                                        // 3 -> if (p>1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else if (2.5<=p<3) {if (TOF) -2s<TOF<3s AND TPC@3s} else (p>=3) {if (TOF) -2s<TOF<3s AND -3s<TPC<2s}
+                                        // 2 -> if (p<1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s AND TPC@3s}
+                                        // 3 -> if (p<1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else if (2.5<=p<3) {if (TOF) -2s<TOF<3s AND TPC@3s} else (p>=3) {if (TOF) -2s<TOF<3s AND -3s<TPC<2s}
+                                        // 4 -> if (p<1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s} else if (p>=2.5) {if (TOF) -2s<TOF<3s}
+                                        // 5 -> if (p<1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s} else if (p>=2.5) {if (TOF) -2s<TOF<3s else TPC@3s}
 
   const Int_t nptbins=14;
   RDHFLctoV0An->SetNPtBins(nptbins);
@@ -181,11 +185,8 @@ void makeInputAliAnalysisTaskSELctoV0bachelor(){
   anacutsval[15][12]=1.2; // pT min V0 track [GeV/c]
   anacutsval[15][13]=1.2; // pT min V0 track [GeV/c]
 
-
-
   RDHFLctoV0An->SetCuts(nvars,nptbins,anacutsval);
 
-
   //RDHFLc->SetRecoKF(); //set this if you want to recompute the secondary vertex with the KF package
 
   //pid settings
@@ -201,38 +202,12 @@ void makeInputAliAnalysisTaskSELctoV0bachelor(){
 
   RDHFLctoV0An->SetPidHF(pidObjBachelor);
 
-  //2. V0pos
-  AliAODPidHF* pidObjV0pos = new AliAODPidHF();
-  Double_t sigmasV0pos[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
-  pidObjV0pos->SetSigma(sigmasV0pos);
-  pidObjV0pos->SetAsym(kFALSE);
-  pidObjV0pos->SetMatch(1);
-  pidObjV0pos->SetTPC(kTRUE);
-  pidObjV0pos->SetTOF(kTRUE);
-  pidObjV0pos->SetTOFdecide(kFALSE);
-
-  RDHFLctoV0An->SetPidV0pos(pidObjV0pos);
-
-  //2. V0neg
-  AliAODPidHF* pidObjV0neg = new AliAODPidHF();
-  Double_t sigmasV0neg[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
-  pidObjV0neg->SetSigma(sigmasV0neg);
-  pidObjV0neg->SetAsym(kFALSE);
-  pidObjV0neg->SetMatch(1);
-  pidObjV0neg->SetTPC(kTRUE);
-  pidObjV0neg->SetTOF(kTRUE);
-  pidObjV0neg->SetTOFdecide(kFALSE);
-
-  RDHFLctoV0An->SetPidV0neg(pidObjV0neg);
-
-
   // uncomment these lines for Baysian PID:
   // Double_t threshold=0.3;
   // SetupCombinedPID(RDHFLctoV0An  ,threshold);
   // RDHFLctoV0An  ->SetPIDStrategy(AliRDHFCutsLctoV0::kCombined);
   //
 
-
   //uncomment these lines to apply cuts with the KF package
   //RDHFLctoV0An->SetCutsStrategy(AliRDHFCutsLctoV0::kKF);
   //for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
@@ -254,8 +229,6 @@ void makeInputAliAnalysisTaskSELctoV0bachelor(){
   delete fout;
 
   delete pidObjBachelor;
-  delete pidObjV0neg;
-  delete pidObjV0pos;
   //delete RDHFLctoV0An;
 
 }
@@ -490,28 +463,6 @@ void makeInputAliAnalysisTaskSESignificanceMaximization(){
   pidObjBachelor->SetTOFdecide(kFALSE);
   RDHFLctoV0->SetPidHF(pidObjBachelor);
 
-  //2. V0pos
-  AliAODPidHF* pidObjV0pos = new AliAODPidHF();
-  Double_t sigmasV0pos[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
-  pidObjV0pos->SetSigma(sigmasV0pos);
-  pidObjV0pos->SetAsym(kFALSE);
-  pidObjV0pos->SetMatch(1);
-  pidObjV0pos->SetTPC(kTRUE);
-  pidObjV0pos->SetTOF(kTRUE);
-  pidObjV0pos->SetTOFdecide(kFALSE);
-  RDHFLctoV0->SetPidV0pos(pidObjV0pos);
-
-  //2. V0neg
-  AliAODPidHF* pidObjV0neg = new AliAODPidHF();
-  Double_t sigmasV0neg[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
-  pidObjV0neg->SetSigma(sigmasV0neg);
-  pidObjV0neg->SetAsym(kFALSE);
-  pidObjV0neg->SetMatch(1);
-  pidObjV0neg->SetTPC(kTRUE);
-  pidObjV0neg->SetTOF(kTRUE);
-  pidObjV0neg->SetTOFdecide(kFALSE);
-  RDHFLctoV0->SetPidV0neg(pidObjV0neg);
-
   //activate pileup rejection (for pp)
   //RDHFLctoV0->SetOptPileup(AliRDHFCuts::kRejectPileupEvent);