Working on the electron cut
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / multPbPb / CreateAlienHandler.C
CommitLineData
8b7362ee 1
5ad99723 2AliAnalysisGrid* CreateAlienHandler(TString dataset, const char * runList, const char * suffix, TList * listToLoad, const char * mode = "full", Bool_t isMC = 0)
8b7362ee 3{
4
5ad99723 5 TGrid::Connect("alien:"); // Connecto to alien
8b7362ee 6
5ad99723 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()) {
4d0aa70f 22 gSystem->ExpandPathName(name->String());
23 name->String().ReplaceAll("+","");
24 sources = sources + gSystem->BaseName(name->String().Data()) + " ";
5ad99723 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()) + " ";
4d0aa70f 29 }
5ad99723 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;
8b7362ee 48
8b7362ee 49}