]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modified tasks to run also on p-Pb data (D.Colella)
authorlramona <lramona@cern.ch>
Wed, 3 Sep 2014 17:47:58 +0000 (19:47 +0200)
committerlramona <lramona@cern.ch>
Wed, 3 Sep 2014 17:47:58 +0000 (19:47 +0200)
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckCascadepp276.cxx
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckCascadepp276.h
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckPerformanceCascadepp276.cxx
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckPerformanceCascadepp276.h
PWGLF/STRANGENESS/Cascades/macros/AddTaskCheckCascadepp276.C
PWGLF/STRANGENESS/Cascades/macros/AddTaskCheckPerformanceCascadepp276.C

index b3093b2100cbff05c445809233f3a3de9a8df20c..18adc0e02063a51df64bff59563eacc88d79b41d 100644 (file)
 //                - AOD analysis part completed 
 //
 //
-//              Adapted to pp 2.76 analysis: D. Colella, domenico.colella@ba.infn.it
+//              Adapted to pp 2.76 TeV analysis: D. Colella, domenico.colella@ba.infn.it
 //               Gen-now 2012
 //                - Physics selection re-moved here (mainly for normalization in the efficiency calcuation)
 //                - Centrality selection deleted
-//                - 
+//
+//
+//             Adapted to pPb 5.02 TeV analysis: D. Colella, domenico.colella@ba.infn.it
+//               Aug-Sep 2014
+//               - Added the parameter fCollidingSystem, to distingish between pp and pPb procedures
+//               - 
+//
+//
 //
 //-----------------------------------------------------------------
 
@@ -92,6 +99,7 @@ class AliAODv0;
 #include "AliESDcascade.h"
 #include "AliAODcascade.h"
 #include "AliAODTrack.h"
+#include "AliAnalysisUtils.h"
 
 #include "AliAnalysisTaskCheckCascadepp276.h"
 
@@ -108,6 +116,8 @@ AliAnalysisTaskCheckCascadepp276::AliAnalysisTaskCheckCascadepp276()
   : AliAnalysisTaskSE(), 
     fAnalysisType               ("ESD"),
     fESDtrackCuts               (0),
+    fUtils                      (0),
+    fCollidingSystem            ("pp"),
     fPIDResponse                (0),
     fkRerunV0CascVertexers      (0),
     fkSDDSelectionOn            (kTRUE),
