AliPhysics  vAN-20150822 (d56cf94)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskEMCALPi0CalibSelection.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 
4  * Permission to use, copy, modify and distribute this software and its *
5  * documentation strictly for non-commercial purposes is hereby granted *
6  * without fee, provided that the above copyright notice appears in all *
7  * copies and that both the copyright notice and this permission notice *
8  * appear in the supporting documentation. The authors make no claims *
9  * about the suitability of this software for any purpose. It is *
10  * provided "as is" without express or implied warranty. *
11  **************************************************************************/
12 
13 // Root
14 #include <TRefArray.h>
15 #include <TList.h>
16 #include <TH1F.h>
17 #include <TGeoManager.h>
18 #include <TFile.h>
19 
20 // AliRoot
22 #include "AliAODEvent.h"
23 #include "AliESDEvent.h"
24 #include "AliEMCALGeometry.h"
25 #include "AliVCluster.h"
26 #include "AliVCaloCells.h"
27 #include "AliEMCALRecoUtils.h"
28 #include "AliOADBContainer.h"
29 
33 
36 //______________________________________________________________________________________________
38 AliAnalysisTaskSE(name),
39 fEMCALGeo(0x0), fLoadMatrices(0),
40 fEMCALGeoName("EMCAL_COMPLETE12SMV1_DCAL_8SM"),
41 fTriggerName("EMC"),
42 fRecoUtils(new AliEMCALRecoUtils),
43 fOADBFilePath(""), fCalibFilePath(""),
44 fCorrectClusters(kFALSE), fRecalPosition(kTRUE),
45 fCaloClustersArr(0x0), fEMCALCells(0x0),
46 fCuts(0x0), fOutputContainer(0x0),
47 fVertex(), fFilteredInput(kFALSE),
48 fEmin(0.5), fEmax(15.),
49 fL0min(0.01), fL0max(0.5),
50 fDTimeCut(100.), fTimeMax(1000000), fTimeMin(-1000000),
51 fAsyCut(1.), fMinNCells(2), fGroupNCells(0),
52 fLogWeight(4.5), fSameSM(kFALSE),
53 fNMaskCellColumns(11), fMaskCellColumns(0x0),
54 fInvMassCutMin(110.), fInvMassCutMax(160.),
55 // Histograms binning
56 fNbins(300),
57 fMinBin(0.), fMaxBin(300.),
58 fNTimeBins(1000), fMinTimeBin(0.), fMaxTimeBin(1000.),
59 // Temporal
60 fMomentum1(), fMomentum2(), fMomentum12(),
61 // Histograms
62 fHmgg(0x0), fHmggDifferentSM(0x0),
63 fHmggMaskFrame(0x0), fHmggDifferentSMMaskFrame(0x0),
64 fHOpeningAngle(0x0), fHOpeningAngleDifferentSM(0x0),
65 fHAsymmetry(0x0), fHAsymmetryDifferentSM(0x0),
66 fhNEvents(0x0),
67 fhClusterTime(0x0), fhClusterPairDiffTime(0x0)
68 {
69  for(Int_t iMod=0; iMod < AliEMCALGeoParams::fgkEMCALModules; iMod++)
70  {
71  for(Int_t iX=0; iX<24; iX++)
72  {
73  for(Int_t iZ=0; iZ<48; iZ++)
74  {
75  fHmpi0[iMod][iZ][iX] = 0 ;
76  }
77  }
78  }
79 
80  fVertex[0]=fVertex[1]=fVertex[2]=-1000;
81 
82  fHTpi0[0]= 0 ;
83  fHTpi0[1]= 0 ;
84  fHTpi0[2]= 0 ;
85  fHTpi0[3]= 0 ;
86 
88  fMaskCellColumns[0] = 6 ; fMaskCellColumns[1] = 7 ; fMaskCellColumns[2] = 8 ;
89  fMaskCellColumns[3] = 35; fMaskCellColumns[4] = 36; fMaskCellColumns[5] = 37;
90  fMaskCellColumns[6] = 12+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[7] = 13+AliEMCALGeoParams::fgkEMCALCols;
91  fMaskCellColumns[8] = 40+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[9] = 41+AliEMCALGeoParams::fgkEMCALCols;
92  fMaskCellColumns[10]= 42+AliEMCALGeoParams::fgkEMCALCols;
93 
94  for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules/2; iSMPair++)
95  {
96  fHmggPairSameSectorSM[iSMPair] = 0;
97  fHmggPairSameSectorSMMaskFrame[iSMPair] = 0;
99  }
100 
101  for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules-2; iSMPair++)
102  {
103  fHmggPairSameSideSM[iSMPair] = 0;
104  fHmggPairSameSideSMMaskFrame[iSMPair] = 0;
105  fhClusterPairDiffTimeSameSide[iSMPair] = 0;
106  }
107 
108  for(Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM++)
109  {
110  fHmggSM[iSM] = 0;
111  fHmggSMMaskFrame[iSM] = 0;
112  fHOpeningAngleSM[iSM] = 0;
113  fHOpeningAnglePairSM[iSM] = 0;
114  fHAsymmetrySM[iSM] = 0;
115  fHAsymmetryPairSM[iSM] = 0;
116  fhTowerDecayPhotonHit[iSM] = 0;
117  fhTowerDecayPhotonEnergy[iSM] = 0;
120  fMatrix[iSM] = 0x0;
121  fhClusterTimeSM[iSM] = 0;
123  }
124 
125  DefineOutput(1, TList::Class());
126  DefineOutput(2, TList::Class()); // will contain cuts or local params
127 }
128 
131 //_____________________________________________________________________________
133 {
134  if(fOutputContainer)
135  {
136  fOutputContainer->Delete() ;
137  delete fOutputContainer ;
138  }
139 
140  if(fEMCALGeo) delete fEMCALGeo ;
141  if(fRecoUtils) delete fRecoUtils ;
142  if(fNMaskCellColumns) delete [] fMaskCellColumns;
143 }
144 
148 //____________________________________________________________
150 {
151  if(fRecoUtils->GetParticleType()!=AliEMCALRecoUtils::kPhoton)
152  AliFatal(Form("Wrong particle type for cluster position recalculation! = %d\n", fRecoUtils->GetParticleType()));
153 
154  AliDebug(1,Form("It will use fLogWeight %.3f",fLogWeight));
155 
156  Float_t pos[]={0,0,0};
157 
158  for(Int_t iClu=0; iClu < fCaloClustersArr->GetEntriesFast(); iClu++)
159  {
160  AliVCluster *c1 = (AliVCluster *) fCaloClustersArr->At(iClu);
161 
162  Float_t e1i = c1->E(); // cluster energy before correction
163  if (e1i < fEmin) continue;
164  else if (e1i > fEmax) continue;
165 
166  else if (c1->GetNCells() < fMinNCells) continue;
167 
168  else if (c1->GetM02() < fL0min || c1->GetM02() > fL0max) continue;
169 
170  if(fRecoUtils->ClusterContainsBadChannel(fEMCALGeo, c1->GetCellsAbsId(), c1->GetNCells())) continue;
171 
172  if(DebugLevel() > 2)
173  {
174  AliInfo(Form("Std : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
175  c1->GetPosition(pos);
176  AliInfo(Form("Std : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
177  }
178 
179  // Correct cluster energy and position if requested, and not corrected previously, by default Off
180  if(fRecoUtils->IsRecalibrationOn())
181  {
182  fRecoUtils->RecalibrateClusterEnergy(fEMCALGeo, c1, fEMCALCells);
183  fRecoUtils->RecalculateClusterShowerShapeParameters(fEMCALGeo, fEMCALCells,c1);
184  fRecoUtils->RecalculateClusterPID(c1);
185  }
186 
187  AliDebug(2,Form("Energy: after recalibration %f",c1->E()));
188 
189  // Recalculate cluster position
190  if ( fRecalPosition ) fRecoUtils->RecalculateClusterPosition(fEMCALGeo, fEMCALCells,c1);
191 
192  // Correct Non-Linearity
193  c1->SetE(fRecoUtils->CorrectClusterEnergyLinearity(c1));
194 
195  AliDebug(2,Form("after linearity correction %f",c1->E()));
196 
197  // In case of MC analysis, to match resolution/calibration in real data
198  //c1->SetE(fRecoUtils->SmearClusterEnergy(c1)); // Not needed anymore
199 
200  AliDebug(2,Form("after smearing %f\n",c1->E()));
201 
202  if(DebugLevel() > 2)
203  {
204  AliInfo(Form("Cor : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
205  c1->GetPosition(pos);
206  AliInfo(Form("Cor : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
207  }
208  } // cluster loop
209 }
210 
214 //__________________________________________________________
216 {
217  Int_t absId1 = -1;
218  Int_t iSupMod1 = -1;
219  Int_t iphi1 = -1;
220  Int_t ieta1 = -1;
221  Int_t absId2 = -1;
222  Int_t iSupMod2 = -1;
223  Int_t iphi2 = -1;
224  Int_t ieta2 = -1;
225  Bool_t shared = kFALSE;
226 
227  Float_t pos[] = {0,0,0};
228 
229  Int_t bc = InputEvent()->GetBunchCrossNumber();
230  Int_t nSM = (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
231 
232  for(Int_t iClu=0; iClu<fCaloClustersArr->GetEntriesFast()-1; iClu++)
233  {
234  AliVCluster *c1 = (AliVCluster *) fCaloClustersArr->At(iClu);
235 
236  // Exclude bad channels
237  if(fRecoUtils->ClusterContainsBadChannel(fEMCALGeo, c1->GetCellsAbsId(), c1->GetNCells())) continue;
238 
239  Float_t e1i = c1->E(); // cluster energy before correction
240 
241  if (e1i < fEmin) continue;
242  else if (e1i > fEmax) continue;
243 
244  else if (!fRecoUtils->IsGoodCluster(c1,fEMCALGeo,fEMCALCells,bc)) continue;
245 
246  else if (c1->GetNCells() < fMinNCells) continue;
247 
248  else if (c1->GetM02() < fL0min || c1->GetM02() > fL0max) continue;
249 
250  if(DebugLevel() > 2)
251  {
252  AliInfo(Form("IMA : i %d, E %f, dispersion %f, m02 %f, m20 %f",c1->GetID(),e1i,c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
253  c1->GetPosition(pos);
254  AliInfo(Form("IMA : i %d, x %f, y %f, z %f",c1->GetID(), pos[0], pos[1], pos[2]));
255  }
256 
257  fRecoUtils->GetMaxEnergyCell(fEMCALGeo, fEMCALCells,c1,absId1,iSupMod1,ieta1,iphi1,shared);
258 
259  c1->GetMomentum(fMomentum1,fVertex);
260 
261  // Check if cluster is in fidutial region, not too close to borders
262  Bool_t in1 = fRecoUtils->CheckCellFiducialRegion(fEMCALGeo, c1, fEMCALCells);
263 
264  // Clusters not facing frame structures
265  Bool_t mask1 = MaskFrameCluster(iSupMod1, ieta1);
266  //if(mask1) printf("Reject eta %d SM %d\n",ieta1, iSupMod1);
267 
268  Double_t time1 = c1->GetTOF()*1.e9;
269 
270  if(time1 > fTimeMax || time1 < fTimeMin) continue;
271 
272  fhClusterTime ->Fill(c1->E(),time1);
273  fhClusterTimeSM[iSupMod1]->Fill(c1->E(),time1);
274 
275  // Combine cluster with other clusters and get the invariant mass
276  for (Int_t jClu=iClu+1; jClu < fCaloClustersArr->GetEntriesFast(); jClu++)
277  {
278  AliAODCaloCluster *c2 = (AliAODCaloCluster *) fCaloClustersArr->At(jClu);
279 
280  Float_t e2i = c2->E();
281  if (e2i < fEmin) continue;
282  else if (e2i > fEmax) continue;
283 
284  else if (!fRecoUtils->IsGoodCluster(c2,fEMCALGeo,fEMCALCells,bc))continue;
285 
286  else if (c2->GetNCells() < fMinNCells) continue;
287 
288  else if (c2->GetM02() < fL0min || c2->GetM02() > fL0max) continue;
289 
290  fRecoUtils->GetMaxEnergyCell(fEMCALGeo, fEMCALCells,c2,absId2,iSupMod2,ieta2,iphi2,shared);
291 
292  c2->GetMomentum(fMomentum2,fVertex);
293 
295  Float_t invmass = fMomentum12.M()*1000;
296 
297  //Asimetry cut
298  Float_t asym = TMath::Abs(fMomentum1.E()-fMomentum2.E())/(fMomentum1.E()+fMomentum2.E());
299 
300  if(asym > fAsyCut) continue;
301 
302  //Time cut
303  Double_t time2 = c2->GetTOF()*1.e9;
304 
305  if(time2 > fTimeMax || time2 < fTimeMin) continue;
306 
307  fhClusterPairDiffTime->Fill(fMomentum12.E(),time1-time2);
308  if(TMath::Abs(time1-time2) > fDTimeCut) continue;
309 
310  if(invmass < fMaxBin && invmass > fMinBin )
311  {
312  //Check if cluster is in fidutial region, not too close to borders
313  Bool_t in2 = fRecoUtils->CheckCellFiducialRegion(fEMCALGeo, c2, fEMCALCells);
314 
315  // Clusters not facing frame structures
316  Bool_t mask2 = MaskFrameCluster(iSupMod2, ieta2);
317  //if(mask2) printf("Reject eta %d SM %d\n",ieta2, iSupMod2);
318 
319  if(in1 && in2)
320  {
321  fHmgg->Fill(invmass,fMomentum12.Pt());
322 
323  if(iSupMod1==iSupMod2)
324  {
325  fHmggSM[iSupMod1]->Fill(invmass,fMomentum12.Pt());
326  fhClusterPairDiffTimeSameSM[iSupMod1]->Fill(fMomentum12.E(),time1-time2);
327  }
328  else
329  fHmggDifferentSM ->Fill(invmass,fMomentum12.Pt());
330 
331  // Same sector
332  Int_t j=0;
333  for(Int_t i = 0; i < nSM/2; i++)
334  {
335  j=2*i;
336  if((iSupMod1==j && iSupMod2==j+1) || (iSupMod1==j+1 && iSupMod2==j))
337  {
338  fHmggPairSameSectorSM[i]->Fill(invmass,fMomentum12.Pt());
339  fhClusterPairDiffTimeSameSector[i]->Fill(fMomentum12.E(),time1-time2);
340  }
341  }
342 
343  // Same side
344  for(Int_t i = 0; i < nSM-2; i++)
345  {
346  if((iSupMod1==i && iSupMod2==i+2) || (iSupMod1==i+2 && iSupMod2==i))
347  {
348  fHmggPairSameSideSM[i]->Fill(invmass,fMomentum12.Pt());
349  fhClusterPairDiffTimeSameSide[i]->Fill(fMomentum12.E(),time1-time2);
350  }
351  }
352 
353 
354  if(!mask1 && !mask2)
355  {
356  fHmggMaskFrame->Fill(invmass,fMomentum12.Pt());
357 
358  if(iSupMod1==iSupMod2) fHmggSMMaskFrame[iSupMod1]->Fill(invmass,fMomentum12.Pt());
359  else fHmggDifferentSMMaskFrame ->Fill(invmass,fMomentum12.Pt());
360 
361  // Same sector
362  j=0;
363  for(Int_t i = 0; i < nSM/2; i++)
364  {
365  j=2*i;
366  if((iSupMod1==j && iSupMod2==j+1) || (iSupMod1==j+1 && iSupMod2==j)) fHmggPairSameSectorSMMaskFrame[i]->Fill(invmass,fMomentum12.Pt());
367  }
368 
369  // Same side
370  for(Int_t i = 0; i < nSM-2; i++)
371  {
372  if((iSupMod1==i && iSupMod2==i+2) || (iSupMod1==i+2 && iSupMod2==i)) fHmggPairSameSideSMMaskFrame[i]->Fill(invmass,fMomentum12.Pt());
373  }
374 
375  }// Pair not facing frame
376 
377  if(invmass > fInvMassCutMin && invmass < fInvMassCutMax) //restrict to clusters really close to pi0 peak
378  {
379 
380  // Check time of cells in both clusters, and fill time histogram
381  for(Int_t icell = 0; icell < c1->GetNCells(); icell++)
382  {
383  Int_t absID = c1->GetCellAbsId(icell);
384  fHTpi0[bc%4]->Fill(absID, fEMCALCells->GetCellTime(absID)*1.e9);
385  }
386 
387  for(Int_t icell = 0; icell < c2->GetNCells(); icell++)
388  {
389  Int_t absID = c2->GetCellAbsId(icell);
390  fHTpi0[bc%4]->Fill(absID, fEMCALCells->GetCellTime(absID)*1.e9);
391  }
392 
393  //Opening angle of 2 photons
394  Float_t opangle = fMomentum1.Angle(fMomentum2.Vect())*TMath::RadToDeg();
395  //printf("*******>>>>>>>> In PEAK pt %f, angle %f \n",fMomentum12.Pt(),opangle);
396 
397 
398  fHOpeningAngle ->Fill(opangle,fMomentum12.Pt());
399  fHAsymmetry ->Fill(asym,fMomentum12.Pt());
400 
401  if(iSupMod1==iSupMod2)
402  {
403  fHOpeningAngleSM[iSupMod1] ->Fill(opangle,fMomentum12.Pt());
404  fHAsymmetrySM[iSupMod1] ->Fill(asym,fMomentum12.Pt());
405  }
406  else
407  {
408  fHOpeningAngleDifferentSM ->Fill(opangle,fMomentum12.Pt());
409  fHAsymmetryDifferentSM ->Fill(asym,fMomentum12.Pt());
410  }
411 
412  if((iSupMod1==0 && iSupMod2==2) || (iSupMod1==2 && iSupMod2==0))
413  {
414  fHOpeningAnglePairSM[0] ->Fill(opangle,fMomentum12.Pt());
415  fHAsymmetryPairSM[0] ->Fill(asym,fMomentum12.Pt());
416 
417  }
418  if((iSupMod1==1 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==1))
419  {
420  fHOpeningAnglePairSM[1] ->Fill(opangle,fMomentum12.Pt());
421  fHAsymmetryPairSM[1] ->Fill(asym,fMomentum12.Pt());
422  }
423 
424  if((iSupMod1==0 && iSupMod2==1) || (iSupMod1==1 && iSupMod2==0))
425  {
426  fHOpeningAnglePairSM[2] ->Fill(opangle,fMomentum12.Pt());
427  fHAsymmetryPairSM[2] ->Fill(asym,fMomentum12.Pt());
428  }
429  if((iSupMod1==2 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==2))
430  {
431  fHOpeningAnglePairSM[3] ->Fill(opangle,fMomentum12.Pt());
432  fHAsymmetryPairSM[3] ->Fill(asym,fMomentum12.Pt());
433  }
434 
435  }// pair in 100 < mass < 160
436 
437  }//in acceptance cuts
438 
439  //In case of filling only channels with second cluster in same SM
440  if(fSameSM && iSupMod1!=iSupMod2) continue;
441 
442  if (fGroupNCells == 0)
443  {
444  fHmpi0[iSupMod1][ieta1][iphi1]->Fill(invmass);
445  fHmpi0[iSupMod2][ieta2][iphi2]->Fill(invmass);
446 
447  if(invmass > fInvMassCutMin && invmass < fInvMassCutMax)//restrict to clusters really close to pi0 peak
448  {
449  fhTowerDecayPhotonHit [iSupMod1]->Fill(ieta1,iphi1);
450  fhTowerDecayPhotonEnergy [iSupMod1]->Fill(ieta1,iphi1,fMomentum1.E());
451  fhTowerDecayPhotonAsymmetry[iSupMod1]->Fill(ieta1,iphi1,asym);
452 
453  fhTowerDecayPhotonHit [iSupMod2]->Fill(ieta2,iphi2);
454  fhTowerDecayPhotonEnergy [iSupMod2]->Fill(ieta2,iphi2,fMomentum2.E());
455  fhTowerDecayPhotonAsymmetry[iSupMod2]->Fill(ieta2,iphi2,asym);
456 
457  if(!mask1)fhTowerDecayPhotonHitMaskFrame[iSupMod1]->Fill(ieta1,iphi1);
458  if(!mask2)fhTowerDecayPhotonHitMaskFrame[iSupMod2]->Fill(ieta2,iphi2);
459 
460  }// pair in mass of pi0
461  }
462  else
463  {
464  //printf("Regroup N %d, eta1 %d, phi1 %d, eta2 %d, phi2 %d \n",fGroupNCells, ieta1, iphi1, ieta2, iphi2);
465  for (Int_t i = -fGroupNCells; i < fGroupNCells+1; i++)
466  {
467  for (Int_t j = -fGroupNCells; j < fGroupNCells+1; j++)
468  {
469  Int_t absId11 = fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod1, iphi1+j, ieta1+i);
470  Int_t absId22 = fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod2, iphi2+j, ieta2+i);
471 
472  Bool_t ok1 = kFALSE;
473  Bool_t ok2 = kFALSE;
474 
475  for(Int_t icell = 0; icell < c1->GetNCells(); icell++)
476  {
477  if(c1->GetCellsAbsId()[icell] == absId11) ok1=kTRUE;
478  }
479 
480  for(Int_t icell = 0; icell < c2->GetNCells(); icell++)
481  {
482  if(c2->GetCellsAbsId()[icell] == absId22) ok2=kTRUE;
483  }
484 
485  if(ok1 && (ieta1+i >= 0) && (iphi1+j >= 0) && (ieta1+i < 48) && (iphi1+j < 24))
486  {
487  fHmpi0[iSupMod1][ieta1+i][iphi1+j]->Fill(invmass);
488  }
489 
490  if(ok2 && (ieta2+i >= 0) && (iphi2+j >= 0) && (ieta2+i < 48) && (iphi2+j < 24))
491  {
492  fHmpi0[iSupMod2][ieta2+i][iphi2+j]->Fill(invmass);
493  }
494  }// j loop
495  }//i loop
496  }//group cells
497 
498  AliDebug(1,Form("Mass in (SM%d,%d,%d) and (SM%d,%d,%d): %.3f GeV E1_i=%f E1_ii=%f E2_i=%f E2_ii=%f\n",
499  iSupMod1,iphi1,ieta1,iSupMod2,iphi2,ieta2,fMomentum12.M(),e1i,c1->E(),e2i,c2->E()));
500  }
501  }
502  } // end of loop over EMCAL clusters
503 }
504 
505 
510 //______________________________________________________________________
512 {
513  if ( !fRecoUtils->IsRecalibrationOn() || fCalibFilePath == "" ) return ;
514 
515  TFile * calibFactorsFile = TFile::Open(fCalibFilePath);
516 
517  if ( !calibFactorsFile ) AliFatal("Cannot recover the calibration factors");
518 
519  for(Int_t ism = 0; ism < fEMCALGeo->GetNumberOfSuperModules(); ism++)
520  {
521  TH2F * histo = (TH2F*) calibFactorsFile->Get(Form("EMCALRecalFactors_SM%d",ism));
522 
523  if ( histo )
524  fRecoUtils->SetEMCALChannelRecalibrationFactors(ism,histo);
525  else
526  AliWarning(Form("Null histogram with calibration factors for SM%d, 1 will be used for the full SM!",ism));
527  }
528 }
529 
533 //________________________________________________________________
535 {
536  Int_t runnumber = InputEvent()->GetRunNumber() ;
537 
538  if(fLoadMatrices)
539  {
540  AliInfo("Load user defined EMCAL geometry matrices");
541 
542  // OADB if available
543  AliOADBContainer emcGeoMat("AliEMCALgeo");
544 
545  if(fOADBFilePath=="") fOADBFilePath = "$ALICE_PHYSICS/OADB/EMCAL" ;
546 
547  emcGeoMat.InitFromFile(Form("%s/EMCALlocal2master.root",fOADBFilePath.Data()),"AliEMCALgeo");
548 
549  TObjArray *matEMCAL=(TObjArray*)emcGeoMat.GetObject(runnumber,"EmcalMatrices");
550 
551  for(Int_t mod = 0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
552  {
553  if (!fMatrix[mod]) // Get it from OADB
554  {
555  AliDebug(1,Form("EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
556  //((TGeoHMatrix*) matEMCAL->At(mod))->Print();
557 
558  fMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
559  }
560 
561  if(fMatrix[mod])
562  {
563  if(DebugLevel() > 1)
564  fMatrix[mod]->Print();
565 
566  fEMCALGeo->SetMisalMatrix(fMatrix[mod],mod) ;
567  }
568  else if(gGeoManager)
569  {
570  AliWarning(Form("Set matrix for SM %d from gGeoManager",mod));
571  fEMCALGeo->SetMisalMatrix(fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
572  }
573  else
574  {
575  AliError(Form("Alignment atrix for SM %d is not available",mod));
576  }
577  }//SM loop
578  }//Load matrices
579  else if(!gGeoManager)
580  {
581  AliInfo("Get geo matrices from data");
582  //Still not implemented in AOD, just a workaround to be able to work at least with ESDs
583  if(!strcmp(InputEvent()->GetName(),"AliAODEvent"))
584  {
585  AliWarning("Use ideal geometry, values geometry matrix not kept in AODs");
586  }//AOD
587  else
588  {
589  AliDebug(1,"AliAnalysisTaskEMCALClusterize Load Misaligned matrices");
590 
591  for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
592  {
593  if(DebugLevel() > 1)
594  InputEvent()->GetEMCALMatrix(mod)->Print();
595 
596  if(InputEvent()->GetEMCALMatrix(mod)) fEMCALGeo->SetMisalMatrix(InputEvent()->GetEMCALMatrix(mod),mod) ;
597 
598  }
599  }// ESD
600  }// Load matrices from Data
601 }
602 
606 //______________________________________________________________________
608 {
609  if(!fRecoUtils->IsRunDepRecalibrationOn()) return;
610 
611  AliOADBContainer *contRFTD=new AliOADBContainer("");
612 
613  contRFTD->InitFromFile(Form("%s/EMCALTemperatureCorrCalib.root",fOADBFilePath.Data()),"AliEMCALRunDepTempCalibCorrections");
614 
615  Int_t runnumber = InputEvent()->GetRunNumber() ;
616 
617  TH1S *htd=(TH1S*)contRFTD->GetObject(runnumber);
618 
619  //If it did not exist for this run, get closes one
620  if (!htd)
621  {
622  AliWarning(Form("No TemperatureCorrCalib Objects for run: %d",runnumber));
623 
624  // let's get the closest runnumber instead then..
625  Int_t lower = 0;
626  Int_t ic = 0;
627  Int_t maxEntry = contRFTD->GetNumberOfEntries();
628 
629  while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) < runnumber) )
630  {
631  lower = ic;
632  ic++;
633  }
634 
635  Int_t closest = lower;
636  if ( (ic<maxEntry) &&
637  (contRFTD->LowerLimit(ic)-runnumber) < (runnumber - contRFTD->UpperLimit(lower)) )
638  {
639  closest = ic;
640  }
641 
642  AliWarning(Form("TemperatureCorrCalib Objects found closest id %d from run: %d",
643  closest, contRFTD->LowerLimit(closest)));
644 
645  htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
646  }
647 
648  // Fill parameters
649  if(htd)
650  {
651  AliInfo("Recalibrate (Temperature) EMCAL");
652 
653  Int_t nSM = fEMCALGeo->GetNumberOfSuperModules();
654 
655  for (Int_t ism = 0; ism < nSM; ++ism)
656  {
657  for (Int_t icol = 0; icol < 48; ++icol)
658  {
659  for (Int_t irow = 0; irow < 24; ++irow)
660  {
661  Float_t factor = fRecoUtils->GetEMCALChannelRecalibrationFactor(ism,icol,irow);
662 
663  Int_t absID = fEMCALGeo->GetAbsCellIdFromCellIndexes(ism, irow, icol); // original calibration factor
664 
665  AliDebug(3,Form(" ism %d, icol %d, irow %d,absID %d - Calib factor %1.5f - ",ism, icol, irow, absID, factor));
666 
667  factor *= htd->GetBinContent(absID) / 10000. ; // correction dependent on T
668 
669  fRecoUtils->SetEMCALChannelRecalibrationFactor(ism,icol,irow,factor);
670 
671  AliDebug(3,Form("T factor %1.5f - final factor %1.5f",
672  htd->GetBinContent(absID) / 10000.,
673  fRecoUtils->GetEMCALChannelRecalibrationFactor(ism,icol,irow)));
674  } // columns
675  } // rows
676  } // SM loop
677  }
678  else AliInfo("Do NOT recalibrate EMCAL with T variations, no params TH1");
679 
680  delete contRFTD;
681 }
682 
683 
686 //___________________________________________________________________
688 {
689  fEMCALGeo = AliEMCALGeometry::GetInstance(fEMCALGeoName) ;
690  Int_t nSM = (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
691 
692  fOutputContainer = new TList();
693  const Int_t buffersize = 255;
694  char hname[buffersize], htitl[buffersize];
695 
696  fhNEvents = new TH1I("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
698 
699  fHmgg = new TH2F("hmgg","2-cluster invariant mass",fNbins,fMinBin,fMaxBin,100,0,10);
700  fHmgg->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
701  fHmgg->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
702  fOutputContainer->Add(fHmgg);
703 
704  fHmggDifferentSM = new TH2F("hmggDifferentSM","2-cluster invariant mass, different SM",fNbins,fMinBin,fMaxBin,100,0,10);
705  fHmggDifferentSM->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
706  fHmggDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
708 
709  fHOpeningAngle = new TH2F("hopang","2-cluster opening angle",100,0.,50.,100,0,10);
710  fHOpeningAngle->SetXTitle("#alpha_{#gamma #gamma}");
711  fHOpeningAngle->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
713 
714  fHOpeningAngleDifferentSM = new TH2F("hopangDifferentSM","2-cluster opening angle, different SM",100,0,50.,100,0,10);
715  fHOpeningAngleDifferentSM->SetXTitle("#alpha_{#gamma #gamma}");
716  fHOpeningAngleDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
718 
719  fHAsymmetry = new TH2F("hasym","2-cluster opening angle",100,0.,1.,100,0,10);
720  fHAsymmetry->SetXTitle("a");
721  fHAsymmetry->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
723 
724  fHAsymmetryDifferentSM = new TH2F("hasymDifferentSM","2-cluster opening angle, different SM",100,0,1.,100,0,10);
725  fHAsymmetryDifferentSM->SetXTitle("a");
726  fHAsymmetryDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
728 
729  //TString pairname[] = {"A side (0-2)", "C side (1-3)","Row 0 (0-1)", "Row 1 (2-3)"};
730 
731  fHmggMaskFrame = new TH2F("hmggMaskFrame","2-cluster invariant mass, frame masked",fNbins,fMinBin,fMaxBin,100,0,10);
732  fHmggMaskFrame->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
733  fHmggMaskFrame->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
735 
736  fHmggDifferentSMMaskFrame = new TH2F("hmggDifferentSMMaskFrame","2-cluster invariant mass, different SM, frame masked",
737  fNbins,fMinBin,fMaxBin,100,0,10);
738  fHmggDifferentSMMaskFrame->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
739  fHmggDifferentSMMaskFrame->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
741 
742  for(Int_t iSM = 0; iSM < nSM; iSM++)
743  {
744  snprintf(hname, buffersize, "hmgg_SM%d",iSM);
745  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d",iSM);
746  fHmggSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
747  fHmggSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
748  fHmggSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
749  fOutputContainer->Add(fHmggSM[iSM]);
750 
751  snprintf(hname, buffersize, "hmgg_SM%d_MaskFrame",iSM);
752  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d",iSM);
753  fHmggSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
754  fHmggSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
755  fHmggSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
757 
758  if(iSM < nSM/2)
759  {
760  snprintf(hname,buffersize, "hmgg_PairSameSectorSM%d",iSM);
761  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
762  fHmggPairSameSectorSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
763  fHmggPairSameSectorSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
764  fHmggPairSameSectorSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
766 
767  snprintf(hname,buffersize, "hmgg_PairSameSectorSM%d_MaskFrame",iSM);
768  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
769  fHmggPairSameSectorSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
770  fHmggPairSameSectorSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
771  fHmggPairSameSectorSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
773 
774  fhClusterPairDiffTimeSameSector[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSector%d",iSM),
775  Form("cluster pair time difference vs E, Sector %d",iSM),
776  100,0,10, 200,-100,100);
777  fhClusterPairDiffTimeSameSector[iSM]->SetXTitle("E_{pair} (GeV)");
778  fhClusterPairDiffTimeSameSector[iSM]->SetYTitle("#Delta t (ns)");
780  }
781 
782  if(iSM < nSM-2)
783  {
784  snprintf(hname,buffersize, "hmgg_PairSameSideSM%d",iSM);
785  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
786  fHmggPairSameSideSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
787  fHmggPairSameSideSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
788  fHmggPairSameSideSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
790 
791  snprintf(hname,buffersize, "hmgg_PairSameSideSM%d_MaskFrame",iSM);
792  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
793  fHmggPairSameSideSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
794  fHmggPairSameSideSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
795  fHmggPairSameSideSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
797 
798  fhClusterPairDiffTimeSameSide[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSide%d",iSM),
799  Form("cluster pair time difference vs E, Side %d",iSM),
800  100,0,10, 200,-100,100);
801  fhClusterPairDiffTimeSameSide[iSM]->SetXTitle("E_{pair} (GeV)");
802  fhClusterPairDiffTimeSameSide[iSM]->SetYTitle("#Delta t (ns)");
804  }
805 
806  snprintf(hname, buffersize, "hopang_SM%d",iSM);
807  snprintf(htitl, buffersize, "Opening angle for super mod %d",iSM);
808  fHOpeningAngleSM[iSM] = new TH2F(hname,htitl,100,0.,50.,100,0,10);
809  fHOpeningAngleSM[iSM]->SetXTitle("#alpha_{#gamma #gamma} (deg)");
810  fHOpeningAngleSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
812 
813  snprintf(hname,buffersize, "hopang_PairSM%d",iSM);
814  snprintf(htitl,buffersize, "Opening angle for SM pair: %d",iSM);
815  fHOpeningAnglePairSM[iSM] = new TH2F(hname,htitl,100,0.,50.,100,0,10);
816  fHOpeningAnglePairSM[iSM]->SetXTitle("#alpha_{#gamma #gamma} (deg)");
817  fHOpeningAnglePairSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
819 
820  snprintf(hname, buffersize, "hasym_SM%d",iSM);
821  snprintf(htitl, buffersize, "Asymmetry for super mod %d",iSM);
822  fHAsymmetrySM[iSM] = new TH2F(hname,htitl,100,0.,1.,100,0,10);
823  fHAsymmetrySM[iSM]->SetXTitle("a");
824  fHAsymmetrySM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
825  fOutputContainer->Add(fHAsymmetrySM[iSM]);
826 
827  snprintf(hname,buffersize, "hasym_PairSM%d",iSM);
828  snprintf(htitl,buffersize, "Asymmetry for SM pair: %d",iSM);
829  fHAsymmetryPairSM[iSM] = new TH2F(hname,htitl,100,0.,1.,100,0,10);
830  fHAsymmetryPairSM[iSM]->SetXTitle("a");
831  fHAsymmetryPairSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
833 
834  Int_t colmax = 48;
835  Int_t rowmax = 24;
836 
837  fhTowerDecayPhotonHit[iSM] = new TH2F (Form("hTowerDecPhotonHit_Mod%d",iSM),
838  Form("Entries in grid of cells in Module %d",iSM),
839  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
840  fhTowerDecayPhotonHit[iSM]->SetYTitle("row (phi direction)");
841  fhTowerDecayPhotonHit[iSM]->SetXTitle("column (eta direction)");
843 
844  fhTowerDecayPhotonEnergy[iSM] = new TH2F (Form("hTowerDecPhotonEnergy_Mod%d",iSM),
845  Form("Accumulated energy in grid of cells in Module %d",iSM),
846  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
847  fhTowerDecayPhotonEnergy[iSM]->SetYTitle("row (phi direction)");
848  fhTowerDecayPhotonEnergy[iSM]->SetXTitle("column (eta direction)");
850 
851  fhTowerDecayPhotonAsymmetry[iSM] = new TH2F (Form("hTowerDecPhotonAsymmetry_Mod%d",iSM),
852  Form("Accumulated asymmetry in grid of cells in Module %d",iSM),
853  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
854  fhTowerDecayPhotonAsymmetry[iSM]->SetYTitle("row (phi direction)");
855  fhTowerDecayPhotonAsymmetry[iSM]->SetXTitle("column (eta direction)");
857 
858  fhTowerDecayPhotonHitMaskFrame[iSM] = new TH2F (Form("hTowerDecPhotonHit_Mod%d_MaskFrame",iSM),Form("Entries in grid of cells in Module %d",iSM),
859  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
860  fhTowerDecayPhotonHitMaskFrame[iSM]->SetYTitle("row (phi direction)");
861  fhTowerDecayPhotonHitMaskFrame[iSM]->SetXTitle("column (eta direction)");
863 
864  fhClusterTimeSM[iSM] = new TH2F(Form("hClusterTime_SM%d",iSM),"cluster time vs E",100,0,10, 100,0,1000);
865  fhClusterTimeSM[iSM]->SetXTitle("E (GeV)");
866  fhClusterTimeSM[iSM]->SetYTitle("t (ns)");
868 
869  fhClusterPairDiffTimeSameSM[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSM%d",iSM),
870  Form("cluster pair time difference vs E, SM %d",iSM),
871  100,0,10, 200,-100,100);
872  fhClusterPairDiffTimeSameSM[iSM]->SetXTitle("E (GeV)");
873  fhClusterPairDiffTimeSameSM[iSM]->SetYTitle("#Delta t (ns)");
875  }
876 
877  Int_t nchannels = nSM*AliEMCALGeoParams::fgkEMCALRows*AliEMCALGeoParams::fgkEMCALCols;
878  for(Int_t ibc = 0; ibc < 4; ibc++)
879  {
880  fHTpi0[ibc] = new TH2F(Form("hTime_BC%d",ibc),Form("Time of cell clusters under pi0 peak, bunch crossing %d",ibc),
881  nchannels,0,nchannels, fNTimeBins,fMinTimeBin,fMaxTimeBin);
882  fOutputContainer->Add(fHTpi0[ibc]);
883  fHTpi0[ibc]->SetYTitle("time (ns)");
884  fHTpi0[ibc]->SetXTitle("abs. Id. ");
885  }
886 
887  fhClusterTime = new TH2F("hClusterTime","cluster time vs E",100,0,10, 100,0,1000);
888  fhClusterTime->SetXTitle("E (GeV)");
889  fhClusterTime->SetYTitle("t (ns)");
891 
892  fhClusterPairDiffTime = new TH2F("hClusterPairDiffTime","cluster pair time difference vs E",100,0,10, 800,-400,400);
893  fhClusterPairDiffTime->SetXTitle("E_{pair} (GeV)");
894  fhClusterPairDiffTime->SetYTitle("#Delta t (ns)");
896 
897  for(Int_t iMod=0; iMod < nSM; iMod++)
898  {
899  for(Int_t iRow=0; iRow < AliEMCALGeoParams::fgkEMCALRows; iRow++)
900  {
901  for(Int_t iCol=0; iCol < AliEMCALGeoParams::fgkEMCALCols; iCol++)
902  {
903  snprintf(hname,buffersize, "%d_%d_%d",iMod,iCol,iRow);
904  snprintf(htitl,buffersize, "Two-gamma inv. mass for super mod %d, cell(col,row)=(%d,%d)",iMod,iCol,iRow);
905  fHmpi0[iMod][iCol][iRow] = new TH1F(hname,htitl,fNbins,fMinBin,fMaxBin);
906  fHmpi0[iMod][iCol][iRow]->SetXTitle("mass (MeV/c^{2})");
907  fOutputContainer->Add(fHmpi0[iMod][iCol][iRow]);
908  }
909  }
910  }
911 
912  fOutputContainer->SetOwner(kTRUE);
913 
914  PostData(1,fOutputContainer);
915 
916  // cuts container, set in terminate but init and post here
917 
918  fCuts = new TList();
919 
920  fCuts ->SetOwner(kTRUE);
921 
922  PostData(2, fCuts);
923 }
924 
930 //______________________________________________________________________________________________________
932 {
933  Int_t icol = ieta;
934  if(iSM%2) icol+=48; // Impair SM, shift index [0-47] to [48-96]
935 
937  {
938  for (Int_t imask = 0; imask < fNMaskCellColumns; imask++)
939  {
940  if(icol==fMaskCellColumns[imask]) return kTRUE;
941  }
942  }
943 
944  return kFALSE;
945 }
946 
952 //__________________________________________________________________________
954 {
955  // Event selection
956 
957  if(fTriggerName!="")
958  {
959  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (InputEvent());
960  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (InputEvent());
961 
962  TString triggerClass = "";
963  if (esdevent) triggerClass = esdevent->GetFiredTriggerClasses();
964  else if(aodevent) triggerClass = aodevent->GetFiredTriggerClasses();
965 
966  AliDebug(1,Form("Event %d, FiredClass %s",
967  (Int_t)Entry(),(((AliESDEvent*)InputEvent())->GetFiredTriggerClasses()).Data()));
968 
969  if(!triggerClass.Contains(fTriggerName))
970  {
971  AliDebug(1,"Reject event!");
972  return;
973  }
974  else
975  AliDebug(1,"Accept event!");
976  }
977 
978  // Get the input event
979 
980  AliVEvent* event = 0;
981  if(fFilteredInput) event = AODEvent();
982  else event = InputEvent();
983 
984  if(!event)
985  {
986  AliWarning("Input event not available!");
987  return;
988  }
989 
990  AliDebug(1,Form("<<< %s: Event %d >>>",event->GetName(), (Int_t)Entry()));
991 
992  // Get the primary vertex
993 
994  event->GetPrimaryVertex()->GetXYZ(fVertex) ;
995 
996  AliDebug(1,Form("Vertex: (%.3f,%.3f,%.3f)",fVertex[0],fVertex[1],fVertex[2]));
997 
998  //Int_t runNum = aod->GetRunNumber();
999  //if(DebugLevel() > 1) printf("Run number: %d\n",runNum);
1000 
1001  fhNEvents->Fill(0); //Count the events to be analyzed
1002 
1003  // Acccess once the geometry matrix and temperature corrections and calibration coefficients
1004  if(fhNEvents->GetEntries() == 1)
1005  {
1007 
1009 
1011  }
1012 
1013  //Get the list of clusters and cells
1014  fEMCALCells = event->GetEMCALCells();
1015 
1016  fCaloClustersArr = new TRefArray();
1017  event->GetEMCALClusters(fCaloClustersArr);
1018 
1019  AliDebug(1,Form("N CaloClusters: %d - N CaloCells %d",fCaloClustersArr->GetEntriesFast(), fEMCALCells->GetNumberOfCells()));
1020 
1021  // Apply non linearity, new calibration, T calibration to the clusters
1022  if( fCorrectClusters )
1023  CorrectClusters();
1024 
1025  FillHistograms();
1026 
1027  delete fCaloClustersArr;
1028 
1029  PostData(1,fOutputContainer);
1030 }
1031 
1034 //_____________________________________________________
1036 {
1037  printf("Cluster cuts: %2.2f < E < %2.2f GeV; number of cells > %d; Assymetry < %1.2f, pair time diff < %2.2f, %2.2f < t < %2.2f ns\n",
1039 
1040  printf("Group %d cells\n", fGroupNCells) ;
1041 
1042  printf("Cluster maximal cell away from border at least %d cells\n", fRecoUtils->GetNumberOfCellsFromEMCALBorder()) ;
1043 
1044  printf("Histograms: bins %d; energy range: %2.2f < E < %2.2f MeV\n",fNbins,fMinBin,fMaxBin) ;
1045 
1046  printf("Switchs:\n \t Remove Bad Channels? %d; Use filtered input? %d; Correct Clusters? %d, and their position? %d \n \t Mass per channel same SM clusters? %d\n",
1047  fRecoUtils->IsBadChannelsRemovalSwitchedOn(),fFilteredInput,fCorrectClusters, fRecalPosition, fSameSM) ;
1048 
1049  printf("OADB path : %s\n",fOADBFilePath .Data());
1050  printf("Calibration path : %s\n",fCalibFilePath.Data());
1051 
1052  printf("EMCAL Geometry name: < %s >, Load Matrices %d\n",fEMCALGeoName.Data(), fLoadMatrices) ;
1053 
1054  if(fLoadMatrices) { for(Int_t ism = 0; ism < AliEMCALGeoParams::fgkEMCALModules; ism++) if(fMatrix[ism]) fMatrix[ism]->Print() ; }
1055 }
1056 
1060 //_____________________________________________________________________
1062 {
1063  if(n > fNMaskCellColumns)
1064  {
1065  delete [] fMaskCellColumns ;
1066 
1067  fMaskCellColumns = new Int_t[n] ;
1068  }
1069 
1070  fNMaskCellColumns = n ;
1071 }
1072 
1077 //___________________________________________________________________________________
1079 {
1080  if(ipos < fNMaskCellColumns) fMaskCellColumns[ipos] = icol ;
1081  else AliWarning("Mask column not set, position larger than allocated set size first") ;
1082 }
1083 
1084 
1087 //______________________________________________________________
1089 {
1090  const Int_t buffersize = 255;
1091  char onePar[buffersize] ;
1092 
1093  snprintf(onePar,buffersize, "Custer cuts: %2.2f < E < %2.2f GeV; %2.2f < Lambda0_2 < %2.2f GeV; min number of cells %d; Assymetry cut %1.2f, time1-time2 < %2.2f; %2.2f < T < %2.2f ns; %3.1f < Mass < %3.1f",
1095  fCuts->Add(new TObjString(onePar));
1096  snprintf(onePar,buffersize, "Group %d cells;", fGroupNCells) ;
1097  fCuts->Add(new TObjString(onePar));
1098  snprintf(onePar,buffersize, "Cluster maximal cell away from border at least %d cells;", fRecoUtils->GetNumberOfCellsFromEMCALBorder()) ;
1099  fCuts->Add(new TObjString(onePar));
1100  snprintf(onePar,buffersize, "Histograms, Mass bins %d; energy range: %2.2f < E < %2.2f GeV;",fNbins,fMinBin,fMaxBin) ;
1101  fCuts->Add(new TObjString(onePar));
1102  snprintf(onePar,buffersize, "Histograms, Time bins %d; energy range: %2.2f < E < %2.2f GeV;",fNTimeBins,fMinTimeBin,fMaxTimeBin) ;
1103  fCuts->Add(new TObjString(onePar));
1104  snprintf(onePar,buffersize, "Switchs: Remove Bad Channels? %d; Use filtered input? %d; Correct Clusters? %d and their position? %d, Mass per channel same SM clusters? %d ",
1105  fRecoUtils->IsBadChannelsRemovalSwitchedOn(),fFilteredInput,fCorrectClusters, fRecalPosition, fSameSM) ;
1106  fCuts->Add(new TObjString(onePar));
1107  snprintf(onePar,buffersize, "EMCAL Geometry name: < %s >, Load Matrices? %d",fEMCALGeoName.Data(),fLoadMatrices) ;
1108  fCuts->Add(new TObjString(onePar));
1109 
1110  // Post Data
1111  PostData(2, fCuts);
1112 }
1113 
Float_t fDTimeCut
Maximum difference between time of cluster pairs (ns).
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
TH2F * fHmggPairSameSectorSMMaskFrame[AliEMCALGeoParams::fgkEMCALModules/2]
! Two-cluster invariant mass per Pair, mask clusters facing frames.
TGeoHMatrix * fMatrix[AliEMCALGeoParams::fgkEMCALModules]
TH2F * fhClusterPairDiffTimeSameSide[AliEMCALGeoParams::fgkEMCALModules-2]
! Diference in time of clusters same side.
Int_t fNTimeBins
N time bins of invariant mass histograms.
TH2F * fhTowerDecayPhotonHit[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, number of times a decay photon hits...
Float_t fInvMassCutMax
Maximum mass cut for clusters to fill time or other histograms.
TH2F * fHAsymmetryPairSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster asymmetry vs pt per Pair,with mass close to pi0.
TH1F * fHmpi0[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
< Two-cluster invariant mass assigned to each cell.
Bool_t fSameSM
Combine clusters in channels on same SM.
Bool_t fLoadMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
AliEMCALRecoUtils * fRecoUtils
Access to reconstruction utilities.
AliEMCALGeometry * fEMCALGeo
! EMCAL geometry pointer.
Float_t fMaxTimeBin
Maximum time bins of invariant mass histograms.
Float_t fLogWeight
Logarithmic weight used in cluster recalibration.
TH2F * fHAsymmetry
! Two-cluster asymmetry vs pt of pair, with mass close to pi0.
This task provides the input for the EMCal energy calibration with pi0 invariant mass analysis per ch...
Float_t fMinTimeBin
Minimum time bins of invariant mass histograms.
AliAnalysisTaskEMCALPi0CalibSelection(const char *name)
Default constructor. Arrays initialization is done here.
TH2F * fHOpeningAngleDifferentSM
! Two-cluster opening angle vs pt of pair, each cluster in different SM, with mass close to pi0...
TH2F * fhClusterPairDiffTimeSameSM[AliEMCALGeoParams::fgkEMCALModules]
! Diference in time of clusters same SM.
TH2F * fHOpeningAngle
! Two-cluster opening angle vs pt of pair, with mass close to pi0.
TH2F * fhClusterTimeSM[AliEMCALGeoParams::fgkEMCALModules]
! Timing of clusters vs energy per SM.
TH2F * fHOpeningAngleSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster opening angle vs pt per SM,with mass close to pi0.
TLorentzVector fMomentum2
Cluster kinematics, temporal.
Float_t fInvMassCutMin
Minimum mass cut for clusters to fill time or other histograms.
TH2F * fHAsymmetrySM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster asymmetry vs pt per SM,with mass close to pi0.
TString fCalibFilePath
Full path with file with energy calibration factors per channel from previous iteration.
TH2F * fHmggSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM.
TH2F * fhTowerDecayPhotonHitMaskFrame[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, number of times a decay photon hits...
TH2F * fHmgg
! Two-cluster invariant mass vs pt of pair.
TH2F * fHTpi0[4]
! Time of cell under pi0 mass, for 4 bunch crossings.
Float_t fMinBin
Minimum mass bins of invariant mass histograms.
Bool_t fRecalPosition
Switch on/off cluster position calculation, in case alignment matrices are not available.
TString fTriggerName
Trigger name must contain this name.
TH2F * fHmggDifferentSMMaskFrame
! Two-cluster invariant mass vs pt of pair, each cluster in different SM,mask clusters facing frames...
TH2F * fhClusterPairDiffTime
! Diference in time of clusters.
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t fNbins
N mass bins of invariant mass histograms.
TH2F * fhClusterTime
! Timing of clusters vs energy.
TLorentzVector fMomentum12
Cluster pair kinematics, temporal.
TH2F * fhTowerDecayPhotonAsymmetry[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, accumulated asymmetry in the tower by decay photo...
TH2F * fHmggPairSameSideSMMaskFrame[AliEMCALGeoParams::fgkEMCALModules-2]
! Two-cluster invariant mass per Pair, mask clusters facing frames.
Bool_t fCorrectClusters
Correct clusters energy, position etc.
void UserCreateOutputObjects()
Create output container, init geometry.
TH2F * fHmggSMMaskFrame[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM, mask clusters facing frames.
void Terminate(Option_t *opt)
Create cuts/param objects and publish to slot.
TH2F * fhTowerDecayPhotonEnergy[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, accumulated energy in the tower by decay photons...
TH2F * fHmggPairSameSideSM[AliEMCALGeoParams::fgkEMCALModules-2]
! Two-cluster invariant mass per Pair.
Float_t fMaxBin
Maximum mass bins of invariant mass histograms.
TH2F * fHmggDifferentSM
! Two-cluster invariant mass vs pt of pair, each cluster in different SM.
TH2F * fhClusterPairDiffTimeSameSector[AliEMCALGeoParams::fgkEMCALModules/2]
! Diference in time of clusters same sector.
TH1I * fhNEvents
! Number of events counter histogram.
TLorentzVector fMomentum1
Cluster kinematics, temporal.
TH2F * fHmggMaskFrame
! Two-cluster invariant mass vs pt of pair, mask clusters facing frames.
TString fOADBFilePath
Default path $ALICE_PHYSICS/OADB/EMCAL, if needed change.
TH2F * fHOpeningAnglePairSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster opening angle vs pt per Pair,with mass close to pi0.
Bool_t fFilteredInput
Read input produced with filter.
TH2F * fHAsymmetryDifferentSM
! Two-cluster asymmetry vs pt of pair, each cluster in different SM, with mass close to pi0...
TH2F * fHmggPairSameSectorSM[AliEMCALGeoParams::fgkEMCALModules/2]
! Two-cluster invariant mass per Pair.