.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / runGrid.C
CommitLineData
67c32a0a 1class AliAnalysisManager;
2class AliAnalysisAlien;
3
264de30e 4void runGrid(TString mode="test",Bool_t mc=0,Int_t day=19,Int_t month=7, Int_t year=2012)
67c32a0a 5{
6ffb7a36 6 //to be used with Aliroot > v5-03-32-AN
67c32a0a 7 AliLog::SetGlobalDebugLevel(100);
8 // Load common libraries
dd4bfd89 9 gEnv->SetValue("XSec.GSI.DelegProxy", "2");
67c32a0a 10
f76247d9 11 // Load common libraries
4070f709 12 gSystem->Load("libCore");
13 gSystem->Load("libTree");
14 gSystem->Load("libGeom");
15 gSystem->Load("libVMC");
16 gSystem->Load("libPhysics");
17 gSystem->Load("libMinuit");
18 gSystem->Load("libGui");
19 gSystem->Load("libXMLParser");
20 gSystem->Load("libSTEERBase");
21 gSystem->Load("libESD");
22 gSystem->Load("libCDB");
f76247d9 23 gSystem->Load("libAOD");
24 gSystem->Load("libANALYSIS");
25 gSystem->Load("libANALYSISalice");
26 gSystem->Load("libCORRFW");
4070f709 27 gSystem->Load("libProof");
28 gSystem->Load("libRAWDatabase");
29 gSystem->Load("libSTEER");
f76247d9 30 //__________________________________________________________________________
31 // Use AliRoot includes to compile our task
32 gROOT->ProcessLine(".include $ALICE_ROOT/include");
4070f709 33 gSystem->Load("libPWGLFspectra");
f76247d9 34
67c32a0a 35 // Create and configure the alien handler plugin
829b5a81 36 AliAnalysisGrid *alienHandler = CreateAlienHandler(mode,mc,day,month,year);
67c32a0a 37 if (!alienHandler) return;
38 // Create the analysis manager
39 AliAnalysisManager *mgr = new AliAnalysisManager("testAnalysis");
40 // Connect plug-in to the analysis manager
41 mgr->SetGridHandler(alienHandler);
42 AliAODInputHandler* aodH = new AliAODInputHandler();
43 mgr->SetInputEventHandler(aodH);
44
67c32a0a 45 // Add PID task
46 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
16ee3540 47 AliAnalysisTaskPIDResponse *taskPID=AddTaskPIDResponse(mc);
48 // Printf("OADB PATH:::::%s",taskPID->GetOADBPath());
49 // taskPID->SetOADBPath("alien:///alice/cern.ch/user/a/akalweit/ForLeornado/OADB");
50 // Printf("OADB PATH:::::%s",taskPID->GetOADBPath());
6ffb7a36 51
16ee3540 52 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskVZEROEPSelection.C");
53 AliVZEROEPSelectionTask *selTask = AddTaskVZEROEPSelection();
f76247d9 54
55 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraAOD.C");
6ffb7a36 56 //LOOP OVER SELECTION
1516046a 57 // 0 1 2 3 4 5 6 7 8 9
6ffb7a36 58 Double_t Nsigmapid=3.;
264de30e 59 Double_t pt=10000.;
60 Double_t p=10000.;
6ffb7a36 61 Double_t y=.5;
62 Double_t ptTofMatch=.6;
63 UInt_t trkbit=1024;
64 UInt_t trkbitQVector=1;
65 Bool_t UseCentPatchAOD049=kFALSE;
66 Double_t DCA=100000;
67 UInt_t minNclsTPC=70;
264de30e 68 Int_t nrebin=30;
10a8ccbe 69 TString opt="";
264de30e 70 Int_t centcut=30;
71
72 for(Int_t icut=0;icut<1;icut++){
1516046a 73 //if(icut!=0)continue;
264de30e 74 //MB
75 AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,centcut,centcut+1,0,100,-0.8,0.8,Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
76 taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
77 taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
78 taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
79 taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
80 //taskAOD->GetEventCuts()->SetMultiplicityCut(250,450);
81 taskAOD->GetEventCuts()->PrintCuts();
82 //smallq
83 AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,centcut,centcut+1,0,0.4,-0.8,0.8,Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
84 taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
85 taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
86 taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
87 taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
88 //taskAOD->GetEventCuts()->SetMultiplicityCut(250,450);
89 taskAOD->GetEventCuts()->PrintCuts();
90 taskAOD->GetEventCuts()->SetCentFromV0(kTRUE);
91 //largeq
92 AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,centcut,centcut+1,1.7,100,-0.8,0.8,Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
3bdbc583 93 taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
94 taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
95 taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
96 taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
264de30e 97 //taskAOD->GetEventCuts()->SetMultiplicityCut(250,450);
98 taskAOD->GetEventCuts()->PrintCuts();
99 //increase centrality
100 centcut++;
101 }
67c32a0a 102
67c32a0a 103 mgr->SetDebugLevel(2);
6ffb7a36 104
00493191 105 //mgr->Init();
106 if (!mgr->InitAnalysis())return;
107 mgr->PrintStatus();
108 // Start analysis in grid.
109 mgr->StartAnalysis("grid");
110}
67c32a0a 111
112
6ffb7a36 113AliAnalysisGrid* CreateAlienHandler(TString mode="test",Bool_t mc=1,Int_t day=0,Int_t month=0, Int_t year=2012)
829b5a81 114{
00493191 115 AliAnalysisAlien *plugin = new AliAnalysisAlien();
264de30e 116 plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/TOF");
f76247d9 117 plugin->SetAdditionalLibs("libPWGLFspectra.so");
264de30e 118 // gROOT->LoadMacro("AliSpectraAODTrackCuts.cxx+g");
119 // gROOT->LoadMacro("AliSpectraAODEventCuts.cxx+g");
120 // gROOT->LoadMacro("AliSpectraAODHistoManager.cxx+g");
121 // gROOT->LoadMacro("AliSpectraAODPID.cxx+g");
122 // gROOT->LoadMacro("AliAnalysisTaskSpectraAOD.cxx+g");
123
124 //plugin->SetAnalysisSource("AliSpectraAODTrackCuts.cxx AliSpectraAODEventCuts.cxx AliSpectraAODHistoManager.cxx AliSpectraAODPID.cxx AliAnalysisTaskSpectraAOD.cxx");
125 //plugin->SetAdditionalLibs("Histograms.h HistogramNames.h HistogramNames.cxx AliSpectraAODTrackCuts.cxx AliSpectraAODEventCuts.cxx AliSpectraAODHistoManager.cxx AliSpectraAODPID.cxx AliAnalysisTaskSpectraAOD.cxx AliSpectraAODTrackCuts.h AliSpectraAODEventCuts.h AliSpectraAODHistoManager.h AliSpectraAODPID.h AliAnalysisTaskSpectraAOD.h");
126
00493191 127 plugin->SetOverwriteMode();
128 plugin->SetExecutableCommand("aliroot -q -b");
129 plugin->SetRunMode(mode.Data());
130 plugin->SetNtestFiles(1);
131 //Set versions of used packages
132 plugin->SetAPIVersion("V1.1x");
133 plugin->SetROOTVersion("v5-33-02b");
264de30e 134 plugin->SetAliROOTVersion("v5-03-35-AN");
00493191 135 // Declare input data to be processed.
829b5a81 136 if(mc)
137 {
264de30e 138 // plugin->SetGridDataDir("/alice/sim/LHC11a10a_bis");
139 // plugin->SetDataPattern("AOD090/*AliAOD.root");
140 // plugin->SetRunPrefix("");
141 // plugin->SetAnalysisMacro("TaskAODPbPbMC.C");
142 // plugin->SetExecutable("TaskAODPbPbMC.sh");
143 // plugin->SetJDLName("TaskAODPbPbMC.jdl");
144 // //plugin->SetSplitMaxInputFileNumber(500);
145 // plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/mc/",day,month,year));
146
147 plugin->SetGridDataDir(" /alice/sim/2012/LHC12a11e/");
148 plugin->SetDataPattern("AOD081/*AliAOD.root");
829b5a81 149 plugin->SetRunPrefix("");
150 plugin->SetAnalysisMacro("TaskAODPbPbMC.C");
151 plugin->SetExecutable("TaskAODPbPbMC.sh");
152 plugin->SetJDLName("TaskAODPbPbMC.jdl");
264de30e 153 //plugin->SetSplitMaxInputFileNumber(200);
154 plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/mcAMPTNoPhysSel_RangeXLarger/",day,month,year));
829b5a81 155 }
156 else
157 {
158 plugin->SetGridDataDir("/alice/data/2010/LHC10h");
159 plugin->SetDataPattern("ESDs/pass2/AOD086/*AliAOD.root");
160 plugin->SetRunPrefix("000");
161 plugin->SetAnalysisMacro("TaskAODPbPbdata.C");
162 plugin->SetExecutable("TaskAODPbPbdata.sh");
163 plugin->SetJDLName("TaskAODPbPbdata.jdl");
164 //plugin->SetSplitMaxInputFileNumber(500);
264de30e 165 plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/dataFinalPlot3040/",day,month,year));
829b5a81 166 }
167 FILE* listruns=fopen("RunListGrid-AOD086.txt","r");
00493191 168 Int_t irun;
829b5a81 169 while(!feof(listruns))
170 {
171 fscanf(listruns,"%d\n",&irun);
172 plugin->AddRunNumber(irun);
173 }
264de30e 174 // plugin->AddRunNumber(139437);
175 // plugin->AddRunNumber(139038);
176 // plugin->AddRunNumber(138653);
177 // plugin->AddRunNumber(138534);
178 // plugin->AddRunNumber(137686);
179
00493191 180 // Declare alien output directory. Relative to working directory.
264de30e 181 plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
182 //plugin->SetGridOutputDir("/alice/cern.ch/user/l/lmilano/AODPbPb472012/data/output/000/");
183 plugin->SetNrunsPerMaster(24); //
58c28d7d 184
00493191 185 // Declare the output file names separated by blancs.
186 // (can be like: file.root or file.root@ALICE::Niham::File)
187 //plugin->SetDefaultOutputs(0);
188 //plugin->SetOutputFiles("AnalysisResults.root.root");
264de30e 189 plugin->SetMergeViaJDL(1);
00493191 190 plugin->SetOneStageMerging(kFALSE);
191 plugin->SetMaxMergeStages(2);
264de30e 192 //plugin->SetMaxMergeFiles(100);
00493191 193 plugin->SetTTL(100000);
194 // Optionally set input format (default xml-single)
195 plugin->SetInputFormat("xml-single");
196 // Optionally modify job price (default 1)
197 plugin->SetPrice(1);
198 // Optionally modify split mode (default 'se')
199 //plugin->SetSplitMaxInputFileNumber();
200 plugin->SetSplitMode("se");
201 return plugin;
00493191 202}