Updated macros for Grid/AAF + new macros for trains
authordelia <delia@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Feb 2012 00:13:31 +0000 (00:13 +0000)
committerdelia <delia@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Feb 2012 00:13:31 +0000 (00:13 +0000)
PWGLF/STRANGENESS/macros/AddTaskCheckCascadePbPb.C [new file with mode: 0644]
PWGLF/STRANGENESS/macros/AddTaskCheckPerformanceCascadePbPb.C [new file with mode: 0644]
PWGLF/STRANGENESS/macros/runGridCascadePbPb.C
PWGLF/STRANGENESS/macros/runProofCascadePbPb.C

diff --git a/PWGLF/STRANGENESS/macros/AddTaskCheckCascadePbPb.C b/PWGLF/STRANGENESS/macros/AddTaskCheckCascadePbPb.C
new file mode 100644 (file)
index 0000000..e2e3850
--- /dev/null
@@ -0,0 +1,66 @@
+AliAnalysisTaskCheckCascadePbPb *AddTaskCheckCascadePbPb( Float_t  centrlowlim         = 0.,
+                                                          Float_t  centruplim          = 90.,
+                                                          TString  centrest            = "V0M",
+                                                          Float_t  vtxlim              = 10.,
+                                                          Bool_t   kextrasel           = kFALSE,
+                                                          Bool_t   krelaunchvertexers  = kFALSE,
+                                                          TString  anatype             = "AOD") 
+{
+   // Creates, configures and attaches to the train a cascades check task.
+   // Get the pointer to the existing analysis manager via the static access method.
+   //==============================================================================
+   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+   if (!mgr) {
+      ::Error("AddTaskCheckCascade", "No analysis manager to connect to.");
+      return NULL;
+   }   
+
+   // Check the analysis type using the event handlers connected to the analysis manager.
+   //==============================================================================
+   if (!mgr->GetInputEventHandler()) {
+      ::Error("AddTaskCheckCascade", "This task requires an input event handler");
+      return NULL;
+   }   
+   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+
+   // Create and configure the task
+       AliAnalysisTaskCheckCascadePbPb *taskcheckcascadepbpb = new AliAnalysisTaskCheckCascadePbPb("TaskCheckCascadePbPb");
+
+  taskcheckcascadepbpb->SetRelaunchV0CascVertexers    (krelaunchvertexers);
+  taskcheckcascadepbpb->SetAnalysisType               (anatype);
+  taskcheckcascadepbpb->SetQualityCutZprimVtxPos      (kTRUE);             // selects vertices in +-10cm
+  taskcheckcascadepbpb->SetQualityCutNoTPConlyPrimVtx (kTRUE);             // retains only events with tracking + SPD vertex
+  taskcheckcascadepbpb->SetQualityCutTPCrefit         (kTRUE);             // requires TPC refit flag to be true to select a track
+  taskcheckcascadepbpb->SetQualityCut80TPCcls         (kTRUE);             // rejects tracks that have less than 80 clusters in the TPC
+  taskcheckcascadepbpb->SetExtraSelections            (kextrasel);         // used to add other selection cuts
+  taskcheckcascadepbpb->SetCentralityLowLim           (centrlowlim);       // setting centrality selection vriables
+  taskcheckcascadepbpb->SetCentralityUpLim            (centruplim);
+  taskcheckcascadepbpb->SetCentralityEst              (centrest);
+  taskcheckcascadepbpb->SetVertexRange                (vtxlim);
+
+  mgr->AddTask(taskcheckcascadepbpb);
+
+   // Create ONLY the output containers for the data produced by the task.
+   // Get and connect other common input/output containers via the manager as below
+   //==============================================================================
+
+   // User file name (if need be)
+   
+   TString outputFileName = AliAnalysisManager::GetCommonFileName();
+   
+   outputFileName += ":PWGLFCheckCascadePbPb";
+   if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
+   
+   Printf("AddTaskCheckCascade - Set OutputFileName : \n %s\n", outputFileName.Data() );
+
+   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistCasc",
+                                                            TList::Class(),
+                                                            AliAnalysisManager::kOutputContainer,
+                                                            outputFileName );
+   
+   
+   mgr->ConnectInput( taskcheckcascadepbpb, 0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput(taskcheckcascadepbpb, 1, coutput1);
+   
+   return taskcheckcascadepbpb;
+}   
diff --git a/PWGLF/STRANGENESS/macros/AddTaskCheckPerformanceCascadePbPb.C b/PWGLF/STRANGENESS/macros/AddTaskCheckPerformanceCascadePbPb.C
new file mode 100644 (file)
index 0000000..2595f91
--- /dev/null
@@ -0,0 +1,67 @@
+AliAnalysisTaskCheckPerformanceCascadePbPb *AddTaskCheckPerformanceCascadePbPb( Float_t  centrlowlim         = 0.,
+                                                                                Float_t  centruplim          = 90.,
+                                                                                TString  centrest            = "V0M",
+                                                                                Float_t  vtxlim              = 10.,
+                                                                                Bool_t   kextrasel           = kFALSE,
+                                                                                Bool_t   kacccut             = kFALSE,
+                                                                                Bool_t   krelaunchvertexers  = kFALSE,
+                                                                                TString  anatype             = "AOD")
+{
+// Creates, configures and attaches to the train a cascades check task.
+   // Get the pointer to the existing analysis manager via the static access method.
+   //==============================================================================
+   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+   if (!mgr) {
+      ::Error("AddTaskCheckPerformanceCascade", "No analysis manager to connect to.");
+      return NULL;
+   }   
+
+   // Check the analysis type using the event handlers connected to the analysis manager.
+   //==============================================================================
+   if (!mgr->GetInputEventHandler()) {
+      ::Error("AddTaskCheckPerformanceCascade", "This task requires an input event handler");
+      return NULL;
+   }   
+   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+
+   // Create and configure the task
+        AliAnalysisTaskCheckPerformanceCascadePbPb *taskCheckPerfCascadePbPb = new AliAnalysisTaskCheckPerformanceCascadePbPb("TaskCheckPerfCascadePbPb");
+
+   taskCheckPerfCascadePbPb->SetAnalysisType                (anatype);
+   taskCheckPerfCascadePbPb-> SetRelaunchV0CascVertexers    (krelaunchvertexers);     
+   taskCheckPerfCascadePbPb-> SetQualityCutZprimVtxPos      (kTRUE);
+   taskCheckPerfCascadePbPb-> SetRejectEventPileUp          (kFALSE);
+   taskCheckPerfCascadePbPb-> SetQualityCutNoTPConlyPrimVtx (kTRUE);
+   taskCheckPerfCascadePbPb-> SetQualityCutTPCrefit         (kTRUE);
+   taskCheckPerfCascadePbPb-> SetQualityCut80TPCcls         (kTRUE);
+   taskCheckPerfCascadePbPb-> SetExtraSelections            (kextrasel);
+   taskCheckPerfCascadePbPb-> SetApplyAccCut                (kacccut);
+   taskCheckPerfCascadePbPb-> SetCentralityLowLim           (centrlowlim);       // setting centrality selection vriables
+   taskCheckPerfCascadePbPb-> SetCentralityUpLim            (centruplim);
+   taskCheckPerfCascadePbPb-> SetCentralityEst              (centrest);
+   taskCheckPerfCascadePbPb-> SetVertexRange                (vtxlim);
+   
+   mgr->AddTask(taskCheckPerfCascadePbPb);
+
+   // Create ONLY the output containers for the data produced by the task.
+   // Get and connect other common input/output containers via the manager as below
+   //==============================================================================
+
+   // User file name (if need be)
+
+   TString outputFileName = AliAnalysisManager::GetCommonFileName();
+   outputFileName += ":PWGLFCheckPerformanceCascadePbPb";
+   if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
+   
+   Printf("AddTaskCheckPerfCascadePbPb - Set OutputFileName : \n %s\n", outputFileName.Data() );
+   
+   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistCascMC",
+                                                            TList::Class(),
+                                                            AliAnalysisManager::kOutputContainer,
+                                                            outputFileName );
+
+   mgr->ConnectInput( taskCheckPerfCascadePbPb, 0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput(taskCheckPerfCascadePbPb, 1, coutput1);
+   
+   return taskCheckPerfCascadePbPb;
+}   
index b26b7b4..14c6e1a 100644 (file)
@@ -1,21 +1,20 @@
-// **** to run the macro: ***********
+/// **** to run the macro: ***********
 // alien-token-init username
