]>
Commit | Line | Data |
---|---|---|
1 | AliAnalysisTaskParticleCorrelation *AddTaskPartCorr | |
2 | ( | |
3 | TString inputDataType, | |
4 | TString calorimeter, | |
5 | Bool_t kPrintSettings = kTRUE, | |
6 | Bool_t kSimulation = kFALSE, | |
7 | Bool_t outputAOD=kFALSE, | |
8 | TString period = "" | |
9 | ) { | |
10 | ||
11 | // Creates a PartCorr task, configures it and adds it to the analysis manager. | |
12 | ||
13 | // Get the pointer to the existing analysis manager via the static access method. | |
14 | //============================================================================== | |
15 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
16 | if (!mgr) { | |
17 | ::Error("AddTaskPartCorr", "No analysis manager to connect to."); | |
18 | return NULL; | |
19 | } | |
20 | ||
21 | Bool_t kUseKinematics = kFALSE; | |
22 | if(kSimulation) { | |
23 | kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; | |
24 | if (!kUseKinematics && inputDataType == "AOD") kUseKinematics = kTRUE; //AOD primary should be available ... | |
25 | } | |
26 | ||
27 | cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl; | |
28 | ||
29 | // Configure analysis | |
30 | //=========================================================================== | |
31 | ||
32 | // *** Reader *** | |
33 | AliCaloTrackReader * reader =0x0 ; | |
34 | if(inputDataType.Contains("AOD")) reader = new AliCaloTrackAODReader(); | |
35 | else if(inputDataType=="ESD") reader = new AliCaloTrackESDReader(); | |
36 | else if(inputDataType=="MC" && inputDataType == "ESD") reader = new AliCaloTrackMCReader(); | |
37 | reader->SetDebug(-1);//10 for lots of messages | |
38 | reader->SwitchOnCTS(); | |
39 | //reader->SetDeltaAODFileName(""); | |
40 | //if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL"); | |
41 | if(calorimeter == "EMCAL") { | |
42 | reader->SwitchOnEMCALCells(); | |
43 | reader->SwitchOnEMCAL(); | |
44 | } | |
45 | if(calorimeter == "PHOS") { | |
46 | reader->SwitchOnPHOSCells(); | |
47 | reader->SwitchOnPHOS(); | |
48 | } | |
49 | ||
50 | // for case inputDataType="deltaAOD", no need to fill the EMCAL/PHOS cluster lists | |
51 | if(inputDataType.Contains("delta")){ | |
52 | reader->SwitchOffEMCAL(); | |
53 | reader->SwitchOffPHOS(); | |
54 | reader->SwitchOffEMCALCells(); | |
55 | reader->SwitchOffPHOSCells(); | |
56 | } | |
57 | ||
58 | if(kUseKinematics){ | |
59 | if(inputDataType == "ESD"){ | |
60 | reader->SwitchOnStack(); | |
61 | reader->SwitchOffAODMCParticles(); | |
62 | } | |
63 | else if(inputDataType == "AOD"){ | |
64 | reader->SwitchOffStack(); | |
65 | reader->SwitchOnAODMCParticles(); | |
66 | } | |
67 | } | |
68 | ||
69 | //----------------------------------------------------------------- | |
70 | // Switch on cluster energy smearing | |
71 | // -> SIMULATION | |
72 | // -> EMCAL | |
73 | //----------------------------------------------------------------- | |
74 | ||
75 | if (kSimulation && calorimeter == "EMCAL") { | |
76 | //switch on cluster energy smearing | |
77 | reader->SwitchOnClusterEnergySmearing(); | |
78 | reader->SetSmearingParameters(0,0.07); | |
79 | reader->SetSmearingParameters(1,0.00); | |
80 | reader->SetSmearingParameters(2,0.00); | |
81 | } | |
82 | ||
83 | ||
84 | //----------------------------------------------------------------- | |
85 | // Z vertex cut | |
86 | reader->SetZvertexCut(10.); | |
87 | //----------------------------------------------------------------- | |
88 | ||
89 | //----------------------------------------------------------------- | |
90 | // Min particle pT | |
91 | //----------------------------------------------------------------- | |
92 | reader->SetEMCALPtMin(0.3); | |
93 | reader->SetPHOSPtMin(0.3); | |
94 | reader->SetCTSPtMin(0.1); | |
95 | ||
96 | if(outputAOD) reader->SwitchOnWriteDeltaAOD() ; | |
97 | if(kPrintSettings) reader->Print(""); | |
98 | ||
99 | // *** Calorimeters Utils *** | |
100 | AliCalorimeterUtils *cu = new AliCalorimeterUtils; | |
101 | ||
102 | //----------------------------------------------------------------- | |
103 | // Non-linearity corrections | |
104 | // -> REAL DATA AND SIMULATION | |
105 | // -> EMCAL | |
106 | //----------------------------------------------------------------- | |
107 | if (calorimeter == "EMCAL") { | |
108 | cu->GetEMCALRecoUtils()->SwitchOnRejectExoticCluster(); | |
109 | cu->SwitchOnCorrectClusterLinearity(); | |
110 | if (!kSimulation) { | |
111 | cu->GetEMCALRecoUtils()->SetNonLinearityFunction(AliEMCALRecoUtils::kBeamTestCorrected); | |
112 | } | |
113 | else { | |
114 | cu->GetEMCALRecoUtils()->SetNonLinearityFunction(AliEMCALRecoUtils::kPi0MC); | |
115 | } | |
116 | } | |
117 | ||
118 | //----------------------------------------------------------------- | |
119 | // Remove clusters close to borders, | |
120 | // at least max energy cell is 1 cell away | |
121 | //----------------------------------------------------------------- | |
122 | cu->SetNumberOfCellsFromEMCALBorder(1); | |
123 | cu->SetNumberOfCellsFromPHOSBorder(2); | |
124 | ||
125 | ||
126 | //----------------------------------------------------------------- | |
127 | // Remove EMCAL hottest channels | |
128 | // -> REAL DATA AND SIMULATION | |
129 | // -> EMCAL | |
130 | // Recover the file from alien | |
131 | // /alice/cern.ch/user/g/gconesab/BadChannelsDB | |
132 | //----------------------------------------------------------------- | |
133 | if (calorimeter == "EMCAL" && period !="") { | |
134 | cu->SwitchOnBadChannelsRemoval(); | |
135 | cu->SwitchOnDistToBadChannelRecalculation(); | |
136 | TFile * fbad = new TFile("BadChannels.root","read"); | |
137 | TH2I * hbad0 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod0"); | |
138 | TH2I * hbad1 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod1"); | |
139 | TH2I * hbad2 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod2"); | |
140 | TH2I * hbad3 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod3"); | |
141 | cu->SetEMCALChannelStatusMap(0,hbad0); | |
142 | cu->SetEMCALChannelStatusMap(1,hbad1); | |
143 | cu->SetEMCALChannelStatusMap(2,hbad2); | |
144 | cu->SetEMCALChannelStatusMap(3,hbad3); | |
145 | } | |
146 | ||
147 | ||
148 | //----------------------------------------------------------------- | |
149 | // Misalignment + recalculate position | |
150 | // -> REAL DATA and SIMULATION | |
151 | // -> EMCAL | |
152 | //----------------------------------------------------------------- | |
153 | if (calorimeter == "EMCAL") { | |
154 | cu->SetEMCALGeometryName("EMCAL_FIRSTYEARV1"); | |
155 | cu->GetEMCALRecoUtils()->SetParticleType(AliEMCALRecoUtils::kPhoton); | |
156 | cu->GetEMCALRecoUtils()->SetW0(4.5); | |
157 | cu->GetEMCALRecoUtils()->SetPositionAlgorithm(AliEMCALRecoUtils::kPosTowerGlobal); | |
158 | cu->SwitchOnLoadOwnEMCALGeometryMatrices(); | |
159 | TGeoHMatrix *matrix[4]; | |
160 | ||
161 | double rotationMatrix[4][9] = {-0.014587, -0.999892, -0.002031, 0.999892, -0.014591, 0.001979, -0.002009, -0.002002, 0.999996, | |
162 | -0.014587, 0.999892, 0.002031, 0.999892, 0.014591, -0.001979, -0.002009, 0.002002, -0.999996, | |
163 | -0.345864, -0.938278, -0.003412, 0.938276, -0.345874, 0.003010, -0.004004, -0.002161, 0.999990, | |
164 | -0.345861, 0.938280, 0.003412, 0.938276, 0.345874, -0.003010, -0.004004, 0.002161, -0.999990}; | |
165 | ||
166 | double translationMatrix[4][3] = {0.351659, 447.576446, 176.269742, | |
167 | 1.062577, 446.893974, -173.728870, | |
168 | -154.213287, 419.306156, 176.753692, | |
169 | -153.018950, 418.623681, -173.243605}; | |
170 | for(int j=0; j<4; j++) | |
171 | { | |
172 | matrix[j] = new TGeoHMatrix(); | |
173 | matrix[j]->SetRotation(rotationMatrix[j]); | |
174 | matrix[j]->SetTranslation(translationMatrix[j]); | |
175 | matrix[j]->Print(); | |
176 | cu->SetEMCALGeometryMatrixInSM(matrix[j],j); | |
177 | } | |
178 | //cu->SwitchOnRecalculateClusterTrackMatching(); | |
179 | } | |
180 | ||
181 | //----------------------------------------------------------------- | |
182 | // Time dependent corrections | |
183 | // -> REAL_DATA ONLY | |
184 | // -> EMCAL | |
185 | // Recover file from alien | |
186 | // /alice/cern.ch/user/g/gconesab/TimeDepCorrectionDB | |
187 | //----------------------------------------------------------------- | |
188 | if (!kSimulation && calorimeter == "EMCAL" && period!="") { | |
189 | cu->GetEMCALRecoUtils()->SwitchOnTimeDepCorrection(); | |
190 | char cmd[200] ; | |
191 | sprintf(cmd, ".!tar xvfz CorrectionFiles.tgz >& /dev/null") ; | |
192 | gROOT->ProcessLine(cmd) ; | |
193 | } | |
194 | ||
195 | ||
196 | //------------------------------------------------------------------------ | |
197 | // Recalibration factors | |
198 | // -> REAL DATA ONLY | |
199 | // -> EMCAL | |
200 | // Recover the file from alien for LHC10d pass2 | |
201 | // /alice/cern.ch/user/g/gconesab/RecalDB/december2010 -> LHC10d pass2 | |
202 | // /alice/cern.ch/user/g/gconesab/RecalDB/summer_december2010 -> LHC10e pass1 | |
203 | // ****** | |
204 | // For other periods/passes, see | |
205 | // https://twiki.cern.ch/twiki/bin/view/ALICE/EMCalOffline#Summary_of_Calibration_and_Align | |
206 | //------------------------------------------------------------------------ | |
207 | ||
208 | if (calorimeter == "EMCAL" && period !="") { | |
209 | cu->SwitchOnRecalibration(); | |
210 | TFile* f = 0x0 ; | |
211 | if (!kSimulation) { | |
212 | if (period == "LHC10d") f = new TFile("RecalibrationFactors_LHC10d.root","read"); | |
213 | else if (period == "LHC10e") f = new TFile("RecalibrationFactors_LHC10e.root","read"); | |
214 | else Fatal("AddTaskPartCorr","run period not supported"); | |
215 | } | |
216 | else { | |
217 | f = new TFile("DecalibrationFactors.root","read"); | |
218 | } | |
219 | if (!f || !f->IsOpen()) Fatal("AddTaskPartCorr","Re(De)-calibration file not found"); | |
220 | ||
221 | Info("AddTaskPartCorr",Form("Using calibration files for period %s",period.Data())); | |
222 | ||
223 | TH2F * h0 = (TH2F*)f->Get("EMCALRecalFactors_SM0"); | |
224 | TH2F * h1 = (TH2F*)f->Get("EMCALRecalFactors_SM1"); | |
225 | TH2F * h2 = (TH2F*)f->Get("EMCALRecalFactors_SM2"); | |
226 | TH2F * h3 = (TH2F*)f->Get("EMCALRecalFactors_SM3"); | |
227 | cu->SetEMCALChannelRecalibrationFactors(0,h0); | |
228 | cu->SetEMCALChannelRecalibrationFactors(1,h1); | |
229 | cu->SetEMCALChannelRecalibrationFactors(2,h2); | |
230 | cu->SetEMCALChannelRecalibrationFactors(3,h3); | |
231 | } | |
232 | ||
233 | cu->SetDebug(-1); | |
234 | ||
235 | ||
236 | // ##### Analysis algorithm settings #### | |
237 | ||
238 | // ------------------------------------------------- | |
239 | // --- Photon/Pi0/Omega/Electron Analysis --- | |
240 | // ------------------------------------------------- | |
241 | ||
242 | AliAnaPhoton *anaphoton = new AliAnaPhoton(); | |
243 | anaphoton->SetDebug(-1); //10 for lots of messages | |
244 | ||
245 | if(calorimeter == "PHOS"){ | |
246 | anaphoton->SetNCellCut(2); | |
247 | anaphoton->SetMinPt(0.3); | |
248 | anaphoton->SetMinDistanceToBadChannel(2, 4, 5); | |
249 | } | |
250 | else {//EMCAL | |
251 | anaphoton->SetNCellCut(1); | |
252 | anaphoton->SetMinPt(0.); | |
253 | //if(!kUseKinematics) anaphoton->SetTimeCut(400,900);// Time window of [400-900] ns | |
254 | anaphoton->SetMinDistanceToBadChannel(1, 2, 3); | |
255 | } | |
256 | anaphoton->SetCalorimeter(calorimeter); | |
257 | if(kUseKinematics) anaphoton->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
258 | else anaphoton->SwitchOffDataMC() ; | |
259 | anaphoton->SwitchOffCaloPID(); | |
260 | anaphoton->SwitchOffFiducialCut(); | |
261 | if(kSimulation){ | |
262 | anaphoton->SwitchOnFiducialCut(); | |
263 | AliFiducialCut * fidCut1stYear = anaphoton->GetFiducialCut(); | |
264 | fidCut1stYear->DoCTSFiducialCut(kFALSE) ; | |
265 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
266 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
267 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
268 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
269 | } | |
270 | ||
271 | if(!inputDataType.Contains("delta")) { | |
272 | anaphoton->SetOutputAODName(Form("Photons%s",calorimeter.Data())); | |
273 | anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
274 | } | |
275 | else anaphoton->SetInputAODName(Form("Photons%s",calorimeter.Data())); | |
276 | anaphoton->AddToHistogramsName("AnaPhotonCorr_"); | |
277 | //Set Histograms bins and ranges | |
278 | anaphoton->SetHistoPtRangeAndNBins(0, 20, 200) ; | |
279 | if(kPrintSettings) anaphoton->Print(""); | |
280 | ||
281 | // ----------------------------------- | |
282 | // --- Pi0 Invariant Mass Analysis --- | |
283 | // ----------------------------------- | |
284 | ||
285 | AliAnaPi0 *anapi0 = new AliAnaPi0(); | |
286 | anapi0->SetDebug(-1);//10 for lots of messages | |
287 | anapi0->SetInputAODName(Form("Photons%s",calorimeter.Data())); | |
288 | anapi0->SetCalorimeter(calorimeter); | |
289 | anapi0->SwitchOnMultipleCutAnalysis(); | |
290 | if(kSimulation){ | |
291 | anapi0->SwitchOnFiducialCut(); | |
292 | AliFiducialCut * fidCut1stYear = anapi0->GetFiducialCut(); | |
293 | fidCut1stYear->DoCTSFiducialCut(kFALSE) ; | |
294 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
295 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
296 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
297 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
298 | } | |
299 | ||
300 | //settings for pp collision | |
301 | anapi0->SwitchOnOwnMix(); | |
302 | anapi0->SwitchOnEventSelection() ; | |
303 | anapi0->SetNCentrBin(1); | |
304 | //anapi0->SetMultiplicity(80, 120); | |
305 | anapi0->SetMultiBin(1); | |
306 | if(kUseKinematics)anapi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
307 | else anapi0->SwitchOffDataMC() ; | |
308 | if(calorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year | |
309 | else anapi0->SetNumberOfModules(4); //EMCAL first year | |
310 | anapi0->SetHistoPtRangeAndNBins(0, 20, 40) ; | |
311 | //anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
312 | //anapi0->SetHistoEtaRangeAndNBins(-0.8, 0.8, 200) ; | |
313 | anapi0->SetHistoMassRangeAndNBins(0., 0.9, 300) ; | |
314 | anapi0->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ; | |
315 | anapi0->SetHistoTrackMultiplicityRangeAndNBins(0, 200, 20); | |
316 | ||
317 | if(kPrintSettings) anapi0->Print(""); | |
318 | ||
319 | //--------------------------- | |
320 | //Pi0, event by event | |
321 | //--------------------------- | |
322 | ||
323 | AliAnaPi0EbE *anapi0ebe = new AliAnaPi0EbE(); | |
324 | anapi0ebe->SwitchOffEventSelection() ; | |
325 | //anapi0ebe->SetMultiplicity(80, 120); | |
326 | anapi0ebe->SetMultiBin(1); | |
327 | anapi0ebe->SetDebug(-1);//10 for lots of messages | |
328 | anapi0ebe->SetAnalysisType(AliAnaPi0EbE::kIMCalo); | |
329 | anapi0ebe->SetMinPt(0); | |
330 | anapi0ebe->SetCalorimeter(calorimeter); | |
331 | anapi0ebe->SetInputAODName(Form("Photons%s",calorimeter.Data())); | |
332 | if(!inputDataType.Contains("delta")) { | |
333 | anapi0ebe->SetOutputAODName(Form("Pi0s%s",calorimeter.Data())); | |
334 | anapi0ebe->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
335 | } | |
336 | else anapi0ebe->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
337 | ||
338 | if(kUseKinematics) anapi0ebe->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
339 | else anapi0ebe->SwitchOffDataMC() ; | |
340 | ||
341 | AliNeutralMesonSelection *nms = anapi0ebe->GetNeutralMesonSelection(); | |
342 | nms->SetInvMassCutRange(0.08, 0.18) ; | |
343 | nms->KeepNeutralMesonSelectionHistos(kTRUE); | |
344 | //Set Histrograms bins and ranges | |
345 | if(calorimeter=="EMCAL" ){ | |
346 | nms->SetHistoERangeAndNBins(0, 15, 150) ; | |
347 | anapi0ebe->SetHistoPtRangeAndNBins(0, 30, 60) ; | |
348 | } | |
349 | else{ | |
350 | nms->SetHistoERangeAndNBins(0, 30, 200) ; | |
351 | anapi0ebe->SetHistoPtRangeAndNBins(0, 30, 100) ; | |
352 | } | |
353 | // nms->SetHistoPtRangeAndNBins(0, 50, 100) ; | |
354 | // nms->SetHistoAngleRangeAndNBins(0, 0.3, 100) ; | |
355 | // nsm->SetHistoIMRangeAndNBins(0, 0.4, 100) ; | |
356 | //Set Histrograms bins and ranges | |
357 | // anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
358 | // anapi0->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
359 | if(kPrintSettings) anapi0ebe->Print(""); | |
360 | ||
361 | //------------------------------------- | |
362 | //*** analysis the omega->pi0+gamma *** | |
363 | //------------------------------------ | |
364 | AliAnaOmegaToPi0Gamma *anaomegaToPi0Gamma = new AliAnaOmegaToPi0Gamma(); | |
365 | anaomegaToPi0Gamma->SetDebug(-1);//10 for lots of messages | |
366 | anaomegaToPi0Gamma->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
367 | anaomegaToPi0Gamma->SetInputAODPhotonName(Form("Photons%s",calorimeter.Data())); | |
368 | anaomegaToPi0Gamma->SetNPID(1); | |
369 | anaomegaToPi0Gamma->SetNVtxZ(1); | |
370 | anaomegaToPi0Gamma->SetNEventsMixed(4); | |
371 | if(calorimeter=="PHOS") | |
372 | anaomegaToPi0Gamma->SetPi0MassPeakWidthCut(0.008); // PHOS | |
373 | else if(calorimeter=="EMCAL") | |
374 | anaomegaToPi0Gamma->SetPi0MassPeakWidthCut(0.012); // EMCAL | |
375 | anaomegaToPi0Gamma->SetHistoPtRangeAndNBins(0, 20, 100) ; | |
376 | anaomegaToPi0Gamma->SetHistoMassRangeAndNBins(0, 1, 100) ; | |
377 | anaomegaToPi0Gamma->SetPi0OverOmegaPtCut(0.8); | |
378 | anaomegaToPi0Gamma->SetGammaOverOmegaPtCut(0.2); | |
379 | if(kUseKinematics) anaomegaToPi0Gamma->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
380 | else anaomegaToPi0Gamma->SwitchOffDataMC() ;//Access MC stack and fill more histograms | |
381 | anaomegaToPi0Gamma->AddToHistogramsName(Form("AnaOmegaToPi0Gamma%s_",calorimeter.Data())); | |
382 | if(kPrintSettings) anaomegaToPi0Gamma->Print(""); | |
383 | ||
384 | ||
385 | // //--------------------------------------------------------------------- | |
386 | // // Electron/btag | |
387 | // //--------------------------------------------------------------------- | |
388 | // if(calorimeter=="EMCAL"){ | |
389 | // | |
390 | // AliAnaBtag *anabtag = new AliAnaBtag(); | |
391 | // anabtag->SetDebug(-1); //10 for lots of messages | |
392 | // if(kUseKinematics){ | |
393 | // anabtag->SwitchOnDataMC(); | |
394 | // anabtag->SetMinPt(1.); | |
395 | // } | |
396 | // anabtag->SetOutputAODName("ElectronsEMCAL"); | |
397 | // anabtag->SetOutputAODClassName("AliAODPWG4Particle"); | |
398 | // //anabtag->SetHistoPtRangeAndNBins(0, 100, 100) ; | |
399 | // //anabtag->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
400 | // //anabtag->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
401 | // if(kPrintSettings)anabtag->Print(""); | |
402 | // } | |
403 | ||
404 | //================================== | |
405 | // ### Isolation analysis ### | |
406 | //================================= | |
407 | //Photon | |
408 | AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation(); | |
409 | anaisol->SetDebug(-1); | |
410 | anaisol->SetMinPt(0); | |
411 | anaisol->SetInputAODName(Form("Photons%s",calorimeter.Data())); | |
412 | anaisol->SetAODObjArrayName("ICPhoton"); | |
413 | anaisol->SetCalorimeter(calorimeter); | |
414 | if(kUseKinematics) anaisol->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
415 | else anaisol->SwitchOffDataMC() ; | |
416 | //Select clusters with no pair, if both clusters with pi0 mass | |
417 | anaisol->SwitchOffInvariantMass(); | |
418 | //Do isolation cut | |
419 | AliIsolationCut * ic = anaisol->GetIsolationCut(); | |
420 | ic->SetConeSize(0.4); | |
421 | ic->SetPtThreshold(0.7); | |
422 | ic->SetPtFraction(0.1); | |
423 | ic->SetSumPtThreshold(1.0) ; | |
424 | ic->SetParticleTypeInCone(AliIsolationCut::kOnlyCharged); | |
425 | ic->SetICMethod(AliIsolationCut::kSumPtFracIC); | |
426 | if(kPrintSettings) ic->Print(""); | |
427 | ||
428 | //Do or not do isolation with previously produced AODs. | |
429 | //No effect if use of SwitchOnSeveralIsolation() | |
430 | anaisol->SwitchOffReIsolation(); | |
431 | //Multiple IC | |
432 | anaisol->SwitchOffSeveralIsolation() ; | |
433 | //Set Histograms bins and ranges | |
434 | anaisol->SetHistoPtRangeAndNBins(0, 50, 200) ; | |
435 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
436 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
437 | anaisol->AddToHistogramsName("AnaIsolPhoton_"); | |
438 | if(kPrintSettings) anaisol->Print(""); | |
439 | ||
440 | //Pi0 | |
441 | AliAnaParticleIsolation *anaisolpi0 = new AliAnaParticleIsolation(); | |
442 | anaisolpi0->SetDebug(-1); | |
443 | anaisolpi0->SetMinPt(0); | |
444 | anaisolpi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
445 | anaisolpi0->AddToHistogramsName("AnaIsolPi0_"); | |
446 | anaisolpi0->SetAODObjArrayName("ICPi0"); | |
447 | anaisolpi0->SetCalorimeter(calorimeter); | |
448 | if(kUseKinematics) anaisolpi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
449 | else anaisolpi0->SwitchOffDataMC() ; | |
450 | //Select clusters with no pair, if both clusters with pi0 mass | |
451 | anaisolpi0->SwitchOffInvariantMass(); | |
452 | //Do isolation cut | |
453 | AliIsolationCut * ic2 = anaisolpi0->GetIsolationCut(); | |
454 | ic2->SetConeSize(0.4); | |
455 | ic2->SetPtThreshold(0.7); | |
456 | ic2->SetPtFraction(0.1); | |
457 | ic2->SetSumPtThreshold(1.0) ; | |
458 | ic2->SetICMethod(AliIsolationCut::kSumPtFracIC); | |
459 | ic2->SetParticleTypeInCone(AliIsolationCut::kOnlyCharged); | |
460 | if(kPrintSettings) ic2->Print(""); | |
461 | //Do or not do isolation with previously produced AODs. | |
462 | //No effect if use of SwitchOnSeveralIsolation() | |
463 | anaisolpi0->SwitchOffReIsolation(); | |
464 | //Multiple IC | |
465 | anaisolpi0->SwitchOffSeveralIsolation() ; | |
466 | //Set Histograms bins and ranges | |
467 | anaisolpi0->SetHistoPtRangeAndNBins(0, 50, 200) ; | |
468 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
469 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
470 | if(kPrintSettings) anaisolpi0->Print(""); | |
471 | ||
472 | //=========================== | |
473 | //Correlation analysis | |
474 | //=========================== | |
475 | ||
476 | // ### Correlation with Jet Finder AOD output | |
477 | AliAnaParticleJetFinderCorrelation *anacorrjet = new AliAnaParticleJetFinderCorrelation(); | |
478 | anacorrjet->SetInputAODName(Form("Photons%s",calorimeter.Data())); | |
479 | anacorrjet->SwitchOffFiducialCut(); | |
480 | anacorrjet->SetDebug(-1); | |
481 | anacorrjet->SetConeSize(1); | |
482 | anacorrjet->SelectIsolated(kTRUE); // do correlation with isolated photons | |
483 | anacorrjet->SetPtThresholdInCone(0.2); | |
484 | anacorrjet->SetDeltaPhiCutRange(0.5,5.5);//Mostly Open Cuts | |
485 | anacorrjet->SetRatioCutRange(0.01,3); //Mostly Open Cuts | |
486 | anacorrjet->UseJetRefTracks(kFALSE); //Not working now | |
487 | //Set Histograms bins and ranges | |
488 | anacorrjet->SetHistoPtRangeAndNBins(0, 50, 200) ; | |
489 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
490 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
491 | if(kPrintSettings) anacorrjet->Print(""); | |
492 | ||
493 | // ### Correlation with hadrons | |
494 | AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation(); | |
495 | anacorrhadron->SetInputAODName(Form("Photons%s",calorimeter.Data())); | |
496 | anacorrhadron->AddToHistogramsName("AnaHadronCorrPhoton_"); | |
497 | anacorrhadron->SetAODObjArrayName("PhotonHadronCorr"); | |
498 | anacorrhadron->SetDebug(-1); | |
499 | anacorrhadron->SwitchOffCaloPID(); | |
500 | if(kSimulation){ | |
501 | anacorrhadron->SwitchOnFiducialCut(); | |
502 | AliFiducialCut * fidCut1stYear = anacorrhadron->GetFiducialCut(); | |
503 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
504 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
505 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
506 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
507 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
508 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
509 | } | |
510 | anacorrhadron->SwitchOnDecayCorr(); | |
511 | anacorrhadron->SetMultiBin(1); | |
512 | anacorrhadron->SwitchOffNeutralCorr(); | |
513 | anacorrhadron->SwitchOffEventSelection(); | |
514 | anacorrhadron->SetPtCutRange(0.1,100); | |
515 | anacorrhadron->SetDeltaPhiCutRange(1.5,4.5); | |
516 | anacorrhadron->SwitchOnSeveralUECalculation(); | |
517 | anacorrhadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
518 | anacorrhadron->SelectIsolated(kFALSE); // do correlation with isolated photons | |
519 | if(kUseKinematics) anacorrhadron->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
520 | else anacorrhadron->SwitchOffDataMC() ; | |
521 | //if(calorimeter=="PHOS"){ | |
522 | //Correlate with particles in EMCAL | |
523 | //anacorrhadron->SwitchOnCaloPID(); | |
524 | //anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
525 | //} | |
526 | //Set Histograms bins and ranges | |
527 | anacorrhadron->SetHistoPtRangeAndNBins(0, 50, 200) ; | |
528 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
529 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
530 | if(kPrintSettings) anacorrhadron->Print(""); | |
531 | ||
532 | // ### Correlation with hadrons | |
533 | AliAnaParticleHadronCorrelation *anacorrisohadron = new AliAnaParticleHadronCorrelation(); | |
534 | anacorrisohadron->SetInputAODName(Form("Photons%s",calorimeter.Data())); | |
535 | anacorrisohadron->AddToHistogramsName("AnaHadronCorrIsoPhoton_"); | |
536 | anacorrisohadron->SetAODObjArrayName("IsoPhotonHadronCorr"); | |
537 | anacorrisohadron->SetDebug(-1); | |
538 | anacorrisohadron->SwitchOffCaloPID(); | |
539 | if(kSimulation){ | |
540 | anacorrisohadron->SwitchOnFiducialCut(); | |
541 | AliFiducialCut * fidCut1stYear = anacorrisohadron->GetFiducialCut(); | |
542 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
543 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
544 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
545 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
546 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
547 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
548 | } | |
549 | anacorrisohadron->SwitchOnDecayCorr(); | |
550 | anacorrisohadron->SetMultiBin(1); | |
551 | anacorrisohadron->SwitchOffNeutralCorr(); | |
552 | anacorrisohadron->SwitchOffEventSelection(); | |
553 | anacorrisohadron->SetPtCutRange(0.1,100); | |
554 | anacorrisohadron->SetDeltaPhiCutRange(1.5,4.5); | |
555 | anacorrisohadron->SwitchOnSeveralUECalculation(); | |
556 | anacorrisohadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
557 | anacorrisohadron->SelectIsolated(kTRUE); // do correlation with isolated photons | |
558 | if(kUseKinematics) anacorrisohadron->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
559 | else anacorrisohadron->SwitchOffDataMC() ; | |
560 | //if(calorimeter=="PHOS"){ | |
561 | //Correlate with particles in EMCAL | |
562 | //anacorrhadron->SwitchOnCaloPID(); | |
563 | //anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
564 | //} | |
565 | //Set Histograms bins and ranges | |
566 | anacorrisohadron->SetHistoPtRangeAndNBins(0, 50, 200) ; | |
567 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
568 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
569 | if(kPrintSettings) anacorrisohadron->Print(""); | |
570 | ||
571 | ||
572 | // ### Pi0 Correlation with hadrons, not isolated | |
573 | AliAnaParticleHadronCorrelation *anacorrhadronpi0 = new AliAnaParticleHadronCorrelation(); | |
574 | anacorrhadronpi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
575 | anacorrhadronpi0->AddToHistogramsName("AnaHadronCorrPi0_"); | |
576 | anacorrhadronpi0->SetAODObjArrayName("Pi0HadronCorr"); | |
577 | anacorrhadronpi0->SetDebug(-1); | |
578 | anacorrhadronpi0->SwitchOffCaloPID(); | |
579 | if(kSimulation){ | |
580 | anacorrhadronpi0->SwitchOnFiducialCut(); | |
581 | AliFiducialCut * fidCut1stYear = anacorrhadronpi0->GetFiducialCut(); | |
582 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
583 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
584 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
585 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
586 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
587 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
588 | } | |
589 | anacorrhadronpi0->SwitchOnDecayCorr(); | |
590 | anacorrhadronpi0->SetMultiBin(1); | |
591 | anacorrhadronpi0->SwitchOffNeutralCorr(); | |
592 | anacorrhadronpi0->SwitchOffEventSelection(); | |
593 | anacorrhadronpi0->SetPtCutRange(0.1,100); | |
594 | anacorrhadronpi0->SetDeltaPhiCutRange(1.5,4.5); | |
595 | anacorrhadronpi0->SelectIsolated(kFALSE); // do correlation with non isolated pi0 | |
596 | anacorrhadronpi0->SwitchOnSeveralUECalculation(); | |
597 | anacorrhadronpi0->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
598 | if(kUseKinematics) anacorrhadronpi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
599 | else anacorrhadronpi0->SwitchOffDataMC() ; | |
600 | //if(calorimeter=="PHOS"){ | |
601 | // //Correlate with particles in EMCAL | |
602 | // anacorrhadronpi0->SwitchOnCaloPID(); | |
603 | // anacorrhadronpi0->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
604 | //} | |
605 | //Set Histograms bins and ranges | |
606 | anacorrhadronpi0->SetHistoPtRangeAndNBins(0, 50, 200) ; | |
607 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
608 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
609 | if(kPrintSettings) anacorrhadronpi0->Print(""); | |
610 | ||
611 | // ### Pi0 Correlation with hadrons, isolated | |
612 | AliAnaParticleHadronCorrelation *anacorrhadronisopi0 = new AliAnaParticleHadronCorrelation(); | |
613 | anacorrhadronisopi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data())); | |
614 | anacorrhadronisopi0->AddToHistogramsName("AnaHadronCorrIsoPi0_"); | |
615 | anacorrhadronisopi0->SetAODObjArrayName("IsoPi0HadronCorr"); | |
616 | anacorrhadronisopi0->SetDebug(-1); | |
617 | anacorrhadronisopi0->SwitchOffCaloPID(); | |
618 | if(kSimulation){ | |
619 | anacorrhadronisopi0->SwitchOnFiducialCut(); | |
620 | AliFiducialCut * fidCut1stYear = anacorrhadronisopi0->GetFiducialCut(); | |
621 | fidCut1stYear->DoEMCALFiducialCut(kTRUE) ; | |
622 | fidCut1stYear->DoPHOSFiducialCut(kTRUE) ; | |
623 | fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.); | |
624 | fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.); | |
625 | fidCut1stYear->DoCTSFiducialCut(kTRUE) ; | |
626 | fidCut1stYear->SetSimpleCTSFiducialCut(0.8,0.,360.); | |
627 | } | |
628 | anacorrhadronisopi0->SwitchOnDecayCorr(); | |
629 | anacorrhadronisopi0->SetMultiBin(1); | |
630 | anacorrhadronisopi0->SwitchOffNeutralCorr(); | |
631 | anacorrhadronisopi0->SwitchOffEventSelection(); | |
632 | anacorrhadronisopi0->SetPtCutRange(0.1,100); | |
633 | anacorrhadronisopi0->SetDeltaPhiCutRange(1.5,4.5); | |
634 | anacorrhadronisopi0->SelectIsolated(kTRUE); // do correlation with isolated pi0 | |
635 | anacorrhadronisopi0->SwitchOnSeveralUECalculation(); | |
636 | anacorrhadronisopi0->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); | |
637 | if(kUseKinematics) anacorrhadronisopi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms | |
638 | else anacorrhadronisopi0->SwitchOffDataMC() ; | |
639 | //if(calorimeter=="PHOS"){ | |
640 | // //Correlate with particles in EMCAL | |
641 | // anacorrhadronpi0->SwitchOnCaloPID(); | |
642 | // anacorrhadronpi0->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
643 | //} | |
644 | //Set Histograms bins and ranges | |
645 | anacorrhadronisopi0->SetHistoPtRangeAndNBins(0, 50, 200) ; | |
646 | // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; | |
647 | // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; | |
648 | if(kPrintSettings) anacorrhadronisopi0->Print(""); | |
649 | ||
650 | ||
651 | // #### Configure Maker #### | |
652 | AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker(); | |
653 | maker->SetReader(reader);//pointer to reader | |
654 | maker->SetCaloUtils(cu); //pointer to calorimeter utils | |
655 | ||
656 | ||
657 | Int_t n = 0;//Analysis number, order is important | |
658 | // Particle selection analysis | |
659 | maker->AddAnalysis(anaphoton,n++); | |
660 | //maker->AddAnalysis(anapi0,n++); | |
661 | maker->AddAnalysis(anapi0ebe,n++); | |
662 | // maker->AddAnalysis(anaomegaToPi0Gamma,n++); | |
663 | //if(calorimeter=="EMCAL")maker->AddAnalysis(anabtag,n++); | |
664 | // Isolation analysis | |
665 | maker->AddAnalysis(anaisol,n++); | |
666 | maker->AddAnalysis(anaisolpi0,n++); | |
667 | // Correlation analysis | |
668 | // maker->AddAnalysis(anacorrjet,n++); | |
669 | maker->AddAnalysis(anacorrhadron,n++); | |
670 | maker->AddAnalysis(anacorrhadronpi0,n++); | |
671 | maker->AddAnalysis(anacorrisohadron,n++); | |
672 | maker->AddAnalysis(anacorrhadronisopi0,n); | |
673 | maker->SetAnaDebug(0) ; | |
674 | maker->SwitchOnHistogramsMaker() ; | |
675 | if(inputDataType.Contains("delta")) maker->SwitchOffAODsMaker() ; | |
676 | else maker->SwitchOnAODsMaker() ; | |
677 | ||
678 | if(kPrintSettings) maker->Print(""); | |
679 | ||
680 | printf("======================== \n"); | |
681 | printf(" End Configuration of PartCorr analysis with detector %s \n",calorimeter.Data()); | |
682 | printf("======================== \n"); | |
683 | ||
684 | // Create task | |
685 | //=========================================================================== | |
686 | AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation (Form("PartCorr%s",calorimeter.Data())); | |
687 | task->SetConfigFileName(""); //Don't configure the analysis via configuration file. | |
688 | //task->SetDebugLevel(-1); | |
689 | task->SetAnalysisMaker(maker); | |
690 | if(inputDataType=="ESD" && !kSimulation) task->SelectCollisionCandidates(); //AliPhysicsSelection has to be attached before. | |
691 | mgr->AddTask(task); | |
692 | ||
693 | //Create containers | |
694 | char name[128]; | |
695 | sprintf(name,"PartCorr_%s",calorimeter.Data()); | |
696 | cout<<"Name of task "<<name<<endl; | |
697 | //AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form(name),TList::Class(), | |
698 | // AliAnalysisManager::kOutputContainer, Form("PartCorr_%s.root",calorimeter.Data())); | |
699 | ||
700 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
701 | ||
702 | // AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form("PartCorr_%s",calorimeter.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PartCorr_%s",outputfile.Data(),calorimeter.Data())); | |
703 | AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(calorimeter.Data(), TList::Class(), | |
704 | AliAnalysisManager::kOutputContainer, | |
705 | Form("%s:PartCorr",outputfile.Data())); | |
706 | ||
707 | AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("%sCuts",calorimeter.Data()), TList::Class(), | |
708 | AliAnalysisManager::kParamContainer, | |
709 | Form("%s:PartCorrCuts",outputfile.Data())); | |
710 | ||
711 | // Create ONLY the output containers for the data produced by the task. | |
712 | // Get and connect other common input/output containers via the manager as below | |
713 | //============================================================================== | |
714 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
715 | // AOD output slot will be used in a different way in future | |
716 | if(!inputDataType.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
717 | mgr->ConnectOutput (task, 1, cout_pc); | |
718 | mgr->ConnectOutput (task, 2, cout_cuts); | |
719 | ||
720 | return task; | |
721 | } |