]>
Commit | Line | Data |
---|---|---|
1 | AliAnalysisTaskParticleCorrelationM *AddTaskPartCorrM(TString data, TString calorimeter, Bool_t kPrintSettings = kFALSE) | |
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 | Bool_t kUseKinematics = kFALSE; | |
13 | kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; | |
14 | ||
15 | cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl; | |
16 | ||
17 | // Configure analysis | |
18 | //=========================================================================== | |
19 | ||
20 | //Reader | |
21 | AliCaloTrackReader * reader = 0x0; | |
22 | if(data.Contains("AOD")) reader = new AliCaloTrackAODReader(); | |
23 | else if(data=="ESD") reader = new AliCaloTrackESDReader(); | |
24 | else if(data=="MC" || (kUseKinematics && data == "ESD")) reader = new AliCaloTrackMCReader(); | |
25 | reader->SetDebug(-1);//10 for lots of messages | |
26 | reader->SwitchOnCTS(); | |
27 | ||
28 | if(calorimeter == "EMCAL") { | |
29 | reader->SwitchOnEMCALCells(); | |
30 | reader->SwitchOnEMCAL(); | |
31 | } | |
32 | if(calorimeter == "PHOS") { | |
33 | reader->SwitchOnPHOSCells(); | |
34 | reader->SwitchOnPHOS(); | |
35 | } | |
36 | ||
37 | reader->SwitchOnSuspiciousClustersRemoval(); //EMCAL | |
38 | ||
39 | // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists | |
40 | if(data.Contains("delta")){ | |
41 | reader->SwitchOffEMCAL(); | |
42 | reader->SwitchOffPHOS(); | |
43 | reader->SwitchOffEMCALCells(); | |
44 | reader->SwitchOffPHOSCells(); | |
45 | } | |
46 | ||
47 | if(kUseKinematics){ | |
48 | if(data == "ESD"){ | |
49 | reader->SwitchOnStack(); | |
50 | reader->SwitchOffAODMCParticles(); | |
51 | } | |
52 | else if(data == "AOD"){ | |
53 | reader->SwitchOffStack(); | |
54 | reader->SwitchOnAODMCParticles(); | |
55 | } | |
56 | } | |
57 | ||
58 | reader->SetZvertexCut(10.); | |
59 | ||
60 | //Min particle pT | |
61 | reader->SetEMCALPtMin(0.5); | |
62 | reader->SetPHOSPtMin(0.5); | |
63 | reader->SetCTSPtMin(0.1); | |
64 | reader->SwitchOffWriteDeltaAOD() ; | |
65 | if(kPrintSettings) reader->Print(""); | |
66 | ||
67 | // ##### Analysis algorithm settings #### | |
68 | AliCaloPID * pid = new AliCaloPID(); | |
69 | pid->SetDispersionCut(1.5); | |
70 | pid->SetTOFCut(5.e-9); | |
71 | pid->SetDebug(-1); | |
72 | if(kPrintSettings) pid->Print(""); | |
73 | //Fiducial cut | |
74 | // AliFiducialCut * fidCut1stYear = new AliFiducialCut(); | |
75 | // fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
76 | // fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
77 | // fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
78 | // fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
79 | // fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
80 | // fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,300.); | |
81 | // ------------------------------------------------- | |
82 | // --- Isolation Cut --- | |
83 | // ------------------------------------------------- | |
84 | AliIsolationCut * ic = new AliIsolationCut(); | |
85 | ic->SetConeSize(0.4); | |
86 | //ic->SetPtThreshold(0.7); | |
87 | ic->SetPtFraction(0.1); | |
88 | ic->SetPtThreshold(0.7) ; | |
89 | ic->SetSumPtThreshold(1.0) ; | |
90 | //choose different method for IC: | |
91 | //kPtThresIC, kSumPtIC, kPtFracIC, kSumPtFracIC | |
92 | // ic->SetICMethod(AliIsolationCut::kPtThresIC); | |
93 | ic->SetICMethod(AliIsolationCut::kSumPtFracIC); | |
94 | //particle in cone: kNeutralAndCharged=0, kOnlyNeutral=1, kOnlyCharged=2 | |
95 | ic->SetParticleTypeInCone(AliIsolationCut::kOnlyCharged); | |
96 | if(kPrintSettings) ic->Print(""); | |
97 | ||
98 | //analysis with calorimeter triggers | |
99 | if(calorimeter=="PHOS" || calorimeter=="EMCAL") { | |
100 | AliCalorimeterUtils * cu = new AliCalorimeterUtils(); | |
101 | cu->SwitchOnBadChannelsRemoval(); | |
102 | ||
103 | cu->SetNumberOfCellsFromEMCALBorder(1) ; //nEMCAL); | |
104 | cu->SetNumberOfCellsFromPHOSBorder(2) ; //nPHOS); | |
105 | // cu->SwitchOnNoFiducialBorderInEMCALEta0(); | |
106 | cu->SetPHOSChannelStatus(1,48, 8); //PHOS new hot channel | |
107 | ||
108 | // // Remove EMCAL hottest channels from Gustavo list | |
109 | // SM0 | |
110 | cu->SetEMCALChannelStatus(0,3,13); cu->SetEMCALChannelStatus(0,44,1); cu->SetEMCALChannelStatus(0,3,13); //warm | |
111 | cu->SetEMCALChannelStatus(0,20,7); cu->SetEMCALChannelStatus(0,38,2); //hot | |
112 | // SM1 warm channels | |
113 | cu->SetEMCALChannelStatus(1,4,7); cu->SetEMCALChannelStatus(1,4,13); cu->SetEMCALChannelStatus(1,9,20); | |
114 | cu->SetEMCALChannelStatus(1,14,15); cu->SetEMCALChannelStatus(1,23,16); cu->SetEMCALChannelStatus(1,32,23); | |
115 | cu->SetEMCALChannelStatus(1,37,5); cu->SetEMCALChannelStatus(1,40,1); cu->SetEMCALChannelStatus(1,40,2); | |
116 | cu->SetEMCALChannelStatus(1,40,5); cu->SetEMCALChannelStatus(1,41,0); cu->SetEMCALChannelStatus(1,41,1); | |
117 | cu->SetEMCALChannelStatus(1,41,2); cu->SetEMCALChannelStatus(1,41,4); | |
118 | // SM2 | |
119 | cu->SetEMCALChannelStatus(2,14,15); cu->SetEMCALChannelStatus(2,18,16); cu->SetEMCALChannelStatus(2,18,17); | |
120 | cu->SetEMCALChannelStatus(2,18,18); cu->SetEMCALChannelStatus(2,18,20); cu->SetEMCALChannelStatus(2,18,21); | |
121 | cu->SetEMCALChannelStatus(2,18,23); cu->SetEMCALChannelStatus(2,19,16); cu->SetEMCALChannelStatus(2,19,17); | |
122 | cu->SetEMCALChannelStatus(2,19,19); cu->SetEMCALChannelStatus(2,19,20); cu->SetEMCALChannelStatus(2,19,21); | |
123 | cu->SetEMCALChannelStatus(2,19,22); | |
124 | //SM3 | |
125 | cu->SetEMCALChannelStatus(3,4,7); | |
126 | ||
127 | // ----------------------------------- | |
128 | // --- Photon and Pi0 Analysis --- | |
129 | // ----------------------------------- | |
130 | ||
131 | AliAnaPhoton *anaphoton = new AliAnaPhoton(); | |
132 | anaphoton->SetDebug(-1); //10 for lots of messages | |
133 | anaphoton->SetMinPt(1.0); | |
134 | anaphoton->SetCaloPID(pid); | |
135 | anaphoton->SetCalorimeter(calorimeter); | |
136 | if(kUseKinematics) anaphoton->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
137 | else anaphoton->SwitchOffDataMC() ; | |
138 | anaphoton->SwitchOffCaloPID(); | |
139 | anaphoton->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL | |
140 | anaphoton->SwitchOnFiducialCut(); | |
141 | AliFiducialCut * fidCut1stYear = anaphoton->GetFiducialCut(); | |
142 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
143 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
144 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
145 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
146 | anaphoton->SwitchOnTrackMatchRejection(); | |
147 | //settings for different multiplicity analysis | |
148 | anaphoton->SwitchOffEventSelection() ; | |
149 | anaphoton->SetMultiplicity(80, 120); | |
150 | ||
151 | if(calorimeter == "EMCAL"){ | |
152 | anaphoton->SetNCellCut(1); | |
153 | anaphoton->SetMinPt(0.3); | |
154 | //if(!kUseKinematics) anaphoton->SetTimeCut(525, 725); | |
155 | anaphoton->SetMinDistanceToBadChannel(1, 2, 3); | |
156 | } | |
157 | else{ | |
158 | anaphoton->SetMinPt(0.3); | |
159 | anaphoton->SetMinDistanceToBadChannel(2, 4, 5); | |
160 | anaphoton->SetNCellCut(2); | |
161 | } | |
162 | if(!data.Contains("delta")) { | |
163 | anaphoton->SetOutputAODName(Form("Triggers%s",calorimeter.Data())); | |
164 | anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
165 | } | |
166 | else anaphoton->SetOutputAODName(Form("Triggers%s",calorimeter.Data())); | |
167 | anaphoton->AddToHistogramsName("AnaPhoton_"); | |
168 | //Set Histograms bins and ranges | |
169 | anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
170 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
171 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
172 | ||
173 | if(kPrintSettings) anaphoton->Print(""); | |
174 | AliAnaPi0 *anapi0 = new AliAnaPi0(); | |
175 | anapi0->SetDebug(-1);//10 for lots of messages | |
176 | anapi0->SetInputAODName(Form("Triggers%s",calorimeter.Data())); | |
177 | anapi0->AddToHistogramsName("AnaPi0_"); | |
178 | anapi0->SetCaloPID(pid); | |
179 | anapi0->SetCalorimeter(calorimeter); | |
180 | anapi0->SwitchOnFiducialCut(); | |
181 | AliFiducialCut * fidCut1stYear = anapi0->GetFiducialCut(); | |
182 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
183 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
184 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
185 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
186 | anapi0->SetNPID(1); | |
187 | //settings for different multiplicity analysis | |
188 | anapi0->SwitchOnEventSelection() ; | |
189 | anapi0->SetNCentrBin(1); | |
190 | anapi0->SetMultiplicity(80, 120); | |
191 | anapi0->SetMultiBin(1); | |
192 | anapi0->SwitchOffDataMC() ;//Access MC stack and fill more histograms | |
193 | if(calorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year | |
194 | else if(calorimeter=="EMCAL") anapi0->SetNumberOfModules(4); //EMCAL first year | |
195 | anapi0->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
196 | //anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
197 | //anapi0->SetHistoEtaRangeAndNBins(-0.8, 0.8, 200) ; | |
198 | anapi0->SetHistoMassRangeAndNBins(0., 1.0, 100) ; | |
199 | anapi0->SetHistoAsymmetryRangeAndNBins(0., 1. , 10) ; | |
200 | if(kPrintSettings) anapi0->Print(""); | |
201 | ||
202 | // ------------------------------------------------- | |
203 | // --- Pi0 EbE Analysis --- | |
204 | // ------------------------------------------------- | |
205 | ||
206 | AliNeutralMesonSelection *nms = new AliNeutralMesonSelection(); | |
207 | nms->SetInvMassCutRange(0.05, 0.16) ; | |
208 | nms->SwitchOffAngleSelection() ; | |
209 | nms->KeepNeutralMesonSelectionHistos(kTRUE); | |
210 | //Set Histrograms bins and ranges | |
211 | nms->SetHistoERangeAndNBins(0, 50, 100) ; | |
212 | nms->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
213 | // nms->SetHistoAngleRangeAndNBins(0, 0.3, 100) ; | |
214 | // nsm->SetHistoIMRangeAndNBins(0, 0.4, 100) ; | |
215 | ||
216 | AliAnaPi0EbE *anapi0ebe = new AliAnaPi0EbE(); | |
217 | anapi0ebe->SetDebug(-1);//10 for lots of messages | |
218 | anapi0ebe->SetAnalysisType(AliAnaPi0EbE::kIMCalo); | |
219 | anapi0ebe->SetMinPt(0.5); | |
220 | anapi0ebe->SetCalorimeter(calorimeter); | |
221 | anapi0ebe->SetInputAODName(Form("Triggers%s",calorimeter.Data())); | |
222 | if(!data.Contains("delta")) { | |
223 | anapi0ebe->SetOutputAODName(Form("Pi0s%s",calorimeter.Data())); | |
224 | anapi0ebe->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
225 | } | |
226 | else anapi0ebe->SetOutputAODName(Form("Pi0s%s",calorimeter.Data())); | |
227 | ||
228 | if(kUseKinematics) anapi0ebe->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
229 | else anapi0ebe->SwitchOffDataMC() ; | |
230 | anapi0ebe->SwitchOffEventSelection() ; | |
231 | anapi0ebe->SetMultiplicity(80, 120); | |
232 | anapi0ebe->SetMultiBin(1); | |
233 | anapi0ebe->SetNeutralMesonSelection(nms); | |
234 | //Set Histrograms bins and ranges | |
235 | anapi0ebe->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
236 | // anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
237 | // anapi0->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
238 | if(kPrintSettings) anapi0ebe->Print(""); | |
239 | ||
240 | // ### Pi0 Correlation with hadrons, not isolated | |
241 | AliAnaParticleHadronCorrelation *anacorrhadronpi0 = new AliAnaParticleHadronCorrelation(); | |
242 | anacorrhadronpi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
243 | anacorrhadronpi0->AddToHistogramsName("AnaHadronCorrPi0_"); | |
244 | anacorrhadronpi0->SetDebug(-1); | |
245 | anacorrhadronpi0->SwitchOffCaloPID(); | |
246 | anacorrhadronpi0->SwitchOnFiducialCut(); | |
247 | AliFiducialCut * fidCut1stYear = anacorrhadronpi0->GetFiducialCut(); | |
248 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
249 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
250 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
251 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
252 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
253 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
254 | anacorrhadronpi0->SwitchOnDecayCorr(); | |
255 | anacorrhadronpi0->SetPtCutRange(0.5,50); | |
256 | anacorrhadronpi0->SetDeltaPhiCutRange(1.5,4.5); | |
257 | anacorrhadronpi0->SelectIsolated(kFALSE); // do correlation with non isolated pi0 | |
258 | anacorrhadronpi0->SetMultiplicity(80, 100); | |
259 | anacorrhadronpi0->SetMultiBin(1); | |
260 | anacorrhadronpi0->SwitchOffNeutralCorr(); | |
261 | anacorrhadronpi0->SwitchOffEventSelection(); | |
262 | anacorrhadronpi0->SwitchOnSeveralUECalculation(); | |
263 | anacorrhadronpi0->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
264 | if(kUseKinematics) anacorrhadronpi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
265 | else anacorrhadronpi0->SwitchOffDataMC() ; | |
266 | //if(calorimeter=="PHOS"){ | |
267 | // //Correlate with particles in EMCAL | |
268 | // anacorrhadronpi0->SwitchOnCaloPID(); | |
269 | // anacorrhadronpi0->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
270 | //} | |
271 | //Set Histograms bins and ranges | |
272 | anacorrhadronpi0->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
273 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
274 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
275 | if(kPrintSettings) anacorrhadronpi0->Print(""); | |
276 | ||
277 | AliAnaParticleIsolation *anaisolpi0 = new AliAnaParticleIsolation(); | |
278 | anaisolpi0->SetDebug(-1); | |
279 | anaisolpi0->SetMinPt(2.); | |
280 | anaisolpi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
281 | anaisolpi0->AddToHistogramsName("AnaIsolPi0_"); | |
282 | anaisolpi0->SetCalorimeter(calorimeter); | |
283 | if(kUseKinematics) anaisolpi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
284 | else anaisolpi0->SwitchOffDataMC() ; | |
285 | //Select clusters with no pair, if both clusters with pi0 mass | |
286 | anaisolpi0->SwitchOffInvariantMass(); | |
287 | //anaisol->SetNeutralMesonSelection(nms); | |
288 | //Do isolation cut | |
289 | anaisolpi0->SetIsolationCut(ic); | |
290 | //Do or not do isolation with previously produced AODs. | |
291 | //No effect if use of SwitchOnSeveralIsolation() | |
292 | anaisolpi0->SwitchOffReIsolation(); | |
293 | //Multiple IC | |
294 | anaisolpi0->SwitchOffSeveralIsolation() ; | |
295 | //Set Histograms bins and ranges | |
296 | anaisolpi0->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
297 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
298 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
299 | if(kPrintSettings) anaisol->Print(""); | |
300 | ||
301 | // ### Pi0 Correlation with hadrons, isolated | |
302 | AliAnaParticleHadronCorrelation *anacorrhadronisopi0 = new AliAnaParticleHadronCorrelation(); | |
303 | anacorrhadronisopi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
304 | anacorrhadronisopi0->AddToHistogramsName("AnaHadronCorrIsoPi0_"); | |
305 | anacorrhadronisopi0->SetDebug(-1); | |
306 | anacorrhadronisopi0->SwitchOffCaloPID(); | |
307 | anacorrhadronisopi0->SwitchOnFiducialCut(); | |
308 | AliFiducialCut * fidCut1stYear = anacorrhadronisopi0->GetFiducialCut(); | |
309 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
310 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
311 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
312 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
313 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
314 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
315 | anacorrhadronisopi0->SwitchOnDecayCorr(); | |
316 | anacorrhadronisopi0->SetPtCutRange(0.5,50); | |
317 | anacorrhadronisopi0->SetDeltaPhiCutRange(1.5,4.5); | |
318 | anacorrhadronisopi0->SelectIsolated(kTRUE); // do correlation with isolated pi0 | |
319 | anacorrhadronisopi0->SetMultiplicity(80, 100); | |
320 | anacorrhadronisopi0->SetMultiBin(1); | |
321 | anacorrhadronisopi0->SwitchOffNeutralCorr(); | |
322 | anacorrhadronisopi0->SwitchOffEventSelection(); | |
323 | anacorrhadronisopi0->SwitchOnSeveralUECalculation(); | |
324 | anacorrhadronisopi0->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
325 | if(kUseKinematics) anacorrhadronisopi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
326 | else anacorrhadronisopi0->SwitchOffDataMC() ; | |
327 | //if(calorimeter=="PHOS"){ | |
328 | // //Correlate with particles in EMCAL | |
329 | // anacorrhadronpi0->SwitchOnCaloPID(); | |
330 | // anacorrhadronpi0->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
331 | //} | |
332 | //Set Histograms bins and ranges | |
333 | anacorrhadronisopi0->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
334 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
335 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
336 | if(kPrintSettings) anacorrhadronisopi0->Print(""); | |
337 | ||
338 | } //analysis in calorimeter | |
339 | else { | |
340 | //---charge particle trigger--------------------- | |
341 | //------------------------------------------------ | |
342 | ||
343 | AliAnaChargedParticles *anacharge = new AliAnaChargedParticles(); | |
344 | anacharge->SetDebug(-1); //10 for lots of messages | |
345 | anacharge->SetMinPt(1.0); | |
346 | // anacharge->SetCaloPID(pid); | |
347 | if(kUseKinematics) anacharge->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
348 | else anacharge->SwitchOffDataMC() ; | |
349 | anacharge->SwitchOffCaloPID(); | |
350 | anacharge->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL | |
351 | anacharge->SwitchOnFiducialCut(); | |
352 | AliFiducialCut * fidCut1stYear = anacharge->GetFiducialCut(); | |
353 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
354 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
355 | if(!data.Contains("delta")) { | |
356 | anacharge->SetOutputAODName(Form("Triggers%s",calorimeter.Data())); | |
357 | anacharge->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
358 | } | |
359 | else anacharge->SetOutputAODName(Form("Triggers%s",calorimeter.Data())); | |
360 | anacharge->AddToHistogramsName("AnaCharge_"); | |
361 | //Set Histograms bins and ranges | |
362 | anacharge->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
363 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
364 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
365 | ||
366 | if(kPrintSettings) anacharge->Print(""); | |
367 | } | |
368 | ||
369 | // ------------------------------------------------- | |
370 | // --- Correlation Analysis with non-isolated triggers --- | |
371 | // ------------------------------------------------- | |
372 | // ### Correlation with hadrons | |
373 | AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation(); | |
374 | anacorrhadron->SetInputAODName(Form("Triggers%s",calorimeter.Data())); | |
375 | anacorrhadron->AddToHistogramsName("AnaHadronCorrTrig_"); | |
376 | anacorrhadron->SetDebug(-1); | |
377 | anacorrhadron->SwitchOnCaloPID(); | |
378 | anacorrhadron->SwitchOnFiducialCut(); | |
379 | AliFiducialCut * fidCut1stYear = anacorrhadron->GetFiducialCut(); | |
380 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
381 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
382 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
383 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
384 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
385 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
386 | anacorrhadron->SetPtCutRange(0.5,50); | |
387 | anacorrhadron->SetDeltaPhiCutRange(1.5,4.5); | |
388 | anacorrhadron->SetMultiplicity(80, 120); | |
389 | anacorrhadron->SetMultiBin(1); | |
390 | anacorrhadron->SwitchOffNeutralCorr(); | |
391 | anacorrhadron->SwitchOffEventSelection(); | |
392 | anacorrhadron->SwitchOnSeveralUECalculation(); | |
393 | anacorrhadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
394 | anacorrhadron->SelectIsolated(kFALSE); // do correlation with isolated photons | |
395 | if(kUseKinematics) anacorrhadron->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
396 | else anacorrhadron->SwitchOffDataMC() ; | |
397 | //if(calorimeter=="PHOS"){ | |
398 | //Correlate with particles in EMCAL | |
399 | //anacorrhadron->SwitchOnCaloPID(); | |
400 | //anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
401 | //} | |
402 | //Set Histograms bins and ranges | |
403 | anacorrhadron->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
404 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
405 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
406 | if(kPrintSettings) anacorrhadron->Print(""); | |
407 | ||
408 | ||
409 | ||
410 | // ### Isolation analysis ### | |
411 | AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation(); | |
412 | anaisol->SetDebug(-1); | |
413 | anaisol->SetMinPt(2.0); | |
414 | anaisol->SetInputAODName(Form("Triggers%s",calorimeter.Data())); | |
415 | anaisol->AddToHistogramsName("AnaIsolTrig_"); | |
416 | anaisol->SetCalorimeter(calorimeter); | |
417 | if(kUseKinematics) anaisol->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
418 | else anaisol->SwitchOffDataMC() ; | |
419 | //Select clusters with no pair, if both clusters with pi0 mass | |
420 | anaisol->SwitchOffInvariantMass(); | |
421 | //anaisol->SetNeutralMesonSelection(nms); | |
422 | //Do isolation cut | |
423 | anaisol->SetIsolationCut(ic); | |
424 | //Do or not do isolation with previously produced AODs. | |
425 | //No effect if use of SwitchOnSeveralIsolation() | |
426 | anaisol->SwitchOffReIsolation(); | |
427 | //Multiple IC | |
428 | anaisol->SwitchOffSeveralIsolation() ; | |
429 | //Set Histograms bins and ranges | |
430 | anaisol->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
431 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
432 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
433 | ||
434 | if(kPrintSettings) anaisol->Print(""); | |
435 | ||
436 | // ------------------------------------------------- | |
437 | // --- Correlation Analysis with isolated triggers --- | |
438 | // ------------------------------------------------- | |
439 | // ### Correlation with hadrons | |
440 | AliAnaParticleHadronCorrelation *anacorrisohadron = new AliAnaParticleHadronCorrelation(); | |
441 | anacorrisohadron->SetInputAODName(Form("Triggers%s",calorimeter.Data())); | |
442 | anacorrisohadron->AddToHistogramsName("AnaHadronCorrIsoTrig_"); | |
443 | anacorrisohadron->SetDebug(-1); | |
444 | anacorrisohadron->SwitchOffCaloPID(); | |
445 | anacorrisohadron->SwitchOnFiducialCut(); | |
446 | AliFiducialCut * fidCut1stYear = anacorrisohadron->GetFiducialCut(); | |
447 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
448 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
449 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
450 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
451 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
452 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
453 | anacorrisohadron->SetPtCutRange(0.5,50); | |
454 | anacorrisohadron->SetDeltaPhiCutRange(1.5,4.5); | |
455 | anacorrisohadron->SetMultiplicity(80, 100); | |
456 | anacorrisohadron->SetMultiBin(1); | |
457 | anacorrisohadron->SwitchOffNeutralCorr(); | |
458 | anacorrisohadron->SwitchOffEventSelection(); | |
459 | anacorrisohadron->SwitchOnSeveralUECalculation(); | |
460 | anacorrisohadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
461 | anacorrisohadron->SelectIsolated(kTRUE); // do correlation with isolated photons | |
462 | if(kUseKinematics) anacorrisohadron->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
463 | else anacorrisohadron->SwitchOffDataMC() ; | |
464 | //if(calorimeter=="PHOS"){ | |
465 | //Correlate with particles in EMCAL | |
466 | //anacorrhadron->SwitchOnCaloPID(); | |
467 | //anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
468 | //} | |
469 | //Set Histograms bins and ranges | |
470 | anacorrisohadron->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
471 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
472 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
473 | if(kPrintSettings) anacorrisohadron->Print(""); | |
474 | ||
475 | // #### Configure Maker #### | |
476 | AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker(); | |
477 | maker->SetReader(reader);//pointer to reader | |
478 | Int_t n = 0;//Analysis number, order is important | |
479 | // Particle selection analysis | |
480 | if(calorimeter=="PHOS" || calorimeter=="EMCAL") { | |
481 | maker->SetCaloUtils(cu); //pointer to calorimeter utils | |
482 | maker->AddAnalysis(anaphoton,n++); | |
483 | maker->AddAnalysis(anapi0,n++); | |
484 | maker->AddAnalysis(anapi0ebe,n++); | |
485 | maker->AddAnalysis(anacorrhadronpi0,n++); | |
486 | maker->AddAnalysis(anaisolpi0,n++); | |
487 | maker->AddAnalysis(anacorrhadronisopi0,n++); | |
488 | } | |
489 | if(calorimeter=="CTS") | |
490 | maker->AddAnalysis(anacharge,n++); | |
491 | // Correlation analysis | |
492 | maker->AddAnalysis(anacorrhadron,n++); | |
493 | // Isolation analysis | |
494 | maker->AddAnalysis(anaisol,n++); | |
495 | // Correlation analysis with isolated triggers | |
496 | maker->AddAnalysis(anacorrisohadron,n); | |
497 | maker->SetAnaDebug(-1) ; | |
498 | maker->SwitchOnHistogramsMaker() ; | |
499 | if(data.Contains("delta")) maker->SwitchOffAODsMaker() ; | |
500 | else maker->SwitchOnAODsMaker() ; | |
501 | ||
502 | if(kPrintSettings) maker->Print(""); | |
503 | ||
504 | printf("======================== \n"); | |
505 | printf(" End Configuration of PartCorr analysis with detector %s \n",calorimeter.Data()); | |
506 | printf("======================== \n"); | |
507 | ||
508 | // Create task | |
509 | //=========================================================================== | |
510 | // AliAnalysisTaskParticleCorrelationM * task = new AliAnalysisTaskParticleCorrelationM(Form("PartCorr%s",calorimeter.Data())); | |
511 | AliAnalysisTaskParticleCorrelationM * task = new AliAnalysisTaskParticleCorrelationM("PartCorr"); | |
512 | task->SetConfigFileName(""); //Don't configure the analysis via configuration file. | |
513 | //task->SetDebugLevel(-1); | |
514 | task->SetAnalysisMaker(maker); | |
515 | //if(!kSimulation)task->SelectCollisionCandidates(); //AliPhysicsSelection has to be attached before. | |
516 | mgr->AddTask(task); | |
517 | ||
518 | // char name[128]; | |
519 | // sprintf(name,"PartCorr_%s",calorimeter.Data()); | |
520 | // cout<<"Name of task "<<name<<endl; | |
521 | //AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form(name),TList::Class(), | |
522 | // AliAnalysisManager::kOutputContainer, Form("PartCorr_%s.root",calorimeter.Data())); | |
523 | ||
524 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
525 | outputfile.ReplaceAll(".root","") ; | |
526 | outputfile.Append("M.root") ; | |
527 | // AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form("PartCorr_%s",calorimeter.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PartCorr_%s",outputfile.Data(),calorimeter.Data())); | |
528 | AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(calorimeter.Data(), TList::Class(), | |
529 | AliAnalysisManager::kOutputContainer, | |
530 | Form("%s:PartCorr",outputfile.Data())); | |
531 | ||
532 | AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("%sCuts",calorimeter.Data()), TList::Class(), | |
533 | AliAnalysisManager::kParamContainer, | |
534 | Form("%s:PartCorrCuts",outputfile.Data())); | |
535 | // Create ONLY the output containers for the data produced by the task. | |
536 | // Get and connect other common input/output containers via the manager as below | |
537 | //============================================================================== | |
538 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
539 | // AOD output slot will be used in a different way in future | |
540 | //if(!data.Contains("delta")) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
541 | // mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
542 | mgr->ConnectOutput (task, 1, cout_pc); | |
543 | mgr->ConnectOutput (task, 2, cout_cuts); | |
544 | ||
545 | return task; | |
546 | } | |
547 | ||
548 |