-// source /tmp/gclient_env_IDuser
 // root -l runGrid.C
 
 class AliAnalysisGrid;
 
-void runGridCascadePbPb ( Bool_t   useMC             = kTRUE,  // kTRUE if analysing a MC sample 
-                          Bool_t   runperformancetask = kTRUE,  
-                          Float_t  centrlowlim       = 0.,
-                          Float_t  centruplim        = 80.,
-                          TString  centrest         = "V0M",
-                          Short_t  lCollidingSystems = 1,       //0 = pp, 1 = AA
-                          Float_t  vtxlim             = 15.,
-                          Bool_t   usecfcontainers     = kTRUE,
-                          Bool_t   kextrasel           = kFALSE,
-                          Bool_t   acccut = kTRUE,
-                          const char *plugin_mode="test") {
+void runGridCascadePbPb( Bool_t   useMC               = kTRUE,  // kTRUE if analysing a MC sample 
+                         Bool_t   runperformancetask  = kTRUE,  
+                         Float_t  centrlowlim         = 0.,
+                         Float_t  centruplim          = 90.,
+                         TString  centrest            = "V0M",
+                         Float_t  vtxlim              = 10.,
+                         Bool_t   kextrasel           = kFALSE,
+                         Bool_t   acccut              = kFALSE,
+                         Bool_t   krelaunchvertexers  = kFALSE,
+                         TString  anatype             = "AOD",//"ESD",
+                         const char *plugin_mode      ="full") {
 
   // Load common libraries
   gSystem->Load("libCore.so");
@@ -44,7 +43,7 @@ void runGridCascadePbPb ( Bool_t   useMC             = kTRUE,  // kTRUE if analy
   //__________________________________________________________________________
   // Create and configure the alien handler plugin
 //  gROOT->LoadMacro("CreateAlienHandler.C");
-  AliAnalysisGrid *alienHandler = CreateAlienHandler(plugin_mode, runperformancetask, useMC);
+  AliAnalysisGrid *alienHandler = CreateAlienHandler(plugin_mode, runperformancetask, useMC, anatype);
   if (!alienHandler) return;
  
   //__________________________________________________________________________
@@ -55,26 +54,47 @@ void runGridCascadePbPb ( Bool_t   useMC             = kTRUE,  // kTRUE if analy
   // Connect plug-in to the analysis manager
   mgr->SetGridHandler(alienHandler);
 
+  // Input handlers
+  AliESDInputHandler* esdH = new AliESDInputHandler();
+  AliAODInputHandler* aodH = new AliAODInputHandler();
+  if (anatype=="ESD") mgr->SetInputEventHandler(esdH);
+  else mgr->SetInputEventHandler(aodH);
+  if (runperformancetask&&(anatype=="ESD")) {
+    AliMCEventHandler* mcHandler = new AliMCEventHandler();
+    mgr->SetMCtruthEventHandler(mcHandler);
+  }
+
   //__________________________________________________________________________
-  // Add task 
+  // Add tasks
+
+ // Physics selection
+  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
+  AliPhysicsSelectionTask *physSel = AddTaskPhysicsSelection(useMC);
+  
+  // Centrality selection
+  if (anatype == "ESD") { 
+    gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
+    AliCentralitySelectionTask *taskCentr = AddTaskCentrality();
+    if (useMC){
+      taskCentr->SetMCInput();
+      taskCentr->DontUseCleaning();
+    }
+  }
+
+  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+  AliAnalysisTaskPIDResponse *pidTask = AddTaskPIDResponse(useMC);
 
   if (runperformancetask) {
     gROOT->LoadMacro("AliAnalysisTaskCheckPerformanceCascadePbPb.cxx++g");
     AliAnalysisTaskCheckPerformanceCascadePbPb *task = new AliAnalysisTaskCheckPerformanceCascadePbPb("TaskPerformanceCascade");
-    task->SetDebugLevelCascade           (0);                 // not used in the task
-    task->SetApplyAccCut                 (acccut);
-    task->SetUseCFCont                   (usecfcontainers);
-    task->SetAlephParamFor1PadTPCCluster (kTRUE);             // to set aleph param - ask which ones have to be used
+    task->SetApplyAccCut                (acccut);
+    task->SetRejectEventPileUp          (kFALSE);            // selects pile up
   } else {
     gROOT->LoadMacro("AliAnalysisTaskCheckCascadePbPb.cxx++g");
     AliAnalysisTaskCheckCascadePbPb *task = new AliAnalysisTaskCheckCascadePbPb("TaskCascade");
-    task->SetUseCFContCascadeCuts       (usecfcontainers);
   }
-
-  task->SetCollidingSystems           (lCollidingSystems); // only for multiplicity binning
-  task->SetAnalysisType               ("ESD");
-  task->SetRelaunchV0CascVertexers    (0);                 // used but code is commented out
+  task->SetRelaunchV0CascVertexers    (krelaunchvertexers); 
+  task->SetAnalysisType               (anatype);
   task->SetQualityCutZprimVtxPos      (kTRUE);             // selects vertices in +-10cm
   task->SetQualityCutNoTPConlyPrimVtx (kTRUE);             // retains only events with tracking + SPD vertex
   task->SetQualityCutTPCrefit         (kTRUE);             // requires TPC refit flag to be true to select a track
@@ -87,23 +107,8 @@ void runGridCascadePbPb ( Bool_t   useMC             = kTRUE,  // kTRUE if analy
  
   mgr->AddTask(task);
 
-  // ESD case
-  AliESDInputHandler* esdH = new AliESDInputHandler();
-  mgr->SetInputEventHandler(esdH);
-  if (runperformancetask) {
-    AliMCEventHandler* mcHandler = new AliMCEventHandler();
-    mgr->SetMCtruthEventHandler(mcHandler);
-  }
-
-  // Physics selection
-  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
-  AliPhysicsSelectionTask *physSel = AddTaskPhysicsSelection(useMC);
   task->SelectCollisionCandidates();
-  // Centrality selection
-  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
-  AliCentralitySelectionTask *taskCentr = AddTaskCentrality();
-  if (useMC) taskCentr->SetMCInput();
+
   //Create containers for input/output
   AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
   if (runperformancetask) AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist", TList::Class(), AliAnalysisManager::kOutputContainer, "CascadePerformance.root");
@@ -128,7 +133,7 @@ void runGridCascadePbPb ( Bool_t   useMC             = kTRUE,  // kTRUE if analy
 
 //__________________________________________________________________________
 
-AliAnalysisGrid* CreateAlienHandler(const char *plugin_mode, Bool_t runperformancetask, Bool_t useMC) {
+AliAnalysisGrid* CreateAlienHandler(const char *plugin_mode, Bool_t runperformancetask, Bool_t useMC, TString anatype) {
   //__________________________________________________________________________
   // Check if user has a valid token, otherwise make one. This has limitations.
   // One can always follow the standard procedure of calling alien-token-init then
@@ -146,37 +151,40 @@ AliAnalysisGrid* CreateAlienHandler(const char *plugin_mode, Bool_t runperforman
 
   //__________________________________________________________________________
   // On GRID - current
-  plugin->SetROOTVersion("v5-27-06d");
-  plugin->SetAliROOTVersion("v4-21-16-AN");
+  plugin->SetROOTVersion("v5-30-06-1");
+  plugin->SetAliROOTVersion("v5-03-01-AN"); 
 
   //__________________________________________________________________________
   // Declare input data to be processed.
   // Method 1: Create automatically XML collections using alien 'find' command.
   if (useMC) {
-    plugin->SetGridDataDir("/alice/sim/LHC11a7");   // Define production directory 
+    //plugin->SetGridDataDir("/alice/sim/LHC11a10b_bis");   // Define production directory
+    //plugin->SetGridDataDir("/alice/sim/LHC11a10b_plus");
+    plugin->SetGridDataDir("/alice/sim/2011/LHC11f5");
     // Set data search pattern
-    plugin->SetDataPattern("*ESDs.root"); 
-    plugin->SetRunRange(137161,138225); 
+    if (anatype == "ESD") plugin->SetDataPattern("*ESDs.root");
+    else plugin->SetDataPattern("AOD081/*AOD.root");  
+    plugin->AddRunNumber(137124);
+
+
   } else {
     plugin->SetGridDataDir("/alice/data/2010/LHC10h");   // Define production directory LFN
-    plugin->SetDataPattern("ESDs/pass2_rev15/*/*ESDs.root");  // Set data search pattern
-    // plugin->SetRunRange(80000,80000); // ...then add run numbers to be considered
-    plugin->SetRunPrefix("000");
-//    plugin->AddRunNumber(137366);
-    plugin->AddRunNumber(138200);
-//    plugin->AddRunNumber(139172);
+    if (anatype == "ESD") {
+      plugin->SetDataPattern("ESDs/pass2/*/*ESDs.root");  // Set data search pattern
+      plugin->SetRunPrefix("000");
+    } else plugin->SetDataPattern("*AOD.root"); 
+    //plugin->SetRunRange(80000,80000); // ...then add run numbers to be considered
+    plugin->AddRunNumber(138534);
   }
-  // Method 2: Use your input collection
-   
-  //plugin->AddDataFile("/alice/cern.ch/user/d/dcolella/wn.xml");
-
+  // Method 2: Use your input collection 
+  //plugin->AddDataFile("/alice/cern.ch/user/m/mnicassi/139105.xml");
   //__________________________________________________________________________
   // Define alien work directory where all files will be copied. Relative to alien $HOME.
-  if (runperformancetask) plugin->SetGridWorkingDir("workperf");
-  else plugin->SetGridWorkingDir("work");
-  // Declare alien output directory. Relative to working directory.
-  plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
+  if (runperformancetask) plugin->SetGridWorkingDir("workperfcentral");
+  else plugin->SetGridWorkingDir("workdata");
+  plugin->SetGridOutputDir("output");
 
+  //__________________________________________________________________________
   if (runperformancetask) plugin->SetAnalysisSource("AliAnalysisTaskCheckPerformanceCascadePbPb.cxx");
   else plugin->SetAnalysisSource("AliAnalysisTaskCheckCascadePbPb.cxx");
 
@@ -192,22 +200,22 @@ AliAnalysisGrid* CreateAlienHandler(const char *plugin_mode, Bool_t runperforman
     plugin->SetAdditionalLibs("AliAnalysisTaskCheckPerformanceCascadePbPb.h AliAnalysisTaskCheckPerformanceCascadePbPb.cxx");
     // Optionally modify the executable name (default analysis.sh)
     plugin->SetExecutable("CascadePerformancePbPb.sh");
-
   } else {
-    plugin->SetAdditionalLibs("AliAnalysisTaskCheckCascadePbPb.h AliAnalysisTaskCheckCascadePbPb.cxx");
+    plugin->SetAdditionalLibs("AliAnalysisTaskCheckCascadePbPb.h AliAnalysisTaskCheckCascadePbPb.cxx ");
     // Optionally modify the executable name (default analysis.sh)
     plugin->SetExecutable("CascadePbPb.sh");
 
   }
+  
   //__________________________________________________________________________
   // Declare the output file names separated by blancs.
   // (can be like: file.root or file.root@ALICE::Niham::File)
-  plugin->SetDefaultOutputs(kFALSE);
-  if (runperformancetask) plugin->SetOutputFiles("CascadePerformance.root");
-  else plugin->SetOutputFiles("Cascades.root");
+  //plugin->SetDefaultOutputs(kFALSE);
+  //if (runperformancetask) plugin->SetOutputFiles("CascadePerformance.root");
+  //else plugin->SetOutputFiles("Cascades.root");
 
   // Optionally define the files to be archived.
-  plugin->SetOutputArchive("root_archive.zip:*.root log_archive.zip:stdout,stderr");
+  //plugin->SetOutputArchive("root_archive.zip:*.root log_archive.zip:stdout,stderr");
 
   //__________________________________________________________________________
   // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
@@ -222,20 +230,19 @@ AliAnalysisGrid* CreateAlienHandler(const char *plugin_mode, Bool_t runperforman
   if (runperformancetask) plugin->SetJDLName("TaskCheckPerformanceCascadePbPb.jdl");
   else plugin->SetJDLName("TaskCheckCascadePbPb.jdl");
 
-  // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
-   plugin->SetSplitMaxInputFileNumber(100);
-
   // Optionally modify job price (default 1)
   plugin->SetPrice(1);
 
   // Merge via JDL
   // comment out the next line when using the "terminate" option, unless
   // you want separate merged files for each run
-//  plugin->SetMergeViaJDL(kTRUE);  // run first in full mode, then in terminate
-//  plugin->SetOneStageMerging(kFALSE);
-//  plugin->SetMaxMergeStages(2);// to define the number of stages
+/*  plugin->SetMergeViaJDL(kTRUE);  // run first in full mode, then in terminate
+  plugin->SetOneStageMerging(kFALSE);
+  plugin->SetMaxMergeFiles(50);
+  plugin->SetMaxMergeStages(2);// to define the number of stages
+*/
   // Optionally set number of runs per master
-  plugin->SetNrunsPerMaster(1);
+//  plugin->SetNrunsPerMaster(1);
   //
   plugin->SetOutputToRunNo();
   // Optionally modify split mode (default 'se')
index 01f490a..85d5a91 100644 (file)
@@ -1,24 +1,22 @@
-void runProofCascadePbPb (
-                          TString  proofCluster      = "mnicassi@alice-caf.cern.ch", //skaf.saske.sk",
-                          TString  alirootVer        = "VO_ALICE@AliRoot::v4-21-16-AN", 
-                          TString  rootVer           = "VO_ALICE@ROOT::v5-27-06d",
-                          TString  dataset           = "/alice/sim/LHC11a7_000137161",
-//                          TString  dataset           = "/alice/data/LHC10h_000137161_p1_5plus",                        
-                          TString  outFileMC         = "CascadePerformance.root",
-                          TString  outFileData       = "CascadeAna.root",
-                          Bool_t   runperformancetask= kFALSE, 
-                          Bool_t   useMC             = kFALSE, 
-                          Bool_t   dataonalien       = kFALSE,
-                          Float_t  centrlowlim       = 0., 
-                          Float_t  centruplim        = 20., 
-                          TString  centrest          = "V0M",
-                          Short_t  lCollidingSystems = 1,       //0 = pp, 1 = AA
-                          Float_t  vtxlim            = 15.,  
-                          Bool_t   usecfcontainers   = kTRUE,
-                          Bool_t   kextrasel         = kTRUE,
-                          Bool_t   acccut            = kFALSE,
-                          Int_t    nEvents           = 5000, 
-                          Int_t    nEventsSkip       = 0) { //1.0*1e7
+void runProofCascadePbPb(
+                     TString  proofCluster      = "mnicassi@alice-caf.cern.ch",//kiaf.sdfarm.kr", //skaf.saske.sk"
+                     TString  alirootVer        = "VO_ALICE@AliRoot::v5-30-01-AN",
+                     TString  rootVer           = "VO_ALICE@ROOT::v5-30-06-1", 
+                     TString  dataset           = "/alice/sim/LHC11f5_000139514", 
+                     TString  outFileMC         = "CascadePerformance.root",
+                     TString  outFileData       = "CascadeAna.root",
+                     Bool_t   runperformancetask= kTRUE, 
+                     Bool_t   useMC             = kTRUE, 
+                     Bool_t   dataonalien       = kFALSE,
+                     Float_t  centrlowlim       = 0., 
+                     Float_t  centruplim        = 90., 
+                     TString  centrest          = "V0M",
+                     Float_t  vtxlim            = 10.,  
+                     Bool_t   kextrasel         = kFALSE,
+                     Bool_t   acccut            = kFALSE,
+                     Bool_t   krelaunchvertexers= kFALSE,
+                     Int_t    nEvents           = 1.0*1e7, 
+                     Int_t    nEventsSkip       = 0) { 
 
   gEnv->SetValue("XSec.GSI.DelegProxy","2");
 
@@ -26,8 +24,7 @@ void runProofCascadePbPb (
   TString extraLibs;
   TList *list = new TList();
   alirootMode="ALIROOT";
-  extraLibs+= "ANALYSIS:ANALYSISalice:CORRFW";  
-
+  extraLibs+= "ANALYSIS:OADB:ANALYSISalice:CORRFW";  
   // sets $ALIROOT_MODE on each worker to let proof to know to run in special mode
   list->Add(new TNamed("ALIROOT_MODE", alirootMode.Data()));
   list->Add(new TNamed("ALIROOT_EXTRA_LIBS", extraLibs.Data()));
@@ -36,6 +33,7 @@ void runProofCascadePbPb (
   // REM: same version of AliRoot on client!
   TProof::Mgr(proofCluster.Data())->SetROOTVersion(rootVer.Data()); //If not using the default version, do it the first time only
   TProof::Open(proofCluster.Data());
+
   // enable n workers per machine
 //  TProof::Open(proofCluster.Data(),"workers=nx")       
   // enable less workers
@@ -44,13 +42,15 @@ void runProofCascadePbPb (
     Error("runProof.C","Connection to AF failed.");
     return;
   }
+
   gProof->EnablePackage(alirootVer.Data(), list);
 
+
   Analysis(dataset.Data(), outFileMC, outFileData, 
            useMC, nEvents, nEventsSkip,
            centrlowlim, centruplim, centrest, 
-           vtxlim, usecfcontainers, lCollidingSystems, kextrasel,
-           runperformancetask, acccut);
+           vtxlim, kextrasel,
+           runperformancetask, acccut, krelaunchvertexers);
 
 }
 
@@ -58,97 +58,74 @@ void runProofCascadePbPb (
 void Analysis(TString dataset, TString outFileMC, TString outFileData, 
               Bool_t useMC, Int_t nEvents, Int_t nEventsSkip, 
               Float_t centrlowlim, Float_t centruplim, TString centrest,
-              Float_t vtxlim, Bool_t usecfcontainers, Short_t  lCollidingSystems,
-              Bool_t kextrasel, Bool_t runperformancetask, Bool_t acccut) {
+              Float_t vtxlim, 
+              Bool_t kextrasel, Bool_t runperformancetask, Bool_t acccut, Bool_t krelaunchvertexers) {
+
 
   TString format = GetFormatFromDataSet(dataset);
 
   // ALICE stuff
+  // create manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) mgr = new AliAnalysisManager("Test train");
 
-  InputHandlerSetup(format,useMC);
+  InputHandlerSetup(format,runperformancetask);
 
   // compile analysis task
   if (runperformancetask) gProof->Load("AliAnalysisTaskCheckPerformanceCascadePbPb.cxx++");
   else gProof->Load("AliAnalysisTaskCheckCascadePbPb.cxx++");
 
-  // create manager
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  if (!mgr) mgr = new AliAnalysisManager("Cascade analysis");
+  // physics selection
+  gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
+  AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(useMC);
+
+  // centrality selection
+  cout<<"Format"<<format.Data()<<endl;
+  if (!format.CompareTo("ESD")) {
+    gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
+    AliCentralitySelectionTask *taskCentr = AddTaskCentrality();
+    if (useMC) {
+      taskCentr->SetMCInput();
+      taskCentr->DontUseCleaning(); // for injected MC
+    }
+  }
+
+  
+  // add PID response task
+  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+  AliAnalysisTaskPIDResponse *pidTask = AddTaskPIDResponse(useMC);
 
   // create task
   if (runperformancetask) {
     AliAnalysisTaskCheckPerformanceCascadePbPb *task = new AliAnalysisTaskCheckPerformanceCascadePbPb("AliAnalysisTaskCheckPerformanceCascadePbPb");
-    task->SetDebugLevelCascade           (0);
-    task->SetUseCFCont                   (usecfcontainers);
+    task->SetApplyAccCut                 (acccut);
+    task->SetRejectEventPileUp(kFALSE);
+
   } else {
     AliAnalysisTaskCheckCascadePbPb *task = new AliAnalysisTaskCheckCascadePbPb("AliAnalysisTaskCheckCascadePbPb");
-    task->SetUseCFContCascadeCuts       (usecfcontainers);
   }
 
-  task->SetCollidingSystems           (lCollidingSystems); // only for multiplicity binning 
   task->SetAnalysisType               (format);
-  task->SetRelaunchV0CascVertexers    (0);                 // used but code is commented out
+  task->SetRelaunchV0CascVertexers    (krelaunchvertexers);                 
   task->SetQualityCutZprimVtxPos      (kTRUE);             // selects vertices in +-10cm
   task->SetQualityCutNoTPConlyPrimVtx (kTRUE);             // retains only events with tracking + SPD vertex 
   task->SetQualityCutTPCrefit         (kTRUE);             // requires TPC refit flag to be true to select a track
   task->SetQualityCut80TPCcls         (kTRUE);             // rejects tracks that have less than 80 clusters in the TPC
   task->SetExtraSelections            (kextrasel);         // used to add other selection cuts 
-  task->SetCentralityLowLim           (centrlowlim);       // setting centrality selection vriables
+  task->SetCentralityLowLim           (centrlowlim);       // setting centrality selection variables
   task->SetCentralityUpLim            (centruplim);
   task->SetCentralityEst              (centrest);
   task->SetVertexRange                (vtxlim);
 
-  // physics selection
-  gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
-  AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(useMC,kFALSE);//,kFALSE); // PbPb: use this second flag up to run 133 and for runs with the CMBS2* triggers (from 137135, including 137161) 
-//  task->SelectCollisionCandidates();
-  
-  // for early PbPb runs collected with CMBS1 (up to 137133) manual settings
-  if (!useMC) {
-    AliPhysicsSelection * physSel = physSelTask->GetPhysicsSelection();
-  
-    if (dataset=="/alice/data/LHC10h_000137045_p1_plus") {
-      physSel->AddCollisionTriggerClass("+CMBS1A-B-NOPF-ALL");   // on the web page
-      physSel->AddCollisionTriggerClass("+CMBS1C-B-NOPF-ALL");
-      physSel->AddCollisionTriggerClass("+CMBAC-B-NOPF-ALL");
-      // This are needed only to fill the statistics tables
-      physSel->AddBGTriggerClass("+CMBAC-C-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBS1C-C-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBS1A-C-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBAC-A-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBS1C-A-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBS1A-A-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBAC-E-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBS1C-E-NOPF-ALL");
-      physSel->AddBGTriggerClass("+CMBS1A-E-NOPF-ALL");
-    } else {
-    // we used these manual settings for run137161 (first and second mult paper)
-    physSel->AddCollisionTriggerClass("+CMBS2A-B-NOPF-ALL");
-    physSel->AddCollisionTriggerClass("+CMBS2C-B-NOPF-ALL");
-    physSel->AddCollisionTriggerClass("+CMBAC-B-NOPF-ALL");
-    }
-
-    task->SelectCollisionCandidates(AliVEvent::kUserDefined);
-  } else {
-
-    task->SelectCollisionCandidates(AliVEvent::kMB); 
-  }
-
-  // centrality selection 
-  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
-  AliCentralitySelectionTask *taskCentr = AddTaskCentrality();
-  if (useMC) taskCentr->SetMCInput();
-
   // create output container
-  if (runperformancetask) AliAnalysisDataContainer *output = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer, outFileMC);
-  else       AliAnalysisDataContainer *output = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer, outFileData);
+  if (runperformancetask) AliAnalysisDataContainer *output = mgr->CreateContainer("clist", TList::Class(), AliAnalysisManager::kOutputContainer, outFileMC);
+  else       AliAnalysisDataContainer *output = mgr->CreateContainer("clist", TList::Class(), AliAnalysisManager::kOutputContainer, outFileData);
 
   // add task to the manager
   mgr->AddTask(task);
 
+  task->SelectCollisionCandidates();
+
   // connect input and output
   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
   mgr->ConnectOutput(task, 1, output);
@@ -157,7 +134,7 @@ void Analysis(TString dataset, TString outFileMC, TString outFileData,
   mgr->InitAnalysis();
   // process dataset  
   mgr->StartAnalysis("proof", dataset.Data(), nEvents, nEventsSkip);  // single dataset
-//  mgr->StartAnalysis("proof","/alice/sim/LHC11a7_000137161|/alice/sim/LHC11a7_000137162|/alice/sim/LHC11a7_000137430|/alice/sim/LHC11a7_000137431|/alice/sim/LHC11a7_000137432",nEvents, nEventsSkip);  // multiple dataset
+  //mgr->StartAnalysis("proof","/alice/sim/LHC11f5_000139514|/alice/sim/LHC11f5_000139517",nEvents, nEventsSkip);  // multiple dataset
 
 }
 
@@ -221,7 +198,6 @@ Bool_t InputHandlerSetup(TString format = "esd", Bool_t useKine = kTRUE) {
         mgr->SetMCtruthEventHandler(mcInputHandler);
       }
     }
-
   } else if (!format.CompareTo("aod")) {
     AliAODInputHandler *aodInputHandler = dynamic_cast<AliAODInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
 
@@ -235,7 +211,5 @@ Bool_t InputHandlerSetup(TString format = "esd", Bool_t useKine = kTRUE) {
     return kFALSE;
   }
 
-  return kTRUE;
-}
-
-//________________________________________________________________________
+  return kTRUE; 
+}