]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/QA/tasks/macros/CreateAlienHandler.C
- corrected the ingroup to alihlt_qa for the documentation creation
[u/mrichter/AliRoot.git] / HLT / QA / tasks / macros / CreateAlienHandler.C
1 // $Id$
2 /*
3  * Alien handler macro to run an HLT analysis task for comparing the offline
4  * with the HLT esd tree on the GRID.
5  *
6  * It is loaded in compare_HLT_offline_grid.C.
7  *
8  * @ingroup alihlt_qa
9  * @author Kalliopi.Kanaki@ift.uib.no
10  */
11
12 AliAnalysisGrid *CreateAlienHandler(const char* mode = "full", const char* detectorTask="global"){
13   
14   // Check if user has a valid token, otherwise make one. This has limitations.
15   // One can always follow the standard procedure of calling alien-token-init then
16   // source /tmp/gclient_env_$UID in the current shell.
17   
18   if(!AliAnalysisGrid::CreateToken()) return NULL;
19   AliAnalysisAlien *plugin = new AliAnalysisAlien();
20
21   // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
22   plugin->SetRunMode(mode);
23   
24   // check the versions available on alien with the command 'packages'
25   plugin->SetAPIVersion("V1.1x");
26   plugin->SetROOTVersion("v5-26-00b");
27   plugin->SetAliROOTVersion("v4-19-10-AN");
28
29   // data alien directory
30   plugin->SetGridDataDir("/alice/data/2010/LHC10b/");
31   
32   // Set data search pattern
33   plugin->SetDataPattern("*ESD.tag.root"); 
34   
35   plugin->AddRunNumber("000116112"); 
36   //plugin->SetRunRange(xxx,yyy);
37  
38   // define working and output directories
39   plugin->SetGridWorkingDir("ESDcomparison"); // relative to $HOME
40   plugin->SetGridOutputDir("output");         // relative to working dir
41   
42   
43   Bool_t bTPC=kFALSE, bPHOS=kFALSE, bITS=kFALSE, bGLOBAL=kFALSE;
44  
45   TString allArgs = detectorTask;
46   TString argument;
47  
48   TObjArray *pTokens = allArgs.Tokenize(" ");
49   if(pTokens){
50      for(int i=0; i<pTokens->GetEntries(); i++){
51          argument=((TObjString*)pTokens->At(i))->GetString();
52          if(argument.IsNull()) continue;
53
54          if(argument.CompareTo("tpc", TString::kIgnoreCase)==0){
55             bTPC = kTRUE;
56             continue;
57          }        
58          if(argument.CompareTo("phos", TString::kIgnoreCase)==0){
59             bPHOS = kTRUE;
60             continue;
61          }         
62          if(argument.CompareTo("its", TString::kIgnoreCase)==0){
63             bITS = kTRUE;
64             continue;
65          }      
66          if(argument.CompareTo("global", TString::kIgnoreCase)==0){
67             bGLOBAL = kTRUE;
68             continue;
69          }        
70          if(argument.CompareTo("all",TString::kIgnoreCase)==0){
71             bTPC    = kTRUE;
72             bPHOS   = kTRUE;
73             bITS    = kTRUE;
74             bGLOBAL = kTRUE;
75             continue;
76          }
77          else break;
78     }
79   }
80     
81   // libs, seperate by blanks
82   if(bTPC){  
83     plugin->SetAnalysisSource("AliAnalysisTaskHLTTPC.cxx");  
84     plugin->SetAdditionalLibs("AliAnalysisTaskHLTTPC.h AliAnalysisTaskHLTTPC.cxx");
85     plugin->SetOutputFiles("HLT-OFFLINE-TPC-comparison.root");    
86   }
87   if(bITS){  
88     plugin->SetAnalysisSource("AliAnalysisTaskHLTITS.cxx");  
89     plugin->SetAdditionalLibs("AliAnalysisTaskHLTITS.h AliAnalysisTaskHLTITS.cxx");
90     plugin->SetOutputFiles("HLT-OFFLINE-ITS-comparison.root");    
91   }
92   if(bPHOS){  
93     plugin->SetAnalysisSource("AliAnalysisTaskHLTPHOS.cxx");  
94     plugin->SetOutputFiles("HLT-OFFLINE-GLOBAL-comparison.root");
95     plugin->SetOutputFiles("HLT-OFFLINE-PHOS-comparison.root");    
96   }
97   if(bGLOBAL){  
98     plugin->SetAnalysisSource("AliAnalysisTaskHLT.cxx");  
99     plugin->SetAdditionalLibs("AliAnalysisTaskHLT.h AliAnalysisTaskHLT.cxx"); 
100     plugin->SetOutputFiles("HLT-OFFLINE-GLOBAL-comparison.root");
101   }
102
103   // Optionally define the files to be archived.
104   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
105   
106   // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
107   plugin->SetAnalysisMacro("runComparison.C");
108   plugin->SetExecutable("comparison.sh");
109
110   plugin->SetSplitMaxInputFileNumber(100);
111   
112   // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
113   plugin->SetMaxInitFailed(10);
114   
115   // Optionally resubmit threshold.
116   plugin->SetMasterResubmitThreshold(90); // in %
117
118   plugin->SetTTL(30000);// in sec
119   
120   // Optionally set input format (default xml-single)
121   plugin->SetInputFormat("xml-single");
122  
123   // Optionally modify the name of the generated JDL (default analysis.jdl)
124   plugin->SetJDLName("analysis.jdl");
125  
126   // Optionally modify job price (default 1)
127   plugin->SetPrice(1);
128   
129   // Optionally modify split mode (default 'se')
130   plugin->SetSplitMode("se");
131   
132   return plugin;
133 }