From 664d4a931626f7f18f70c72254d12e38a62932fe Mon Sep 17 00:00:00 2001 From: rbailhac Date: Fri, 22 Jun 2012 10:41:24 +0000 Subject: [PATCH] Test for grid --- .../hfe/macros/test/CreateAlienHandlerPbPb.C | 101 +++++++++++++++++ PWGHF/hfe/macros/test/runGridPbPb.C | 103 ++++++++++++++++++ 2 files changed, 204 insertions(+) create mode 100644 PWGHF/hfe/macros/test/CreateAlienHandlerPbPb.C create mode 100644 PWGHF/hfe/macros/test/runGridPbPb.C diff --git a/PWGHF/hfe/macros/test/CreateAlienHandlerPbPb.C b/PWGHF/hfe/macros/test/CreateAlienHandlerPbPb.C new file mode 100644 index 00000000000..9a82c33bc23 --- /dev/null +++ b/PWGHF/hfe/macros/test/CreateAlienHandlerPbPb.C @@ -0,0 +1,101 @@ +//Macro to test Analysis Macros on the GRID +//please check settings for output files +//for local test use 'test' mode + +AliAnalysisGrid* CreateAlienHandlerPbPb() +{ +// 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 +// source /tmp/gclient_env_$UID in the current shell. +// if (!AliAnalysisGrid::CreateToken()) return NULL; + AliAnalysisAlien *plugin = new AliAnalysisAlien(); + plugin->SetOverwriteMode(); +// Set the run mode (can be "full", "test", "offline", "submit" or "terminate") + plugin->SetRunMode("test"); +// plugin->SetRunMode("offline"); +// plugin->SetRunMode("full"); +// plugin->SetRunMode("terminate"); + plugin->SetNtestFiles(1); +// Set versions of used packages + + plugin->SetAPIVersion("V1.1x"); + plugin->SetROOTVersion("v5-33-02b"); + plugin->SetAliROOTVersion("v5-03-33-AN"); +// Declare input data to be processed. +// Method 1: Create automatically XML collections using alien 'find' command. +// Define production directory LFN +// On real reconstructed data: + plugin->SetGridDataDir("/alice/data/2011/LHC11h_2"); +// Set data search pattern +plugin->SetDataPattern("*/pass2/*/AliESDs.root"); + +//same for pp MC: +// plugin->SetGridDataDir("/alice/sim/LHC10f6a"); +// plugin->SetDataPattern("*/*/AliESDs.root"); +// Data pattern for reconstructed data +// plugin->SetDataPattern("*AliAOD.root"); //esta linea sirve para pruebas + + plugin->SetRunPrefix("000"); // real data + +// ...then add run numbers to be considered +// plugin->SetRunRange(122374,126437); //sim data +//10d +// plugin->AddRunNumber(126437); //sim data +//11h.pass2 +plugin->AddRunNumber(170040); +// plugin->SetOutputSingleFolder("output"); + 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("tag.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("work"); +// 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 +// using ACLiC on the worker nodes. +// plugin->SetAnalysisSource("AliAnalysisHelperJetTasks.cxx AliAnalysisTaskPartonDisc.cxx"); + plugin->AddIncludePath("-I. .I$ALIEN_ROOT/api/lib -I$ROOTSYS/lib -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/PWGHF/ -I$ALICE_ROOT/PWGHF/hfe/macros -I$ALICE_ROOT/PWGHF/hfe -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/ANALYSIS/Tender -I$ALICE_ROOT/ANALYSIS/TenderSupplies -I$ALICE_ROOT/PWG/ -I$ALICE_ROOT/PWG/FLOW -I$ALICE_ROOT/PWG/Base -I$ALICE_ROOT/PWG/Tasks"); + // plugin->SetAdditionalLibs("libGui.so libXMLParser.so libSTEERBase.so libESD.so libAOD.so libCDB.so libANALYSIS.so libANALYSISalice.so libCORRFW.so libTENDER.so libProof.so libRAWDatabase.so libSTEER.so libTOFbase.so libPWGDQdielectron.so");// ConfigLowMassDiE.C") + plugin->SetAdditionalLibs("libGui.so libXMLParser.so libSTEERBase.so libESD.so libAOD.so libCDB.so libANALYSIS.so libANALYSISalice.so libCORRFW.so libPWGflowBase.so libPWGflowTasks.so libPWGHFhfe.so libTENDER.so libProof.so libRAWDatabase.so libSTEER.so libTOFbase.so"); + +// Declare all libraries (other than the default ones for the framework. These will be +// loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here. +// plugin->SetAdditionalLibs("AliAnalysisHelperJetTasks.h AliAnalysisHelperJetTasks.cxx AliAnalysisTaskPartonDisc.h AliAnalysisTaskPartonDisc.cxx"); +// Declare the output file names separated by blancs. +// (can be like: file.root or file.root@ALICE::Niham::File) +// plugin->SetOutputFiles("Output.root"); + //plugin->SetDefaultOutputs(); + plugin->SetDefaultOutputs(kFALSE); + plugin->SetOutputFiles("rbailhac_tpctofv2PbPb2011_out.root"); + //plugin->SetOutputFiles("cbaumann_LMEEpp2010_out.root"); +// plugin->SetOutputFiles("cbaumann_lowmass_out.root cbaumann_lowmass_CF.root"); +// Optionally define the files to be archived. +// plugin->SetOutputArchive("log_archive.zip:stdout,stderr@disk=2 root_archive.zip:*.root@disk=2"); +// plugin->SetOutputArchive("log_archive.zip:stdout,stderr"); +// Optionally set a name for the generated analysis macro (default MyAnalysis.C) + plugin->SetAnalysisMacro("Tpctofv2Analysis.C"); +// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore) +// plugin->SetSplitMaxInputFileNumber(2); +// Optionally modify the executable name (default analysis.sh) + plugin->SetExecutable("Tpctofv2Analysis.sh"); + plugin->SetExecutableCommand("aliroot -b -q"); +// Optionally set number of failed jobs that will trigger killing waiting sub-jobs. +// plugin->SetMaxInitFailed(5); +// Optionally resubmit threshold. +// plugin->SetMasterResubmitThreshold(90); +// Optionally set time to live (default 30000 sec) + plugin->SetTTL(30000); +// Optionally set input format (default xml-single) + plugin->SetInputFormat("xml-single"); +// Optionally modify the name of the generated JDL (default analysis.jdl) + plugin->SetJDLName("Tpctofv2Analysis.jdl"); +// Optionally modify job price (default 1) + plugin->SetPrice(1); +// Optionally modify split mode (default 'se') + plugin->SetSplitMode("se"); + return plugin; +} diff --git a/PWGHF/hfe/macros/test/runGridPbPb.C b/PWGHF/hfe/macros/test/runGridPbPb.C new file mode 100644 index 00000000000..76643324486 --- /dev/null +++ b/PWGHF/hfe/macros/test/runGridPbPb.C @@ -0,0 +1,103 @@ +//Replace User Task with your Add Task and appropriate parameters + +Bool_t SetupPar(const char *parfile); + +void runGridPbPb() +{ + // Load common libraries + gSystem->Load("libCore.so"); + gSystem->Load("libTree.so"); + gSystem->Load("libGeom.so"); + gSystem->Load("libVMC.so"); + gSystem->Load("libPhysics.so"); + gSystem->Load("libMinuit.so"); + gSystem->Load("libGui.so"); + gSystem->Load("libXMLParser.so"); + gSystem->Load("libSTEERBase.so"); + gSystem->Load("libESD.so"); + gSystem->Load("libCDB.so"); + gSystem->Load("libAOD.so"); + gSystem->Load("libANALYSIS.so"); + gSystem->Load("libANALYSISalice.so"); + + //lib necessary for dielectron + gSystem->Load("libCORRFW.so"); + gSystem->Load("libPWGflowBase.so"); + gSystem->Load("libPWGflowTasks.so"); + + gSystem->Load("libTENDER"); + gSystem->Load("libTENDERSupplies"); + gSystem->Load("libProof.so"); + gSystem->Load("libRAWDatabase.so"); + gSystem->Load("libSTEER.so"); + gSystem->Load("libTOFbase.so"); + + gSystem->Load("libTRDbase.so"); + gSystem->Load("libVZERObase.so"); + gSystem->Load("libPWGHFbase.so"); + gSystem->Load("libPWGHFhfe.so"); + gSystem->Load("libTENDERSupplies.so"); + + // Load common libraries + + // Use AliRoot includes to compile our task + gROOT->ProcessLine(".include $ALICE_ROOT/include"); + gROOT->ProcessLine(".include $ALICE_ROOT/PWGHF/"); + gROOT->ProcessLine(".include $ALICE_ROOT/PWGHF/hfe"); + gROOT->ProcessLine(".include $ALICE_ROOT/PWG/FLOW"); + gROOT->ProcessLine(".include $ALICE_ROOT/PWG/FLOW/Base"); + gROOT->ProcessLine(".include $ALICE_ROOT/PWG/FLOW/Tasks"); + + // Create and configure the alien handler plugin + gROOT->LoadMacro("CreateAlienHandlerPbPb.C"); + AliAnalysisGrid *alienHandler = CreateAlienHandlerPbPb(); + if (!alienHandler) return; + + // Create the analysis manager + AliAnalysisManager *mgr = new AliAnalysisManager("tpctofv2Analysis"); + + // Connect plug-in to the analysis manager + mgr->SetGridHandler(alienHandler); + + AliESDInputHandler* esdH = new AliESDInputHandler(); + esdH->SetReadFriends(kFALSE); + mgr->SetInputEventHandler(esdH); + + + + //==== Physics Selection ==== + gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C"); + AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(); + + //==== Add tender ==== + +// gROOT->LoadMacro("AddTaskTender.C"); +// AddTaskTender(); + + //===== ADD PID RESPONSE: === + + gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); + AddTaskPIDResponse(); + + //===== ADD CENTRALITY: === + gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C"); + AddTaskCentrality(); + + + //===== ADD TASK:: + + gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/AddTaskHFEtpctofv2.C"); + AddTaskHFEtpctofv2(); + + + + // Enable debug printouts + mgr->SetDebugLevel(10); + + if (!mgr->InitAnalysis()) + return; + + mgr->PrintStatus(); + // Start analysis in grid. + mgr->StartAnalysis("grid"); +}; -- 2.43.0