@@ -202,6 +212,8 @@ AliAnalysisTaskCheckCascadepp276::AliAnalysisTaskCheckCascadepp276(const char *n
   : AliAnalysisTaskSE(name), 
     fAnalysisType               ("ESD"), 
     fESDtrackCuts               (0), 
+    fUtils                      (0),
+    fCollidingSystem            ("pp"),
     fPIDResponse                (0),
     fkRerunV0CascVertexers      (0),
     fkSDDSelectionOn            (kTRUE),
@@ -289,24 +301,39 @@ AliAnalysisTaskCheckCascadepp276::AliAnalysisTaskCheckCascadepp276(const char *n
      // Input slot #0 works with a TChain
      // DefineInput(0, TChain::Class());
      // Output slot #1 writes into a TList container (cascade)
-        // default p-p values
-        fV0Sels[0] =  33.  ;     // max allowed chi2
-        fV0Sels[1] =   0.01;     // min allowed impact parameter for the 1st daughter 
-        fV0Sels[2] =   0.01;     // min allowed impact parameter for the 2nd daughter 
-        fV0Sels[3] =   1.5;      // max allowed DCA between the daughter tracks       
-        fV0Sels[4] =   0.9;      // min allowed cosine of V0's pointing angle  - This is pT dependent         
-        fV0Sels[5] =   0.2;      // min radius of the fiducial volume                 
-        fV0Sels[6] = 200.;       // max radius of the fiducial volume                 
-
-        fCascSels[0] =  33.;     // max allowed chi2 (same as PDC07)
-        fCascSels[1] =   0.01;   // min allowed V0 impact parameter                    
-        fCascSels[2] =   0.008;  // "window" around the Lambda mass                    
-        fCascSels[3] =   0.01;   // min allowed bachelor's impact parameter          
-        fCascSels[4] =   2.0;    // max allowed DCA between the V0 and the bachelor    
-        fCascSels[5] =   0.95;   // min allowed cosine of the cascade pointing angle   
-        fCascSels[6] =   0.2;    // min radius of the fiducial volume                  
-        fCascSels[7] = 100.;     // max radius of the fiducial volume                  
-
+     if (fCollidingSystem == "pp") {
+         fV0Sels[0] =  33.  ;     // max allowed chi2
+         fV0Sels[1] =   0.01;     // min allowed impact parameter for the 1st daughter 
+         fV0Sels[2] =   0.01;     // min allowed impact parameter for the 2nd daughter 
+         fV0Sels[3] =   1.5;      // max allowed DCA between the daughter tracks       
+         fV0Sels[4] =   0.9;      // min allowed cosine of V0's pointing angle - This is pT dependent        
+         fV0Sels[5] =   0.2;      // min radius of the fiducial volume                 
+         fV0Sels[6] = 200.;       // max radius of the fiducial volume                 
+         fCascSels[0] =  33.;     // max allowed chi2 (same as PDC07)
+         fCascSels[1] =   0.01;   // min allowed V0 impact parameter                    
+         fCascSels[2] =   0.008;  // "window" around the Lambda mass                    
+         fCascSels[3] =   0.01;   // min allowed bachelor's impact parameter          
+         fCascSels[4] =   2.0;    // max allowed DCA between the V0 and the bachelor    
+         fCascSels[5] =   0.95;   // min allowed cosine of the cascade pointing angle   
+         fCascSels[6] =   0.2;    // min radius of the fiducial volume                  
+         fCascSels[7] = 100.;     // max radius of the fiducial volume 
+     } else if (fCollidingSystem == "pPb") {
+         fV0Sels[0] =  33.  ;     // max allowed chi2
+         fV0Sels[1] =   0.02;     // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05)
+         fV0Sels[2] =   0.02;     // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05)
+         fV0Sels[3] =   2.0 ;     // max allowed DCA between the daughter tracks       (LHC09a4 : 0.5)
+         fV0Sels[4] =   0.95;     // min allowed cosine of V0's pointing angle         (LHC09a4 : 0.99)
+         fV0Sels[5] =   1.0 ;     // min radius of the fiducial volume                 (LHC09a4 : 0.2)
+         fV0Sels[6] = 200.  ;     // max radius of the fiducial volume                 (LHC09a4 : 100.0)
+         fCascSels[0] =  33.   ;  // max allowed chi2 (same as PDC07)
+         fCascSels[1] =   0.05 ;  // min allowed V0 impact parameter                    (PDC07 : 0.05   / LHC09a4 : 0.025 )
+         fCascSels[2] =   0.010;  // "window" around the Lambda mass                    (PDC07 : 0.008  / LHC09a4 : 0.010 )
+         fCascSels[3] =   0.03 ;  // min allowed bachelor's impact parameter            (PDC07 : 0.035  / LHC09a4 : 0.025 )
+         fCascSels[4] =   2.0  ;  // max allowed DCA between the V0 and the bachelor    (PDC07 : 0.1    / LHC09a4 : 0.2   )
+         fCascSels[5] =   0.95 ;  // min allowed cosine of the cascade pointing angle   (PDC07 : 0.9985 / LHC09a4 : 0.998 )
+         fCascSels[6] =   0.4  ;  // min radius of the fiducial volume                  (PDC07 : 0.9    / LHC09a4 : 0.2   )
+         fCascSels[7] = 100.   ;  // max radius of the fiducial volume                  (PDC07 : 100    / LHC09a4 : 100   )
+     }
      // Output slot #0 writes into a TList container (Cascade)
      DefineOutput(1, TList::Class());
      DefineOutput(2, AliCFContainer::Class());
@@ -348,7 +375,6 @@ void AliAnalysisTaskCheckCascadepp276::UserCreateOutputObjects() {
  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
  fPIDResponse = inputHandler->GetPIDResponse();
-
  // Only used to get the number of primary reconstructed tracks
  if (fAnalysisType == "ESD" && (! fESDtrackCuts )){
    fESDtrackCuts = new AliESDtrackCuts();
@@ -358,22 +384,39 @@ void AliAnalysisTaskCheckCascadepp276::UserCreateOutputObjects() {
  // Initialize cuts to re-run V0 and cascade vertexers
  //---------------------------------------------------
  // Not validated; to be checked
- fV0Sels[0] =  33.  ;     // max allowed chi2
- fV0Sels[1] =   0.01;     // min allowed impact parameter for the 1st daughter 
- fV0Sels[2] =   0.01;     // min allowed impact parameter for the 2nd daughter 
- fV0Sels[3] =   1.5;      // max allowed DCA between the daughter tracks       
- fV0Sels[4] =   0.9;     // min allowed cosine of V0's pointing angle         
- fV0Sels[5] =   0.2;      // min radius of the fiducial volume                 
- fV0Sels[6] = 200.;       // max radius of the fiducial volume                 
-
- fCascSels[0] =  33.;     // max allowed chi2 (same as PDC07)
- fCascSels[1] =   0.01;   // min allowed V0 impact parameter                    
- fCascSels[2] =   0.008;  // "window" around the Lambda mass                    
- fCascSels[3] =   0.01;   // min allowed bachelor's impact parameter          
- fCascSels[4] =   2.0;    // max allowed DCA between the V0 and the bachelor    
- fCascSels[5] =   0.95;   // min allowed cosine of the cascade pointing angle   
- fCascSels[6] =   0.2;    // min radius of the fiducial volume                  
- fCascSels[7] = 100.;     // max radius of the fiducial volume 
+ if (fCollidingSystem == "pp") {
+      fV0Sels[0] =  33.  ;     // max allowed chi2
+      fV0Sels[1] =   0.01;     // min allowed impact parameter for the 1st daughter 
+      fV0Sels[2] =   0.01;     // min allowed impact parameter for the 2nd daughter 
+      fV0Sels[3] =   1.5;      // max allowed DCA between the daughter tracks       
+      fV0Sels[4] =   0.9;      // min allowed cosine of V0's pointing angle         
+      fV0Sels[5] =   0.2;      // min radius of the fiducial volume                 
+      fV0Sels[6] = 200.;       // max radius of the fiducial volume                 
+      fCascSels[0] =  33.;     // max allowed chi2 (same as PDC07)
+      fCascSels[1] =   0.01;   // min allowed V0 impact parameter                    
+      fCascSels[2] =   0.008;  // "window" around the Lambda mass                    
+      fCascSels[3] =   0.01;   // min allowed bachelor's impact parameter          
+      fCascSels[4] =   2.0;    // max allowed DCA between the V0 and the bachelor    
+      fCascSels[5] =   0.95;   // min allowed cosine of the cascade pointing angle   
+      fCascSels[6] =   0.2;    // min radius of the fiducial volume                  
+      fCascSels[7] = 100.;     // max radius of the fiducial volume 
+ } else if (fCollidingSystem == "pPb") {
+      fV0Sels[0] =  33.  ;     // max allowed chi2
+      fV0Sels[1] =   0.02;     // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05)
+      fV0Sels[2] =   0.02;     // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05)
+      fV0Sels[3] =   2.0 ;     // max allowed DCA between the daughter tracks       (LHC09a4 : 0.5)
+      fV0Sels[4] =   0.95;     // min allowed cosine of V0's pointing angle         (LHC09a4 : 0.99)
+      fV0Sels[5] =   1.0 ;     // min radius of the fiducial volume                 (LHC09a4 : 0.2)
+      fV0Sels[6] = 200.  ;     // max radius of the fiducial volume                 (LHC09a4 : 100.0)
+      fCascSels[0] =  33.   ;  // max allowed chi2 (same as PDC07)
+      fCascSels[1] =   0.05 ;  // min allowed V0 impact parameter                    (PDC07 : 0.05   / LHC09a4 : 0.025 )
+      fCascSels[2] =   0.010;  // "window" around the Lambda mass                    (PDC07 : 0.008  / LHC09a4 : 0.010 )
+      fCascSels[3] =   0.03 ;  // min allowed bachelor's impact parameter            (PDC07 : 0.035  / LHC09a4 : 0.025 )
+      fCascSels[4] =   2.0  ;  // max allowed DCA between the V0 and the bachelor    (PDC07 : 0.1    / LHC09a4 : 0.2   )
+      fCascSels[5] =   0.95 ;  // min allowed cosine of the cascade pointing angle   (PDC07 : 0.9985 / LHC09a4 : 0.998 )
+      fCascSels[6] =   0.4  ;  // min radius of the fiducial volume                  (PDC07 : 0.9    / LHC09a4 : 0.2   )
+      fCascSels[7] = 100.   ;  // max radius of the fiducial volume                  (PDC07 : 100    / LHC09a4 : 100   )
+ }
 
  //----------------------
  // Initialize the histos
@@ -691,10 +734,22 @@ void AliAnalysisTaskCheckCascadepp276::UserCreateOutputObjects() {
    lNbBinsPerVar[0] = 100;
    lNbBinsPerVar[1] = 800;
    lNbBinsPerVar[2] = 22;
-   if (fkSDDSelectionOn) {
-        if (fwithSDD) fCFContCascadePIDXiMinus = new AliCFContainer(Form("fCFContCascadePIDXiMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Xi^{-} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
-        else if (!fwithSDD) fCFContCascadePIDXiMinus = new AliCFContainer(Form("fCFContCascadePIDXiMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Xi^{-} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar ); 
-   } else if (!fkSDDSelectionOn) fCFContCascadePIDXiMinus = new AliCFContainer(Form("fCFContCascadePIDXiMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Xi^{-} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   if (fCollidingSystem == "pp" && fkSDDSelectionOn) {
+        if (fwithSDD) fCFContCascadePIDXiMinus = new AliCFContainer(Form("fCFContCascadePIDXiMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",
+                                                                    fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                    "Pt_{cascade} Vs M_{#Xi^{-} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
+        else if (!fwithSDD) fCFContCascadePIDXiMinus = new AliCFContainer(Form("fCFContCascadePIDXiMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",
+                                                                    fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                    "Pt_{cascade} Vs M_{#Xi^{-} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar ); 
+   } else if (fCollidingSystem == "pp" && !fkSDDSelectionOn) {
+        fCFContCascadePIDXiMinus = new AliCFContainer(Form("fCFContCascadePIDXiMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",
+                                                      fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                      "Pt_{cascade} Vs M_{#Xi^{-} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   } else if (fCollidingSystem == "pPb") {
+        fCFContCascadePIDXiMinus = new AliCFContainer(Form("fCFContCascadePIDXiMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",
+                                                      fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                      "Pt_{cascade} Vs M_{#Xi^{-} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   }
      //Setting the bin limits 
    fCFContCascadePIDXiMinus->SetBinLimits(0,   0.0  ,  10.0 ); // Pt(Cascade)
    fCFContCascadePIDXiMinus->SetBinLimits(1,   1.2  ,   2.0 ); // Xi Effective mass
@@ -722,10 +777,22 @@ void AliAnalysisTaskCheckCascadepp276::UserCreateOutputObjects() {
    lNbBinsPerVar[0] = 100;
    lNbBinsPerVar[1] = 800;
    lNbBinsPerVar[2] = 22;
-   if (fkSDDSelectionOn) {
-        if (fwithSDD) fCFContCascadePIDXiPlus = new AliCFContainer(Form("fCFContCascadePIDXiPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Xi^{+} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
-        else if (!fwithSDD) fCFContCascadePIDXiPlus = new AliCFContainer(Form("fCFContCascadePIDXiPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Xi^{+} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
-   } else if (!fkSDDSelectionOn) fCFContCascadePIDXiPlus = new AliCFContainer(Form("fCFContCascadePIDXiPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Xi^{+} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   if (fCollidingSystem == "pp" && fkSDDSelectionOn) {
+        if (fwithSDD) fCFContCascadePIDXiPlus = new AliCFContainer(Form("fCFContCascadePIDXiPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",
+                                                                   fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                   "Pt_{cascade} Vs M_{#Xi^{+} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar);
+        else if (!fwithSDD) fCFContCascadePIDXiPlus = new AliCFContainer(Form("fCFContCascadePIDXiPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",
+                                                                         fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                         "Pt_{cascade} Vs M_{#Xi^{+} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar);
+   } else if (fCollidingSystem == "pp" && !fkSDDSelectionOn) { 
+        fCFContCascadePIDXiPlus = new AliCFContainer(Form("fCFContCascadePIDXiPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",
+                                                     fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                     "Pt_{cascade} Vs M_{#Xi^{+} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar);
+   } else if (fCollidingSystem == "pPb") {
+        fCFContCascadePIDXiPlus = new AliCFContainer(Form("fCFContCascadePIDXiPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",
+                                                     fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                     "Pt_{cascade} Vs M_{#Xi^{+} candidates} Vs Y_{#Xi}", lNbSteps, lNbVariables, lNbBinsPerVar);
+   }
      //Setting the bin limits 
    fCFContCascadePIDXiPlus->SetBinLimits(0,   0.0  ,  10.0 );  // Pt(Cascade)
    fCFContCascadePIDXiPlus->SetBinLimits(1,   1.2  ,   2.0 );  // Xi Effective mass
@@ -753,10 +820,22 @@ void AliAnalysisTaskCheckCascadepp276::UserCreateOutputObjects() {
    lNbBinsPerVar[0] = 100;
    lNbBinsPerVar[1] = 1000;
    lNbBinsPerVar[2] = 22;
-   if (fkSDDSelectionOn) {
-        if (fwithSDD) fCFContCascadePIDOmegaMinus = new AliCFContainer(Form("fCFContCascadePIDOmegaMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Omega^{-} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
-        else if (!fwithSDD) fCFContCascadePIDOmegaMinus = new AliCFContainer(Form("fCFContCascadePIDOmegaMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Omega^{-} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
-   } else if (!fkSDDSelectionOn) fCFContCascadePIDOmegaMinus = new AliCFContainer(Form("fCFContCascadePIDOmegaMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Omega^{-} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   if (fCollidingSystem == "pp" && fkSDDSelectionOn) {
+        if (fwithSDD) fCFContCascadePIDOmegaMinus = new AliCFContainer(Form("fCFContCascadePIDOmegaMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",
+                                                                       fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                       "Pt_{cascade} Vs M_{#Omega^{-} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+        else if (!fwithSDD) fCFContCascadePIDOmegaMinus = new AliCFContainer(Form("fCFContCascadePIDOmegaMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",
+                                                                             fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                             "Pt_{cascade} Vs M_{#Omega^{-} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   } else if (!fkSDDSelectionOn) {
+        fCFContCascadePIDOmegaMinus = new AliCFContainer(Form("fCFContCascadePIDOmegaMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",
+                                                         fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                         "Pt_{cascade} Vs M_{#Omega^{-} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   } else if (fCollidingSystem == "pPb") {
+        fCFContCascadePIDOmegaMinus = new AliCFContainer(Form("fCFContCascadePIDOmegaMinus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",
+                                                         fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                         "Pt_{cascade} Vs M_{#Omega^{-} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   }
      //Setting the bin limits 
    fCFContCascadePIDOmegaMinus->SetBinLimits(0,   0.0  ,  10.0 );      // Pt(Cascade)
    fCFContCascadePIDOmegaMinus->SetBinLimits(1,   1.5  ,   2.5 );      // Omega Effective mass
@@ -784,10 +863,22 @@ void AliAnalysisTaskCheckCascadepp276::UserCreateOutputObjects() {
    lNbBinsPerVar[0] = 100;
    lNbBinsPerVar[1] = 1000;
    lNbBinsPerVar[2] = 22; 
-   if (fkSDDSelectionOn) {
-        if (fwithSDD) fCFContCascadePIDOmegaPlus = new AliCFContainer(Form("fCFContCascadePIDOmegaPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Omega^{+} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
-        else if (!fwithSDD) fCFContCascadePIDOmegaPlus = new AliCFContainer(Form("fCFContCascadePIDOmegaPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Omega^{+} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
-   } else if (!fkSDDSelectionOn) fCFContCascadePIDOmegaPlus = new AliCFContainer(Form("fCFContCascadePIDOmegaPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Pt_{cascade} Vs M_{#Omega^{+} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   if (fCollidingSystem == "pp" && fkSDDSelectionOn) {
+        if (fwithSDD) fCFContCascadePIDOmegaPlus = new AliCFContainer(Form("fCFContCascadePIDOmegaPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",
+                                                                      fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                      "Pt_{cascade} Vs M_{#Omega^{+} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+        else if (!fwithSDD) fCFContCascadePIDOmegaPlus = new AliCFContainer(Form("fCFContCascadePIDOmegaPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",
+                                                                            fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                            "Pt_{cascade} Vs M_{#Omega^{+} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   } else if (fCollidingSystem == "pp" && !fkSDDSelectionOn) {
+        fCFContCascadePIDOmegaPlus = new AliCFContainer(Form("fCFContCascadePIDOmegaPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",
+                                                        fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                        "Pt_{cascade} Vs M_{#Omega^{+} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   } else if (fCollidingSystem == "pPb") {
+        fCFContCascadePIDOmegaPlus = new AliCFContainer(Form("fCFContCascadePIDOmegaPlus_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",
+                                                        fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                        "Pt_{cascade} Vs M_{#Omega^{+} candidates} Vs Y_{#Omega}", lNbSteps, lNbVariables, lNbBinsPerVar );
+   }
      //Setting the bin limits 
    fCFContCascadePIDOmegaPlus->SetBinLimits(0,   0.0  ,  10.0 );       // Pt(Cascade)
    fCFContCascadePIDOmegaPlus->SetBinLimits(1,   1.5  ,   2.5 );       // Omega Effective mass
@@ -833,10 +924,22 @@ void AliAnalysisTaskCheckCascadepp276::UserCreateOutputObjects() {
    lNbBinsPerVar[16] = 112;    //Proper lenght of cascade       
    lNbBinsPerVar[17] = 112;    //Proper lenght of V0
    lNbBinsPerVar[18] = 112;    //Distance V0-Xi in transverse plane
-   if (fkSDDSelectionOn) {
-        if (fwithSDD) fCFContCascadeCuts = new AliCFContainer(Form("fCFContCascadeCuts_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Container for Cascade cuts", lNbSteps, lNbVariables, lNbBinsPerVar);
-        else if (!fwithSDD) fCFContCascadeCuts = new AliCFContainer(Form("fCFContCascadeCuts_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Container for Cascade cuts", lNbSteps, lNbVariables, lNbBinsPerVar);
-   } else if (!fkSDDSelectionOn) fCFContCascadeCuts = new AliCFContainer(Form("fCFContCascadeCuts_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),"Container for Cascade cuts", lNbSteps, lNbVariables, lNbBinsPerVar);
+   if (fCollidingSystem == "pp" && fkSDDSelectionOn) {
+        if (fwithSDD) fCFContCascadeCuts = new AliCFContainer(Form("fCFContCascadeCuts_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDon",
+                                                              fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                              "Container for Cascade cuts", lNbSteps, lNbVariables, lNbBinsPerVar);
+        else if (!fwithSDD) fCFContCascadeCuts = new AliCFContainer(Form("fCFContCascadeCuts_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_wSDDoff",
+                                                                    fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                                    "Container for Cascade cuts", lNbSteps, lNbVariables, lNbBinsPerVar);
+   } else if (fCollidingSystem == "pp" && !fkSDDSelectionOn) {
+        fCFContCascadeCuts = new AliCFContainer(Form("fCFContCascadeCuts_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f_woSDD",
+                                                fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                "Container for Cascade cuts", lNbSteps, lNbVariables, lNbBinsPerVar);
+   } else if (fCollidingSystem == "pPb") {
+        fCFContCascadeCuts = new AliCFContainer(Form("fCFContCascadeCuts_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",
+                                                fMinnTPCcls,fVtxRange,fVtxRangeMin,fMinPtCutOnDaughterTracks,fEtaCutOnDaughterTracks),
+                                                "Container for Cascade cuts", lNbSteps, lNbVariables, lNbBinsPerVar);
+   }
      //Setting the bin limits 
      //0 -  DcaXiDaughters
    Double_t *lBinLim0  = new Double_t[ lNbBinsPerVar[0] + 1 ];
@@ -956,12 +1059,20 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
   AliESDEvent *lESDevent = 0x0;
   AliAODEvent *lAODevent = 0x0;
 
+  //----------------------
+  // Check the PIDresponse
   //---------------------
-  //Check the PIDresponse
   if(!fPIDResponse) {
        AliError("Cannot get pid response");
        return;
   }
+  if(! fESDtrackCuts ){
+       fESDtrackCuts = new AliESDtrackCuts();
+  }
+  if(! fUtils ){
+       fUtils = new AliAnalysisUtils();
+  }
+
 
   ///////////////////
   // EVENT SELECTIONS
@@ -1006,7 +1117,7 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
   // - Fill the plots
   fHistCascadeMultiplicityBeforeAnySel->Fill(ncascadesBeforeAnySel);
   fHistTrackMultiplicityBeforeAnySel->Fill(nTrackMultiplicityBeforeAnySel);
+
   //--------------
   // SDD selection
   //--------------
@@ -1015,7 +1126,7 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
   Int_t nTrackMultiplicityAfterSDDSel = 0;
   // - Selection for ESD and AOD
   if (fAnalysisType == "ESD") {
-     if (fkSDDSelectionOn) {
+     if (fkSDDSelectionOn && fCollidingSystem == "pp") {
         TString trcl = lESDevent->GetFiredTriggerClasses();
         //cout<<"Fired Trigger Classes: "<<trcl<<endl;
         if (fwithSDD){
@@ -1046,7 +1157,7 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
      ncascadesAfterSDDSel = lESDevent->GetNumberOfCascades();
      nTrackMultiplicityAfterSDDSel = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
   } else if (fAnalysisType == "AOD") {
-     if (fkSDDSelectionOn) {
+     if (fkSDDSelectionOn && fCollidingSystem == "pp") {
         TString trcl = lAODevent->GetFiredTriggerClasses();
         if (fwithSDD){
            if(!(trcl.Contains("ALLNOTRD"))) {
@@ -1080,60 +1191,54 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
   fHistCascadeMultiplicityAfterSDDSel->Fill(ncascadesAfterSDDSel);
   fHistTrackMultiplicityAfterSDDSel->Fill(nTrackMultiplicityAfterSDDSel);
 
-  //----------------------------------------------
-  // Physics selection (+ re-vertexer for the ESD)
-  //----------------------------------------------
+  //-------------------------------------------
+  // Multiplicity estimators for pPb collisions  //FIXME
+  //-------------------------------------------
+  //AliCentrality* centrality = 0;
+  //if      (fAnalysisType == "ESD" && (fCollidingSystem == "pPb")) centrality = lESDevent->GetCentrality();
+  //else if (fAnalysisType == "AOD" && (fCollidingSystem == "pPb")) centrality = lAODevent->GetCentrality();
+  //Float_t lcentrality = 0.;
+  //if (fCollidingSystem == "pPb") {
+  //     if (fkUseCleaning) lcentrality = centrality->GetCentralityPercentile(fCentrEstimator.Data());
+  //     else {
+  //         lcentrality = centrality->GetCentralityPercentileUnchecked(fCentrEstimator.Data());
+  //         if (centrality->GetQuality()>1) {
+  //             PostData(1, fCFContCascadeCuts);
+  //            return;
+  //         }
+  //     }
+  //     //if (lcentrality<fCentrLowLim||lcentrality>=fCentrUpLim) { 
+  //     //    PostData(1, fCFContCascadeCuts);
+  //     //    return;
+  //     //}
+  //} else if (fCollidingSystem == "pp") lcentrality = 0.;  
+
+  //------------------
+  // Physics selection 
+  //-----------------
   // - Define the variables
   Int_t ncascadesAfterPhysicsSel = 0;
   Int_t nTrackMultiplicityAfterPhysicsSel = 0;
   // - Selection for ESD and AOD
+  UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
+  Bool_t isSelected = 0;
+  if      (fCollidingSystem == "pp" ) isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
+  else if (fCollidingSystem == "pPb") isSelected = (maskIsSelected & AliVEvent::kINT7) == AliVEvent::kINT7;
+  if(! isSelected){
+      PostData(1, fListHistCascade);
+      PostData(2, fCFContCascadePIDXiMinus);
+      PostData(3, fCFContCascadePIDXiPlus);
+      PostData(4, fCFContCascadePIDOmegaMinus);
+      PostData(5, fCFContCascadePIDOmegaPlus);
+      PostData(6, fCFContCascadeCuts);
+      cout<<"We are selecting the events that past tha Physics Selection. This event does not pass the Physics Selection. =>  RETURN!! (Exclude it)..."<<endl;
+      return;
+  }
   if (fAnalysisType == "ESD") {
-      UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
-      Bool_t isSelected = 0;
-      isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
-      if(! isSelected){
-          PostData(1, fListHistCascade);
-          PostData(2, fCFContCascadePIDXiMinus);
-          PostData(3, fCFContCascadePIDXiPlus);
-          PostData(4, fCFContCascadePIDOmegaMinus);
-          PostData(5, fCFContCascadePIDOmegaPlus);
-          PostData(6, fCFContCascadeCuts);
-          cout<<"We are selecting the events that past tha Physics Selection. This event does not pass the Physics Selection. =>  RETURN!! (Exclude it)..."<<endl;
-          return;
-      }
       // - Take the number of cascades and tracks after physics selection
       ncascadesAfterPhysicsSel = lESDevent->GetNumberOfCascades();    
       nTrackMultiplicityAfterPhysicsSel = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);  
-      // - Cascade vertexer (ESD)
-      // Relaunch V0 and Cascade vertexers
-      if (fkRerunV0CascVertexers) { 
-            lESDevent->ResetCascades();
-            lESDevent->ResetV0s();
-            AliV0vertexer *lV0vtxer = new AliV0vertexer();
-            AliCascadeVertexer *lCascVtxer = new AliCascadeVertexer();
-            //lV0vtxer->GetCuts(fV0Sels);
-            //lCascVtxer->GetCuts(fCascSels);
-            lV0vtxer->SetCuts(fV0Sels);      // NB don't use SetDefaultCuts!! because it acts on static variables 
-            lCascVtxer->SetCuts(fCascSels);
-            lV0vtxer->Tracks2V0vertices(lESDevent);
-            lCascVtxer->V0sTracks2CascadeVertices(lESDevent);
-            //delete lV0vtxer;
-            //delete lCascVtxer;
-      }         
   } else if (fAnalysisType == "AOD") {
-      UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
-      Bool_t isSelected = 0;
-      isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
-      if(! isSelected){
-          PostData(1, fListHistCascade);
-          PostData(2, fCFContCascadePIDXiMinus);
-          PostData(3, fCFContCascadePIDXiPlus);
-          PostData(4, fCFContCascadePIDOmegaMinus);
-          PostData(5, fCFContCascadePIDOmegaPlus);
-          PostData(6, fCFContCascadeCuts);
-          cout<<"We are selecting the events that past tha Physics Selection. This event does not pass the Physics Selection. =>  RETURN!! (Exclude it)..."<<endl;
-          return;
-      }    
       // - Take the number of cascades and tracks after the physics selection
       ncascadesAfterPhysicsSel = lAODevent->GetNumberOfCascades();
       nTrackMultiplicityAfterPhysicsSel = -100;  //FIXME: I can't find the equivalent method for the AOD    
@@ -1142,20 +1247,90 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
   fHistCascadeMultiplicityAfterPhysicsSel->Fill(ncascadesAfterPhysicsSel);
   fHistTrackMultiplicityAfterPhysicsSel->Fill(nTrackMultiplicityAfterPhysicsSel);
 
+  //---------------------------------------
+  // Re-run cascade vertexer (only for ESD)
+  //---------------------------------------
+  if (fAnalysisType == "ESD" && fkRerunV0CascVertexers) {
+       lESDevent->ResetCascades();
+       lESDevent->ResetV0s();
+       AliV0vertexer *lV0vtxer = new AliV0vertexer();
+       AliCascadeVertexer *lCascVtxer = new AliCascadeVertexer();
+       //lV0vtxer->GetCuts(fV0Sels);
+       //lCascVtxer->GetCuts(fCascSels);
+       lV0vtxer->SetCuts(fV0Sels);      // NB don't use SetDefaultCuts!! because it acts on static variables 
+       lCascVtxer->SetCuts(fCascSels);
+       lV0vtxer->Tracks2V0vertices(lESDevent);
+       lCascVtxer->V0sTracks2CascadeVertices(lESDevent);
+       //delete lV0vtxer;
+       //delete lCascVtxer;
+  }
+
   //------------------------------
   // Well-established PV selection
   //------------------------------
   // - Define variables
   Int_t ncascadesForSelEvtNoTPCOnly = 0;
   Int_t nTrackMultiplicityForSelEvtNoTPCOnly = 0;
-  // - Selection for ESD and AOD
-  if (fAnalysisType == "ESD") {
-      // - Vertex coordinates: get the PVs stored in the ESD found with tracks and SPD
-      const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks();
-      const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD();
-      // - Select only looking at events with well-established PV
-      if (fkQualityCutNoTPConlyPrimVtx) {
-          if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtx->GetStatus() ){
+  // - Selection for the two colliding systems
+  if (fCollidingSystem == "pp") {
+      // - Selection for ESD and AOD
+      if (fAnalysisType == "ESD") {
+          // - Vertex coordinates: get the PVs stored in the ESD found with tracks and SPD
+          const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks();
+          const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD();
+          // - Select only looking at events with well-established PV
+          if (fkQualityCutNoTPConlyPrimVtx) {
+              if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtx->GetStatus() ){
+                  AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
+                  PostData(1, fListHistCascade);
+                  PostData(2, fCFContCascadePIDXiMinus);
+                  PostData(3, fCFContCascadePIDXiPlus);
+                  PostData(4, fCFContCascadePIDOmegaMinus);
+                  PostData(5, fCFContCascadePIDOmegaPlus);
+                  PostData(6, fCFContCascadeCuts);
+                  return;
+              }
+          }
+          // - Take the number of cascades and tracks after TPConly selection
+          ncascadesForSelEvtNoTPCOnly = lESDevent->GetNumberOfCascades();
+          nTrackMultiplicityForSelEvtNoTPCOnly = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
+      } else if (fAnalysisType == "AOD") {
+          // - Vertex coordinates: get the PVs stored in the AOD found with tracks and SPD
+          const AliAODVertex *lPrimarySPDVtx = lAODevent->GetPrimaryVertexSPD();
+          const AliAODVertex *lPrimaryTrackingAODVtx = lAODevent->GetPrimaryVertex();
+          // - Select only looking at events with well-established PV
+          if (fkQualityCutNoTPConlyPrimVtx) {
+              if (!lPrimarySPDVtx && !lPrimaryTrackingAODVtx) {
+                  AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
+                  PostData(1, fListHistCascade);
+                  PostData(2, fCFContCascadePIDXiMinus);
+                  PostData(3, fCFContCascadePIDXiPlus);
+                  PostData(4, fCFContCascadePIDOmegaMinus);
+                  PostData(5, fCFContCascadePIDOmegaPlus);
+                  PostData(6, fCFContCascadeCuts);
+                  return;
+              }
+          }
+          // - Take the number of cascades and tracks after TPConly selection
+          ncascadesForSelEvtNoTPCOnly = lAODevent->GetNumberOfCascades();
+          nTrackMultiplicityForSelEvtNoTPCOnly = -100;  //FIXME: I can't find the equivalent method for the AOD
+      }
+  } else if (fCollidingSystem == "pPb") {
+      if (fAnalysisType == "ESD") {
+          Bool_t fHasVertex = kFALSE;
+          const AliESDVertex *vertex = lESDevent->GetPrimaryVertexTracks();
+          if (vertex->GetNContributors() < 1) {
+              vertex = lESDevent->GetPrimaryVertexSPD();
+              if (vertex->GetNContributors() < 1) fHasVertex = kFALSE;
+              else fHasVertex = kTRUE;
+              TString vtxTyp = vertex->GetTitle();
+              Double_t cov[6]={0};
+              vertex->GetCovarianceMatrix(cov);
+              Double_t zRes = TMath::Sqrt(cov[5]);
+              if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE;
+          }
+          else fHasVertex = kTRUE;
+          if (fUtils->IsFirstEventInChunk(lESDevent)) { //Is First event in chunk rejection: Still present!
               AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
               PostData(1, fListHistCascade);
               PostData(2, fCFContCascadePIDXiMinus);
@@ -1165,17 +1340,24 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
               PostData(6, fCFContCascadeCuts);
               return;
           }
-      }
-      // - Take the number of cascades and tracks after TPConly selection
-      ncascadesForSelEvtNoTPCOnly = lESDevent->GetNumberOfCascades();
-      nTrackMultiplicityForSelEvtNoTPCOnly = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
-  } else if (fAnalysisType == "AOD") {
-      // - Vertex coordinates: get the PVs stored in the AOD found with tracks and SPD
-      const AliAODVertex *lPrimarySPDVtx = lAODevent->GetPrimaryVertexSPD();
-      const AliAODVertex *lPrimaryTrackingAODVtx = lAODevent->GetPrimaryVertex();
-      // - Select only looking at events with well-established PV
-      if (fkQualityCutNoTPConlyPrimVtx) {
-          if (!lPrimarySPDVtx && !lPrimaryTrackingAODVtx) {
+          // - Take the number of cascades and tracks after TPConly selection
+          ncascadesForSelEvtNoTPCOnly = lESDevent->GetNumberOfCascades();
+          nTrackMultiplicityForSelEvtNoTPCOnly = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
+      } else if (fAnalysisType == "AOD") {
+          Bool_t fHasVertex = kFALSE;
+          const AliAODVertex *vertex = lAODevent->GetPrimaryVertex();
+          if (vertex->GetNContributors() < 1) {
+              vertex = lAODevent->GetPrimaryVertexSPD();
+              if (vertex->GetNContributors() < 1) fHasVertex = kFALSE;
+              else fHasVertex = kTRUE;
+              TString vtxTyp = vertex->GetTitle();
+              Double_t cov[6]={0};
+              vertex->GetCovarianceMatrix(cov);
+              Double_t zRes = TMath::Sqrt(cov[5]);
+              if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE;
+          }  
+          else fHasVertex = kTRUE;
+          if (fHasVertex == kFALSE) { //Is First event in chunk rejection: Still present!  //FIXME
               AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
               PostData(1, fListHistCascade);
               PostData(2, fCFContCascadePIDXiMinus);
@@ -1184,16 +1366,17 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
               PostData(5, fCFContCascadePIDOmegaPlus);
               PostData(6, fCFContCascadeCuts);
               return;
-          }
+          }  
+          // - Take the number of cascades and tracks after TPConly selection
+          ncascadesForSelEvtNoTPCOnly = lAODevent->GetNumberOfCascades();
+          nTrackMultiplicityForSelEvtNoTPCOnly = -100;  //FIXME: I can't find the equivalent method for the AOD
       }
-      // - Take the number of cascades and tracks after TPConly selection
-      ncascadesForSelEvtNoTPCOnly = lAODevent->GetNumberOfCascades();
-      nTrackMultiplicityForSelEvtNoTPCOnly = -100;  //FIXME: I can't find the equivalent method for the AOD
   }
   // - Fill the plots
   fHistCascadeMultiplicityForSelEvtNoTPCOnly->Fill(ncascadesForSelEvtNoTPCOnly);
   fHistTrackMultiplicityForSelEvtNoTPCOnly->Fill(nTrackMultiplicityForSelEvtNoTPCOnly);
-    
+   
   //----------------
   // Pilup selection
   //----------------
@@ -1201,7 +1384,7 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
   Int_t ncascadesForSelEvtNoTPCOnlyNoPileup = 0;
   Int_t nTrackMultiplicityForSelEvtNoTPCOnlyNoPileup = 0;
   // - Selection for ESD and AOD
-  if (fAnalysisType == "ESD") {
+  if (fAnalysisType == "ESD" && fCollidingSystem == "pp") {
       if (fkQualityCutPileup) {
           if(lESDevent->IsPileupFromSPD()){
               AliWarning("Pb / Pile-up event ... return!");
@@ -1217,7 +1400,7 @@ void AliAnalysisTaskCheckCascadepp276::UserExec(Option_t *) {
       // - Take the number of cascades and tracks after Pileup selection
       ncascadesForSelEvtNoTPCOnlyNoPileup = lESDevent->GetNumberOfCascades();
       nTrackMultiplicityForSelEvtNoTPCOnlyNoPileup = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
-  } else if (fAnalysisType == "AOD") {
+  } else if (fAnalysisType == "AOD" && fCollidingSystem == "pp") {
       if (fkQualityCutPileup) {
           if(lAODevent->IsPileupFromSPD()){
               AliWarning("Pb / Pile-up event ... return!");
index ad6650f6f38812279d272d327d1909e66d7e28e0..35bebe3167565e33038ec416b7360ec183c68041 100644 (file)
@@ -28,6 +28,7 @@ class AliESDEvent;
 class AliPhysicsSelection;
 class AliCFContainer;
 class AliPIDResponse;
+class AliAnalysisUtils;
 
 #include "TString.h"
 
@@ -53,6 +54,7 @@ class AliAnalysisTaskCheckCascadepp276 : public AliAnalysisTaskSE {
   virtual void   Terminate(Option_t *);
   
   void SetAnalysisType               (const char* analysisType          = "ESD"  ) { fAnalysisType                = analysisType;               }
+  void SetCollidingSystem            (const char* collidingSystem       = "pp") { fCollidingSystem             = collidingSystem;            }
   void SetRelaunchV0CascVertexers    (Bool_t rerunV0CascVertexers       = kFALSE ) { fkRerunV0CascVertexers       = rerunV0CascVertexers;       }
   void SetSDDSelection               (Bool_t sddOnSelection             = kTRUE  ) { fkSDDSelectionOn             = sddOnSelection;             }
   void SetQualityCutZprimVtxPos      (Bool_t qualityCutZprimVtxPos      = kTRUE  ) { fkQualityCutZprimVtxPos      = qualityCutZprimVtxPos;      }
@@ -74,9 +76,13 @@ class AliAnalysisTaskCheckCascadepp276 : public AliAnalysisTaskSE {
         // http://root.cern.ch/download/doc/11InputOutput.pdf, page 14
 
 
-        TString         fAnalysisType;                  // "ESD" or "AOD" analysis type        
-        AliESDtrackCuts *fESDtrackCuts;                 // ESD track cuts used for primary track definition
-        AliPIDResponse  *fPIDResponse;                  //! PID response object
+        TString          fAnalysisType;                  // "ESD" or "AOD" analysis type       
+       // TString          fCollidingSystem;               // "pPb" or "pp" colliding system
+        AliESDtrackCuts  *fESDtrackCuts;                 // ESD track cuts used for primary track definition
+       // AliPIDResponse   *fPIDResponse;                  //! PID response object
+        AliAnalysisUtils *fUtils;                        // analysis utils (for pA vertex selection)
+        TString          fCollidingSystem;               // "pPb" or "pp" colliding system
+        AliPIDResponse   *fPIDResponse;                  //! PID response object
 
         Bool_t          fkRerunV0CascVertexers;         // Boolean : kTRUE = relaunch both V0 + Cascade vertexers
         Bool_t          fkSDDSelectionOn;               // Boolena : kTRUE = select events with SDD on
index 2f4398dd66a86b1c62a301d720cef095cc96b573..48bf37e19e4808126d67d8bb8067d00ec93f02b0 100644 (file)
 //                        - cos of PA V0 wrt Xi vertex and not primary vertex  
 //                        - distance xi-V0 added in the container
 //                        - AOD analysis developed (January 2012)
-//
-//
-//
-//              Adapted to pp 2.76 analysis: D. Colella, domenico.colella@ba.infn.it (Nov. 2012):
+//                   
+//            Adapted to pp 2.76 analysis: D. Colella, domenico.colella@ba.infn.it (Nov. 2012):
 //                        - added new and removed other histograms 
 //                        - Physics selection moved here (mainly for normalization in the efficiency calcuation)
 //                        - Centrality selection deleted
 //                        - 3DHisto denominator moved before any event selection for Normalization
 //                        - injected and natural part of MC selection removed
 // 
-//
+//            Adapted to pPb 5.02 TeV analysis: D. Colella, domenico.colella@ba.infn.it (Sep. 2014)
+//                        - Added the parameter fCollidingSystem, to distingish between pp and pPb procedures
+//                         
 //
 //-----------------------------------------------------------------
 
@@ -83,6 +83,7 @@
 #include "AliAODEvent.h"
 #include "AliAODMCParticle.h" 
 #include "AliAnalysisTaskCheckPerformanceCascadepp276.h"
+#include "AliAnalysisUtils.h"
 
 using std::cout;
 using std::endl;
@@ -96,6 +97,8 @@ AliAnalysisTaskCheckPerformanceCascadepp276::AliAnalysisTaskCheckPerformanceCasc
 : AliAnalysisTaskSE(), // <- take care to AliAnalysisTask( empty )
     fAnalysisType                  ("ESD"), 
     fESDtrackCuts                  (0), 
+    fUtils                         (0),
+    fCollidingSystem               ("pp"), 
     fPIDResponse                   (0),
     fkRerunV0CascVertexers         (0),
     fkSDDselectionOn               (kTRUE),
@@ -294,6 +297,8 @@ AliAnalysisTaskCheckPerformanceCascadepp276::AliAnalysisTaskCheckPerformanceCasc
   : AliAnalysisTaskSE(name),
     fAnalysisType                  ("ESD"), 
     fESDtrackCuts                  (0),
+    fUtils                         (0),
+    fCollidingSystem               ("pp"),
     fPIDResponse                   (0),
     fkRerunV0CascVertexers         (0),
     fkSDDselectionOn               (kTRUE),
@@ -484,30 +489,46 @@ AliAnalysisTaskCheckPerformanceCascadepp276::AliAnalysisTaskCheckPerformanceCasc
       // Define input and output slots here
       // Input slot #0 works with a TChain
       // Output slot #1 writes into a TList container (cascade)
-        
-        // PbPb default cuts  
-        fV0Sels[0] =  33.;       // max allowed chi2
-        fV0Sels[1] =   0.1;      // min allowed impact parameter for the 1st daughter 
-        fV0Sels[2] =   0.1;      // min allowed impact parameter for the 2nd daughter 
-        fV0Sels[3] =   1.5 ;     // max allowed DCA between the daughter tracks       
-        fV0Sels[4] =   0.9 ;     // min allowed cosine of V0's pointing angle         
-        fV0Sels[5] =   0.2;      // min radius of the fiducial volume                 
-        fV0Sels[6] = 200.  ;     // max radius of the fiducial volume                 
-        fCascSels[0] =  33.;     // max allowed chi2 
-        fCascSels[1] =   0.01;   // min allowed V0 impact parameter                    
-        fCascSels[2] =   0.008;  // "window" around the Lambda mass                    
-        fCascSels[3] =   0.01;   // min allowed bachelor's impact parameter            
-        fCascSels[4] =   2.0  ;  // max allowed DCA between the V0 and the bachelor    
-        fCascSels[5] =   0.95;   // min allowed cosine of the cascade pointing angle   
-        fCascSels[6] =   0.2  ;  // min radius of the fiducial volume                  
-        fCascSels[7] = 100.   ;  // max radius of the fiducial volume                  
+      if (fCollidingSystem == "pp") {
+         fV0Sels[0] =  33.  ;     // max allowed chi2
+         fV0Sels[1] =   0.01;     // min allowed impact parameter for the 1st daughter 
+         fV0Sels[2] =   0.01;     // min allowed impact parameter for the 2nd daughter 
+         fV0Sels[3] =   1.5;      // max allowed DCA between the daughter tracks       
+         fV0Sels[4] =   0.9;      // min allowed cosine of V0's pointing angle - This is pT dependent        
+         fV0Sels[5] =   0.2;      // min radius of the fiducial volume                 
+         fV0Sels[6] = 200.;       // max radius of the fiducial volume                 
+         fCascSels[0] =  33.;     // max allowed chi2 (same as PDC07)
+         fCascSels[1] =   0.01;   // min allowed V0 impact parameter                    
+         fCascSels[2] =   0.008;  // "window" around the Lambda mass                    
+         fCascSels[3] =   0.01;   // min allowed bachelor's impact parameter          
+         fCascSels[4] =   2.0;    // max allowed DCA between the V0 and the bachelor    
+         fCascSels[5] =   0.95;   // min allowed cosine of the cascade pointing angle   
+         fCascSels[6] =   0.2;    // min radius of the fiducial volume                  
+         fCascSels[7] = 100.;     // max radius of the fiducial volume 
+      } else if (fCollidingSystem == "pPb") {
+         fV0Sels[0] =  33.  ;     // max allowed chi2
+         fV0Sels[1] =   0.02;     // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05)
+         fV0Sels[2] =   0.02;     // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05)
+         fV0Sels[3] =   2.0 ;     // max allowed DCA between the daughter tracks       (LHC09a4 : 0.5)
+         fV0Sels[4] =   0.95;     // min allowed cosine of V0's pointing angle         (LHC09a4 : 0.99)
+         fV0Sels[5] =   1.0 ;     // min radius of the fiducial volume                 (LHC09a4 : 0.2)
+         fV0Sels[6] = 200.  ;     // max radius of the fiducial volume                 (LHC09a4 : 100.0)
+         fCascSels[0] =  33.   ;  // max allowed chi2 (same as PDC07)
+         fCascSels[1] =   0.05 ;  // min allowed V0 impact parameter                    (PDC07 : 0.05   / LHC09a4 : 0.025 )
+         fCascSels[2] =   0.010;  // "window" around the Lambda mass                    (PDC07 : 0.008  / LHC09a4 : 0.010 )
+         fCascSels[3] =   0.03 ;  // min allowed bachelor's impact parameter            (PDC07 : 0.035  / LHC09a4 : 0.025 )
+         fCascSels[4] =   2.0  ;  // max allowed DCA between the V0 and the bachelor    (PDC07 : 0.1    / LHC09a4 : 0.2   )
+         fCascSels[5] =   0.95 ;  // min allowed cosine of the cascade pointing angle   (PDC07 : 0.9985 / LHC09a4 : 0.998 )
+         fCascSels[6] =   0.4  ;  // min radius of the fiducial volume                  (PDC07 : 0.9    / LHC09a4 : 0.2   )
+         fCascSels[7] = 100.   ;  // max radius of the fiducial volume                  (PDC07 : 100    / LHC09a4 : 100   )
+      }
               
-        DefineOutput(1, TList::Class());
-        DefineOutput(2, AliCFContainer::Class());
-        DefineOutput(3, AliCFContainer::Class());
-        DefineOutput(4, AliCFContainer::Class());
-        DefineOutput(5, AliCFContainer::Class());
-        DefineOutput(6, AliCFContainer::Class());
+      DefineOutput(1, TList::Class());
+      DefineOutput(2, AliCFContainer::Class());
+      DefineOutput(3, AliCFContainer::Class());
+      DefineOutput(4, AliCFContainer::Class());
+      DefineOutput(5, AliCFContainer::Class());
+      DefineOutput(6, AliCFContainer::Class());
     }
 
     //____Destructor____
@@ -549,6 +570,9 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserCreateOutputObjects() {
  if (! fESDtrackCuts ){
       fESDtrackCuts = new AliESDtrackCuts();
  }
+ if (! fUtils){
+      fUtils = new AliAnalysisUtils();
+ }
  
  //----------------------
  // Initialize the histos
@@ -1454,31 +1478,6 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
            cout << "Name of the file with pb :" <<  CurrentFileName() << endl;
            return;
        }
-       // - Cascade vertexer (ESD)
-       // Relaunch V0 and Cascade vertexer
-       if (fkRerunV0CascVertexers) { 
-           lESDevent->ResetCascades();
-           lESDevent->ResetV0s();
-           AliV0vertexer *lV0vtxer = new AliV0vertexer();
-           AliCascadeVertexer *lCascVtxer = new AliCascadeVertexer();
-           //lV0vtxer->GetCuts(fV0Sels);
-           //lCascVtxer->GetCuts(fCascSels);
-           lV0vtxer->SetCuts(fV0Sels);      // NB don't use SetDefaultCuts!! because it acts on static variables 
-           lCascVtxer->SetCuts(fCascSels);
-           lV0vtxer->Tracks2V0vertices(lESDevent);
-           lCascVtxer->V0sTracks2CascadeVertices(lESDevent);
-           //delete lV0vtxer;
-           //delete lCascVtxer; 
-           //---
-           //lESDevent->ResetCascades();
-           //lESDevent->ResetV0s();
-           //AliV0vertexer lV0vtxer;
-           //AliCascadeVertexer lCascVtxer;
-           //lV0vtxer.SetCuts(fV0Sels);
-           //lCascVtxer.SetCuts(fCascSels);
-           //lV0vtxer.Tracks2V0vertices(lESDevent);
-           //lCascVtxer.V0sTracks2CascadeVertices(lESDevent);
-       }
    } else if (fAnalysisType == "AOD") {  
        lAODevent = dynamic_cast<AliAODEvent*>( InputEvent() ); 
        if (!lAODevent) {
@@ -1509,7 +1508,7 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
        //Multiplicity
        Int_t lMultiplicity = -100;
        nTrackMultiplicityBeforeAnySel = lMultiplicity;
-       ncascadesBeforeAnySel  = lAODevent->GetNumberOfCascades();
+       ncascadesBeforeAnySel = lAODevent->GetNumberOfCascades();
    }
    fHistTrackMultiplicityBeforeAnySel->Fill(nTrackMultiplicityBeforeAnySel);
    fHistCascadeMultiplicityBeforeAnySel->Fill(ncascadesBeforeAnySel);
@@ -1520,7 +1519,7 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
    // - Define variables
    Int_t  ncascadesAfterSDDSel          = -1; //number of cascades after SDD selection
    Int_t  nTrackMultiplicityAfterSDDSel = -1; //number of tracks after SDD selection
-   if (fkSDDselectionOn) {
+   if (fkSDDselectionOn && fCollidingSystem == "pp") {
         TString trcl = " ";
         trcl = lESDevent->GetFiredTriggerClasses();
         if (fAnalysisType == "ESD") trcl = lESDevent->GetFiredTriggerClasses();
@@ -1673,7 +1672,6 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
        }
    }
 
    //--------------------
    // - Physics selection
    //--------------------
@@ -1681,35 +1679,24 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
    Int_t    ncascadesAfterPhysicsSel          = -1; //number of cascades after physics selection
    Int_t    nTrackMultiplicityAfterPhysicsSel = -1; //number of tracks after physics selection
    // - Selection for ESD and AOD
+   UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
+   Bool_t isSelected = 0;
+   if      (fCollidingSystem == "pp" ) isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
+   else if (fCollidingSystem == "pPb") isSelected = (maskIsSelected & AliVEvent::kINT7) == AliVEvent::kINT7;
+   if(!isSelected){
+       PostData(1, fListHistCascade);
+       PostData(2, fCFContCascadePIDAsXiMinus);
+       PostData(3, fCFContCascadePIDAsXiPlus);
+       PostData(4, fCFContCascadePIDAsOmegaMinus);
+       PostData(5, fCFContCascadePIDAsOmegaPlus);
+       PostData(6, fCFContAsCascadeCuts);
+       return;
+   }
    if (fAnalysisType == "ESD") {
-       UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
-       Bool_t isSelected = 0;
-       isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
-       if(!isSelected){
-           PostData(1, fListHistCascade);
-           PostData(2, fCFContCascadePIDAsXiMinus);
-           PostData(3, fCFContCascadePIDAsXiPlus);
-           PostData(4, fCFContCascadePIDAsOmegaMinus);
-           PostData(5, fCFContCascadePIDAsOmegaPlus);
-           PostData(6, fCFContAsCascadeCuts);
-           return;
-       }
        // - Take the number of cascades and tracks after physics selection
        ncascadesAfterPhysicsSel = lESDevent->GetNumberOfCascades();
        nTrackMultiplicityAfterPhysicsSel = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC, 0.5);
    } else if (fAnalysisType == "AOD") {
-       UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
-       Bool_t isSelected = 0;
-       isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
-       if(!isSelected){
-           PostData(1, fListHistCascade);
-           PostData(2, fCFContCascadePIDAsXiMinus);
-           PostData(3, fCFContCascadePIDAsXiPlus);
-           PostData(4, fCFContCascadePIDAsOmegaMinus);
-           PostData(5, fCFContCascadePIDAsOmegaPlus);
-           PostData(6, fCFContAsCascadeCuts);
-           return;
-       }
        // - Take the number of cascades and tracks after physics selection
        ncascadesAfterPhysicsSel = lAODevent->GetNumberOfCascades();
        nTrackMultiplicityAfterPhysicsSel = -100;
@@ -1717,50 +1704,129 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
    fHistCascadeMultiplicityAfterPhysicsSel->Fill(ncascadesAfterPhysicsSel);
    fHistTrackMultiplicityAfterPhysicsSel->Fill(nTrackMultiplicityAfterPhysicsSel);
 
+   //------------------------
+   // - Cascade vertexer (ESD)
+   //-------------------------
+   // Relaunch V0 and Cascade vertexer
+   if (fAnalysisType == "ESD" && fkRerunV0CascVertexers) {
+           lESDevent->ResetCascades();
+           lESDevent->ResetV0s();
+           AliV0vertexer *lV0vtxer = new AliV0vertexer();
+           AliCascadeVertexer *lCascVtxer = new AliCascadeVertexer();
+           //lV0vtxer->GetCuts(fV0Sels);
+           //lCascVtxer->GetCuts(fCascSels);
+           lV0vtxer->SetCuts(fV0Sels);      // NB don't use SetDefaultCuts!! because it acts on static variables 
+           lCascVtxer->SetCuts(fCascSels);
+           lV0vtxer->Tracks2V0vertices(lESDevent);
+           lCascVtxer->V0sTracks2CascadeVertices(lESDevent);
+           //delete lV0vtxer;
+           //delete lCascVtxer; 
+   }
+
    //-------------------------------------------------------
    // Select only looking at events with well-established PV
    //-------------------------------------------------------
    Int_t    ncascadesForSelEvtNoTPCOnly                  = -1; //number of cascades after the TPConly selection
    Int_t    nTrackMultiplicityForSelEvtNoTPCOnly         = -1; //number of tracks after the TPConly selection
-   if (fAnalysisType == "ESD" ) {
-       // - Select only looking at events with well-established PV
-       if (fkQualityCutNoTPConlyPrimVtx) {
-           const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD();
-           const AliESDVertex *lPrimaryTrackingVtx = lESDevent->GetPrimaryVertexTracks();
-           if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingVtx->GetStatus() ){
-               AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
-               PostData(1, fListHistCascade);
-               PostData(2, fCFContCascadePIDAsXiMinus);
-               PostData(3, fCFContCascadePIDAsXiPlus);
-               PostData(4, fCFContCascadePIDAsOmegaMinus);
-               PostData(5, fCFContCascadePIDAsOmegaPlus);
-               PostData(6, fCFContAsCascadeCuts);
-               return;
+   // - Selection for the two colliding systems
+   if (fCollidingSystem == "pp") {
+       if (fAnalysisType == "ESD" ) {
+           // - Select only looking at events with well-established PV
+           if (fkQualityCutNoTPConlyPrimVtx) {
+               const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD();
+               const AliESDVertex *lPrimaryTrackingVtx = lESDevent->GetPrimaryVertexTracks();
+               if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingVtx->GetStatus() ){
+                   AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
+                   PostData(1, fListHistCascade);
+                   PostData(2, fCFContCascadePIDAsXiMinus);
+                   PostData(3, fCFContCascadePIDAsXiPlus);
+                   PostData(4, fCFContCascadePIDAsOmegaMinus);
+                   PostData(5, fCFContCascadePIDAsOmegaPlus);
+                   PostData(6, fCFContAsCascadeCuts);
+                   return;
+               }
            }
-       }
-       // - Take the number of cascades and tracks after TPConly selection
-       ncascadesForSelEvtNoTPCOnly = lESDevent->GetNumberOfCascades();
-       nTrackMultiplicityForSelEvtNoTPCOnly = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
-   } else if (fAnalysisType == "AOD") {
-       // - Select only looking at events with well-established PV
-       if (fkQualityCutNoTPConlyPrimVtx) {
-           const AliAODVertex *lPrimarySPDVtx = lAODevent->GetPrimaryVertexSPD();
-           const AliAODVertex *lPrimaryTrackingAODVtx = lAODevent->GetPrimaryVertex();
-           if (!lPrimarySPDVtx && !lPrimaryTrackingAODVtx) {
-               AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
-               PostData(1, fListHistCascade);
-               PostData(2, fCFContCascadePIDAsXiMinus);
-               PostData(3, fCFContCascadePIDAsXiPlus);
-               PostData(4, fCFContCascadePIDAsOmegaMinus);
-               PostData(5, fCFContCascadePIDAsOmegaPlus);
-               PostData(6, fCFContAsCascadeCuts);
-               return;
+           // - Take the number of cascades and tracks after TPConly selection
+           ncascadesForSelEvtNoTPCOnly = lESDevent->GetNumberOfCascades();
+           nTrackMultiplicityForSelEvtNoTPCOnly = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
+       } else if (fAnalysisType == "AOD") {
+           // - Select only looking at events with well-established PV
+           if (fkQualityCutNoTPConlyPrimVtx) {
+               const AliAODVertex *lPrimarySPDVtx = lAODevent->GetPrimaryVertexSPD();
+               const AliAODVertex *lPrimaryTrackingAODVtx = lAODevent->GetPrimaryVertex();
+               if (!lPrimarySPDVtx && !lPrimaryTrackingAODVtx) {
+                   AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
+                   PostData(1, fListHistCascade);
+                   PostData(2, fCFContCascadePIDAsXiMinus);
+                   PostData(3, fCFContCascadePIDAsXiPlus);
+                   PostData(4, fCFContCascadePIDAsOmegaMinus);
+                   PostData(5, fCFContCascadePIDAsOmegaPlus);
+                   PostData(6, fCFContAsCascadeCuts);
+                   return;
+               }
            }
+           // - Take the number of cascades and tracks after TPConly selection
+           ncascadesForSelEvtNoTPCOnly = lAODevent->GetNumberOfCascades();
+           nTrackMultiplicityForSelEvtNoTPCOnly = -100;  //FIXME
+       }
+   } else if (fCollidingSystem == "pPb") {
+      if (fAnalysisType == "ESD") {
+          Bool_t fHasVertex = kFALSE;
+          const AliESDVertex *vertex = lESDevent->GetPrimaryVertexTracks();
+          if (vertex->GetNContributors() < 1) { 
+              vertex = lESDevent->GetPrimaryVertexSPD();
+              if (vertex->GetNContributors() < 1) fHasVertex = kFALSE;
+              else fHasVertex = kTRUE;
+              TString vtxTyp = vertex->GetTitle();
+              Double_t cov[6]={0};
+              vertex->GetCovarianceMatrix(cov);
+              Double_t zRes = TMath::Sqrt(cov[5]);
+              if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE;
+          }    
+          else fHasVertex = kTRUE;
+          if (fUtils->IsFirstEventInChunk(lESDevent)) { //Is First event in chunk rejection: Still present!
+              AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
+              PostData(1, fListHistCascade);
+              PostData(2, fCFContCascadePIDAsXiMinus);
+              PostData(3, fCFContCascadePIDAsXiPlus);
+              PostData(4, fCFContCascadePIDAsOmegaMinus);
+              PostData(5, fCFContCascadePIDAsOmegaPlus);
+              PostData(6, fCFContAsCascadeCuts);
+              return;
+          }    
+          // - Take the number of cascades and tracks after TPConly selection
+          ncascadesForSelEvtNoTPCOnly = lESDevent->GetNumberOfCascades();
+          nTrackMultiplicityForSelEvtNoTPCOnly = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
+      } else if (fAnalysisType == "AOD") {
+          Bool_t fHasVertex = kFALSE;
+          const AliAODVertex *vertex = lAODevent->GetPrimaryVertex();
+          if (vertex->GetNContributors() < 1) { 
+              vertex = lAODevent->GetPrimaryVertexSPD();
+              if (vertex->GetNContributors() < 1) fHasVertex = kFALSE;
+              else fHasVertex = kTRUE;
+              TString vtxTyp = vertex->GetTitle();
+              Double_t cov[6]={0};
+              vertex->GetCovarianceMatrix(cov);
+              Double_t zRes = TMath::Sqrt(cov[5]);
+              if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE;
+          }    
+          else fHasVertex = kTRUE;
+          if (fHasVertex == kFALSE) { //Is First event in chunk rejection: Still present! //FIXME
+              AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
+              PostData(1, fListHistCascade);
+              PostData(2, fCFContCascadePIDAsXiMinus);
+              PostData(3, fCFContCascadePIDAsXiPlus);
+              PostData(4, fCFContCascadePIDAsOmegaMinus);
+              PostData(5, fCFContCascadePIDAsOmegaPlus);
+              PostData(6, fCFContAsCascadeCuts);
+              return;
+          }    
+          // - Take the number of cascades and tracks after TPConly selection
+          ncascadesForSelEvtNoTPCOnly = lAODevent->GetNumberOfCascades();
+          nTrackMultiplicityForSelEvtNoTPCOnly = -100;  //FIXME: I can't find the equivalent method for the AOD
        }
-       // - Take the number of cascades and tracks after TPConly selection
-       ncascadesForSelEvtNoTPCOnly = lAODevent->GetNumberOfCascades();
-       nTrackMultiplicityForSelEvtNoTPCOnly = -100;  //FIXME
    }
+   // - Fill the plots
    fHistCascadeMultiplicityForSelEvtNoTPCOnly->Fill(ncascadesForSelEvtNoTPCOnly);
    fHistTrackMultiplicityForSelEvtNoTPCOnly->Fill(nTrackMultiplicityForSelEvtNoTPCOnly);
     
@@ -1769,9 +1835,8 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
    //-----------------
    Int_t    ncascadesForSelEvtNoTPCOnlyNoPileup          = -1; //number of cascades after the NoPileup selection
    Int_t    nTrackMultiplicityForSelEvtNoTPCOnlyNoPileup = -1; //number of tracks after the Pileup selection
-   if (fAnalysisType == "ESD" ) {
-       // - Selection for pile up
-       if (fkRejectEventPileUp) {
+   if (fkRejectEventPileUp && fCollidingSystem == "pp") {
+       if (fAnalysisType == "ESD") {
            if(lESDevent->IsPileupFromSPD()){
                AliWarning("Pb / Pile-up event ... return!");
                PostData(1, fListHistCascade);
@@ -1781,14 +1846,8 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
                PostData(5, fCFContCascadePIDAsOmegaPlus);
                PostData(6, fCFContAsCascadeCuts);
                return;
-           }
-       }
-       // - Take the number of cascades and tracks after Pileup selection
-       ncascadesForSelEvtNoTPCOnlyNoPileup = lESDevent->GetNumberOfCascades();
-       nTrackMultiplicityForSelEvtNoTPCOnlyNoPileup = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
-   } else if (fAnalysisType == "AOD") {
-       // - Selection for pile up
-       if (fkRejectEventPileUp) {
+           } 
+       } else if (fAnalysisType == "AOD") {
            if(lAODevent->IsPileupFromSPD()){
                AliWarning("Pb / Pile-up event ... return!");
                PostData(1, fListHistCascade);
@@ -1798,9 +1857,14 @@ void AliAnalysisTaskCheckPerformanceCascadepp276::UserExec(Option_t *) {
                PostData(5, fCFContCascadePIDAsOmegaPlus);
                PostData(6, fCFContAsCascadeCuts);
                return;
-           }
+           } 
        }
-       // - Take the number of cascades and tracks after Pileup selection
+   }
+   // - Take the number of cascades and tracks after Pileup selection
+   if (fAnalysisType == "ESD") {
+       ncascadesForSelEvtNoTPCOnlyNoPileup = lESDevent->GetNumberOfCascades();
+       nTrackMultiplicityForSelEvtNoTPCOnlyNoPileup = fESDtrackCuts->GetReferenceMultiplicity(lESDevent,AliESDtrackCuts::kTrackletsITSTPC,0.5);
+   } else if (fAnalysisType == "AOD") {
        ncascadesForSelEvtNoTPCOnlyNoPileup = lAODevent->GetNumberOfCascades();
        nTrackMultiplicityForSelEvtNoTPCOnlyNoPileup = -100;
    }
index ffc0348b473f443b386384516622c17fcb3c50f2..8cf17dad1eea653279838c92b385e6fceccc004c 100644 (file)
@@ -22,6 +22,7 @@ class AliESDtrackCuts;
 class AliPhysicsSelection;
 class AliCFContainer;
 class AliPIDResponse;
+class AliAnalysisUtils;
 
 #include "AliAnalysisTaskSE.h"
 
@@ -36,23 +37,23 @@ class AliAnalysisTaskCheckPerformanceCascadepp276 : public AliAnalysisTaskSE {
   virtual void   UserExec(Option_t *option);
   virtual void   Terminate(Option_t *);
   
-  void SetAnalysisType     (const char* analysisType    = "ESD") { fAnalysisType     = analysisType;}
-  
-  void SetRelaunchV0CascVertexers    (Bool_t  rerunV0CascVertexers       = 0    ) { fkRerunV0CascVertexers        = rerunV0CascVertexers;      }
-  void SetSDDSelection               (Bool_t  sddOnSelection             = kTRUE) { fkSDDselectionOn              = sddOnSelection;            }
-  void SetQualityCutZprimVtxPos      (Bool_t  qualityCutZprimVtxPos      = kTRUE) { fkQualityCutZprimVtxPos       = qualityCutZprimVtxPos;     }
-  void SetRejectEventPileUp          (Bool_t  rejectPileUp               = kTRUE) { fkRejectEventPileUp           = rejectPileUp;              }
-  void SetQualityCutNoTPConlyPrimVtx (Bool_t  qualityCutNoTPConlyPrimVtx = kTRUE) { fkQualityCutNoTPConlyPrimVtx  = qualityCutNoTPConlyPrimVtx;}
-  void SetQualityCutTPCrefit         (Bool_t  qualityCutTPCrefit         = kTRUE) { fkQualityCutTPCrefit          = qualityCutTPCrefit;        }
-  void SetQualityCutnTPCcls          (Bool_t  qualityCutnTPCcls          = kTRUE) { fkQualityCutnTPCcls           = qualityCutnTPCcls;         }
-  void SetWithSDDOn                  (Bool_t  withsddOn                  = kTRUE) { fwithSDD                      = withsddOn;                 }
-  void SetQualityCutMinnTPCcls       (Int_t   minnTPCcls                 = 70   ) { fMinnTPCcls                   = minnTPCcls;                }
-  void SetExtraSelections            (Bool_t  extraSelections            = 0    ) { fkExtraSelections             = extraSelections;           }
-  void SetVertexRange                (Float_t vtxrange                   = 0.   ) { fVtxRange                     = vtxrange;                  }
-  void SetVertexRangeMin             (Float_t vtxrangemin                = 0.   ) { fVtxRangeMin                  = vtxrangemin;               }
-  void SetApplyAccCut                (Bool_t  acccut                     = kFALSE){ fApplyAccCut                  = acccut;                    }    
-  void SetMinptCutOnDaughterTracks   (Float_t minptdaughtrks             = 0.   ) { fMinPtCutOnDaughterTracks     = minptdaughtrks;            }
-  void SetEtaCutOnDaughterTracks     (Float_t etadaughtrks               = 0.   ) { fEtaCutOnDaughterTracks       = etadaughtrks;              }
+  void SetAnalysisType               (const char* analysisType           = "ESD") { fAnalysisType                 = analysisType;               }
+  void SetCollidingSystem            (const char* collidingSystem        = "pp" ) { fCollidingSystem              = collidingSystem;            }  
+  void SetRelaunchV0CascVertexers    (Bool_t  rerunV0CascVertexers       = 0    ) { fkRerunV0CascVertexers        = rerunV0CascVertexers;       }
+  void SetSDDSelection               (Bool_t  sddOnSelection             = kTRUE) { fkSDDselectionOn              = sddOnSelection;             }
+  void SetQualityCutZprimVtxPos      (Bool_t  qualityCutZprimVtxPos      = kTRUE) { fkQualityCutZprimVtxPos       = qualityCutZprimVtxPos;      }
+  void SetRejectEventPileUp          (Bool_t  rejectPileUp               = kTRUE) { fkRejectEventPileUp           = rejectPileUp;               }
+  void SetQualityCutNoTPConlyPrimVtx (Bool_t  qualityCutNoTPConlyPrimVtx = kTRUE) { fkQualityCutNoTPConlyPrimVtx  = qualityCutNoTPConlyPrimVtx; }
+  void SetQualityCutTPCrefit         (Bool_t  qualityCutTPCrefit         = kTRUE) { fkQualityCutTPCrefit          = qualityCutTPCrefit;         }
+  void SetQualityCutnTPCcls          (Bool_t  qualityCutnTPCcls          = kTRUE) { fkQualityCutnTPCcls           = qualityCutnTPCcls;          }
+  void SetWithSDDOn                  (Bool_t  withsddOn                  = kTRUE) { fwithSDD                      = withsddOn;                  }
+  void SetQualityCutMinnTPCcls       (Int_t   minnTPCcls                 = 70   ) { fMinnTPCcls                   = minnTPCcls;                 }
+  void SetExtraSelections            (Bool_t  extraSelections            = 0    ) { fkExtraSelections             = extraSelections;            }
+  void SetVertexRange                (Float_t vtxrange                   = 0.   ) { fVtxRange                     = vtxrange;                   }
+  void SetVertexRangeMin             (Float_t vtxrangemin                = 0.   ) { fVtxRangeMin                  = vtxrangemin;                }
+  void SetApplyAccCut                (Bool_t  acccut                     = kFALSE){ fApplyAccCut                  = acccut;                     }    
+  void SetMinptCutOnDaughterTracks   (Float_t minptdaughtrks             = 0.   ) { fMinPtCutOnDaughterTracks     = minptdaughtrks;             }
+  void SetEtaCutOnDaughterTracks     (Float_t etadaughtrks               = 0.   ) { fEtaCutOnDaughterTracks       = etadaughtrks;               }
 
  private:
         // Note : In ROOT, "//!" means "do not stream the data from Master node to Worker node" ...
@@ -61,8 +62,11 @@ class AliAnalysisTaskCheckPerformanceCascadepp276 : public AliAnalysisTaskSE {
 
         TString         fAnalysisType;          // "ESD" or "AOD" analysis type        
         AliESDtrackCuts *fESDtrackCuts;         // ESD track cuts used for primary track definition
-      //TPaveText       *fPaveTextBookKeeping;  // TString to store all the relevant info necessary for book keeping (v0 cuts, cascade cuts, quality cuts, ...)
+        AliAnalysisUtils *fUtils;
+        TString         fCollidingSystem;       // "pPb" or "pp" colliding system
+       // AliESDtrackCuts *fESDtrackCuts;         // ESD track cuts used for primary track definition
         AliPIDResponse *fPIDResponse;           //! PID response object        
+       // AliAnalysisUtils *fUtils;
 
         Bool_t          fkRerunV0CascVertexers;         // Boolean : kTRUE = relaunch both V0 + Cascade vertexers
         Bool_t          fkSDDselectionOn;               // Boolean : kTRUE = enable the selection based on the SDD status
@@ -83,7 +87,7 @@ class AliAnalysisTaskCheckPerformanceCascadepp276 : public AliAnalysisTaskSE {
         Double_t        fV0Sels[7];                     // Array to store the 7 values for the different selections V0 related (if fkRerunV0CascVertexers)
         Double_t        fCascSels[8];                   // Array to store the 8 values for the different selections Casc. related (if fkRerunV0CascVertexers)
        
-       TList   *fListHistCascade;              //! List of Cascade histograms
+       TList   *fListHistCascade;                      //! List of Cascade histograms
          // - General Plots
          // Cascade multiplicity plots
          TH1F *fHistCascadeMultiplicityBeforeAnySel;
index 8f1d1e4666b7658eed0043f02ea08eee0f3bc44f..1f0fcd6e8b4218459f9fe955f0308a4df5ab4e72 100644 (file)
@@ -1,4 +1,5 @@
-AliAnalysisTaskCheckCascadepp276 *AddTaskCheckCascadepp276( Int_t    minnTPCcls             = 70,
+AliAnalysisTaskCheckCascadepp276 *AddTaskCheckCascadepp276( TString  collidingSystem        = "pp",
+                                                            Int_t    minnTPCcls             = 70,
                                                             Float_t  vtxlim                 = 10.0,
                                                             Float_t  vtxlimmin              = 0.0,
                                                             Bool_t   fwithsdd               = kFALSE,
@@ -28,12 +29,15 @@ AliAnalysisTaskCheckCascadepp276 *AddTaskCheckCascadepp276( Int_t    minnTPCcls
    // Create and configure the task
    //==============================================================================
    TString taskname = Form("TaskCheckCascadepp276_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",minnTPCcls,vtxlim,vtxlimmin,minptondaughtertracks,etacutondaughtertracks);
-     if(fwithsdd) {
+     if(fwithsdd && collidingSystem == "pp") {
           if (ksddonselection)       taskname += "_wSDDon";
           else if (!ksddonselection) taskname += "_wSDDoff";
-     } else if (!fwithsdd)           taskname += "_woSDD";
+     } else if (!fwithsdd && collidingSystem == "pp") {
+          taskname += "_woSDD";
+     }
    AliAnalysisTaskCheckCascadepp276 *taskcheckcascadepp276 = new AliAnalysisTaskCheckCascadepp276(taskname);
      taskcheckcascadepp276->SetAnalysisType               (type);                   // "ESD" or "AOD"
+     taskcheckcascadepp276->SetCollidingSystem            (collidingSystem);        // choose the collidiond system to run on: "pp" and "pPb"
      taskcheckcascadepp276->SetRelaunchV0CascVertexers    (krelaunchvertexers);     // choose if reconstruct the vertex of V0 in the cascades
      taskcheckcascadepp276->SetSDDSelection               (fwithsdd);               // choose if apply SDD event selection
      taskcheckcascadepp276->SetQualityCutZprimVtxPos      (kTRUE);                  // choose if apply Z vtx PV position event selection
@@ -69,7 +73,7 @@ AliAnalysisTaskCheckCascadepp276 *AddTaskCheckCascadepp276( Int_t    minnTPCcls
       outputname3 += Form("_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",minnTPCcls,vtxlim,vtxlimmin,minptondaughtertracks,etacutondaughtertracks);
       outputname4 += Form("_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",minnTPCcls,vtxlim,vtxlimmin,minptondaughtertracks,etacutondaughtertracks);
       outputname5 += Form("_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",minnTPCcls,vtxlim,vtxlimmin,minptondaughtertracks,etacutondaughtertracks);
-      if(fwithsdd) {
+      if(fwithsdd && collidingSystem == "pp") {
           if (ksddonselection) {
               outputname0 += "_wSDDon";
               outputname1 += "_wSDDon";
@@ -77,7 +81,7 @@ AliAnalysisTaskCheckCascadepp276 *AddTaskCheckCascadepp276( Int_t    minnTPCcls
               outputname3 += "_wSDDon";
               outputname4 += "_wSDDon";
               outputname5 += "_wSDDon";
-          } else if (!ksddonselection) {
+          } else if (!ksddonselection && collidingSystem == "pp") {
               outputname0 += "_wSDDoff";
               outputname1 += "_wSDDoff";
               outputname2 += "_wSDDoff";
@@ -85,7 +89,7 @@ AliAnalysisTaskCheckCascadepp276 *AddTaskCheckCascadepp276( Int_t    minnTPCcls
               outputname4 += "_wSDDoff";
               outputname5 += "_wSDDoff";
           }
-      } else if (!fwithsdd) {
+      } else if (!fwithsdd && collidingSystem == "pp") {
           outputname0 += "_woSDD";
           outputname1 += "_woSDD";
           outputname2 += "_woSDD";
@@ -96,9 +100,9 @@ AliAnalysisTaskCheckCascadepp276 *AddTaskCheckCascadepp276( Int_t    minnTPCcls
 
    //Save objects into the train common file
    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(outputname0,
-                                                                                        TList::Class(),
-                                                                                        AliAnalysisManager::kOutputContainer,
-                                                                                        outputFileName );
+                                                            TList::Class(),
+                                                            AliAnalysisManager::kOutputContainer,
+                                                            outputFileName );
    AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(outputname1,
                                                              AliCFContainer::Class(),
                                                              AliAnalysisManager::kOutputContainer,
index 0ff00dab7bd82600a9b0ba913441617ae074149e..3e1ebf4682ce08f656ce8f610bacf81d8f729a6e 100644 (file)
@@ -1,4 +1,5 @@
-AliAnalysisTaskCheckPerformanceCascadepp276 *AddTaskCheckPerformanceCascadepp276( Int_t    minnTPCcls             = 70,
+AliAnalysisTaskCheckPerformanceCascadepp276 *AddTaskCheckPerformanceCascadepp276( TString  collidingSystem        = "pp",
+                                                                                  Int_t    minnTPCcls             = 70,
                                                                                   Float_t  vtxlim                 = 10.,
                                                                                   Float_t  vtxlimmin              = 0.,
                                                                                   Bool_t   fwithsdd               = kFALSE,
@@ -32,6 +33,7 @@ AliAnalysisTaskCheckPerformanceCascadepp276 *AddTaskCheckPerformanceCascadepp276
      tasknameperf += Form("_minnTPCcls%i_vtxlim%.1f-%.1f_minptdghtrk%.1f_etacutdghtrk%.1f",minnTPCcls,vtxlim,vtxlimmin,minptondaughtertracks,etacutondaughtertracks);
    AliAnalysisTaskCheckPerformanceCascadepp276 *taskCheckPerfCascadepp276 = new AliAnalysisTaskCheckPerformanceCascadepp276(tasknameperf);
      taskCheckPerfCascadepp276->SetAnalysisType               (type);                   // "ESD" or "AOD"
+     taskCheckPerfCascadepp276->SetCollidingSystem            (collidingSystem);        // choose the collidiond system to run on: "pp" and "pPb"
      taskCheckPerfCascadepp276->SetRelaunchV0CascVertexers    (krelaunchvertexers);     // choose if reconstruct the vertex of V0 in the cascades
      taskCheckPerfCascadepp276->SetSDDSelection               (fwithsdd);               // choose if apply SDD event selection
      taskCheckPerfCascadepp276->SetQualityCutZprimVtxPos      (kTRUE);                  // choose if apply Z vtx PV position event selection