Working on the electron cut
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / multPbPb / CreateAlienHandler.C
1
2 AliAnalysisGrid* CreateAlienHandler(TString dataset, const char * runList, const char * suffix, TList * listToLoad, const char * mode = "full", Bool_t isMC = 0)
3 {
4   
5   TGrid::Connect("alien:"); // Connecto to alien
6
7   AliAnalysisAlien * handler = new AliAnalysisAlien("test");
8   // input
9   handler->SetGridDataDir(dataset);
10   handler->AddRunNumber(runList);
11   if(dataset.Contains("sim")) handler->SetDataPattern("*AliESDs.root");
12   else handler->SetDataPattern("*pass2/*AliESDs.root");
13   handler->SetAnalysisMacro("MultPb.C");
14   handler->SetJDLName("MultPb.jdl");
15   handler->SetAdditionalRootLibs("libCore libTree libGeom libVMC libPhysics libSTEERBase libESD libAOD libANALYSIS libOADB libANALYSISalice");   
16   handler->SetRunMode(mode);
17   TIterator * iter = listToLoad->MakeIterator();
18   TObjString * name = 0;
19   TString sources = "";
20   TString sourcescxxOnly = "";
21   while (name = (TObjString *)iter->Next()) {
22      gSystem->ExpandPathName(name->String());
23      name->String().ReplaceAll("+","");     
24      sources = sources + gSystem->BaseName(name->String().Data()) + " ";
25      TString header = gSystem->BaseName(name->String().Data());
26      header.ReplaceAll("cxx","h");
27      sources = sources + header.Data() + " ";
28      if(name->String().Contains("cxx")) sourcescxxOnly = sourcescxxOnly + gSystem->BaseName(name->String().Data()) + " ";
29    }
30   handler->SetAnalysisSource(sourcescxxOnly.Data());
31   handler->SetAdditionalLibs(sources.Data());   
32
33   // Alirootversion
34   //VO_ALICE@GEANT3::v1-12  
35   handler->SetAPIVersion("V1.1x");
36   handler->SetROOTVersion   ("v5-30-03-1")    ;
37   handler->SetAliROOTVersion("v5-02-12-AN") ;
38
39   // output
40   TString runs = runList;
41   runs.ReplaceAll(" ","_");
42   handler->SetGridWorkingDir(TString("MultPbPb_") + gSystem->BaseName(dataset)+suffix+"_"+runs);
43   handler->SetGridOutputDir("out");
44   //  handler->SetOutputFiles("sec.root");
45   handler->SetMergeExcludes("sec.root EventStat_temp.root event_stat.root multPbPbtracks.root"); // don't merge files; FIXME: if processing many bin, the name of files not to be merged should be changed
46
47   return handler;
48
49 }