TENDER becomes Tender
[u/mrichter/AliRoot.git] / PWGLF / totEt / macros / CreateAlienHandlerCaloEtSim.C
CommitLineData
2c846661 1AliAnalysisGrid* CreateAlienHandlerCaloEtSim(TString outputDir, TString outputName, const char * pluginRunMode, int production, Bool_t isPHOS, Bool_t ispp,Bool_t isData, Int_t runnum, Bool_t runCompiledVersion)
4998bf42 2{
99a6613d 3 // Check if user has a valid token, otherwise make one. This has limitations.
4 // One can always follow the standard procedure of calling alien-token-init then
5 // source /tmp/gclient_env_$UID in the current shell.
c9bdd83c 6 //if (!AliAnalysisGrid::CreateToken()) return NULL;
99a6613d 7 AliAnalysisAlien *plugin = new AliAnalysisAlien();
4998bf42 8
99a6613d 9 // Overwrite all generated files, datasets and output results from a previous session
10 plugin->SetOverwriteMode();
11 // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
53992099 12 // plugin->SetRunMode("full"); // VERY IMPORTANT - DECRIBED BELOW
13 // plugin->SetRunMode("test"); // VERY IMPORTANT - DECRIBED BELOW
14 plugin->SetRunMode(pluginRunMode); // VERY IMPORTANT - DECRIBED BELOW
8df12228 15 cout<<"Running in "<<pluginRunMode<<" mode"<<endl;
53992099 16
99a6613d 17 // Set versions of used packages
964c8159 18 plugin->SetAPIVersion("V1.1x");
aa9239e0 19 plugin->SetROOTVersion("v5-34-08-6");
20 plugin->SetAliROOTVersion("vAN-20140623");
99a6613d 21 // Declare input data to be processed.
4998bf42 22
99a6613d 23 // Method 1: Create automatically XML collections using alien 'find' command.
24 // Define production directory LFN
25 // plugin->SetGridDataDir("/alice/sim/LHC10a18");
26 // Set data search pattern
27 // plugin->SetDataPattern("*ESDs.root"); // simulated, tags not used
28 // plugin->SetDataPattern("*ESDs/pass4/*ESDs.root"); // real data check reco pass and data base directory
29 // plugin->SetRunPrefix("000"); // real data
30 // plugin->SetDataPattern("*tag.root"); // Use ESD tags (same applies for AOD's)
31 // ...then add run numbers to be considered
32 // plugin->AddRunNumber(125020); // simulated
33 // plugin->AddRunNumber(104065); // real data
4998bf42 34
7c03166b 35
36 plugin->SetDataPattern("*ESDs.root");
c31562f7 37 //plugin->SetGridDataDir("/alice/sim/LHC10d4");
38 //plugin->AddRunNumber("120741");//smallest of the above
7c03166b 39 if(ispp){
40 if( production==0){
41 //pp
42 plugin->SetGridDataDir("/alice/sim/2012/LHC12a15e/");
43 plugin->AddRunNumber(169838);
44 }
45 if( production==1 || production==2 || production==3){
46 cout<<"I am here! "<<endl;
47 //pp
48 if(production==1){
49 plugin->SetGridDataDir(" /alice/sim/LHC11b1a/");//nominal
50 outputDir = outputDir + "NominalLHC11b1a";
51 }
52 if(production==2){
53 plugin->SetGridDataDir(" /alice/sim/LHC11b1b/");//high material budget
54 outputDir = outputDir + "HighLHC11b1b";
55 }
56 if(production==3){
57 plugin->SetGridDataDir(" /alice/sim/LHC11b1c/");//low material budget
58 outputDir = outputDir + "LowLHC11b1c";
59 }
60 plugin->AddRunNumber(121040);//all runs in these productions with good EMC and PHOS and global status
61 plugin->AddRunNumber(121039);//
62 plugin->AddRunNumber(118558);
63 plugin->AddRunNumber(118518);
64 plugin->AddRunNumber(118506);
65 //Additional runs which may be used 118561, 118560, 118556 emc bad parts
66 //118512, 118507 status unknown
67 }
68 }
69 else{
70 if(isData){//185 jobs
d45a33b8 71 cout<<"Running over data"<<endl;
72 if(production==1){
73 plugin->SetGridDataDir("/alice/data/2010/LHC10h");//PbPb data
74 plugin->SetDataPattern("*ESDs/pass2/*ESDs.root");
75 plugin->SetRunPrefix("000"); // real data
76 outputDir = outputDir + "LHC10hPass2";
77 if(runnum==0){
78 plugin->AddRunNumber(139465);
aa9239e0 79// plugin->AddRunNumber(138442);
80// plugin->AddRunNumber(138364);
81// plugin->AddRunNumber(138396);
82// plugin->AddRunNumber(137722);
83 //outputDir = outputDir + "Run139465";
d45a33b8 84 }
85 if(runnum==1){
86 plugin->AddRunNumber(138442);
87 outputDir = outputDir + "Run138442";
88 }
89 if(runnum==2){
90 plugin->AddRunNumber(138364);
91 outputDir = outputDir + "Run138364";
92 }
93 if(runnum==3){
94 plugin->AddRunNumber(138534);
95 outputDir = outputDir + "Run138534";
96 }
97 if(runnum==4){
98 plugin->AddRunNumber(138275);
99 outputDir = outputDir + "Run138275";
100 }
101 }
102 if(production==2){
103 plugin->SetGridDataDir("/alice/data/2011/LHC11h_2");//PbPb data
104 plugin->SetDataPattern("*ESDs/pass2/*ESDs.root");
105 plugin->SetRunPrefix("000"); // real data
2c846661 106 //plugin->AddRunNumber(169099);
aa9239e0 107 if(runnum==0){
108 plugin->AddRunNumber(168464);
109 }
d45a33b8 110 outputDir = outputDir + "LHC11hPass2";
aa9239e0 111 if(runnum==1){
112 plugin->AddRunNumber(169588);
113 outputDir +="169588";
114 }
115 if(runnum==2){
116 plugin->AddRunNumber(170268);
117 outputDir +="170268";
118 }
119 if(runnum==3){
120 plugin->AddRunNumber(170207);
121 outputDir +="170207";
122 }
123 if(runnum==4){
124 plugin->AddRunNumber(168512);
125 outputDir +="168512";
126 }
127 if(runnum==5){
128 plugin->AddRunNumber(170311);
129 outputDir +="170311";
130 }
d45a33b8 131 }
7c03166b 132 }
133 else{
134 if(production==0){
135 //Standard
136 if(isPHOS){
137 plugin->SetGridDataDir("/alice/sim/LHC11a10a_bis");
138 }
139 else{
140 outputDir = outputDir + "LHC11a4_bis";
141 plugin->SetGridDataDir("/alice/sim/LHC11a4_bis");
142 plugin->SetGridDataDir("/alice/sim/LHC11a4_bis");
143 }
144 plugin->AddRunNumber(139465);
145 plugin->AddRunNumber(139470);
146 plugin->AddRunNumber(137366);
147 plugin->AddRunNumber(137161);
148 }
149 if(production==1){
70292245 150 //cout<<"I am here! Line 93 "<<endl;
7c03166b 151 //if(!isPHOS){
152 outputDir = outputDir + "LHC11a10a_bis";
153 plugin->SetGridDataDir("/alice/sim/LHC11a10a_bis");
154 //}
155// plugin->AddRunNumber(137366);
156// plugin->AddRunNumber(137161);
157// plugin->AddRunNumber(139470);
158 plugin->AddRunNumber(139465);//probably our focus now
d45a33b8 159// plugin->AddRunNumber(138442);
160// plugin->AddRunNumber(138364);
161// plugin->AddRunNumber(138534);
162// plugin->AddRunNumber(138275);
7c03166b 163 }
164 if(production==2){
165 if(!isPHOS){
166 outputDir = outputDir + "LHC11b7";
167 plugin->SetGridDataDir("/alice/sim/LHC11b7");
168 }
169 plugin->AddRunNumber(137549);
170 plugin->AddRunNumber(138200);
171 }
172 if(production==3){
173 if(!isPHOS){
174 outputDir = outputDir + "LHC11a10a";
175 plugin->SetGridDataDir("/alice/sim/LHC11a10a");
176 }
177 plugin->AddRunNumber(139470);
178 }
70292245 179 if(production==4){
180 outputDir = outputDir + "LHC13d2";
181 plugin->SetGridDataDir(" /alice/sim/2013/LHC13d2");
182 plugin->AddRunNumber(139465);//probably our focus now
183 }
aa9239e0 184 if(production==5){//2011 production - warning only 0-10%
185 cout<<"I am here setting grid data dir"<<endl;
186 outputDir = outputDir + "LHC12d3";
187 plugin->SetGridDataDir("/alice/sim/2012/LHC12d3");
188 plugin->AddRunNumber(168464);//probably our focus now
189 }
190 if(production==6){//2011 production - 0-10%
191 cout<<"I am here setting grid data dir"<<endl;
192 outputDir = outputDir + "LHC13e1a";
193 plugin->SetGridDataDir("/alice/sim/2013/LHC13e1a");
194 plugin->AddRunNumber(168464);//probably our focus now
195 }
196 if(production==7){//2011 production - 10-50%
197 cout<<"I am here setting grid data dir"<<endl;
198 outputDir = outputDir + "LHC13e1b";
199 plugin->SetGridDataDir("/alice/sim/2013/LHC13e1b");
200 plugin->AddRunNumber(168464);//probably our focus now
201 }
202 if(production==8){//2011 production - 50-90%
2c846661 203 cout<<"I am here setting grid data dir"<<endl;
aa9239e0 204 outputDir = outputDir + "LHC13e1c";
205 plugin->SetGridDataDir("/alice/sim/2013/LHC13e1c");
2c846661 206 plugin->AddRunNumber(168464);//probably our focus now
2c846661 207 }
70292245 208
209
7c03166b 210 }
211 }
212
99a6613d 213 // Method 2: Declare existing data files (raw collections, xml collections, root file)
214 // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
215 // XML collections added via this method can be combined with the first method if
216 // the content is compatible (using or not tags)
83de2448 217 //plugin->AddDataFile("tag.xml");
6ad010c1 218 // plugin->AddDataFile("wn.xml"); // test
99a6613d 219 // file generated with: find -x tag /alice/sim/LHC10d1/117222/* AliESDs.root > tag.xml
4998bf42 220
99a6613d 221 // Define alien work directory where all files will be copied. Relative to alien $HOME.
222 plugin->SetGridWorkingDir(outputDir.Data());
223 // Declare alien output directory. Relative to working directory.
224 plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
225 // Declare the analysis source files names separated by blancs. To be compiled runtime IN THE SAME ORDER THEY ARE LISTED
9fb993e3 226 //plugin->SetAdditionalRootLibs("libPHOSUtils.so libEMCALUtils.so libPWG4CaloCalib.so libPWG4PartCorrBase.so libPWG4PartCorrDep.so");
99a6613d 227 // using ACLiC on the worker nodes.
2c846661 228 if(runCompiledVersion){
af472fff 229 plugin->SetAdditionalLibs("libPHOSUtils.so libTender.so libTenderSupplies.so libPWGTools.so libPWGEMCAL.so badchannels.root libPWGLFtotEt.so corrections.root calocorrections.root ConfigEtMonteCarlo.C ConfigEtReconstructed.C");
2c846661 230 }
231 else{
232 plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.cxx AliAnalysisEtCommon.cxx AliAnalysisEtSelector.cxx AliAnalysisEtSelectorPhos.cxx AliAnalysisEtSelectorEmcal.cxx AliAnalysisEtTrackMatchCorrections.cxx AliAnalysisEtRecEffCorrection.cxx AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTransverseEnergy.cxx AliAnalysisEmEtMonteCarlo.cxx AliAnalysisEmEtReconstructed.cxx AliAnalysisTaskTotEt.cxx");
fe71c343 233 //plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.cxx AliAnalysisEtCommon.cxx AliAnalysisEtSelector.cxx AliAnalysisEtSelectorPhos.cxx AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTransverseEnergy.cxx AliAnalysisTaskTotEt.cxx");
99a6613d 234 // Declare all libraries (other than the default ones for the framework. These will be
235 // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
af472fff 236 plugin->SetAdditionalLibs("libPHOSUtils.so libTender.so libTenderSupplies.so libPWGTools.so libPWGEMCAL.so AliAnalysisEtCuts.cxx AliAnalysisEtCuts.h AliAnalysisHadEtCorrections.cxx AliAnalysisHadEtCorrections.h AliAnalysisEtCommon.cxx AliAnalysisEtCommon.h AliAnalysisEtSelector.cxx AliAnalysisEtSelector.h AliAnalysisEtSelectorPhos.cxx AliAnalysisEtSelectorPhos.h AliAnalysisEtSelectorEmcal.cxx AliAnalysisEtSelectorEmcal.h AliAnalysisEtTrackMatchCorrections.cxx AliAnalysisEtTrackMatchCorrections.h AliAnalysisEtRecEffCorrection.cxx AliAnalysisEtRecEffCorrection.h AliAnalysisEt.cxx AliAnalysisEt.h AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarlo.h AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloPhos.h AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtMonteCarloEmcal.h AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructed.h AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedPhos.h AliAnalysisEtReconstructedEmcal.cxx AliAnalysisEtReconstructedEmcal.h AliAnalysisTaskTransverseEnergy.cxx AliAnalysisTaskTransverseEnergy.h AliAnalysisEmEtMonteCarlo.cxx AliAnalysisEmEtMonteCarlo.h AliAnalysisEmEtReconstructed.cxx AliAnalysisEmEtReconstructed.h AliAnalysisTaskTotEt.cxx AliAnalysisTaskTotEt.h badchannels.root corrections.root calocorrections.root ConfigEtMonteCarlo.C ConfigEtReconstructed.C");
2c846661 237 }
238 plugin->SetExecutableCommand("aliroot -b -q");
6ad010c1 239 // add extra include files/path
240 plugin->AddIncludePath("-I. -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/ANALYSIS");
99a6613d 241
242 // No need for output file names. Procedure is automatic. <-- not true
62633297 243 //plugin->SetDefaultOutputs(kFALSE);
8df12228 244 //plugin->SetOutputFiles(outputName.Data());
62633297 245 //plugin->SetOutputFiles("Et.ESD.sim.EMCAL.root event_stat.root");
99a6613d 246 // No need define the files to be archived. Note that this is handled automatically by the plugin.
247 // plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
248 // Set a name for the generated analysis macro (default MyAnalysis.C) Make this unique !
249 plugin->SetAnalysisMacro("DavidEtAnalysis.C");
250 // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore). The optimum for an analysis
251 // is correlated with the run time - count few hours TTL per job, not minutes !
aa9239e0 252 plugin->SetSplitMaxInputFileNumber(50);
99a6613d 253 // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
d45a33b8 254 //plugin->SetMaxInitFailed(50);
99a6613d 255 // Optionally resubmit threshold.
c9bdd83c 256 //plugin->SetMasterResubmitThreshold(90);
99a6613d 257 // Optionally set time to live (default 30000 sec)
2c846661 258 plugin->SetTTL(30000);
99a6613d 259 // Optionally set input format (default xml-single)
260 plugin->SetInputFormat("xml-single");
261 // Optionally modify the name of the generated JDL (default analysis.jdl)
262 plugin->SetJDLName("TaskEt.jdl");
263 // Optionally modify job price (default 1)
264 plugin->SetPrice(1);
265 // Optionally modify split mode (default 'se')
266 plugin->SetSplitMode("se");
6ad010c1 267
7c03166b 268
269 plugin->SetMergeViaJDL();
270
99a6613d 271 return plugin;
4998bf42 272}