]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/macros/AddTaskPartCorr.C
Added functionality to rotate particle for background calculations + argument control.
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskPartCorr.C
CommitLineData
f37fa8d2 1AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calorimeter, Bool_t kPrintSettings = kFALSE,Bool_t kSimulation = kFALSE, Bool_t outputAOD=kFALSE, Bool_t oldAOD=kFALSE)
90eb3a19 2{
3 // Creates a PartCorr task, configures it and adds it to the analysis manager.
4
5 // Get the pointer to the existing analysis manager via the static access method.
6 //==============================================================================
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8 if (!mgr) {
9 ::Error("AddTaskPartCorr", "No analysis manager to connect to.");
10 return NULL;
11 }
12
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 //==============================================================================
15 if (!mgr->GetInputEventHandler()) {
16 ::Error("AddTaskPartCorr", "This task requires an input event handler");
17 return NULL;
18 }
1e3689fa 19 TString inputDataType = "AOD";
20 if(!data.Contains("delta"))
21 inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
22 //cout<<"DATA TYPE :: "<<inputDataType<<endl;
23 // inputDataType: data managed by the input handler
24 // data: can be same as one managed by input handler, or the output AOD created by the filter. By default use AOD
25
26 Bool_t kUseKinematics = kFALSE;
27 if(kSimulation) {
28 kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
29 if (!kUseKinematics && data=="AOD" && inputDataType != "ESD") kUseKinematics = kTRUE; //AOD primary should be available ...
30 }
31
32 cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl;
33
34 // Configure analysis
35 //===========================================================================
36
37 // *** Reader ***
38 AliCaloTrackReader * reader = ;
39 if(data.Contains("AOD")) reader = new AliCaloTrackAODReader();
40 else if(data=="ESD") reader = new AliCaloTrackESDReader();
41 else if(data=="MC" && inputDataType == "ESD") reader = new AliCaloTrackMCReader();
42 reader->SetDebug(-1);//10 for lots of messages
43 reader->SwitchOnCTS();
44 //reader->SetDeltaAODFileName("");
45 //if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL");
911e17cd 46 if(calorimeter == "EMCAL") {
afabc52f 47 reader->SwitchOnEMCALCells();
48 reader->SwitchOnEMCAL();
911e17cd 49 }
50 if(calorimeter == "PHOS") {
afabc52f 51 reader->SwitchOnPHOSCells();
52 reader->SwitchOnPHOS();
911e17cd 53 }
1e3689fa 54
1e86c71e 55 // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists
56 if(data.Contains("delta")){
1e3689fa 57 reader->SwitchOffEMCAL();
58 reader->SwitchOffPHOS();
59 reader->SwitchOffEMCALCells();
60 reader->SwitchOffPHOSCells();
1e86c71e 61 }
1e3689fa 62
4a55403a 63 if(kUseKinematics){
afabc52f 64 if(inputDataType == "ESD"){
65 reader->SwitchOnStack();
66 reader->SwitchOffAODMCParticles();
67 }
68 else if(inputDataType == "AOD"){
69 reader->SwitchOffStack();
70 reader->SwitchOnAODMCParticles();
71 }
4a55403a 72 }
afabc52f 73
90eb3a19 74 //Min particle pT
de8a210f 75 reader->SetEMCALPtMin(0.1);
76 reader->SetPHOSPtMin(0.);
77 reader->SetCTSPtMin(0.);
17708df9 78 if(outputAOD) reader->SwitchOnWriteDeltaAOD() ;
f37fa8d2 79 if(oldAOD) reader->SwitchOnOldAODs();
4a55403a 80 if(kPrintSettings) reader->Print("");
afabc52f 81
fa991e42 82 // *** Calorimeters Utils ***
83 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
84 // Remove clusters close to borders, at least max energy cell is 1 cell away
85 cu->SetNumberOfCellsFromEMCALBorder(1);
1e3689fa 86 cu->SetNumberOfCellsFromPHOSBorder(2);
fa991e42 87 cu->SwitchOnNoFiducialBorderInEMCALEta0();
1e3689fa 88
fa991e42 89 // Remove EMCAL hottest channels for first LHC10 periods
90 cu->SwitchOnBadChannelsRemoval();
91 // SM0
353067af 92 cu->SetEMCALChannelStatus(0,3,13); cu->SetEMCALChannelStatus(0,44,1); cu->SetEMCALChannelStatus(0,3,13);
fa991e42 93 cu->SetEMCALChannelStatus(0,20,7); cu->SetEMCALChannelStatus(0,38,2);
94 // SM1
353067af 95 cu->SetEMCALChannelStatus(1,4,7); cu->SetEMCALChannelStatus(1,4,13); cu->SetEMCALChannelStatus(1,9,20);
96 cu->SetEMCALChannelStatus(1,14,15); cu->SetEMCALChannelStatus(1,23,16); cu->SetEMCALChannelStatus(1,32,23);
97 cu->SetEMCALChannelStatus(1,37,5); cu->SetEMCALChannelStatus(1,40,1); cu->SetEMCALChannelStatus(1,40,2);
98 cu->SetEMCALChannelStatus(1,40,5); cu->SetEMCALChannelStatus(1,41,0); cu->SetEMCALChannelStatus(1,41,1);
99 cu->SetEMCALChannelStatus(1,41,2); cu->SetEMCALChannelStatus(1,41,4);
fa991e42 100 // SM2
101 cu->SetEMCALChannelStatus(2,14,15); cu->SetEMCALChannelStatus(2,18,16); cu->SetEMCALChannelStatus(2,18,17);
102 cu->SetEMCALChannelStatus(2,18,18); cu->SetEMCALChannelStatus(2,18,20); cu->SetEMCALChannelStatus(2,18,21);
103 cu->SetEMCALChannelStatus(2,18,23); cu->SetEMCALChannelStatus(2,19,16); cu->SetEMCALChannelStatus(2,19,17);
104 cu->SetEMCALChannelStatus(2,19,19); cu->SetEMCALChannelStatus(2,19,20); cu->SetEMCALChannelStatus(2,19,21);
105 cu->SetEMCALChannelStatus(2,19,22);
106 //SM3
107 cu->SetEMCALChannelStatus(3,4,7);
1e3689fa 108
109
fa991e42 110 //Recalibration
111 //cu->SwitchOnRecalibration();
112 //TFile * f = new TFile("RecalibrationFactors.root","read");
113 //cu->SetEMCALChannelRecalibrationFactors(0,(TH2F*)f->Get("EMCALRecalFactors_SM0"));
114 //cu->SetEMCALChannelRecalibrationFactors(1,(TH2F*)f->Get("EMCALRecalFactors_SM1"));
115 //cu->SetEMCALChannelRecalibrationFactors(2,(TH2F*)f->Get("EMCALRecalFactors_SM2"));
116 //cu->SetEMCALChannelRecalibrationFactors(3,(TH2F*)f->Get("EMCALRecalFactors_SM3"));
117 //f->Close();
1e3689fa 118
fa991e42 119 cu->SetDebug(-1);
120 if(kPrintSettings) cu->Print("");
1e3689fa 121
122
a3aebfff 123 // ##### Analysis algorithm settings ####
afabc52f 124
4df35693 125 // -------------------------------------------------
32301b07 126 // --- Photon/Pi0/Omega/Electron Analysis ---
4df35693 127 // -------------------------------------------------
128
129 AliAnaPhoton *anaphoton = new AliAnaPhoton();
130 anaphoton->SetDebug(-1); //10 for lots of messages
57eb7f00 131 if(calorimeter == "PHOS"){
57b97dc6 132 anaphoton->SetNCellCut(0);// At least 2 cells
133 anaphoton->SetMinPt(0.);
1e3689fa 134 anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
57eb7f00 135 }
136 else {//EMCAL
1e3689fa 137 //anaphoton->SetNCellCut(0);// At least 2 cells
138 anaphoton->SetMinPt(0.1); // no effect minium EMCAL cut.
0ae57829 139 if(!kUseKinematics) anaphoton->SetTimeCut(400,900);// Time window of [400-900] ns
1e3689fa 140 anaphoton->SetMinDistanceToBadChannel(6, 12, 18);
57eb7f00 141 }
4df35693 142 anaphoton->SetCalorimeter(calorimeter);
143 if(kUseKinematics) anaphoton->SwitchOnDataMC() ;//Access MC stack and fill more histograms
144 else anaphoton->SwitchOffDataMC() ;
145 anaphoton->SwitchOffCaloPID();
146 anaphoton->SwitchOffFiducialCut();
de8a210f 147 if(kSimulation){
1e3689fa 148 anaphoton->SwitchOnFiducialCut();
3f25d966 149 AliFiducialCut * fidCut1stYear = anaphoton->GetFiducialCut();
7e7694bb 150 fidCut1stYear->DoCTSFiducialCut(kFALSE) ;
151 fidCut1stYear->DoEMCALFiducialCut(kTRUE) ;
152 fidCut1stYear->DoPHOSFiducialCut(kTRUE) ;
153 fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.);
154 fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.);
de8a210f 155 }
1e3689fa 156
4df35693 157 if(!data.Contains("delta")) {
1e3689fa 158 anaphoton->SetOutputAODName(Form("Photons%s",calorimeter.Data()));
159 anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
4df35693 160 }
161 else anaphoton->SetInputAODName(Form("Photons%s",calorimeter.Data()));
162 anaphoton->AddToHistogramsName("AnaPhotonCorr_");
de8a210f 163 //Set Histograms bins and ranges
4df35693 164 anaphoton->SetHistoPtRangeAndNBins(0, 50, 200) ;
de8a210f 165 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
166 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
4df35693 167 if(kPrintSettings) anaphoton->Print("");
7e7694bb 168
4df35693 169 // -----------------------------------
170 // --- Pi0 Invariant Mass Analysis ---
171 // -----------------------------------
1e3689fa 172
90eb3a19 173 AliAnaPi0 *anapi0 = new AliAnaPi0();
74b57e64 174 anapi0->SetDebug(-1);//10 for lots of messages
4df35693 175 anapi0->SetInputAODName(Form("Photons%s",calorimeter.Data()));
90eb3a19 176 anapi0->SetCalorimeter(calorimeter);
5ae09196 177 anapi0->SwitchOnMultipleCutAnalysis();
0cdb88b8 178 if(kSimulation){
1e3689fa 179 anapi0->SwitchOnFiducialCut();
4f155d15 180 AliFiducialCut * fidCut1stYear = anapi0->GetFiducialCut();
181 fidCut1stYear->DoCTSFiducialCut(kFALSE) ;
182 fidCut1stYear->DoEMCALFiducialCut(kTRUE) ;
decca433 183 fidCut1stYear->DoPHOSFiducialCut(kTRUE) ;
184 fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.);
185 fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.);
0cdb88b8 186 }
decca433 187
2d3dce11 188 anapi0->SetNPID(1); //Available from tag AliRoot::v4-18-15-AN
afabc52f 189 //settings for pp collision
7e7694bb 190 anapi0->SwitchOnOwnMix();
afabc52f 191 anapi0->SetNCentrBin(1);
192 anapi0->SetNZvertBin(1);
193 anapi0->SetNRPBin(1);
194 anapi0->SetNMaxEvMix(10);
0ae57829 195 if(kUseKinematics)anapi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms
196 else anapi0->SwitchOffDataMC() ;
6921fa00 197 if(calorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year
198 else anapi0->SetNumberOfModules(4); //EMCAL first year
4df35693 199 anapi0->SetHistoPtRangeAndNBins(0, 50, 200) ;
0cdb88b8 200 //anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
201 //anapi0->SetHistoEtaRangeAndNBins(-0.8, 0.8, 200) ;
4df35693 202 anapi0->SetHistoMassRangeAndNBins(0., 0.6, 200) ;
0cdb88b8 203 anapi0->SetHistoAsymmetryRangeAndNBins(0., 1. , 10) ;
4a55403a 204 if(kPrintSettings) anapi0->Print("");
32301b07 205
206 //---------------------------
207 //Pi0, event by event
208 //---------------------------
7e7694bb 209
32301b07 210 AliAnaPi0EbE *anapi0ebe = new AliAnaPi0EbE();
211 anapi0ebe->SetDebug(-1);//10 for lots of messages
212 anapi0ebe->SetAnalysisType(AliAnaPi0EbE::kIMCalo);
213 anapi0ebe->SetMinPt(0);
214 anapi0ebe->SetCalorimeter(calorimeter);
215 anapi0ebe->SetInputAODName(Form("Photons%s",calorimeter.Data()));
216 if(!data.Contains("delta")) {
4f155d15 217 anapi0ebe->SetOutputAODName(Form("Pi0s%s",calorimeter.Data()));
218 anapi0ebe->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
32301b07 219 }
220 else anapi0ebe->SetInputAODName(Form("Pi0s%s",calorimeter.Data()));
4f155d15 221
32301b07 222 if(kUseKinematics) anapi0ebe->SwitchOnDataMC() ;//Access MC stack and fill more histograms
223 else anapi0ebe->SwitchOffDataMC() ;
4f155d15 224
decca433 225 AliNeutralMesonSelection *nms = anapi0ebe->GetNeutralMesonSelection();
57b97dc6 226 nms->SetInvMassCutRange(0.08, 0.18) ;
decca433 227 nms->KeepNeutralMesonSelectionHistos(kTRUE);
228 //Set Histrograms bins and ranges
57b97dc6 229 if(calorimeter=="EMCAL" ){
230 nms->SetHistoERangeAndNBins(0, 15, 150) ;
231 anapi0ebe->SetHistoPtRangeAndNBins(0, 15, 75) ;
232 }
233 else{
234 nms->SetHistoERangeAndNBins(0, 30, 200) ;
235 anapi0ebe->SetHistoPtRangeAndNBins(0, 30, 100) ;
236 }
decca433 237 // nms->SetHistoPtRangeAndNBins(0, 50, 100) ;
238 // nms->SetHistoAngleRangeAndNBins(0, 0.3, 100) ;
239 // nsm->SetHistoIMRangeAndNBins(0, 0.4, 100) ;
32301b07 240 //Set Histrograms bins and ranges
32301b07 241 // anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
242 // anapi0->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
243 if(kPrintSettings) anapi0ebe->Print("");
244
245 //-------------------------------------
246 //*** analysis the omega->pi0+gamma ***
247 //------------------------------------
248 AliAnaOmegaToPi0Gamma *anaomegaToPi0Gamma = new AliAnaOmegaToPi0Gamma();
249 anaomegaToPi0Gamma->SetDebug(-1);//10 for lots of messages
250 anaomegaToPi0Gamma->SetInputAODName(Form("Pi0s%s",calorimeter.Data()));
251 anaomegaToPi0Gamma->SetInputAODPhotonName(Form("Photons%s",calorimeter.Data()));
252 anaomegaToPi0Gamma->SetNPID(1);
253 anaomegaToPi0Gamma->SetNVtxZ(1);
254 anaomegaToPi0Gamma->SetNEventsMixed(4);
255 if(calorimeter=="PHOS")
7e7694bb 256 anaomegaToPi0Gamma->SetPi0MassPeakWidthCut(0.008); // PHOS
32301b07 257 else if(calorimeter=="EMCAL")
7e7694bb 258 anaomegaToPi0Gamma->SetPi0MassPeakWidthCut(0.012); // EMCAL
32301b07 259 anaomegaToPi0Gamma->SetHistoPtRangeAndNBins(0, 20, 100) ;
260 anaomegaToPi0Gamma->SetHistoMassRangeAndNBins(0, 1, 100) ;
261 anaomegaToPi0Gamma->SetPi0OverOmegaPtCut(0.8);
262 anaomegaToPi0Gamma->SetGammaOverOmegaPtCut(0.2);
263 if(kUseKinematics) anaomegaToPi0Gamma->SwitchOnDataMC() ;//Access MC stack and fill more histograms
264 else anaomegaToPi0Gamma->SwitchOffDataMC() ;//Access MC stack and fill more histograms
265 anaomegaToPi0Gamma->AddToHistogramsName(Form("AnaOmegaToPi0Gamma%s_",calorimeter.Data()));
266 if(kPrintSettings) anaomegaToPi0Gamma->Print("");
267
268
269 //---------------------------------------------------------------------
270 // Electron/btag
271 //---------------------------------------------------------------------
272 if(calorimeter=="EMCAL"){
7e7694bb 273 Double_t pOverEmin = 0.8; //tight
274 Double_t pOverEmax = 1.2; //tight
275 Double_t dRmax = 0.02; //tight
276
277 AliAnaBtag *anaelectron = new AliAnaBtag();
278 anaelectron->SetDebug(-1); //10 for lots of messages
279 anaelectron->SetCalorimeter("EMCAL");
280 if(kUseKinematics){
281 anaelectron->SwitchOffDataMC();
282 anaelectron->SetMinPt(1.);
283 }
284 anaelectron->SetOutputAODName("ElectronsEMCAL");
285 anaelectron->SetOutputAODClassName("AliAODPWG4Particle");
286 //Determine which cuts to use based on enum
287 anaelectron->SetpOverEmin(pOverEmin);
288 anaelectron->SetpOverEmax(pOverEmax);
289 anaelectron->SetResidualCut(dRmax);
290 //Set Histrograms bins and ranges
291 anaelectron->SetHistoPtRangeAndNBins(0, 100, 100) ;
292 anaelectron->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
293 anaelectron->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
294 if(kPrintSettings)anaelectron->Print("");
32301b07 295 }
296 //==================================
90eb3a19 297 // ### Isolation analysis ###
32301b07 298 //=================================
299 //Photon
90eb3a19 300 AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation();
301 anaisol->SetDebug(-1);
4007d0a2 302 anaisol->SetMinPt(0);
de8a210f 303 anaisol->SetInputAODName(Form("Photons%s",calorimeter.Data()));
91f45193 304 anaisol->SetAODObjArrayName("ICPhoton");
90eb3a19 305 anaisol->SetCalorimeter(calorimeter);
4a55403a 306 if(kUseKinematics) anaisol->SwitchOnDataMC() ;//Access MC stack and fill more histograms
307 else anaisol->SwitchOffDataMC() ;
90eb3a19 308 //Select clusters with no pair, if both clusters with pi0 mass
309 anaisol->SwitchOffInvariantMass();
90eb3a19 310 //Do isolation cut
7787a778 311 AliIsolationCut * ic = anaisol->GetIsolationCut();
312 ic->SetConeSize(0.4);
313 ic->SetPtThreshold(0.2);
0c1383b5 314 ic->SetParticleTypeInCone(AliIsolationCut::kOnlyCharged);
7787a778 315 ic->SetICMethod(AliIsolationCut::kPtThresIC);
316 if(kPrintSettings) ic->Print("");
1e3689fa 317
90eb3a19 318 //Do or not do isolation with previously produced AODs.
319 //No effect if use of SwitchOnSeveralIsolation()
320 anaisol->SwitchOffReIsolation();
321 //Multiple IC
322 anaisol->SwitchOffSeveralIsolation() ;
de8a210f 323 //Set Histograms bins and ranges
4df35693 324 anaisol->SetHistoPtRangeAndNBins(0, 50, 200) ;
de8a210f 325 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
326 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
327 anaisol->AddToHistogramsName("AnaIsolPhoton_");
4a55403a 328 if(kPrintSettings) anaisol->Print("");
90eb3a19 329
32301b07 330 //Pi0
331 AliAnaParticleIsolation *anaisolpi0 = new AliAnaParticleIsolation();
332 anaisolpi0->SetDebug(-1);
333 anaisolpi0->SetMinPt(0);
334 anaisolpi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data()));
335 anaisolpi0->AddToHistogramsName("AnaIsolPi0_");
91f45193 336 anaisolpi0->SetAODObjArrayName("ICPi0");
32301b07 337 anaisolpi0->SetCalorimeter(calorimeter);
338 if(kUseKinematics) anaisolpi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms
339 else anaisolpi0->SwitchOffDataMC() ;
340 //Select clusters with no pair, if both clusters with pi0 mass
341 anaisolpi0->SwitchOffInvariantMass();
32301b07 342 //Do isolation cut
343 AliIsolationCut * ic2 = anaisolpi0->GetIsolationCut();
344 ic2->SetConeSize(0.4);
345 ic2->SetPtThreshold(0.2);
346 ic2->SetICMethod(AliIsolationCut::kPtThresIC);
17708df9 347 if(kPrintSettings) ic2->Print("");
32301b07 348 //Do or not do isolation with previously produced AODs.
349 //No effect if use of SwitchOnSeveralIsolation()
350 anaisolpi0->SwitchOffReIsolation();
351 //Multiple IC
352 anaisolpi0->SwitchOffSeveralIsolation() ;
353 //Set Histograms bins and ranges
354 anaisolpi0->SetHistoPtRangeAndNBins(0, 50, 200) ;
355 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
356 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
17708df9 357 if(kPrintSettings) anaisolpi0->Print("");
32301b07 358
359 //===========================
360 //Correlation analysis
361 //===========================
362
a3aebfff 363 // ### Correlation with Jet Finder AOD output
364 AliAnaParticleJetFinderCorrelation *anacorrjet = new AliAnaParticleJetFinderCorrelation();
de8a210f 365 anacorrjet->SetInputAODName(Form("Photons%s",calorimeter.Data()));
ff45398a 366 anacorrjet->SwitchOffFiducialCut();
a3aebfff 367 anacorrjet->SetDebug(-1);
368 anacorrjet->SetConeSize(1);
369 anacorrjet->SelectIsolated(kTRUE); // do correlation with isolated photons
370 anacorrjet->SetPtThresholdInCone(0.2);
371 anacorrjet->SetDeltaPhiCutRange(0.5,5.5);//Mostly Open Cuts
372 anacorrjet->SetRatioCutRange(0.01,3); //Mostly Open Cuts
373 anacorrjet->UseJetRefTracks(kFALSE); //Not working now
de8a210f 374 //Set Histograms bins and ranges
4df35693 375 anacorrjet->SetHistoPtRangeAndNBins(0, 50, 200) ;
afabc52f 376 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
377 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
4a55403a 378 if(kPrintSettings) anacorrjet->Print("");
90eb3a19 379
380 // ### Correlation with hadrons
a3aebfff 381 AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation();
de8a210f 382 anacorrhadron->SetInputAODName(Form("Photons%s",calorimeter.Data()));
de8a210f 383 anacorrhadron->AddToHistogramsName("AnaHadronCorrPhoton_");
91f45193 384 anacorrhadron->SetAODObjArrayName("PhotonHadronCorr");
a3aebfff 385 anacorrhadron->SetDebug(-1);
12524a23 386 anacorrhadron->SwitchOffCaloPID();
ff45398a 387 anacorrhadron->SwitchOffFiducialCut();
de8a210f 388 anacorrhadron->SetPtCutRange(0.1,100);
a3aebfff 389 anacorrhadron->SetDeltaPhiCutRange(1.5,4.5);
2d3dce11 390 anacorrhadron->SwitchOnSeveralUECalculation();
afabc52f 391 anacorrhadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
2d3dce11 392 anacorrhadron->SelectIsolated(kFALSE); // do correlation with isolated photons
de8a210f 393 if(kUseKinematics) anacorrhadron->SwitchOnDataMC() ;//Access MC stack and fill more histograms
394 else anacorrhadron->SwitchOffDataMC() ;
395 //if(calorimeter=="PHOS"){
afabc52f 396 //Correlate with particles in EMCAL
397 //anacorrhadron->SwitchOnCaloPID();
398 //anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
de8a210f 399 //}
400 //Set Histograms bins and ranges
4df35693 401 anacorrhadron->SetHistoPtRangeAndNBins(0, 50, 200) ;
afabc52f 402 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
403 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
4a55403a 404 if(kPrintSettings) anacorrhadron->Print("");
90eb3a19 405
afabc52f 406 // ### Correlation with hadrons
407 AliAnaParticleHadronCorrelation *anacorrisohadron = new AliAnaParticleHadronCorrelation();
408 anacorrisohadron->SetInputAODName(Form("Photons%s",calorimeter.Data()));
afabc52f 409 anacorrisohadron->AddToHistogramsName("AnaHadronCorrIsoPhoton_");
91f45193 410 anacorrisohadron->SetAODObjArrayName("IsoPhotonHadronCorr");
afabc52f 411 anacorrisohadron->SetDebug(-1);
412 anacorrisohadron->SwitchOffCaloPID();
413 anacorrisohadron->SwitchOffFiducialCut();
414 anacorrisohadron->SetPtCutRange(0.1,100);
415 anacorrisohadron->SetDeltaPhiCutRange(1.5,4.5);
416 anacorrisohadron->SwitchOnSeveralUECalculation();
417 anacorrisohadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
418 anacorrisohadron->SelectIsolated(kTRUE); // do correlation with isolated photons
419 if(kUseKinematics) anacorrisohadron->SwitchOnDataMC() ;//Access MC stack and fill more histograms
420 else anacorrisohadron->SwitchOffDataMC() ;
421 //if(calorimeter=="PHOS"){
422 //Correlate with particles in EMCAL
423 //anacorrhadron->SwitchOnCaloPID();
424 //anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
425 //}
426 //Set Histograms bins and ranges
4df35693 427 anacorrisohadron->SetHistoPtRangeAndNBins(0, 50, 200) ;
afabc52f 428 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
429 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
430 if(kPrintSettings) anacorrisohadron->Print("");
431
afabc52f 432
433 // ### Pi0 Correlation with hadrons, not isolated
434 AliAnaParticleHadronCorrelation *anacorrhadronpi0 = new AliAnaParticleHadronCorrelation();
435 anacorrhadronpi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data()));
afabc52f 436 anacorrhadronpi0->AddToHistogramsName("AnaHadronCorrPi0_");
91f45193 437 anacorrhadronpi0->SetAODObjArrayName("Pi0HadronCorr");
afabc52f 438 anacorrhadronpi0->SetDebug(-1);
439 anacorrhadronpi0->SwitchOffCaloPID();
440 anacorrhadronpi0->SwitchOffFiducialCut();
441 anacorrhadronpi0->SetPtCutRange(0.1,100);
442 anacorrhadronpi0->SetDeltaPhiCutRange(1.5,4.5);
443 anacorrhadronpi0->SelectIsolated(kFALSE); // do correlation with non isolated pi0
444 anacorrhadronpi0->SwitchOnSeveralUECalculation();
445 anacorrhadronpi0->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
446 if(kUseKinematics) anacorrhadronpi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms
447 else anacorrhadronpi0->SwitchOffDataMC() ;
448 //if(calorimeter=="PHOS"){
449 // //Correlate with particles in EMCAL
450 // anacorrhadronpi0->SwitchOnCaloPID();
451 // anacorrhadronpi0->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
452 //}
453 //Set Histograms bins and ranges
4df35693 454 anacorrhadronpi0->SetHistoPtRangeAndNBins(0, 50, 200) ;
afabc52f 455 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
456 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
457 if(kPrintSettings) anacorrhadronpi0->Print("");
458
459 // ### Pi0 Correlation with hadrons, isolated
460 AliAnaParticleHadronCorrelation *anacorrhadronisopi0 = new AliAnaParticleHadronCorrelation();
461 anacorrhadronisopi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data()));
afabc52f 462 anacorrhadronisopi0->AddToHistogramsName("AnaHadronCorrIsoPi0_");
91f45193 463 anacorrhadronisopi0->SetAODObjArrayName("IsoPi0HadronCorr");
afabc52f 464 anacorrhadronisopi0->SetDebug(-1);
465 anacorrhadronisopi0->SwitchOffCaloPID();
466 anacorrhadronisopi0->SwitchOffFiducialCut();
467 anacorrhadronisopi0->SetPtCutRange(0.1,100);
468 anacorrhadronisopi0->SetDeltaPhiCutRange(1.5,4.5);
469 anacorrhadronisopi0->SelectIsolated(kTRUE); // do correlation with isolated pi0
470 anacorrhadronisopi0->SwitchOnSeveralUECalculation();
471 anacorrhadronisopi0->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
472 if(kUseKinematics) anacorrhadronisopi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms
473 else anacorrhadronisopi0->SwitchOffDataMC() ;
474 //if(calorimeter=="PHOS"){
475 // //Correlate with particles in EMCAL
476 // anacorrhadronpi0->SwitchOnCaloPID();
477 // anacorrhadronpi0->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
478 //}
479 //Set Histograms bins and ranges
4df35693 480 anacorrhadronisopi0->SetHistoPtRangeAndNBins(0, 50, 200) ;
afabc52f 481 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
482 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
483 if(kPrintSettings) anacorrhadronisopi0->Print("");
1e3689fa 484
1e3689fa 485
90eb3a19 486 // #### Configure Maker ####
a3aebfff 487 AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
fa991e42 488 maker->SetReader(reader);//pointer to reader
489 maker->SetCaloUtils(cu); //pointer to calorimeter utils
1e3689fa 490 Int_t n = 0;//Analysis number, order is important
491 // Particle selection analysis
492 maker->AddAnalysis(anaphoton,n++);
493 maker->AddAnalysis(anapi0,n++);
494 maker->AddAnalysis(anapi0ebe,n++);
32301b07 495 maker->AddAnalysis(anaomegaToPi0Gamma,n++);
496 if(calorimeter=="EMCAL")maker->AddAnalysis(anaelectron,n++);
1e3689fa 497 // Isolation analysis
498 maker->AddAnalysis(anaisol,n++);
1e3689fa 499 maker->AddAnalysis(anaisolpi0,n++);
500 // Correlation analysis
501 maker->AddAnalysis(anacorrjet,n++);
502 maker->AddAnalysis(anacorrhadron,n++);
503 maker->AddAnalysis(anacorrhadronpi0,n++);
17708df9 504 maker->AddAnalysis(anacorrisohadron,n++);
1e3689fa 505 maker->AddAnalysis(anacorrhadronisopi0,n);
02e972d8 506 maker->SetAnaDebug(-1) ;
90eb3a19 507 maker->SwitchOnHistogramsMaker() ;
1e86c71e 508 if(data.Contains("delta")) maker->SwitchOffAODsMaker() ;
509 else maker->SwitchOnAODsMaker() ;
510
4a55403a 511 if(kPrintSettings) maker->Print("");
a3aebfff 512
90eb3a19 513 printf("======================== \n");
a3aebfff 514 printf(" End Configuration of PartCorr analysis with detector %s \n",calorimeter.Data());
90eb3a19 515 printf("======================== \n");
516
afabc52f 517 // Create task
518 //===========================================================================
ad1ac1b7 519 AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation (Form("PartCorr%s",calorimeter.Data()));
a3aebfff 520 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
521 //task->SetDebugLevel(-1);
3f7a860b 522 task->SelectCollisionCandidates();
0cdb88b8 523 task->SetAnalysisMaker(maker);
1e86c71e 524 //if(!kSimulation)task->SelectCollisionCandidates(); //AliPhysicsSelection has to be attached before.
a3aebfff 525 mgr->AddTask(task);
526
0c1383b5 527 //Create containers
fbc534a2 528 char name[128];
529 sprintf(name,"PartCorr_%s",calorimeter.Data());
d0b67781 530 cout<<"Name of task "<<name<<endl;
531 //AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form(name),TList::Class(),
afabc52f 532 // AliAnalysisManager::kOutputContainer, Form("PartCorr_%s.root",calorimeter.Data()));
a3aebfff 533
d0b67781 534 TString outputfile = AliAnalysisManager::GetCommonFileName();
535 // AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form("PartCorr_%s",calorimeter.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PartCorr_%s",outputfile.Data(),calorimeter.Data()));
0c1383b5 536 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(calorimeter.Data(), TList::Class(),
7e7694bb 537 AliAnalysisManager::kOutputContainer,
538 Form("%s:PartCorr",outputfile.Data()));
0c1383b5 539
540 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("%sCuts",calorimeter.Data()), TList::Class(),
7e7694bb 541 AliAnalysisManager::kParamContainer,
542 Form("%s:PartCorrCuts",outputfile.Data()));
0c1383b5 543
a3aebfff 544 // Create ONLY the output containers for the data produced by the task.
545 // Get and connect other common input/output containers via the manager as below
546 //==============================================================================
547 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
548 // AOD output slot will be used in a different way in future
f37fa8d2 549 if(!data.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
a3aebfff 550 mgr->ConnectOutput (task, 1, cout_pc);
0c1383b5 551 mgr->ConnectOutput (task, 2, cout_cuts);
7e7694bb 552
a3aebfff 553 return task;
90eb3a19 554}
a3aebfff 555
556