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