]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FEMTOSCOPY/macros/Local/runLocal.C
Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / macros / Local / runLocal.C
CommitLineData
34067c86 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://");
8 gSystem->Load("libProofPlayer.so");
9
10 //____________________________________________________//
11 //_____________Setting up STEERBase.par_______________//
12 //____________________________________________________//
13 setupPar("STEERBase");
14 gSystem->Load("libSTEERBase.so");
15
16 //____________________________________________________//
17 //_____________Setting up ESD.par_____________________//
18 //____________________________________________________//
19 setupPar("ESD");
20 gSystem->Load("libVMC.so");
21 gSystem->Load("libESD.so");
22
23 //____________________________________________________//
24 //_____________Setting up AOD.par_____________________//
25 //____________________________________________________//
26 setupPar("AOD");
27 gSystem->Load("libAOD.so");
28
29 //_________________________________________________________//
30 //_____________Setting up ANALYSIS.par_____________________//
31 //_________________________________________________________//
32 setupPar("ANALYSIS");
33 gSystem->Load("libANALYSIS.so");
34
35 //_________________________________________________________//
36 //_____________Setting up ANALYSISalice.par________________//
37 //_________________________________________________________//
38 setupPar("ANALYSISalice");
39 gSystem->Load("libANALYSISalice.so");
40
41 //____________________________________________________//
42 //_____________Setting up PWG2AOD.par_________________//
43 //____________________________________________________//
44 setupPar("PWG2AOD");
45 gSystem->Load("libPWG2AOD.so");
46
47 //____________________________________________________//
48 //_____________Setting up PWG2femtoscopy.par__________//
49 //____________________________________________________//
50 setupPar("PWG2femtoscopy");
51 gSystem->Load("libPWG2femtoscopy.so");
52
53 //____________________________________________________//
54 //_____________Setting up PWG2femtoscopyUser.par______//
55 //____________________________________________________//
56 setupPar("PWG2femtoscopyUser");
57 gSystem->Load("libPWG2femtoscopyUser.so");
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++");
34067c86 62
63 //____________________________________________//
64 //Usage of event tags
65 AliTagAnalysis *analysis = new AliTagAnalysis();
66 TChain *chain = 0x0;
67 // chain = analysis->GetChainFromCollection(collectionfile,"esdTree");
68
c3153714 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
34067c86 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
8a546c82 91 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
34067c86 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}