.so cleanup: no .so ext to GetLibraries()
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / macros / AddTask_GammaConvV1.C
CommitLineData
a280ac15 1
993a4d9d 2void AddTask_GammaConvV1(TString mode){
a280ac15 3
4070f709 4 gSystem->Load("libCore");
5 gSystem->Load("libTree");
6 gSystem->Load("libGeom");
7 gSystem->Load("libVMC");
8 gSystem->Load("libPhysics");
a280ac15 9 gSystem->Load("libMinuit");
10 gSystem->Load("libSTEERBase");
11 gSystem->Load("libESD");
12 gSystem->Load("libAOD");
13 gSystem->Load("libANALYSIS");
14 gSystem->Load("libANALYSISalice");
4070f709 15 gSystem->Load("libPWGGAGammaConv");
16 gSystem->Load("libEve");
17 gSystem->Load("libCDB");
18 gSystem->Load("libProof");
19 gSystem->Load("libRAWDatabase");
20 gSystem->Load("libSTEER");
21 gSystem->Load("libSTEERBase");
22 gSystem->Load("libTender");
23 gSystem->Load("libTRDbase");
24 gSystem->Load("libVZERObase");
25 gSystem->Load("libVZEROrec");
26 gSystem->Load("libTenderSupplies");
993a4d9d 27
28 Bool_t isMC = kTRUE;
29 Bool_t readTR = kTRUE;
30
31 TString Pattern="*/AliESDs.root";
32 //TString Pattern="*/AliAOD.root";
33 TString Prefix ="";
34
35
a280ac15 36
993a4d9d 37
38// Int_t run_numbers[100] = {137161, 137162, 137165, 137230, 137231, 137232, 137235, 137236, 137243, 137366, 137430, 137431, 137432, 137434, 137439, 137440, 137441, 137443, 137530, 137531, 137539, 137541, 137544, 137546, 137549, 137595, 137608, 137638, 137639, 137685, 137686, 137691, 137692, 137693, 137704, 137718, 137722, 137724, 137751, 137752, 137844, 137848, 138190, 138192, 138197, 138201, 138225, 138275, 138364, 138396, 138438, 138439, 138442, 138469, 138534, 138578, 138579, 138582, 138583, 138621, 138624, 138638, 138652, 138653, 138662, 138666, 138730, 138732, 138837, 138870, 138871, 138872, 139028, 139029, 139036, 139037, 139038, 139104, 139105, 139107, 139173, 139308, 139309, 139310, 139311, 139314, 139328, 139329, 139360, 139437, 139438, 139439, 139465, 139503, 139504, 139505, 139507, 139510};
39
40 Int_t run_numbers[10] = {137161, 137162, 137165, 137230, 137231, 137232, 137235, 137236, 137243, 137366};
41 //Int_t run_numbers[10] = {137430, 137431, 137432, 137434, 137439, 137440, 137441, 137443, 137530, 137531};
42 //Int_t run_numbers[10] = {137539, 137541, 137544, 137546, 137549, 137595, 137608, 137638, 137639, 137685};
43 //Int_t run_numbers[10] = {137686, 137691, 137692, 137693, 137704, 137718, 137722, 137724, 137751, 137752};
44 //Int_t run_numbers[10] = {137844, 137848, 138190, 138192, 138197, 138201, 138225, 138275, 138364, 138396};
45 //Int_t run_numbers[10] = {138438, 138439, 138442, 138469, 138534, 138578, 138579, 138582, 138583, 138621};
46 //Int_t run_numbers[10] = {138624, 138638, 138652, 138653, 138662, 138666, 138730, 138732, 138837, 138870};
47 //Int_t run_numbers[10] = {138871, 138872, 139028, 139029, 139036, 139037, 139038, 139104, 139105, 139107};
48 //Int_t run_numbers[10] = {139173, 139308, 139309, 139310, 139311, 139314, 139328, 139329, 139360, 139437};
49 //Int_t run_numbers[10] = {139438, 139439, 139465, 139503, 139504, 139505, 139507, 139510};
50 gSystem->Setenv("alien_CLOSE_SE","ALICE::Grenoble::SE");
51
52 AliAnalysisManager *mgr = new AliAnalysisManager("Analysis");
3377d047 53 if (!mgr) {
54 Error("AddTask_GammaConvV1", "No analysis manager found.");
55 return 0;
56 }
a280ac15 57
993a4d9d 58 gROOT->LoadMacro("CreateAlienHandlerNonPT.C");
59 AliAnalysisAlien *alienHandler = CreateAlienHandler(mode);
60 if (!alienHandler) return;
61
62 TString WorkingDir = "MCPbPb_LHC13d2_v3";
63 TString data = "/alice/sim/2013/LHC13d2/";
fc98dbf3 64
993a4d9d 65 mgr->SetGridHandler(alienHandler);
66 alienHandler->SetGridWorkingDir(WorkingDir.Data());
67 alienHandler->SetGridOutputDir(Form("OUTPUT_%s",WorkingDir.Data()));
68
69 alienHandler->SetGridDataDir(data);
70 alienHandler->SetDataPattern(Pattern.Data());
71 alienHandler->SetRunPrefix(Prefix.Data());
72 //alienHandler->SetRunRange(137161,139510);
73 for (Int_t i=0; i<10; i++) {
74 if (run_numbers[i]==0) break;
75 alienHandler->AddRunNumber(run_numbers[i]);
76 }
77
78 AliESDInputHandler * handler;
79 handler = new AliESDInputHandler(); mgr->SetInputEventHandler((AliESDInputHandler*)handler);
80
81 AliMCEventHandler* mcHandler;
82 if(isMC){
83 mcHandler = new AliMCEventHandler();
84 mgr->SetMCtruthEventHandler(mcHandler);
85 mcHandler->SetReadTR(readTR);
a280ac15 86 }
87
3377d047 88 //========= Add PID Reponse to ANALYSIS manager ====
89 if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){
90 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
993a4d9d 91 AddTaskPIDResponse(isMC);
92 }//========= Add PID Reponse to ANALYSIS manager ====
a280ac15 93
993a4d9d 94 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
95 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(isMC);
96
97 AliCentralitySelectionTask *taskCentrality;
98 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
99 taskCentrality = AddTaskCentrality();
100 if (isMC){
101 taskCentrality->SetMCInput();
102 Info("AddTask_tender_CentralitySelection", "This task has MC.");
a280ac15 103 }
993a4d9d 104
105 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/GammaConv/macros/AddTask_GammaConvV1_PbPb.C");
106
107 cout<<"Connecting to Alien..."<<endl;
108 TGrid::Connect("alien://");
109 cout<<"==============================="<<endl;
110 cout<<"Successfully connected to Alien"<<endl;
111 cout<<"==============================="<<endl;
112
113 AliAnalysisTask *taskA = AddTask_GammaConvV1_PbPb(1, //change different set of cuts
114 isMC, //run MC
115 kFALSE, //enable QA in AliAnalysisTaskGammaConvV1
116 kTRUE, // enable additional Photon QA task
117 "alien:///alice/cern.ch/user/f/fbock/MCSpectraInput.root", // path to file for weigting input
118 kTRUE, //enable Weighting
119 "1000000060084000001500000");
120
121 AliAnalysisTask *taskB = AddTask_GammaConvV1_PbPb(2, //change different set of cuts
122 isMC, //run MC
123 kFALSE, //enable QA in AliAnalysisTaskGammaConvV1
124 kTRUE, // enable additional Photon QA task
125 "alien:///alice/cern.ch/user/f/fbock/MCSpectraInput.root", // path to file for weigting input
126 kTRUE, //enable Weighting
127 "1000000060084000001500000");
128
129 AliAnalysisTask *taskC = AddTask_GammaConvV1_PbPb(5, //change different set of cuts
130 isMC, //run MC
131 kFALSE, //enable QA in AliAnalysisTaskGammaConvV1
132 kTRUE, // enable additional Photon QA task
133 "alien:///alice/cern.ch/user/f/fbock/MCSpectraInput.root", // path to file for weigting input
134 kTRUE, //enable Weighting
135 "1000000060084000001500000");
136
137 AliAnalysisTask *taskD = AddTask_GammaConvV1_PbPb(6, //change different set of cuts
138 isMC, //run MC
139 kFALSE, //enable QA in AliAnalysisTaskGammaConvV1
140 kTRUE, // enable additional Photon QA task
141 "alien:///alice/cern.ch/user/f/fbock/MCSpectraInput.root", // path to file for weigting input
142 kTRUE, //enable Weighting
143 "1000000060084000001500000");
144
a280ac15 145
993a4d9d 146 if (!mgr->InitAnalysis())return;
147 mgr->StartAnalysis("grid");
148}
149Int_t CheckLoadLibrary(const char* library)
150{
151 // checks if a library is already loaded, if not loads the library
152
9a3036c4 153 if (strlen(gSystem->GetLibraries(library, "", kFALSE)) > 0)
993a4d9d 154 return 1;
155
156 return gSystem->Load(library);
3377d047 157}