.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Local / runLocal.C
CommitLineData
76ce4b5b 1void runLocal(const char *chainlistfile, int dataFromAlien=0) {
2 TStopwatch timer;
3 timer.Start();
4
5 printf("*** Connect to AliEn ***\n");
6 if (dataFromAlien)
7 TGrid::Connect("alien://");
4070f709 8 gSystem->Load("libProofPlayer");
76ce4b5b 9
10 //____________________________________________________//
11 //_____________Setting up STEERBase.par_______________//
12 //____________________________________________________//
13 setupPar("STEERBase");
4070f709 14 gSystem->Load("libSTEERBase");
76ce4b5b 15
16 //____________________________________________________//
17 //_____________Setting up ESD.par_____________________//
18 //____________________________________________________//
19 setupPar("ESD");
4070f709 20 gSystem->Load("libVMC");
21 gSystem->Load("libESD");
76ce4b5b 22
23 //____________________________________________________//
24 //_____________Setting up AOD.par_____________________//
25 //____________________________________________________//
26 setupPar("AOD");
4070f709 27 gSystem->Load("libAOD");
76ce4b5b 28
29 //_________________________________________________________//
30 //_____________Setting up ANALYSIS.par_____________________//
31 //_________________________________________________________//
32 setupPar("ANALYSIS");
4070f709 33 gSystem->Load("libANALYSIS");
76ce4b5b 34
35 //_________________________________________________________//
36 //_____________Setting up ANALYSISalice.par________________//
37 //_________________________________________________________//
38 setupPar("ANALYSISalice");
4070f709 39 gSystem->Load("libANALYSISalice");
76ce4b5b 40
41 //____________________________________________________//
42 //_____________Setting up PWG2AOD.par_________________//
43 //____________________________________________________//
44 setupPar("PWG2AOD");
4070f709 45 gSystem->Load("libPWG2AOD");
76ce4b5b 46
47 //____________________________________________________//
48 //_____________Setting up PWG2femtoscopy.par__________//
49 //____________________________________________________//
50 setupPar("PWG2femtoscopy");
4070f709 51 gSystem->Load("libPWG2femtoscopy");
76ce4b5b 52
53 //____________________________________________________//
54 //_____________Setting up PWG2femtoscopyUser.par______//
55 //____________________________________________________//
56 setupPar("PWG2femtoscopyUser");
4070f709 57 gSystem->Load("libPWG2femtoscopyUser");
76ce4b5b 58
59 //ANALYSIS PART
60 gSystem->SetIncludePath("-I$ROOTSYS/include -I\"/usr/local/CERN/root/include\" -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I./ESD -I./AOD -I./ANALYSIS -I./PWG2AOD/AOD");
61 gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
62
63 //____________________________________________//
64 //Usage of event tags
65 AliTagAnalysis *analysis = new AliTagAnalysis();
66 TChain *chain = 0x0;
67 // chain = analysis->GetChainFromCollection(collectionfile,"esdTree");
68
69 if (dataFromAlien) {
70 AliTagAnalysis *analysis = new AliTagAnalysis();
71 chain = analysis->GetChainFromCollection(chainlistfile,"esdTree");
72 }
73 else {
74 gROOT->LoadMacro("CreateESDChain.C");
75 chain = CreateESDChain(chainlistfile,500);
76 }
77
78 //____________________________________________//
79 // Make the analysis manager
80 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
81 AliESDInputHandler* esdH = new AliESDInputHandler;
82 esdH->SetInactiveBranches("FMD CaloCluster");
83 mgr->SetInputEventHandler(esdH);
84 //____________________________________________//
85 // 1st Pt task
86 AliAnalysisTaskFemto *task1 = new AliAnalysisTaskFemto("TaskFemto");
87
88 mgr->AddTask(task1);
89
90 // Create containers for input/output
91 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
92 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"Femto.ESD.root");
93
94 //____________________________________________//
95 cinput1->SetData(chain);
96 mgr->ConnectInput(task1,0,cinput1);
97 mgr->ConnectOutput(task1,0,coutput1);
98
99 if (!mgr->InitAnalysis()) return;
100 mgr->PrintStatus();
101 mgr->StartAnalysis("local",chain);
102
103 timer.Stop();
104 timer.Print();
105}
106
107Int_t setupPar(const char* pararchivename) {
108 ///////////////////
109 // Setup PAR File//
110 ///////////////////
111 if (pararchivename) {
112 char processline[1024];
113 sprintf(processline,".! tar xvzf %s.par",pararchivename);
114 gROOT->ProcessLine(processline);
115 const char* ocwd = gSystem->WorkingDirectory();
116 gSystem->ChangeDirectory(pararchivename);
117
118 // check for BUILD.sh and execute
119 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
120 printf("*******************************\n");
121 printf("*** Building PAR archive ***\n");
122 printf("*******************************\n");
123
124 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
125 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
126 return -1;
127 }
128 }
129 // check for SETUP.C and execute
130 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
131 printf("*******************************\n");
132 printf("*** Setup PAR archive ***\n");
133 printf("*******************************\n");
134 gROOT->Macro("PROOF-INF/SETUP.C");
135 }
136
137 gSystem->ChangeDirectory("../");
138 }
139
140 return 1;
141}