]>
Commit | Line | Data |
---|---|---|
4998bf42 | 1 | //Create by Christine Nattrass, Rebecca Scott, Irakli Martashvili |
2 | //University of Tennessee at Knoxville | |
3 | ||
4 | //by default this runs locally | |
5 | //With the argument true this submits jobs to the grid | |
6 | //As written this requires an xml script tag.xml in the ~/et directory on the grid to submit jobs | |
70292245 | 7 | void runHadEt(bool submit = false, bool data = false, Int_t dataset = 2013, Int_t test = 1, Int_t material = 0, Bool_t altV0Scale = kFALSE, bool runCompiledVersion = kFALSE, int simflag = 0) { |
4998bf42 | 8 | TStopwatch timer; |
9 | timer.Start(); | |
10 | gSystem->Load("libTree.so"); | |
11 | gSystem->Load("libGeom.so"); | |
12 | gSystem->Load("libVMC.so"); | |
2eca0e87 | 13 | gSystem->Load("libPhysics.so"); |
4998bf42 | 14 | gSystem->Load("libXMLIO.so"); |
15 | ||
16 | gSystem->Load("libSTEERBase.so"); | |
17 | gSystem->Load("libESD.so"); | |
18 | gSystem->Load("libAOD.so"); | |
19 | ||
20 | gSystem->Load("libANALYSIS"); | |
2eca0e87 | 21 | gSystem->Load("libOADB.so"); |
4998bf42 | 22 | gSystem->Load("libANALYSISalice"); |
2b29a14e | 23 | gSystem->Load("libPWGUDbase.so"); |
4998bf42 | 24 | |
25 | gSystem->AddIncludePath("-I$ALICE_ROOT/include"); | |
2b29a14e | 26 | gSystem->AddIncludePath("-I$ALICE_ROOT/PWGUD/base"); |
2eca0e87 | 27 | if(runCompiledVersion){ |
28 | gSystem->Load("libPWGLFtotEt.so"); | |
29 | } | |
30 | else{ | |
31 | gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g"); | |
32 | gROOT->ProcessLine(".L AliAnalysisHadEtCorrections.cxx+g"); | |
33 | gROOT->ProcessLine(".L AliAnalysisEtCommon.cxx+g"); | |
34 | gROOT->ProcessLine(".L AliAnalysisHadEt.cxx+g"); | |
35 | gROOT->ProcessLine(".L AliAnalysisHadEtMonteCarlo.cxx+g"); | |
36 | gROOT->ProcessLine(".L AliAnalysisHadEtReconstructed.cxx+g"); | |
2eca0e87 | 37 | gROOT->ProcessLine(".L AliAnalysisTaskTransverseEnergy.cxx+g"); |
38 | gROOT->ProcessLine(".L AliAnalysisTaskHadEt.cxx+g"); | |
39 | } | |
4998bf42 | 40 | |
41 | char *kTreeName = "esdTree" ; | |
42 | TChain * chain = new TChain(kTreeName,"myESDTree") ; | |
43 | if(submit){ | |
44 | gSystem->Load("libNetx.so") ; | |
45 | gSystem->Load("libgapiUI.so"); | |
46 | gSystem->Load("libRAliEn.so"); | |
47 | TGrid::Connect("alien://") ; | |
48 | } | |
3d658d3b | 49 | bool PbPb = false; |
50 | if(dataset ==20100){ | |
51 | bool PbPb = true; | |
52 | if(data){ | |
53 | chain->Add("/data/LHC10h/pass2_rev15/10000137366041.860/AliESDs.root");//Data Pb+Pb | |
54 | chain->Add("/data/LHC10h/pass2_rev15/10000137366041.870/AliESDs.root");//Data Pb+Pb | |
55 | chain->Add("/data/LHC10h/pass2_rev15/10000137366041.880/AliESDs.root");//Data Pb+Pb | |
56 | chain->Add("/data/LHC10h/pass2_rev15/10000137366041.890/AliESDs.root");//Data Pb+Pb | |
57 | chain->Add("/data/LHC10h/pass2_rev15/10000137366041.900/AliESDs.root");//Data Pb+Pb | |
58 | } | |
59 | else{ | |
60 | chain->Add("/data/LHC10h8/137161/999/AliESDs.root");//Hijing Pb+Pb | |
61 | chain->Add("/data/LHC10h8/137161/111/AliESDs.root");//Hijing Pb+Pb | |
62 | chain->Add("/data/LHC10h8/137161/222/AliESDs.root");//Hijing Pb+Pb | |
63 | //chain->Add("/data/LHC11a4_bis/137161/999/AliESDs.root");//Hijing Pb+Pb | |
64 | //chain->Add("/data/LHC10h12/999/AliESDs.root");//Hijing Pb+Pb | |
65 | } | |
66 | } | |
67 | else{ | |
70292245 | 68 | if(dataset==2013){//pPb 5 TeV |
69 | if(data){ | |
70 | chain->Add("/data/LHC13b/13000195483082.95/AliESDs.root"); | |
71 | } | |
72 | else{ | |
73 | chain->Add("/data/LHC12c1b/111/AliESDs.root"); | |
74 | } | |
75 | } | |
76 | else{ | |
77 | if(data){ | |
78 | cout<<"Yes I am analyzing the correct file"<<endl; | |
79 | //chain->Add("/data/LHC10dpass2/10000126403050.70/AliESDs.root");//data | |
80 | //chain->Add("/data/LHC11a/11000146856042.90/AliESDs.root");//data pp 2.76 TeV w/SDD pass 2 | |
81 | //chain->Add("/data/LHC11a/11000146860043.90/AliESDs.root");//data pp 2.76 TeV w/SDD pass 3 | |
82 | chain->Add("/data/LHC10c/10000120683048.90/AliESDs.root");//Data Pb+Pb | |
83 | } | |
84 | else{ | |
85 | cerr<<"Hello I am here 75"<<endl; | |
86 | //chain->Add("/data/LHC10d15/1821/AliESDs.root");//simulation p+p | |
87 | chain->Add("/data/LHC11b10a/001/AliESDs.root"); | |
88 | } | |
89 | } | |
3d658d3b | 90 | } |
4998bf42 | 91 | |
92 | // Make the analysis manager | |
93 | AliAnalysisManager *mgr = new AliAnalysisManager("TotEtManager"); | |
94 | if(submit){ | |
71d37ec1 | 95 | |
96 | gROOT->LoadMacro("CreateAlienHandlerHadEt.C"); | |
f1eeb37a | 97 | AliAnalysisGrid *alienHandler = CreateAlienHandlerHadEt(dataset,data,test,material,altV0Scale,runCompiledVersion,simflag);//integer dataset, boolean isData, bool submit-in-test-mode, bool use alternatve V0 scaling |
3d658d3b | 98 | if (!alienHandler) return; |
99 | mgr->SetGridHandler(alienHandler); | |
4998bf42 | 100 | } |
101 | ||
70292245 | 102 | cerr<<"Hello I am here 91"<<endl; |
4998bf42 | 103 | AliVEventHandler* esdH = new AliESDInputHandler; |
104 | mgr->SetInputEventHandler(esdH); | |
105 | AliMCEventHandler* handler = new AliMCEventHandler; | |
7d2d1773 | 106 | if(!data){ |
107 | handler->SetReadTR(kFALSE); | |
108 | mgr->SetMCtruthEventHandler(handler); | |
109 | } | |
50f29788 | 110 | |
99dbeec6 | 111 | |
99dbeec6 | 112 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C"); |
d35312c9 | 113 | AliPhysicsSelectionTask *physSelTask = AddTaskPhysicsSelection(!data); |
2eca0e87 | 114 | if(!physSelTask) { Printf("no physSelTask"); return; } |
115 | AliPhysicsSelection *physSel = physSelTask->GetPhysicsSelection(); | |
d35312c9 | 116 | //physSel->AddCollisionTriggerClass("+CINT1B-ABCE-NOPF-ALL");// #3119 #769"); |
f1eeb37a | 117 | //physSelTask->AddCollisionTriggerClass("kMB");// #3119 #769"); |
2eca0e87 | 118 | |
70292245 | 119 | cerr<<"Hello I am here 108"<<endl; |
2eca0e87 | 120 | |
99dbeec6 | 121 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C"); |
50f29788 | 122 | |
99dbeec6 | 123 | AliCentralitySelectionTask *centTask; |
50f29788 | 124 | |
d992f900 | 125 | if(PbPb){ |
99dbeec6 | 126 | AliCentralitySelectionTask *centTask = AddTaskCentrality(); |
3d658d3b | 127 | if(!data){ |
99dbeec6 | 128 | cout<<"Setting up centrality for MC"<<endl; |
129 | centTask->SetMCInput(); | |
130 | } | |
3d658d3b | 131 | else{ |
132 | cout<<"Setting up centrality for data"<<endl; | |
133 | } | |
d992f900 | 134 | } |
70292245 | 135 | Int_t pass = 2; |
3d658d3b | 136 | if(dataset==20100){//PbPb 2.76 TeV |
70292245 | 137 | if(data){gSystem->CopyFile("rootFiles/corrections/corrections.LHC11a10a_bis.PbPb.ForData.root","corrections.root",kTRUE);} |
138 | else{gSystem->CopyFile("rootFiles/corrections/corrections.LHC11a10a_bis.PbPb.ForSimulations.root","corrections.root",kTRUE);} | |
71d37ec1 | 139 | gSystem->CopyFile("ConfigHadEtMonteCarloPbPb.C","ConfigHadEtMonteCarlo.C",kTRUE); |
140 | gSystem->CopyFile("ConfigHadEtReconstructedPbPb.C","ConfigHadEtReconstructed.C",kTRUE); | |
70292245 | 141 | pass = 2; |
71d37ec1 | 142 | //centTask->SetPass(1); |
3d658d3b | 143 | } |
144 | else{ | |
145 | if(dataset==2009){//pp 900 GeV | |
71d37ec1 | 146 | gSystem->CopyFile("ConfigHadEtMonteCarlopp900GeV.C","ConfigHadEtMonteCarlo.C",kTRUE); |
147 | gSystem->CopyFile("ConfigHadEtReconstructedpp900GeV.C","ConfigHadEtReconstructed.C",kTRUE); | |
148 | if(data){gSystem->CopyFile("rootFiles/corrections/corrections.LHC11b1a.pp.ForData.root","corrections.root",kTRUE);} | |
149 | else{gSystem->CopyFile("rootFiles/corrections/corrections.LHC11b1a.pp.ForSimulations.root","corrections.root",kTRUE);} | |
70292245 | 150 | pass = 3; |
71d37ec1 | 151 | } |
3d658d3b | 152 | if(dataset==20111){//pp 2.76 TeV |
2b29a14e | 153 | if(altV0Scale)gSystem->CopyFile("ConfigHadEtMonteCarlopp276TeVAlt.C","ConfigHadEtMonteCarlo.C",kTRUE); |
154 | else{gSystem->CopyFile("ConfigHadEtMonteCarlopp276TeV.C","ConfigHadEtMonteCarlo.C",kTRUE);} | |
71d37ec1 | 155 | gSystem->CopyFile("ConfigHadEtReconstructedpp276TeV.C","ConfigHadEtReconstructed.C",kTRUE); |
156 | if(data){gSystem->CopyFile("rootFiles/corrections/corrections.LHC11b10a.pp.ForData.root","corrections.root",kTRUE);} | |
157 | else{gSystem->CopyFile("rootFiles/corrections/corrections.LHC11b10a.pp.ForSimulations.root","corrections.root",kTRUE);} | |
70292245 | 158 | pass = 4; |
71d37ec1 | 159 | } |
160 | if(dataset==2010){//pp 7 TeV | |
161 | gSystem->CopyFile("ConfigHadEtMonteCarlopp7TeV.C","ConfigHadEtMonteCarlo.C",kTRUE); | |
162 | gSystem->CopyFile("ConfigHadEtReconstructedpp7TeV.C","ConfigHadEtReconstructed.C",kTRUE); | |
163 | if(data){gSystem->CopyFile("rootFiles/corrections/corrections.LHC10e20.pp.ForData.root","corrections.root",kTRUE);} | |
164 | else{gSystem->CopyFile("rootFiles/corrections/corrections.LHC10e20.pp.ForSimulations.root","corrections.root",kTRUE);} | |
70292245 | 165 | pass = 2; |
166 | } | |
167 | if(dataset==2012){//pp 8 TeV | |
168 | gSystem->CopyFile("ConfigHadEtMonteCarlopp8TeV.C","ConfigHadEtMonteCarlo.C",kTRUE); | |
169 | gSystem->CopyFile("ConfigHadEtReconstructedpp8TeV.C","ConfigHadEtReconstructed.C",kTRUE); | |
170 | if(data){gSystem->CopyFile("rootFiles/corrections/corrections.LHC12c1b.pp.ForData.root","corrections.root",kTRUE);} | |
171 | else{gSystem->CopyFile("rootFiles/corrections/corrections.LHC12c1b.pp.ForSimulations.root","corrections.root",kTRUE);} | |
172 | pass = 1; | |
173 | } | |
174 | if(dataset==2013){//pPb 5 TeV | |
175 | gSystem->CopyFile("ConfigHadEtMonteCarlopPb5TeV.C","ConfigHadEtMonteCarlo.C",kTRUE); | |
176 | gSystem->CopyFile("ConfigHadEtReconstructedpPb5TeV.C","ConfigHadEtReconstructed.C",kTRUE); | |
177 | if(data){gSystem->CopyFile("rootFiles/corrections/corrections.LHC13b3.pPb.ForData.root","corrections.root",kTRUE);} | |
178 | else{gSystem->CopyFile("rootFiles/corrections/corrections.LHC13b3.pPb.ForSimulations.root","corrections.root",kTRUE);} | |
179 | pass = 3; | |
71d37ec1 | 180 | } |
3d658d3b | 181 | } |
70292245 | 182 | |
183 | ||
184 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
185 | cerr<<"I am adding PID response task 169"<<endl; | |
9a365626 | 186 | //AliAnalysisTask *AddTaskPIDResponse(Bool_t isMC=kFALSE, Bool_t autoMCesd=kTRUE, |
187 | // Bool_t tuneOnData=kFALSE, Int_t recoPass=2, | |
188 | // Bool_t cachePID=kFALSE, TString detResponse="", | |
189 | // Bool_t useTPCEtaCorrection = kFALSE); | |
70292245 | 190 | AliAnalysisTaskPIDResponse *taskPID=AddTaskPIDResponse(!data,kTRUE,kTRUE,pass); |
191 | //gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C"); | |
192 | //AddTaskPIDqa(); | |
9a365626 | 193 | |
71d37ec1 | 194 | AliAnalysisTaskHadEt *task2 = new AliAnalysisTaskHadEt("TaskHadEt",!data);//,recoFile,mcFile); |
195 | if(!data) task2->SetMcData(); | |
2eca0e87 | 196 | //Add thing here to select collision type!! |
70292245 | 197 | if(dataset==2013){//pPb 5 TeV |
198 | //task2->SelectCollisionCandidates(AliVEvent::kAnyINT ) ; | |
199 | task2->SelectCollisionCandidates(AliVEvent::kINT7 ) ; | |
200 | } | |
201 | else{ if(dataset!=20100){task2->SelectCollisionCandidates(AliVEvent::kMB ) ;}} | |
202 | //if(dataset!=20100){task2->SelectCollisionCandidates(AliVEvent::kMB ) ;} | |
71d37ec1 | 203 | mgr->AddTask(task2); |
2eca0e87 | 204 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); |
71d37ec1 | 205 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("out2", TList::Class(), AliAnalysisManager::kOutputContainer,"Et.ESD.new.sim.root"); |
2eca0e87 | 206 | // mgr->ConnectInput(task2,0,cinput1); |
207 | // mgr->ConnectOutput(task2,1,coutput2); | |
71d37ec1 | 208 | mgr->ConnectInput(task2,0,cinput1); |
209 | mgr->ConnectOutput(task2,1,coutput2); | |
210 | ||
4998bf42 | 211 | mgr->SetDebugLevel(0); |
212 | ||
213 | if (!mgr->InitAnalysis()) return; | |
214 | mgr->PrintStatus(); | |
215 | if(submit){ | |
216 | mgr->StartAnalysis("grid"); | |
217 | } | |
218 | else{ | |
219 | mgr->StartAnalysis("local",chain); | |
220 | } | |
221 | ||
222 | timer.Stop(); | |
223 | timer.Print(); | |
224 | } |