From 61e0c8c0787520158f7e311942ef30d934f71f81 Mon Sep 17 00:00:00 2001 From: snelling Date: Fri, 16 Apr 2010 15:14:26 +0000 Subject: [PATCH] 1.) runFlowTask.C: a) Included by default some other methods besides SP; b) Added Bool_t DATA = kFALSE/kTRUE to the macro's argument when running in mode mGrid as well; c) Added method CrossCheckUserSettings() which for instance prevents setting MCEP = DATA = kTRUE. Implementation of other warnings (e.g. for LYZ1SUM = LYZ2SUM = kTRUE shall be implemented within this method in order not to spoil to much the main body of the macro with trivial things); 2.) CreateAlienHandler.C: a) When running in run mode "test" by default 10 files will be copied locally and analysis will be performed only on them, which can take more than 1h in reality. Added setter for number of files to be copied locally: plugin->SetNtestFiles(2); b) Updated Root and AliRoot versions: plugin->SetROOTVersion("v5-26-00b-2"); plugin->SetAliROOTVersion("v4-19-10-AN"); c) There is a method to add more runs of a certain production in one go: plugin->SetRunRange(105000,106000); d) Instead of storing outputs in directories 000,001, etc, the output files will be stored in directories named after the run number of a certain production: plugin->SetOutputToRunNo(); e) Provided example of plugin usage for one MC production and for real data on Grid. 3.) In *Task*.cxx: a) Added in accordance with the 3rd point at https://aliceinfo.cern.ch/Offline/Activities/Analysis/AnalysisFramework/analysisFAQ.html the line PostData(1,fListHistos); at the end of each method UserCreateOutputObjects() in the task's classes. Now even if no event passes the selection criteria the output files of each method still will be in "AnalysisResults.root" but with the empty histograms. This is extremely relevant for merging procedure and for instance for validating jobs in plugin's "test" mode. --- .../AliFlowTasks/AliAnalysisTaskCumulants.cxx | 2 + .../AliAnalysisTaskFittingQDistribution.cxx | 2 + .../AliAnalysisTaskLYZEventPlane.cxx | 1 + .../AliAnalysisTaskLeeYangZeros.cxx | 2 + .../AliAnalysisTaskMCEventPlane.cxx | 2 + .../AliAnalysisTaskMixedHarmonics.cxx | 4 +- .../AliAnalysisTaskNestedLoops.cxx | 4 +- .../AliAnalysisTaskQCumulants.cxx | 4 +- .../AliAnalysisTaskScalarProduct.cxx | 3 ++ PWG2/FLOW/macros/CreateAlienHandler.C | 48 ++++++++++--------- PWG2/FLOW/macros/runFlowTask.C | 35 ++++++++++---- 11 files changed, 72 insertions(+), 35 deletions(-) diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx index 1399ad31d13..be125ac19e0 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx @@ -116,6 +116,8 @@ void AliAnalysisTaskCumulants::UserCreateOutputObjects() { Printf("ERROR: Could not retrieve histogram list (GFC, Task::UserCreateOutputObjects()) !!!!"); } + + PostData(1,fListHistos); } // end of void AliAnalysisTaskCumulants::UserCreateOutputObjects() diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFittingQDistribution.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFittingQDistribution.cxx index 909214531ce..3cd6a586444 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFittingQDistribution.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFittingQDistribution.cxx @@ -111,6 +111,8 @@ void AliAnalysisTaskFittingQDistribution::UserCreateOutputObjects() { Printf("ERROR: Could not retrieve histogram list (FQD, Task::UserCreateOutputObjects()) !!!!"); } + + PostData(1,fListHistos); } // end of void AliAnalysisTaskFittingQDistribution::UserCreateOutputObjects() diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskLYZEventPlane.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskLYZEventPlane.cxx index 46cddce6b96..033b2701bc3 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskLYZEventPlane.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskLYZEventPlane.cxx @@ -108,6 +108,7 @@ void AliAnalysisTaskLYZEventPlane::UserCreateOutputObjects() } else { cout<<"ERROR: Could not retrieve histogram list"<Print(); } else {Printf("ERROR: Could not retrieve histogram list"); } + + PostData(1,fListHistos); } diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx index 1ec6981d113..fab5e488a7e 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx @@ -92,6 +92,8 @@ void AliAnalysisTaskMCEventPlane::UserCreateOutputObjects() } else {Printf("ERROR: Could not retrieve histogram list"); } + PostData(1,fListHistos); + } //________________________________________________________________________ diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMixedHarmonics.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMixedHarmonics.cxx index 1c781ed2256..a0514629274 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMixedHarmonics.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMixedHarmonics.cxx @@ -130,7 +130,9 @@ void AliAnalysisTaskMixedHarmonics::UserCreateOutputObjects() { Printf("ERROR: Could not retrieve histogram list (MH, Task::UserCreateOutputObjects()) !!!!"); } - + + PostData(1,fListHistos); + } // end of void AliAnalysisTaskMixedHarmonics::UserCreateOutputObjects() //================================================================================================================ diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskNestedLoops.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskNestedLoops.cxx index a302b0ca8e4..cc450379ee4 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskNestedLoops.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskNestedLoops.cxx @@ -114,7 +114,9 @@ void AliAnalysisTaskNestedLoops::UserCreateOutputObjects() { Printf("ERROR: Could not retrieve histogram list (NL, Task::UserCreateOutputObjects()) !!!!"); } - + + PostData(1,fListHistos); + } // end of void AliAnalysisTaskNestedLoops::UserCreateOutputObjects() //================================================================================================================ diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskQCumulants.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskQCumulants.cxx index 4848439a022..45aaad764b2 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskQCumulants.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskQCumulants.cxx @@ -138,7 +138,9 @@ void AliAnalysisTaskQCumulants::UserCreateOutputObjects() { Printf("ERROR: Could not retrieve histogram list (QC, Task::UserCreateOutputObjects()) !!!!"); } - + + PostData(1,fListHistos); + } // end of void AliAnalysisTaskQCumulants::UserCreateOutputObjects() //================================================================================================================ diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx index 50a5c8d3ed2..2d3dc8b6b6a 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx @@ -122,6 +122,9 @@ void AliAnalysisTaskScalarProduct::UserCreateOutputObjects() fListHistos = fSP->GetHistList(); } else {Printf("ERROR: Could not retrieve histogram list"); } + + PostData(1,fListHistos); + } //________________________________________________________________________ diff --git a/PWG2/FLOW/macros/CreateAlienHandler.C b/PWG2/FLOW/macros/CreateAlienHandler.C index 023ae945cd7..36e99a0acd6 100644 --- a/PWG2/FLOW/macros/CreateAlienHandler.C +++ b/PWG2/FLOW/macros/CreateAlienHandler.C @@ -4,38 +4,42 @@ AliAnalysisGrid* CreateAlienHandler() { // then source /tmp/gclient_env_$UID in the current shell. if (!AliAnalysisGrid::CreateToken()) return NULL; AliAnalysisAlien *plugin = new AliAnalysisAlien(); + // Set the run mode (can be "full", "test", "offline", "submit" or "terminate") plugin->SetRunMode("test"); + plugin->SetNtestFiles(2); // Relevant only for run mode "test" + // Set versions of used packages plugin->SetAPIVersion("V1.1x"); - plugin->SetROOTVersion("v5-26-00b"); - plugin->SetAliROOTVersion("v4-19-04-AN"); - // Declare input data to be processed. - // Method 1: Create automatically XML collections using alien 'find' command. - // Define production directory LFN - //plugin->SetGridDataDir("/alice/data/2009/LHC09d/000104892/ESDs/pass3"); - plugin->SetGridDataDir("/alice/sim/LHC08d7a/"); - //plugin->SetGridDataDir("/alice/data/2009/LHC09d/000105054/ESDs/pass2"); - // Set data search pattern - //plugin->SetDataPattern("*tag.root"); - //plugin->SetDataPattern("*ESD.tag.root"); - // ...then add run numbers to be considered - plugin->AddRunNumber(122080); - //plugin->AddRunNumber(125025); - /* - for(Int_t r=114040;r<=114044;r++) - { - plugin->AddRunNumber(r); - } - */ - // Method 2: Declare existing data files (raw collections, xml collections, root file) + plugin->SetROOTVersion("v5-26-00b-2"); + plugin->SetAliROOTVersion("v4-19-10-AN"); + + // Declare input data to be processed - can be done in two ways: + // METHOD 1: Create automatically XML collections using alien 'find' command. + // ============================================================================ + // Example 1: MC production (set in macro runFlowTask.C: DATA = kFALSE) + // plugin->SetGridDataDir("/alice/sim/LHC10a10"); + // plugin->SetDataPattern("*AliESDs.root"); // The default data pattern, other may be "*tag.root", "*ESD.tag.root", etc + // plugin->AddRunNumber(105054); // Alternatively use e.g. plugin->SetRunRange(105044,106044); to add more runs in one go + // plugin->SetOutputToRunNo(); + // ============================================================================ + // Example 2: Real data (set in macro runFlowTask.C: DATA = kTRUE, MCEP = kFALSE) + plugin->SetGridDataDir("/alice/data/2009/LHC09d"); + plugin->SetDataPattern("*ESDs/pass5/*ESDs.root"); + plugin->SetRunPrefix("000"); + plugin->AddRunNumber(104044); + plugin->AddRunNumber(104892); // Alternatively use e.g. plugin->SetRunRange(104044,106044); to add more runs in one go + plugin->SetOutputToRunNo(); + // ============================================================================ + + // METHOD 2: Declare existing data files (raw collections, xml collections, root file) // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir()) // XML collections added via this method can be combined with the first method if // the content is compatible (using or not tags) //plugin->AddDataFile("hijingWithoutFlow10000Evts.xml"); // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root"); // Define alien work directory where all files will be copied. Relative to alien $HOME. - plugin->SetGridWorkingDir("hijingWithoutFlow/m0to100"); + plugin->SetGridWorkingDir("realData/900GeV"); // Declare alien output directory. Relative to working directory. plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output // Declare the analysis source files names separated by blancs. To be compiled runtime diff --git a/PWG2/FLOW/macros/runFlowTask.C b/PWG2/FLOW/macros/runFlowTask.C index 0be80f7d4cb..538a9a1039e 100644 --- a/PWG2/FLOW/macros/runFlowTask.C +++ b/PWG2/FLOW/macros/runFlowTask.C @@ -8,15 +8,15 @@ enum anaModes {mLocal,mLocalPAR,mPROOF,mGRID}; // Flow analysis method can be:(set to kTRUE or kFALSE) Bool_t MCEP = kFALSE; // correlation with Monte Carlo reaction plane Bool_t SP = kTRUE; // scalar product method (similar to eventplane method) -Bool_t GFC = kFALSE; // cumulants based on generating function -Bool_t QC = kFALSE; // cumulants using Q vectors -Bool_t FQD = kFALSE; // fit of the distribution of the Q vector (only integrated v) -Bool_t LYZ1SUM = kFALSE; // Lee Yang Zeroes using sum generating function (integrated v) -Bool_t LYZ1PROD = kFALSE; // Lee Yang Zeroes using product generating function (integrated v) +Bool_t GFC = kTRUE; // cumulants based on generating function +Bool_t QC = kTRUE; // cumulants using Q vectors +Bool_t FQD = kTRUE; // fit of the distribution of the Q vector (only integrated v) +Bool_t LYZ1SUM = kTRUE; // Lee Yang Zeroes using sum generating function (integrated v) +Bool_t LYZ1PROD = kTRUE; // Lee Yang Zeroes using product generating function (integrated v) Bool_t LYZ2SUM = kFALSE; // Lee Yang Zeroes using sum generating function (second pass differential v) Bool_t LYZ2PROD = kFALSE; // Lee Yang Zeroes using product generating function (second pass differential v) Bool_t LYZEP = kFALSE; // Lee Yang Zeroes Event plane using sum generating function (gives eventplane + weight) -Bool_t MH = kFALSE; // azimuthal correlators in mixed harmonics +Bool_t MH = kTRUE; // azimuthal correlators in mixed harmonics Bool_t NL = kFALSE; // nested loops (for instance distribution of phi1-phi2 for all distinct pairs) Bool_t METHODS[] = {SP,LYZ1SUM,LYZ1PROD,LYZ2SUM,LYZ2PROD,LYZEP,GFC,QC,FQD,MCEP,MH,NL}; @@ -43,11 +43,13 @@ void runFlowTask(Int_t mode=mLocal, Int_t nRuns = 1, //Bool_t DATA = kTRUE, const Char_t* dataDir="/PWG0/jgrosseo/run000104867_90_92_pass4", Int_t offset=0) //Bool_t DATA = kFALSE, const Char_t* dataDir="/ALICE/pp010000/MC_LHC09a4_81xxx", Int_t offset=0) //Bool_t DATA = kFALSE, const Char_t* dataDir="/COMMON/COMMON/LHC10a8_run104867_8", Int_t offset=0) -//void runFlowTask(Int_t mode = mGRID) +//void runFlowTask(Int_t mode = mGRID, Bool_t DATA = kTRUE) { TStopwatch timer; timer.Start(); + CrossCheckUserSettings(DATA); + LoadLibraries(mode); if (mode == mGRID) { @@ -95,15 +97,14 @@ void runFlowTask(Int_t mode=mLocal, Int_t nRuns = 1, AliMCEventHandler *mc = new AliMCEventHandler(); mgr->SetMCtruthEventHandler(mc); } - - + //____________________________________________// // Load the analysis task gROOT->LoadMacro("AddTaskFlow.C"); AliAnalysisTaskFlowEvent* taskFE = AddTaskFlow(type,METHODS,QA,WEIGHTS); - //task to check the offline trigger + // Task to check the offline trigger if (mode == mLocal || mode == mGRID) { gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C"); } else if (mode == mPROOF || mode == mLocalPAR) { @@ -136,6 +137,20 @@ void runFlowTask(Int_t mode=mLocal, Int_t nRuns = 1, } +void CrossCheckUserSettings(Bool_t bData) +{ + // Check in this method if the user settings make sense. + + if(MCEP==kTRUE && bData==kTRUE) + { + cout<