]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/totEt/macros/runCaloEt.C
adding switches for 2011 data and so that PID doesnt crash for local testing
[u/mrichter/AliRoot.git] / PWGLF / totEt / macros / runCaloEt.C
CommitLineData
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
8df12228 7void runCaloEt(bool submit = false, // true or false
f6e609f6 8 const char *dataType="simPbPb", // "sim" or "real" etc.
6d4ab54d 9 // const char *dataType="realPbPb", // "sim" or "real" etc.
9a365626 10 const char *pluginRunMode="test", // "test" or "full" or "terminate"
6d4ab54d 11 const char *det = "EMCal",//"EMCal",
12 int production = 1, Bool_t withtender = kTRUE, Int_t runnum = 0, Bool_t withNonlinearity = kTRUE, Bool_t withReclusterizing = kFALSE, Int_t trackmatchcuts=0, Bool_t is2011 = kFALSE, Bool_t jethad = kFALSE) // "PHOS" or "EMCAL" or EMCalDetail
99a6613d 13{
2c846661 14 bool runCompiledVersion = kTRUE;
15 class AliAnalysisEtCuts;
8df12228 16 TStopwatch timer;
17 timer.Start();
18 gSystem->Load("libTree");
19 gSystem->Load("libGeom");
20 gSystem->Load("libVMC");
21 gSystem->Load("libPhysics");
8df12228 22 gSystem->Load("libMinuit");
23
24 gSystem->AddIncludePath("-I$ALICE_ROOT/include");
25 gSystem->AddIncludePath("-I. -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/ANALYSIS");
26
27 gSystem->Load("libSTEERBase");
28 gSystem->Load("libESD");
29 gSystem->Load("libAOD");
30
31 gSystem->Load("libANALYSIS");
32 gSystem->Load("libANALYSISalice");
33 gSystem->Load("libCORRFW");
34
2c846661 35 gSystem->Load("libTENDER.so");
36 gSystem->Load("libTENDERSupplies.so");
37 gSystem->Load("libPWGTools.so");
38 gSystem->Load("libPWGEMCAL.so");
39 gROOT->ProcessLine(".include $ALICE_ROOT/Tender/");
40 //gSystem->AddIncludePath("-I$ALICE_ROOT/ANALYSIS ");
058989e8 41
42
8df12228 43 if (!submit) {
44 cout << "local - no submitting" << endl;
45 }
46 else {
47 cout << "submitting to grid" << endl;
48 }
49
2c846661 50 if(runCompiledVersion){
51 gSystem->Load("libPWGLFtotEt.so");
52 }
53 else{
54 gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g");
55 gROOT->ProcessLine(".L AliAnalysisHadEtCorrections.cxx+g");
56 gROOT->ProcessLine(".L AliAnalysisEtCommon.cxx+g");
57 gROOT->ProcessLine(".L AliAnalysisEtSelector.cxx+g");
58 gROOT->ProcessLine(".L AliAnalysisEtSelectorPhos.cxx+g");
59 gROOT->ProcessLine(".L AliAnalysisEtSelectorEmcal.cxx+g");
60 gROOT->ProcessLine(".L AliAnalysisEtTrackMatchCorrections.cxx+g");
61 gROOT->ProcessLine(".L AliAnalysisEtRecEffCorrection.cxx+g");
62 gROOT->ProcessLine(".L AliAnalysisEt.cxx+g");
63 gROOT->ProcessLine(".L AliAnalysisEtMonteCarlo.cxx+g");
64 gROOT->ProcessLine(".L AliAnalysisEtMonteCarloPhos.cxx+g");
65 gROOT->ProcessLine(".L AliAnalysisEtMonteCarloEmcal.cxx+g");
66 gROOT->ProcessLine(".L AliAnalysisEtReconstructed.cxx+g");
67 gROOT->ProcessLine(".L AliAnalysisEtReconstructedPhos.cxx+g");
68 gROOT->ProcessLine(".L AliAnalysisEtReconstructedEmcal.cxx+g");
69 //gROOT->ProcessLine(".L AliAnalysisEtSelectionContainer.cxx+g");
70 //gROOT->ProcessLine(".L AliAnalysisEtSelectionHandler.cxx+g");
71 gROOT->ProcessLine(".L AliAnalysisTaskTransverseEnergy.cxx+g");
72 gROOT->ProcessLine(".L AliAnalysisEmEtMonteCarlo.cxx+g");
73 gROOT->ProcessLine(".L AliAnalysisEmEtReconstructed.cxx+g");
74 gROOT->ProcessLine(".L AliAnalysisTaskTotEt.cxx+g");
75 }
f6e609f6 76 TString detStr(det);
77 TString dataStr(dataType);
78 if ( detStr.Contains("PHOS") ) {
6d4ab54d 79 if(is2011){
80 gSystem->CopyFile("calocorrections.2011.PHOS.root","calocorrections.root",kTRUE);
81 }
82 else{
83 gSystem->CopyFile("calocorrections.PHOS.root","calocorrections.root",kTRUE);
84 }
f6e609f6 85 if ( dataStr.Contains("sim") ) {
86 gSystem->CopyFile("ConfigEtMonteCarlo.PHOS.C","ConfigEtMonteCarlo.C",kTRUE);
87 }
88 else{
89 gSystem->CopyFile("ConfigEtMonteCarlo.PHOS.data.C","ConfigEtMonteCarlo.C",kTRUE);
90 }
91 }
92 else{
6d4ab54d 93 if(is2011){
94 gSystem->CopyFile("calocorrections.2011.EMCAL.root","calocorrections.root",kTRUE);
95 }
96 else{
97 gSystem->CopyFile("calocorrections.EMCAL.root","calocorrections.root",kTRUE);
98 }
99 if(is2011){
100 if ( dataStr.Contains("sim") ) {
101 gSystem->CopyFile("ConfigEtMonteCarlo.EMCAL.2011.C","ConfigEtMonteCarlo.C",kTRUE);
102 }
103 else{
104 gSystem->CopyFile("ConfigEtMonteCarlo.EMCAL.2011.data.C","ConfigEtMonteCarlo.C",kTRUE);
105 }
106 }
107 else{
2c846661 108 if ( dataStr.Contains("sim") ) {
109 gSystem->CopyFile("ConfigEtMonteCarlo.EMCAL.C","ConfigEtMonteCarlo.C",kTRUE);
110 }
111 else{
112 gSystem->CopyFile("ConfigEtMonteCarlo.EMCAL.data.C","ConfigEtMonteCarlo.C",kTRUE);
113 }
6d4ab54d 114 }
f6e609f6 115 }
116
2c846661 117 if(is2011){
118 gSystem->CopyFile("ConfigEtReconstructed.2011.C","ConfigEtReconstructed.C",kTRUE);
119 }
120 else{
121 gSystem->CopyFile("ConfigEtReconstructed.2010.C","ConfigEtReconstructed.C",kTRUE);
122 }
4cb06159 123
8df12228 124 char *kTreeName = "esdTree" ;
125 TChain * chain = new TChain(kTreeName,"myESDTree") ;
126
127 if(submit){
128 gSystem->Load("libNetx") ;
129 gSystem->Load("libgapiUI");
130 gSystem->Load("libRAliEn");
131 TGrid::Connect("alien://") ;
132 }
133
134 // Make the analysis manager
135 AliAnalysisManager *mgr = new AliAnalysisManager("TotEtManager");
136
8df12228 137 TString taskName = "TaskTotEt" + detStr;
8df12228 138 TString dataStrName(dataType);
139 dataStrName.ReplaceAll("/",".");
95c06714 140 Bool_t isPb = kFALSE;
141 if ( dataStr.Contains("PbPb") ) { isPb = kTRUE;}
142 TString suffix = "";
143 if(!withtender){
144 suffix = "WithoutTender";
145 }
146 if(!isPb){
147 suffix = "pp"+suffix;
148 }
8df12228 149 TString outputName = "Et.ESD." + dataStrName + "." + detStr + ".root";
95c06714 150 TString outputDir = "totEt" + dataStr + detStr+suffix;
9a365626 151 if(!withNonlinearity){
152 outputDir +="NoNonlinearity";
153 }
154 if(withReclusterizing){
155 outputDir +="WithReclusterizing";
156 }
157 if(trackmatchcuts!=0){
158 outputDir +=Form("TrackMatchCut%i",trackmatchcuts);
159 }
6d4ab54d 160 if(jethad) outputDir+="WithJetHadronMethod";
8df12228 161
162 cout << " taskName " << taskName
163 << " outputName " << outputName
164 << " outputDir (alien) " << outputDir << endl;
1a331f88 165 mgr->SetCommonFileName(outputName.Data());
166 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("out1", TList::Class(), AliAnalysisManager::kOutputContainer, outputName);
9a365626 167 if(!isPb){ cout<<"I am not PbPb!!"<<endl;}
8df12228 168 if (submit) {
169 gROOT->LoadMacro("CreateAlienHandlerCaloEtSim.C");
2c846661 170 cout<<"Passing in production number "<<production<<endl;
171 AliAnalysisGrid *alienHandler = CreateAlienHandlerCaloEtSim(outputDir, outputName, pluginRunMode, production,detStr.Contains("PHOS"),!isPb,dataStr.Contains("real"),runnum,runCompiledVersion);
8df12228 172 if (!alienHandler) return;
173 mgr->SetGridHandler(alienHandler);
174 }
175
176 AliVEventHandler* esdH = new AliESDInputHandler;
177 mgr->SetInputEventHandler(esdH);
178 AliMCEventHandler* handler = new AliMCEventHandler;
179 Bool_t isMc = kTRUE;
8df12228 180 if ( dataStr.Contains("sim") ) {
181 cout << " MC " << endl;
182 if ( dataStr.Contains("PbPb") ) { // a la: simPbPb/LHC10e18a
183 cout << " PbPb " << endl;
f6e609f6 184 TString fileLocation = "/data/LHC10h8/137161/999/AliESDs.root";//"/home/dsilverm/data/E_T/" + dataStr + "/dir/AliESDs.root";
8df12228 185 cout << "fileLocation " << fileLocation.Data() << endl;
95c06714 186// chain->Add(fileLocation.Data()); // link to local test file
70292245 187// chain->Add("/data/tmp/3682/AliESDs.root");
188// chain->Add("/data/tmp/2782/AliESDs.root");
9a365626 189// chain->Add("/data/LHC10h8/137161/999/AliESDs.root");//Hijing Pb+Pb
190// chain->Add("/data/LHC10h8/137161/111/AliESDs.root");//Hijing Pb+Pb
191// chain->Add("/data/LHC10h8/137161/222/AliESDs.root");//Hijing Pb+Pb
6d4ab54d 192// chain->Add("/data/LHC14a6/168464/605/AliESDs.root");
193//chain->Add("/data/LHC11a10a_bis/139465/001/AliESDs.root");
194// chain->Add("/data/LHC14a6/168464/605/AliESDs.root");//HIJING with embedded signals
195 chain->Add("/data/LHC12d3/168464/201/AliESDs.root");//HIJING with embedded signals - works, full acceptance
196 //chain->Add("/data/LHC14a6/168464/888/AliESDs.root");//HIJING with embedded signals
2c846661 197// chain->Add("/data/LHC11a10a_bis/139465/002/AliESDs.root");
198// chain->Add("/data/LHC11a10a_bis/139465/003/AliESDs.root");
199// chain->Add("/data/LHC11a10a_bis/139465/004/AliESDs.root");
200// chain->Add("/data/LHC11a10a_bis/139465/006/AliESDs.root");
201// chain->Add("/data/LHC11a10a_bis/139465/007/AliESDs.root");
202// chain->Add("/data/LHC11a10a_bis/139465/008/AliESDs.root");
203// chain->Add("/data/LHC11a10a_bis/139465/009/AliESDs.root");
204// chain->Add("/data/LHC11a10a_bis/139465/010/AliESDs.root");
d45a33b8 205// chain->Add("/data/LHC11a10a_bis/139465/011/AliESDs.root");
206// chain->Add("/data/LHC11a10a_bis/139465/012/AliESDs.root");
207// chain->Add("/data/LHC11a10a_bis/139465/013/AliESDs.root");
208// chain->Add("/data/LHC11a10a_bis/139465/014/AliESDs.root");
209// chain->Add("/data/LHC11a10a_bis/139465/015/AliESDs.root");
210// chain->Add("/data/LHC11a10a_bis/139465/016/AliESDs.root");
211// chain->Add("/data/LHC11a10a_bis/139465/017/AliESDs.root");
212// chain->Add("/data/LHC11a10a_bis/139465/018/AliESDs.root");
213// chain->Add("/data/LHC11a10a_bis/139465/019/AliESDs.root");
214// chain->Add("/data/LHC11a10a_bis/139465/020/AliESDs.root");
215// chain->Add("/data/LHC11a10a_bis/139465/021/AliESDs.root");
216// chain->Add("/data/LHC11a10a_bis/139465/022/AliESDs.root");
217// chain->Add("/data/LHC11a10a_bis/139465/023/AliESDs.root");
218// chain->Add("/data/LHC11a10a_bis/139465/024/AliESDs.root");
219// chain->Add("/data/LHC11a10a_bis/139465/025/AliESDs.root");
220// chain->Add("/data/LHC11a10a_bis/139465/026/AliESDs.root");
221// chain->Add("/data/LHC11a10a_bis/139465/027/AliESDs.root");
222// chain->Add("/data/LHC11a10a_bis/139465/028/AliESDs.root");
223// chain->Add("/data/LHC11a10a_bis/139465/029/AliESDs.root");
224// chain->Add("/data/LHC11a10a_bis/139465/030/AliESDs.root");
225// chain->Add("/data/LHC11a10a_bis/139465/031/AliESDs.root");
226// chain->Add("/data/LHC11a10a_bis/139465/032/AliESDs.root");
227// chain->Add("/data/LHC11a10a_bis/139465/033/AliESDs.root");
228// chain->Add("/data/LHC11a10a_bis/139465/034/AliESDs.root");
229// chain->Add("/data/LHC11a10a_bis/139465/035/AliESDs.root");
230// chain->Add("/data/LHC11a10a_bis/139465/036/AliESDs.root");
231// chain->Add("/data/LHC11a10a_bis/139465/037/AliESDs.root");
232// chain->Add("/data/LHC11a10a_bis/139465/038/AliESDs.root");
233// chain->Add("/data/LHC11a10a_bis/139465/039/AliESDs.root");
234// chain->Add("/data/LHC11a10a_bis/139465/040/AliESDs.root");
235// chain->Add("/data/LHC11a10a_bis/139465/041/AliESDs.root");
236// chain->Add("/data/LHC11a10a_bis/139465/042/AliESDs.root");
237// chain->Add("/data/LHC11a10a_bis/139465/043/AliESDs.root");
238// chain->Add("/data/LHC11a10a_bis/139465/044/AliESDs.root");
239// chain->Add("/data/LHC11a10a_bis/139465/045/AliESDs.root");
240// chain->Add("/data/LHC11a10a_bis/139465/046/AliESDs.root");
241// chain->Add("/data/LHC11a10a_bis/139465/047/AliESDs.root");
242// chain->Add("/data/LHC11a10a_bis/139465/048/AliESDs.root");
243// chain->Add("/data/LHC11a10a_bis/139465/049/AliESDs.root");
244// chain->Add("/data/LHC11a10a_bis/139465/050/AliESDs.root");
245// chain->Add("/data/LHC11a10a_bis/139465/051/AliESDs.root");
246// chain->Add("/data/LHC11a10a_bis/139465/052/AliESDs.root");
247// chain->Add("/data/LHC11a10a_bis/139465/053/AliESDs.root");
248// chain->Add("/data/LHC11a10a_bis/139465/054/AliESDs.root");
249// chain->Add("/data/LHC11a10a_bis/139465/055/AliESDs.root");
250// chain->Add("/data/LHC11a10a_bis/139465/056/AliESDs.root");
251// chain->Add("/data/LHC11a10a_bis/139465/057/AliESDs.root");
252// chain->Add("/data/LHC11a10a_bis/139465/058/AliESDs.root");
253// chain->Add("/data/LHC11a10a_bis/139465/059/AliESDs.root");
254// chain->Add("/data/LHC11a10a_bis/139465/060/AliESDs.root");
255// chain->Add("/data/LHC11a10a_bis/139465/061/AliESDs.root");
256// chain->Add("/data/LHC11a10a_bis/139465/062/AliESDs.root");
9a365626 257
99a6613d 258 }
8df12228 259 else { // pp
058989e8 260 cout<<"adding pp simulation file"<<endl;
9a365626 261 chain->Add("/data/LHC11b1b/999/AliESDs.root");
262 //chain->Add("/data/LHC11b1a/999/AliESDs.root");
263 //chain->Add("/data/LHC10d15/1821/AliESDs.root");
8df12228 264 //chain->Add("/data/LHC10dpass2/10000126403050.70/AliESDs.root");//data
265 //chain->Add("/home/dsilverm/data/E_T/sim/LHC10d1/117222/100/AliESDs.root"); // link to local test file
13b0d3c1 266 }
8df12228 267 handler->SetReadTR(kFALSE);
268 mgr->SetMCtruthEventHandler(handler);
269 }
270 else { // real data
95c06714 271 cout<<"Hello there! I am data."<<endl;
8df12228 272 isMc = kFALSE;
70292245 273
274 // chain->Add("/data/tmp/10000139465010.600/AliESDs.root");
275
6d4ab54d 276 chain->Add("/data/LHC11h/pass2/000168464/11000168464082.94/AliESDs.root");
277 //chain->Add("/data/LHC10h/pass2_rev15/10000137366041.860/AliESDs.root");
70292245 278// chain->Add("/data/LHC10h/pass2_rev15/10000137366041.870/AliESDs.root");
279// chain->Add("/data/LHC10h/pass2_rev15/10000137366041.880/AliESDs.root");
280// chain->Add("/data/LHC10h/pass2_rev15/10000137366041.890/AliESDs.root");
281// chain->Add("/data/LHC10h/pass2_rev15/10000137366041.900/AliESDs.root");
95c06714 282// chain->Add("/data/LHC10dpass2/10000126403050.70/AliESDs.root");//data
058989e8 283 //chain->Add("/home/dsilverm/data/E_T/data/2010/LHC10b/000117222/ESDs/pass2/10000117222021.30/AliESDs.root"); // link to local test file
8df12228 284 cout << " not MC " << endl;
285 }
286
058989e8 287
f6e609f6 288 //if(!isMc && detStr.Contains("EMC")){
70292245 289 if(detStr.Contains("EMC")){
290 //if(0){
058989e8 291 cout<<"You are running over EMCal data and using the tender supply"<<endl;
69008885 292 //this macro is downloaded from the EMCal tender supply twiki
293 //hopefully it will be replaced by something checked in to aliroot
294 //I have added the function from GetOCDBRecParam.C in Jiri's example to this so that we don't add gobs of macros to the code
295 //I set the defaults to the golden run for PbPb because we are focusing on the golden run, however, this should be thought through!!
70292245 296 //AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance(geoname);
297
298 gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalSetup.C");
299 AliEmcalSetupTask *setupTask = AddTaskEmcalSetup();
300 setupTask->SetGeoPath("$ALICE_ROOT/OADB/EMCAL");
301 setupTask->SetOcdbPath("");
302
303// gROOT->LoadMacro("AddTaskEMCALTenderForEtAnalysis.C");
304// //cout<<"WARNING: YOU ARE USING CALIBRATION FACTORS FROM PbPb RUN 137161!!"<<endl;
305// // // get reco params from grid OCDB
306// // gROOT->LoadMacro("./GetOCDBRecParam.C");
307// // // run num, data type pp/PbPb, from grid
308// //Gets calibration factors from grid if jobs are to be submitted to the grid
309// // AliEMCALRecParam* pars = GetOCDBRecParam( 137161, "PbPb", submit);
310// //EMCAL_FIRSTYEARV1 F-
311// //AliTender *tender = AddTaskEMCALTender( "EMCAL_COMPLETEV1", 0,withNonlinearity,withReclusterizing,trackmatchcuts);
312// AliTender *tender = AddTaskEMCALTender( "EMCAL_FIRSTYEARV1", 0,withNonlinearity,withReclusterizing,trackmatchcuts);
313// //this also likely needs modification
314// // tender->SelectCollisionCandidates( AliVEvent::kMB | AliVEvent::kEMCEGA | AliVEvent::kEMC1 | AliVEvent::kEMC7 );
315// // if(submit){tender->SetDefaultCDBStorage("raw://");} //uncomment if you work on grid
316// // else{tender->SetDefaultCDBStorage("local://$ALICE_ROOT/OCDB");} //uncomment if you work local
317
318// if(submit){
319// cout<<"Setting tender to run on grid"<<endl;
320// tender->SetDefaultCDBStorage("raw://"); //uncomment if you work on grid
321// }
322// else{
323// cout<<"Setting tender to run locally"<<endl;
324// tender->SetDefaultCDBStorage("local://$ALICE_ROOT/OCDB"); //uncomment if you work local
325// }
326
327
328 gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEMCALTender.C");//tendertasks
329 TString runPeriod = "LHC10h";
2c846661 330 Bool_t distBC = kTRUE; //distance to bad channel
331 Bool_t recalibClus = kTRUE; //recalibrate cluster energy
332 Bool_t recalcClusPos = kTRUE; //recalculate cluster position
333 Bool_t nonLinearCorr = kTRUE; //apply non-linearity
334 Bool_t remExotic = kTRUE; //remove exotic cells
335 Bool_t fidRegion = kTRUE; //apply fiducial cuts --> different from defaults
336 Bool_t calibEnergy = kTRUE; //calibrate energy
337 Bool_t calibTime = kTRUE; //calibrate timing
338 Bool_t remBC = kTRUE; //remove bad channels
339 UInt_t nonLinFunct = AliEMCALRecoUtils::kBeamTestCorrected;
340 Bool_t reclusterize = kFALSE; //reclusterize --> different from defaults
341 Float_t seedthresh = 0.100; //seed threshold
342 Float_t cellthresh = 0.050; //cell threshold
343 UInt_t clusterizer = AliEMCALRecParam::kClusterizerv2;
344 Bool_t trackMatch = kTRUE; //track matching
345 Bool_t updateCellOnly = kFALSE; //only change if you run your own clusterizer task
346 Float_t timeMin = 100e-9; //minimum time of physical signal in a cell/digit (s)
347 Float_t timeMax = 900e-9; //maximum time of physical signal in a cell/digit (s)
348 Float_t timeCut = 900e-9; //maximum time difference between the digits inside EMC cluster (s)
349 const char *pass = 0 ; //string defining pass (use none if figured out from path)
350 //AliAnalysisTaskSE *tender = AddTaskEMCALTender();
351 AliAnalysisTaskSE *tender = AddTaskEMCALTender(distBC, recalibClus, recalcClusPos, nonLinearCorr, remExotic,
70292245 352 fidRegion, calibEnergy, calibTime, remBC, nonLinFunct, reclusterize, seedthresh,
353 cellthresh, clusterizer, trackMatch, updateCellOnly, timeMin, timeMax, timeCut);
354
355
356
1a331f88 357 // one can sellect what collision candidates to use
358 // triggered sample only: L1 = AliVEvent::kEMCEGA, AliVEvent::kEMCEJE; L0 = AliVEvent::kEMC1, AliVEvent::kEMC7
359 tender->SelectCollisionCandidates( AliVEvent::kAny );
6d4ab54d 360 //tender->SetDebugLevel(2);
1a331f88 361
362 //AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("histosTrgContam", TList::Class(), AliAnalysisManager::kOutputContainer,"AnalysisResults.root");
363 //mgr->ConnectOutput(tender,1,coutput3);
364 cout<<"Output container name "<<AliAnalysisManager::GetCommonFileName()<<endl;
058989e8 365 }
366
367 if(isMc) cout<<"I am a MC"<<endl;
8df12228 368 gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
369
370 AliPhysicsSelectionTask *physicsSelectionTask = AddTaskPhysicsSelection(isMc);//isMC is true when processing monte carlo
371 if(isPb){
058989e8 372 cout<<"Adding centrality selection task"<<endl;
50f29788 373 gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
fe71c343 374 //gROOT->ProcessLine(".L AliCentralitySelectionTask.cxx++g");
50f29788 375 AliCentralitySelectionTask *centTask = AddTaskCentrality();
95c06714 376 if(isMc){
377 cout<<"Setting up centrality for MC"<<endl;
378 centTask->SetMCInput();
379 }
380 else{
381 cout<<"Setting up centrality for data"<<endl;
382 }
8df12228 383 }
384
9a365626 385 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
386 //AliAnalysisTask *AddTaskPIDResponse(Bool_t isMC=kFALSE, Bool_t autoMCesd=kTRUE,
387// Bool_t tuneOnData=kFALSE, Int_t recoPass=2,
388// Bool_t cachePID=kFALSE, TString detResponse="",
389// Bool_t useTPCEtaCorrection = kFALSE);
6d4ab54d 390// AliAnalysisTask *AddTaskPIDResponse(Bool_t isMC=kFALSE, Bool_t autoMCesd=kTRUE,
391// Bool_t tuneOnData=kFALSE, Int_t recoPass=2,
392// Bool_t cachePID=kFALSE, TString detResponse="",
393// Bool_t useTPCEtaCorrection = kTRUE,
394// Bool_t useTPCMultiplicityCorrection = kFALSE
395// Int_t userDataRecoPass = -1)
396
397 AliAnalysisTask *taskPID;
398 if(submit){
399 taskPID=AddTaskPIDResponse(isMc);//,kTRUE,kTRUE,2,kFALSE,"",kTRUE,kFALSE,2);
400 }
401 else{
402 cout<<"Not submitting so forcing pass number locally so it doesn't crash"<<endl;
403 taskPID=AddTaskPIDResponse(isMc,kTRUE,kTRUE,2,kFALSE,"",kTRUE,kFALSE,2);
404 }
70292245 405 //gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
406 //AddTaskPIDqa();
058989e8 407
408 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
409
410
411
412
413
8df12228 414 AliAnalysisTaskTotEt *task1 = new AliAnalysisTaskTotEt(taskName);
0adfc269 415 task1->SetMcData(isMc);//necessary to tell the task to basically accept all MC events.
9a365626 416 task1->SelectCollisionCandidates(AliVEvent::kMB ) ;
8df12228 417 mgr->AddTask(task1);
418
8df12228 419
420 //____________________________________________//
421 mgr->ConnectInput(task1,0,cinput1);
422 mgr->ConnectOutput(task1,1,coutput1);
058989e8 423
424
8df12228 425
426 mgr->SetDebugLevel(0);
427
428 if (!mgr->InitAnalysis()) return;
429 mgr->PrintStatus();
430 if(submit){
431 mgr->StartAnalysis("grid");
432 }
433 else{
434 mgr->StartAnalysis("local",chain);
435 }
436
437 timer.Stop();
438 timer.Print();
4998bf42 439}