From 091f77ea4f41892b08f3b437997701f96691616d Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 25 Jan 2019 13:53:25 +0100 Subject: [PATCH 1/4] Incorporated IDE files and analysis intermediate files --- .gitignore | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index c92972b..9736678 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,15 @@ *.root *.xml *.pcm +*.sh +*.jdl + +.cproject +.project + + +myAnalysis.C +myTask_merge.C +outputs_valid +stderr + From 2ed5b2a180d7983caacda24fbdc96a8a2fe9c01b Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 25 Jan 2019 13:54:06 +0100 Subject: [PATCH 2/4] Incorporated proper includes --- AddMyTask.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AddMyTask.C b/AddMyTask.C index a64f43e..729ce52 100644 --- a/AddMyTask.C +++ b/AddMyTask.C @@ -1,3 +1,6 @@ +#include "AliAnalysisManager.h" +#include "AliAnalysisTaskMyTask.h" + AliAnalysisTaskMyTask* AddMyTask(TString name = "name") { // get the manager via the static access member. since it's static, you don't need From 7f96fea61f87c92c7d8bbf8a799187c18fe27973 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 25 Jan 2019 13:58:31 +0100 Subject: [PATCH 3/4] Adaptation for no need to modify for merging nor test nor local Added two function call parameters for mode and merging on grid with proper comments on its use Updated the AliPhysics version and suppressed the Alien API requirement Incorporated proper includes --- runAnalysis.C | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/runAnalysis.C b/runAnalysis.C index da6d7a0..e022687 100644 --- a/runAnalysis.C +++ b/runAnalysis.C @@ -1,15 +1,32 @@ +#include "TInterpreter.h" +#include "TChain.h" +#include "AliAnalysisAlien.h" +#include "AliAnalysisManager.h" +#include "AliAODInputHandler.h" + // include the header of your analysis task here! for classes already compiled by aliBuild, // precompiled header files (with extension pcm) are available, so that you do not need to // specify includes for those. for your own task however, you (probably) have not generated a // pcm file, so we need to include it explicitly #include "AliAnalysisTaskMyTask.h" -void runAnalysis() +// run your analysis in the mode 'mode' +// if 'mode' is 'grid' the results will be merged via jdl on the grid if gridMerge is true +// available modes: "grid", "local", "test", "terminate" +// mode "grid" : self-explained +// mode "local" : expects an AliAOD.root data file in the current directory +// mode "test" : your laptop will behave as a grid node running the analysis on data +// files downloaded from the grid +// mode "terminate" : when your analysis is finished on the grid iterate calls with this mode +// until your jobs are merged then make a final call with this mode and +// gridMerge kFALSE to bring home your results + +void runAnalysis(const char *mode = "grid", Bool_t gridMerge = kTRUE) { // set if you want to run the analysis locally (kTRUE), or on grid (kFALSE) - Bool_t local = kTRUE; + Bool_t local = (TString(mode).EqualTo("local")) ? kTRUE : kFALSE; // if you run on grid, specify test mode (kTRUE) or full grid model (kFALSE) - Bool_t gridTest = kTRUE; + Bool_t gridTest = (TString(mode).EqualTo("test")) ? kTRUE : kFALSE; // since we will compile a class, tell root where to look for headers #if !defined (__CINT__) || defined (__CLING__) @@ -62,9 +79,8 @@ void runAnalysis() alienHandler->SetAnalysisSource("AliAnalysisTaskMyTask.cxx"); // select the aliphysics version. all other packages // are LOADED AUTOMATICALLY! - alienHandler->SetAliPhysicsVersion("vAN-20181028_ROOT6-1"); - // set the Alien API version - alienHandler->SetAPIVersion("V1.1x"); + alienHandler->SetAliPhysicsVersion("vAN-20190122_ROOT6-1"); + // select the input data alienHandler->SetGridDataDir("/alice/data/2015/LHC15o"); alienHandler->SetDataPattern("*pass1/AOD194/*AOD.root"); @@ -85,8 +101,8 @@ void runAnalysis() // after re-running the jobs in SetRunMode("terminate") // (see below) mode, set SetMergeViaJDL(kFALSE) // to collect final results - alienHandler->SetMaxMergeStages(1); - alienHandler->SetMergeViaJDL(kTRUE); + alienHandler->SetMaxMergeStages(2); + alienHandler->SetMergeViaJDL(gridMerge); // define the output folders alienHandler->SetGridWorkingDir("myWorkingDir"); From 8add07e42ccff50f2e25b7f0b7acf8e2a26744fe Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 25 Jan 2019 23:15:14 +0100 Subject: [PATCH 4/4] Adaptation for running with root5 --- AddMyTask.C | 2 ++ AliAnalysisTaskMyTask.cxx | 1 + AliAnalysisTaskMyTask.h | 2 ++ runAnalysis.C | 6 +++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/AddMyTask.C b/AddMyTask.C index 729ce52..7d3d4a9 100644 --- a/AddMyTask.C +++ b/AddMyTask.C @@ -1,5 +1,7 @@ +#if !defined (__CINT__) || defined (__CLING__) #include "AliAnalysisManager.h" #include "AliAnalysisTaskMyTask.h" +#endif AliAnalysisTaskMyTask* AddMyTask(TString name = "name") { diff --git a/AliAnalysisTaskMyTask.cxx b/AliAnalysisTaskMyTask.cxx index 148078a..c216f90 100644 --- a/AliAnalysisTaskMyTask.cxx +++ b/AliAnalysisTaskMyTask.cxx @@ -23,6 +23,7 @@ #include "TH1F.h" #include "TList.h" #include "AliAnalysisTask.h" +#include "AliAnalysisTaskSE.h" #include "AliAnalysisManager.h" #include "AliAODEvent.h" #include "AliAODInputHandler.h" diff --git a/AliAnalysisTaskMyTask.h b/AliAnalysisTaskMyTask.h index e293d5c..a4b5b51 100644 --- a/AliAnalysisTaskMyTask.h +++ b/AliAnalysisTaskMyTask.h @@ -5,7 +5,9 @@ #ifndef AliAnalysisTaskMyTask_H #define AliAnalysisTaskMyTask_H +#if !defined (__CINT__) || defined (__CLING__) #include "AliAnalysisTaskSE.h" +#endif class AliAnalysisTaskMyTask : public AliAnalysisTaskSE { diff --git a/runAnalysis.C b/runAnalysis.C index e022687..dcebef6 100644 --- a/runAnalysis.C +++ b/runAnalysis.C @@ -1,14 +1,18 @@ +#include "TROOT.h" +#include "TSystem.h" +#if !defined (__CINT__) || defined (__CLING__) #include "TInterpreter.h" #include "TChain.h" #include "AliAnalysisAlien.h" #include "AliAnalysisManager.h" #include "AliAODInputHandler.h" - // include the header of your analysis task here! for classes already compiled by aliBuild, // precompiled header files (with extension pcm) are available, so that you do not need to // specify includes for those. for your own task however, you (probably) have not generated a // pcm file, so we need to include it explicitly #include "AliAnalysisTaskMyTask.h" +#endif + // run your analysis in the mode 'mode' // if 'mode' is 'grid' the results will be merged via jdl on the grid if gridMerge is true