]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add macros for GRID tests of new tasks
authorcbaumann <cbaumann@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 16:16:16 +0000 (16:16 +0000)
committercbaumann <cbaumann@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 16:16:16 +0000 (16:16 +0000)
PWGDQ/dielectron/macrosLMEE/testing/CreateAlienHandlerPbPb.C [new file with mode: 0644]
PWGDQ/dielectron/macrosLMEE/testing/runGridPbPb.C [new file with mode: 0644]

diff --git a/PWGDQ/dielectron/macrosLMEE/testing/CreateAlienHandlerPbPb.C b/PWGDQ/dielectron/macrosLMEE/testing/CreateAlienHandlerPbPb.C
new file mode 100644 (file)
index 0000000..c380aba
--- /dev/null
@@ -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-02a");
+   plugin->SetAliROOTVersion("v5-03-19-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/PWGDQ/ -I$ALICE_ROOT/PWGDQ/dielectron/macrosLMEE -I$ALICE_ROOT/PWGDQ/dielectron -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/ANALYSIS/Tender -I$ALICE_ROOT/ANALYSIS/TenderSupplies");
+ //  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  libTENDER.so libProof.so libRAWDatabase.so libSTEER.so libTOFbase.so libPWGDQdielectron.so ConfigLowMassDiE.C");
+   
+// 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("cbaumann_LMEEPbPb2011_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("DielAnalysis.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("DielAnalysis.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("DielAnalysis.jdl");
+// Optionally modify job price (default 1)
+   plugin->SetPrice(1);      
+// Optionally modify split mode (default 'se')    
+   plugin->SetSplitMode("se");
+   return plugin;
+}
diff --git a/PWGDQ/dielectron/macrosLMEE/testing/runGridPbPb.C b/PWGDQ/dielectron/macrosLMEE/testing/runGridPbPb.C
new file mode 100644 (file)
index 0000000..63f6892
--- /dev/null
@@ -0,0 +1,97 @@
+//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("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("libPWGDQdielectron.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/PWGDQ/");
+   gROOT->ProcessLine(".include $ALICE_ROOT/PWGDQ/dielectron");
+
+   // 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("lowmassAnalysis");
+
+   // 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/PWGDQ/dielectron/macrosLMEE/AddTask_cbaumann_LMEEPbPb2011.C");
+   AddTask_cbaumann_LMEEPbPb2011(kFALSE,kFALSE,kTRUE);
+
+
+
+   // Enable debug printouts
+   mgr->SetDebugLevel(10);
+
+   if (!mgr->InitAnalysis())
+         return;
+
+   mgr->PrintStatus();
+   // Start analysis in grid.
+   mgr->StartAnalysis("grid");
+};