AliPhysics  master (3d17d9d)
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 "AliMultSelection.h"
25 #include "AliEMCALGeometry.h"
26 #include "AliVCluster.h"
27 #include "AliVCaloCells.h"
28 #include "AliEMCALRecoUtils.h"
29 #include "AliOADBContainer.h"
30 #include "AliDataFile.h"
31 
35 
38 //______________________________________________________________________________________________
41 fEMCALGeo(0x0), fLoadMatrices(0),
42 fEMCALGeoName("EMCAL_COMPLETE12SMV1_DCAL_8SM"),
43 fTriggerName("EMC"),
44 fRecoUtils(new AliEMCALRecoUtils),
45 fOADBFilePath(""), fCalibFilePath(""),
46 fCorrectClusters(kFALSE), fRecalPosition(kTRUE),
47 fCaloClustersArr(0x0), fEMCALCells(0x0),
48 //fCuts(0x0),
49 fOutputContainer(0x0),
50 fCheckCentrality(kFALSE), fCentralityClass("V0M"), fCentWithEventSel(kFALSE),
51 fCentMin(-1), fCentMax(10000000),
52 fVertex(), fFilteredInput(kFALSE),
53 fImportGeometryFromFile(1), fImportGeometryFilePath(""),
54 fEmin(0.5), fEmax(15.),
55 fEBkgmin(0.5), fEBkgmax(15.),
56 fL0min(0.01), fL0max(0.5),
57 fL0Bkgmin(1.0), fL0Bkgmax(3.0),
58 fOpAnglemin(0.), fOpAnglemax(3.0),
59 fDTimeCut(100.), fTimeMax(1000000), fTimeMin(-1000000),
60 fAsyCut(1.), fMinNCells(2), fGroupNCells(0),
61 fLogWeight(4.5), fSameSM(kFALSE),
62 fNMaskCellColumns(11), fMaskCellColumns(0x0),
63 fSelectOnlyCellSignalOutOfCollision(0),
64 fCellEnergyHiso(0), fClusterTopology(0),
65 fSelectOnlyPhotonsInDifferentSM(0),
66 fChangeBkgShape(0),
67 fInvMassCutMin(110.), fInvMassCutMax(160.),
68 // Histograms binning
69 fNbins(300), fMinBin(0.), fMaxBin(300.),
70 fNTimeBins(1000), fMinTimeBin(0.), fMaxTimeBin(1000.),
71 fNEnergybins(1000), fMinEnergyBin(0.), fMaxEnergyBin(100.),
72 // Temporal
73 fMomentum1(), fMomentum2(), fMomentum12(),
74 // Histograms
75 fHmgg(0x0), fHmggDifferentSM(0x0),
76 fHmggMaskFrame(0x0), fHmggDifferentSMMaskFrame(0x0),
77 fHOpeningAngle(0x0), fHOpeningAngleDifferentSM(0x0),
78 fHAsymmetry(0x0), fHAsymmetryDifferentSM(0x0),
79 fhNEvents(0x0),
80 fhCentrality(0x0), fhCentralitySelected(0x0),
81 fhClusterTime(0x0), fhClusterPairDiffTime(0x0)
82 {
83  for(Int_t iMod=0; iMod < AliEMCALGeoParams::fgkEMCALModules; iMod++)
84  {
85  for(Int_t iX=0; iX<24; iX++)
86  {
87  for(Int_t iZ=0; iZ<48; iZ++)
88  {
89  fHmpi0[iMod][iZ][iX] = 0 ;
90  fhEnergy[iMod][iZ][iX] = 0 ;
91  }
92  }
93  }
94 
95  fVertex[0]=fVertex[1]=fVertex[2]=-1000;
96 
97  fHTpi0[0]= 0 ;
98  fHTpi0[1]= 0 ;
99  fHTpi0[2]= 0 ;
100  fHTpi0[3]= 0 ;
101 
103  fMaskCellColumns[0] = 6 ; fMaskCellColumns[1] = 7 ; fMaskCellColumns[2] = 8 ;
104  fMaskCellColumns[3] = 35; fMaskCellColumns[4] = 36; fMaskCellColumns[5] = 37;
105  fMaskCellColumns[6] = 12+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[7] = 13+AliEMCALGeoParams::fgkEMCALCols;
106  fMaskCellColumns[8] = 40+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[9] = 41+AliEMCALGeoParams::fgkEMCALCols;
107  fMaskCellColumns[10]= 42+AliEMCALGeoParams::fgkEMCALCols;
108 
109  for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules/2; iSMPair++)
110  {
111  fHmggPairSameSectorSM[iSMPair] = 0;
112  fHmggPairSameSectorSMMaskFrame[iSMPair] = 0;
114  }
115 
116  for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules-2; iSMPair++)
117  {
118  fHmggPairSameSideSM[iSMPair] = 0;
119  fHmggPairSameSideSMMaskFrame[iSMPair] = 0;
120  fhClusterPairDiffTimeSameSide[iSMPair] = 0;
121  }
122 
123  for(Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM++)
124  {
125  fHmggSM[iSM] = 0;
126  fHmggSM_Zone1[iSM] = 0;
127  fHmggSM_Zone2[iSM] = 0;
128  fHmggSM_Zone3[iSM] = 0;
129  fHmggSM_Zone4[iSM] = 0;
130  fHmggSM_Zone5[iSM] = 0;
131  fHmggSM_Zone6[iSM] = 0;
132  fHmggSM_Zone7[iSM] = 0;
133  fHmggSMMaskFrame[iSM] = 0;
134  fHOpeningAngleSM[iSM] = 0;
135  fHOpeningAnglePairSM[iSM] = 0;
136  fHAsymmetrySM[iSM] = 0;
137  fHAsymmetryPairSM[iSM] = 0;
138  fhTowerDecayPhotonHit[iSM] = 0;
139  fhTowerDecayPhotonEnergy[iSM] = 0;
142  fMatrix[iSM] = 0x0;
143  fhClusterTimeSM[iSM] = 0;
144  fhTopoClusterCase0[iSM] =0;
145  fhTopoClusterCase1[iSM] =0;
146  fhTopoClusterCase2[iSM] =0;
147  fhTopoClusterCase3[iSM] =0;
148  fhTopoClusterAmpCase0[iSM] =0;
149  fhTopoClusterAmpCase1[iSM] =0;
150  fhTopoClusterAmpCase2[iSM] =0;
151  fhTopoClusterAmpCase3[iSM] =0;
157  }
158 }
159 
165 //______________________________________________________________________________________________
167 AliAnalysisTaskSE(name),
168 fEMCALGeo(0x0), fLoadMatrices(0),
169 fEMCALGeoName("EMCAL_COMPLETE12SMV1_DCAL_8SM"),
170 fTriggerName("EMC"),
173 fCorrectClusters(kFALSE), fRecalPosition(kTRUE),
174 fCaloClustersArr(0x0), fEMCALCells(0x0),
175 //fCuts(0x0),
176 fOutputContainer(0x0),
177 fCheckCentrality(kFALSE), fCentralityClass("V0M"), fCentWithEventSel(kFALSE),
178 fCentMin(-1), fCentMax(10000000),
179 fVertex(), fFilteredInput(kFALSE),
181 fEmin(0.5), fEmax(15.),
182 fEBkgmin(0.5), fEBkgmax(15.),
183 fL0min(0.01), fL0max(0.5),
184 fL0Bkgmin(1.0), fL0Bkgmax(3.0),
185 fOpAnglemin(0.), fOpAnglemax(3.0),
186 fDTimeCut(100.), fTimeMax(1000000), fTimeMin(-1000000),
187 fAsyCut(1.), fMinNCells(2), fGroupNCells(0),
188 fLogWeight(4.5), fSameSM(kFALSE),
193 fChangeBkgShape(0),
194 fInvMassCutMin(110.), fInvMassCutMax(160.),
195 // Histograms binning
196 fNbins(300), fMinBin(0.), fMaxBin(300.),
197 fNTimeBins(1000), fMinTimeBin(0.), fMaxTimeBin(1000.),
198 fNEnergybins(1000), fMinEnergyBin(0.), fMaxEnergyBin(100.),
199 // Temporal
201 // Histograms
202 fHmgg(0x0), fHmggDifferentSM(0x0),
206 fhNEvents(0x0),
209 {
210  for(Int_t iMod=0; iMod < AliEMCALGeoParams::fgkEMCALModules; iMod++)
211  {
212  for(Int_t iX=0; iX<24; iX++)
213  {
214  for(Int_t iZ=0; iZ<48; iZ++)
215  {
216  fHmpi0[iMod][iZ][iX] = 0 ;
217  fhEnergy[iMod][iZ][iX] = 0 ;
218  }
219  }
220  }
221 
222  fVertex[0]=fVertex[1]=fVertex[2]=-1000;
223 
224  fHTpi0[0]= 0 ;
225  fHTpi0[1]= 0 ;
226  fHTpi0[2]= 0 ;
227  fHTpi0[3]= 0 ;
228 
230  fMaskCellColumns[0] = 6 ; fMaskCellColumns[1] = 7 ; fMaskCellColumns[2] = 8 ;
231  fMaskCellColumns[3] = 35; fMaskCellColumns[4] = 36; fMaskCellColumns[5] = 37;
232  fMaskCellColumns[6] = 12+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[7] = 13+AliEMCALGeoParams::fgkEMCALCols;
233  fMaskCellColumns[8] = 40+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[9] = 41+AliEMCALGeoParams::fgkEMCALCols;
234  fMaskCellColumns[10]= 42+AliEMCALGeoParams::fgkEMCALCols;
235 
236  for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules/2; iSMPair++)
237  {
238  fHmggPairSameSectorSM[iSMPair] = 0;
239  fHmggPairSameSectorSMMaskFrame[iSMPair] = 0;
241  }
242 
243  for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules-2; iSMPair++)
244  {
245  fHmggPairSameSideSM[iSMPair] = 0;
246  fHmggPairSameSideSMMaskFrame[iSMPair] = 0;
247  fhClusterPairDiffTimeSameSide[iSMPair] = 0;
248  }
249 
250  for(Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM++)
251  {
252  fHmggSM[iSM] = 0;
253  fHmggSM_Zone1[iSM] = 0;
254  fHmggSM_Zone2[iSM] = 0;
255  fHmggSM_Zone3[iSM] = 0;
256  fHmggSM_Zone4[iSM] = 0;
257  fHmggSM_Zone5[iSM] = 0;
258  fHmggSM_Zone6[iSM] = 0;
259  fHmggSM_Zone7[iSM] = 0;
260  fHmggSMMaskFrame[iSM] = 0;
261  fHOpeningAngleSM[iSM] = 0;
262  fHOpeningAnglePairSM[iSM] = 0;
263  fHAsymmetrySM[iSM] = 0;
264  fHAsymmetryPairSM[iSM] = 0;
265  fhTowerDecayPhotonHit[iSM] = 0;
266  fhTowerDecayPhotonEnergy[iSM] = 0;
269  fMatrix[iSM] = 0x0;
270  fhClusterTimeSM[iSM] = 0;
271  fhTopoClusterCase0[iSM] =0;
272  fhTopoClusterCase1[iSM] =0;
273  fhTopoClusterCase2[iSM] =0;
274  fhTopoClusterCase3[iSM] =0;
275  fhTopoClusterAmpCase0[iSM] =0;
276  fhTopoClusterAmpCase1[iSM] =0;
277  fhTopoClusterAmpCase2[iSM] =0;
278  fhTopoClusterAmpCase3[iSM] =0;
284  }
285 
286  DefineOutput(1, TList::Class());
287 //DefineOutput(2, TList::Class()); // will contain cuts or local params
288 }
289 
292 //_____________________________________________________________________________
294 {
295  if(fOutputContainer)
296  {
297  fOutputContainer->Delete() ;
298  delete fOutputContainer ;
299  }
300 
301  if(fEMCALGeo) delete fEMCALGeo ;
302  if(fRecoUtils) delete fRecoUtils ;
303  if(fNMaskCellColumns) delete [] fMaskCellColumns;
304 }
305 
309 //____________________________________________________________
311 {
312  if(fRecoUtils->GetParticleType()!=AliEMCALRecoUtils::kPhoton)
313  AliFatal(Form("Wrong particle type for cluster position recalculation! = %d\n", fRecoUtils->GetParticleType()));
314 
315  AliDebug(1,Form("It will use fLogWeight %.3f",fLogWeight));
316 
317  Float_t pos[]={0,0,0};
318 
319  for(Int_t iClu=0; iClu < fCaloClustersArr->GetEntriesFast(); iClu++)
320  {
321  AliVCluster *c1 = (AliVCluster *) fCaloClustersArr->At(iClu);
322 
323  Float_t e1i = c1->E(); // cluster energy before correction
324  if(fChangeBkgShape && (((c1->GetM02() > fL0Bkgmin) && (c1->GetM02() < fL0Bkgmax)) && ((e1i < fEBkgmin) || (e1i > fEBkgmax)))) continue;
325  if(fChangeBkgShape && (((c1->GetM02() < fL0Bkgmin) || (c1->GetM02() > fL0Bkgmax)) && (e1i < fEmin))) continue;
326  else if (!fChangeBkgShape && e1i < fEmin) continue;
327  else if (e1i > fEmax) continue;
328 
329  else if (c1->GetNCells() < fMinNCells) continue;
330 
331  else if(fChangeBkgShape && (c1->GetM02() < fL0min || (c1->GetM02() > fL0max && c1->GetM02() < fL0Bkgmin) || c1->GetM02() > fL0Bkgmax)) continue;
332 
333  else if (!fChangeBkgShape && (c1->GetM02() < fL0min || c1->GetM02() > fL0max)) continue;
334 
335  if(fRecoUtils->ClusterContainsBadChannel(fEMCALGeo, c1->GetCellsAbsId(), c1->GetNCells())) continue;
336 
337  if(DebugLevel() > 2)
338  {
339  AliInfo(Form("Std : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
340  c1->GetPosition(pos);
341  AliInfo(Form("Std : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
342  }
343 
344  // Correct cluster energy and position if requested, and not corrected previously, by default Off
346  {
350  }
351 
352  AliDebug(2,Form("Energy: after recalibration %f",c1->E()));
353 
354  // Recalculate cluster position
356 
357  // Correct Non-Linearity
359 
360  AliDebug(2,Form("after linearity correction %f",c1->E()));
361 
362  // In case of MC analysis, to match resolution/calibration in real data
363  //c1->SetE(fRecoUtils->SmearClusterEnergy(c1)); // Not needed anymore
364 
365  AliDebug(2,Form("after smearing %f\n",c1->E()));
366 
367  if(DebugLevel() > 2)
368  {
369  AliInfo(Form("Cor : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
370  c1->GetPosition(pos);
371  AliInfo(Form("Cor : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
372  }
373  } // cluster loop
374 }
375 
379 //__________________________________________________________
381 {
382  Int_t absId1 = -1;
383  Int_t iSupMod1 = -1;
384  Int_t iphi1 = -1;
385  Int_t ieta1 = -1;
386  Int_t absId2 = -1;
387  Int_t iSupMod2 = -1;
388  Int_t iphi2 = -1;
389  Int_t ieta2 = -1;
390  Bool_t shared = kFALSE;
391 
392  Float_t pos[] = {0,0,0};
393 
394  Int_t bc = InputEvent()->GetBunchCrossNumber();
395  Int_t nSM = (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
396 
397  Int_t nbClusterInTopoHisto[nSM];
398 
399  for(Int_t iSM = 0; iSM < nSM; iSM++)
400  {
401  nbClusterInTopoHisto[iSM] = 0;
402  }
403 
404  for(Int_t iClu=0; iClu<fCaloClustersArr->GetEntriesFast()-1; iClu++)
405  {
406  AliVCluster *c1 = (AliVCluster *) fCaloClustersArr->At(iClu);
407 
408  // Exclude bad channels
409  if(fRecoUtils->ClusterContainsBadChannel(fEMCALGeo, c1->GetCellsAbsId(), c1->GetNCells())) continue;
410 
411  Float_t e1i = c1->E(); // cluster energy before correction
412 
413  if(fChangeBkgShape && (((c1->GetM02() > fL0Bkgmin) && (c1->GetM02() < fL0Bkgmax)) && ((e1i < fEBkgmin) || (e1i > fEBkgmax)))) continue;
414  if(fChangeBkgShape && (((c1->GetM02() < fL0Bkgmin) || (c1->GetM02() > fL0Bkgmax)) && (e1i < fEmin))) continue;
415  else if (!fChangeBkgShape && e1i < fEmin) continue;
416  else if (e1i > fEmax) continue;
417 
418  else if (!fRecoUtils->IsGoodCluster(c1,fEMCALGeo,fEMCALCells,bc)) continue;
419 
420  else if (c1->GetNCells() < fMinNCells) continue;
421 
422  else if(fChangeBkgShape && (c1->GetM02() < fL0min || (c1->GetM02() > fL0max && c1->GetM02() < fL0Bkgmin) || c1->GetM02() > fL0Bkgmax)) continue;
423 
424  else if (!fChangeBkgShape && (c1->GetM02() < fL0min || c1->GetM02() > fL0max)) continue;
425 
426  if(DebugLevel() > 2)
427  {
428  AliInfo(Form("IMA : i %d, E %f, dispersion %f, m02 %f, m20 %f",c1->GetID(),e1i,c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
429  c1->GetPosition(pos);
430  AliInfo(Form("IMA : i %d, x %f, y %f, z %f",c1->GetID(), pos[0], pos[1], pos[2]));
431  }
432 
433  fRecoUtils->GetMaxEnergyCell(fEMCALGeo, fEMCALCells,c1,absId1,iSupMod1,ieta1,iphi1,shared);
434 
435  c1->GetMomentum(fMomentum1,fVertex);
436 
437  // Check if cluster is in fidutial region, not too close to borders
439 
440  // Clusters not facing frame structures
441  Bool_t mask1 = MaskFrameCluster(iSupMod1, ieta1);
442  //if(mask1) printf("Reject eta %d SM %d\n",ieta1, iSupMod1);
443 
444  Double_t time1 = c1->GetTOF()*1.e9;
445 
446  if(fSelectOnlyCellSignalOutOfCollision && ((time1 < fTimeMax) && (time1 > fTimeMin))) continue;
447  else if(!fSelectOnlyCellSignalOutOfCollision && (time1 > fTimeMax || time1 < fTimeMin)) continue;
448 
449  fhClusterTime ->Fill(c1->E(),time1);
450  fhClusterTimeSM[iSupMod1]->Fill(c1->E(),time1);
451 
452  if(fClusterTopology)
453  {
454  Int_t iPosInNoisyQuartet = FindPositionInNoisyQuartet(iphi1,ieta1,iSupMod1);
455  AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
456 
457  for(Int_t iCell = 0; iCell < c1->GetNCells(); iCell++)
458  {
459  Int_t iSupMod = -1, iIeta =-1, iIphi =-1, iTower =-1, ietaCell =-1, iphiCell =-1;
460 
461  Int_t CellID = c1->GetCellsAbsId()[iCell];
462  geom->GetCellIndex(CellID,iSupMod,iTower,iIphi,iIeta);
463  geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta,iphiCell,ietaCell);
464 // Float_t AmpFraction = c1->GetCellAmplitudeFraction(CellID);
465  Float_t amp = fEMCALCells->GetCellAmplitude(CellID);
466 
467  Float_t AmpFraction = amp / e1i;
468 
469  AliDebug(2,Form("Cell ID: %i, Cell row: %i, Cell col: %i, Cell amp: %f, Cell amp fraction: %f\n",CellID,iphiCell,ietaCell,amp,AmpFraction));
470 
471  switch (iPosInNoisyQuartet) {
472  case 0:
473  fhTopoClusterCase0[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1);
474  fhTopoClusterAmpCase0[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,amp);
475  fhTopoClusterAmpFractionCase0[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,AmpFraction);
476  break;
477  case 1:
478  fhTopoClusterCase1[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1);
479  fhTopoClusterAmpCase1[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,amp);
480  fhTopoClusterAmpFractionCase1[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,AmpFraction);
481  break;
482  case 2:
483  fhTopoClusterCase2[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1);
484  fhTopoClusterAmpCase2[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,amp);
485  fhTopoClusterAmpFractionCase2[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,AmpFraction);
486  break;
487  case 3:
488  fhTopoClusterCase3[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1);
489  fhTopoClusterAmpCase3[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,amp);
490  fhTopoClusterAmpFractionCase3[iSupMod1]->Fill(ietaCell-ieta1,iphiCell-iphi1,AmpFraction);
491  break;
492  default:
493  break;
494  }
495 
496  if(amp && AmpFraction)
497  {
498  nbClusterInTopoHisto[iSupMod1] = nbClusterInTopoHisto[iSupMod1] + 1;
499  }
500  }
501  }
502 
503  // Combine cluster with other clusters and get the invariant mass
504  for (Int_t jClu=iClu+1; jClu < fCaloClustersArr->GetEntriesFast(); jClu++)
505  {
506  AliAODCaloCluster *c2 = (AliAODCaloCluster *) fCaloClustersArr->At(jClu);
507 
508  Float_t e2i = c2->E();
509  if(fChangeBkgShape && (((c2->GetM02() > fL0Bkgmin) && (c2->GetM02() < fL0Bkgmax)) && ((e2i < fEBkgmin) || (e2i > fEBkgmax)) && ((fMomentum1.Angle(fMomentum2.Vect()) < fOpAnglemin) || (fMomentum1.Angle(fMomentum2.Vect()) > fOpAnglemax)))) continue;
510  if(fChangeBkgShape && (((c2->GetM02() < fL0Bkgmin) || (c2->GetM02() > fL0Bkgmax)) && (e2i < fEmin))) continue;
511  else if (!fChangeBkgShape && e2i < fEmin) continue;
512  else if (e2i > fEmax) continue;
513 
514  else if (!fRecoUtils->IsGoodCluster(c2,fEMCALGeo,fEMCALCells,bc))continue;
515 
516  else if (c2->GetNCells() < fMinNCells) continue;
517 
518  else if(fChangeBkgShape && (c2->GetM02() < fL0min || (c2->GetM02() > fL0max && c2->GetM02() < fL0Bkgmin) || c2->GetM02() > fL0Bkgmax)) continue;
519 
520  else if (!fChangeBkgShape && (c2->GetM02() < fL0min || c2->GetM02() > fL0max)) continue;
521 
522  fRecoUtils->GetMaxEnergyCell(fEMCALGeo, fEMCALCells,c2,absId2,iSupMod2,ieta2,iphi2,shared);
523 
524  c2->GetMomentum(fMomentum2,fVertex);
525 
527  Float_t invmass = fMomentum12.M()*1000;
528 
529  //Asimetry cut
530  Float_t asym = TMath::Abs(fMomentum1.E()-fMomentum2.E())/(fMomentum1.E()+fMomentum2.E());
531 
532  if(asym > fAsyCut) continue;
533 
534  //Time cut
535  Double_t time2 = c2->GetTOF()*1.e9;
536 
537  if(fSelectOnlyCellSignalOutOfCollision && ((time2 < fTimeMax) && (time2 > fTimeMin))) continue;
538  else if(!fSelectOnlyCellSignalOutOfCollision && (time2 > fTimeMax || time2 < fTimeMin)) continue;
539 
540  fhClusterPairDiffTime->Fill(fMomentum12.E(),time1-time2);
541  if(TMath::Abs(time1-time2) > fDTimeCut) continue;
542 
543  if(invmass < fMaxBin && invmass > fMinBin )
544  {
545  //Check if cluster is in fidutial region, not too close to borders
547 
548  // Clusters not facing frame structures
549  Bool_t mask2 = MaskFrameCluster(iSupMod2, ieta2);
550  //if(mask2) printf("Reject eta %d SM %d\n",ieta2, iSupMod2);
551 
552 
553 
554  if(in1 && in2)
555  {
556  fHmgg->Fill(invmass,fMomentum12.Pt());
557 
558  if(iSupMod1==iSupMod2)
559  {
560  fHmggSM[iSupMod1]->Fill(invmass,fMomentum12.Pt());
561  fhClusterPairDiffTimeSameSM[iSupMod1]->Fill(fMomentum12.E(),time1-time2);
562 
563  //Is in zone number i
564  Bool_t zone1 = IsInZone1(iSupMod1,ieta1,iphi1);
565  Bool_t zone2 = IsInZone2(iSupMod1,ieta1,iphi1);
566  Bool_t zone3 = IsInZone3(iSupMod1,ieta1,iphi1);
567  Bool_t zone4 = IsInZone4(iSupMod1,ieta1,iphi1);
568  Bool_t zone5 = IsInZone5(iSupMod1,ieta1,iphi1);
569  Bool_t zone6 = IsInZone6(iSupMod1,ieta1,iphi1);
570  Bool_t zone7 = IsInZone7(iSupMod1,ieta1,iphi1);
571 
572 
573  if(zone1) fHmggSM_Zone1[iSupMod1]->Fill(invmass,fMomentum12.Pt());
574  if(zone2) fHmggSM_Zone2[iSupMod1]->Fill(invmass,fMomentum12.Pt());
575  if(zone3) fHmggSM_Zone3[iSupMod1]->Fill(invmass,fMomentum12.Pt());
576  if(zone4) fHmggSM_Zone4[iSupMod1]->Fill(invmass,fMomentum12.Pt());
577  if(zone5) fHmggSM_Zone5[iSupMod1]->Fill(invmass,fMomentum12.Pt());
578  if(zone6) fHmggSM_Zone6[iSupMod1]->Fill(invmass,fMomentum12.Pt());
579  if(zone7) fHmggSM_Zone7[iSupMod1]->Fill(invmass,fMomentum12.Pt());
580 
581  }
582  else
583  fHmggDifferentSM ->Fill(invmass,fMomentum12.Pt());
584 
585  // Same sector
586  Int_t j=0;
587  for(Int_t i = 0; i < nSM/2; i++)
588  {
589  j=2*i;
590  if((iSupMod1==j && iSupMod2==j+1) || (iSupMod1==j+1 && iSupMod2==j))
591  {
592  fHmggPairSameSectorSM[i]->Fill(invmass,fMomentum12.Pt());
593  fhClusterPairDiffTimeSameSector[i]->Fill(fMomentum12.E(),time1-time2);
594  }
595  }
596 
597  // Same side
598  for(Int_t i = 0; i < nSM-2; i++)
599  {
600  if((iSupMod1==i && iSupMod2==i+2) || (iSupMod1==i+2 && iSupMod2==i))
601  {
602  fHmggPairSameSideSM[i]->Fill(invmass,fMomentum12.Pt());
603  fhClusterPairDiffTimeSameSide[i]->Fill(fMomentum12.E(),time1-time2);
604  }
605  }
606 
607 
608  if(!mask1 && !mask2)
609  {
610  fHmggMaskFrame->Fill(invmass,fMomentum12.Pt());
611 
612  if(iSupMod1==iSupMod2) fHmggSMMaskFrame[iSupMod1]->Fill(invmass,fMomentum12.Pt());
613  else fHmggDifferentSMMaskFrame ->Fill(invmass,fMomentum12.Pt());
614 
615  // Same sector
616  j=0;
617  for(Int_t i = 0; i < nSM/2; i++)
618  {
619  j=2*i;
620  if((iSupMod1==j && iSupMod2==j+1) || (iSupMod1==j+1 && iSupMod2==j)) fHmggPairSameSectorSMMaskFrame[i]->Fill(invmass,fMomentum12.Pt());
621  }
622 
623  // Same side
624  for(Int_t i = 0; i < nSM-2; i++)
625  {
626  if((iSupMod1==i && iSupMod2==i+2) || (iSupMod1==i+2 && iSupMod2==i)) fHmggPairSameSideSMMaskFrame[i]->Fill(invmass,fMomentum12.Pt());
627  }
628 
629  }// Pair not facing frame
630 
631  if(invmass > fInvMassCutMin && invmass < fInvMassCutMax) //restrict to clusters really close to pi0 peak
632  {
633 
634  // Check time of cells in both clusters, and fill time histogram
635  for(Int_t icell = 0; icell < c1->GetNCells(); icell++)
636  {
637  Int_t absID = c1->GetCellAbsId(icell);
638  fHTpi0[bc%4]->Fill(absID, fEMCALCells->GetCellTime(absID)*1.e9);
639  }
640 
641  for(Int_t icell = 0; icell < c2->GetNCells(); icell++)
642  {
643  Int_t absID = c2->GetCellAbsId(icell);
644  fHTpi0[bc%4]->Fill(absID, fEMCALCells->GetCellTime(absID)*1.e9);
645  }
646 
647  //Opening angle of 2 photons
648  Float_t opangle = fMomentum1.Angle(fMomentum2.Vect())*TMath::RadToDeg();
649  //printf("*******>>>>>>>> In PEAK pt %f, angle %f \n",fMomentum12.Pt(),opangle);
650 
651 
652  fHOpeningAngle ->Fill(opangle,fMomentum12.Pt());
653  fHAsymmetry ->Fill(asym,fMomentum12.Pt());
654 
655  if(iSupMod1==iSupMod2)
656  {
657  fHOpeningAngleSM[iSupMod1] ->Fill(opangle,fMomentum12.Pt());
658  fHAsymmetrySM[iSupMod1] ->Fill(asym,fMomentum12.Pt());
659  }
660  else
661  {
662  fHOpeningAngleDifferentSM ->Fill(opangle,fMomentum12.Pt());
663  fHAsymmetryDifferentSM ->Fill(asym,fMomentum12.Pt());
664  }
665 
666  if((iSupMod1==0 && iSupMod2==2) || (iSupMod1==2 && iSupMod2==0))
667  {
668  fHOpeningAnglePairSM[0] ->Fill(opangle,fMomentum12.Pt());
669  fHAsymmetryPairSM[0] ->Fill(asym,fMomentum12.Pt());
670 
671  }
672  if((iSupMod1==1 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==1))
673  {
674  fHOpeningAnglePairSM[1] ->Fill(opangle,fMomentum12.Pt());
675  fHAsymmetryPairSM[1] ->Fill(asym,fMomentum12.Pt());
676  }
677 
678  if((iSupMod1==0 && iSupMod2==1) || (iSupMod1==1 && iSupMod2==0))
679  {
680  fHOpeningAnglePairSM[2] ->Fill(opangle,fMomentum12.Pt());
681  fHAsymmetryPairSM[2] ->Fill(asym,fMomentum12.Pt());
682  }
683  if((iSupMod1==2 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==2))
684  {
685  fHOpeningAnglePairSM[3] ->Fill(opangle,fMomentum12.Pt());
686  fHAsymmetryPairSM[3] ->Fill(asym,fMomentum12.Pt());
687  }
688 
689  }// pair in 100 < mass < 160
690 
691  }//in acceptance cuts
692 
693  //In case of filling only channels with second cluster in same SM
694  if(fSameSM && iSupMod1!=iSupMod2) continue;
695  if(fSelectOnlyPhotonsInDifferentSM && (iSupMod1 == iSupMod2)) continue;
696 
697  if (fGroupNCells == 0)
698  {
699  fHmpi0[iSupMod1][ieta1][iphi1]->Fill(invmass);
700  fHmpi0[iSupMod2][ieta2][iphi2]->Fill(invmass);
701 
702  if (fCellEnergyHiso) fhEnergy[iSupMod1][ieta1][iphi1]->Fill(fMomentum1.E());
703  if (fCellEnergyHiso) fhEnergy[iSupMod2][ieta2][iphi2]->Fill(fMomentum2.E());
704 
705  if(invmass > fInvMassCutMin && invmass < fInvMassCutMax)//restrict to clusters really close to pi0 peak
706  {
707  fhTowerDecayPhotonHit [iSupMod1]->Fill(ieta1,iphi1);
708  fhTowerDecayPhotonEnergy [iSupMod1]->Fill(ieta1,iphi1,fMomentum1.E());
709  fhTowerDecayPhotonAsymmetry[iSupMod1]->Fill(ieta1,iphi1,asym);
710 
711  fhTowerDecayPhotonHit [iSupMod2]->Fill(ieta2,iphi2);
712  fhTowerDecayPhotonEnergy [iSupMod2]->Fill(ieta2,iphi2,fMomentum2.E());
713  fhTowerDecayPhotonAsymmetry[iSupMod2]->Fill(ieta2,iphi2,asym);
714 
715  if(!mask1)fhTowerDecayPhotonHitMaskFrame[iSupMod1]->Fill(ieta1,iphi1);
716  if(!mask2)fhTowerDecayPhotonHitMaskFrame[iSupMod2]->Fill(ieta2,iphi2);
717 
718  }// pair in mass of pi0
719  }
720  else
721  {
722  //printf("Regroup N %d, eta1 %d, phi1 %d, eta2 %d, phi2 %d \n",fGroupNCells, ieta1, iphi1, ieta2, iphi2);
723  for (Int_t i = -fGroupNCells; i < fGroupNCells+1; i++)
724  {
725  for (Int_t j = -fGroupNCells; j < fGroupNCells+1; j++)
726  {
727  Int_t absId11 = fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod1, iphi1+j, ieta1+i);
728  Int_t absId22 = fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod2, iphi2+j, ieta2+i);
729 
730  Bool_t ok1 = kFALSE;
731  Bool_t ok2 = kFALSE;
732 
733  for(Int_t icell = 0; icell < c1->GetNCells(); icell++)
734  {
735  if(c1->GetCellsAbsId()[icell] == absId11) ok1=kTRUE;
736  }
737 
738  for(Int_t icell = 0; icell < c2->GetNCells(); icell++)
739  {
740  if(c2->GetCellsAbsId()[icell] == absId22) ok2=kTRUE;
741  }
742 
743  if(ok1 && (ieta1+i >= 0) && (iphi1+j >= 0) && (ieta1+i < 48) && (iphi1+j < 24))
744  {
745  fHmpi0[iSupMod1][ieta1+i][iphi1+j]->Fill(invmass);
746  if(fCellEnergyHiso) fhEnergy[iSupMod1][ieta1+i][iphi1+j]->Fill(fMomentum1.E());
747  }
748 
749  if(ok2 && (ieta2+i >= 0) && (iphi2+j >= 0) && (ieta2+i < 48) && (iphi2+j < 24))
750  {
751  fHmpi0[iSupMod2][ieta2+i][iphi2+j]->Fill(invmass);
752  if(fCellEnergyHiso) fhEnergy[iSupMod2][ieta2+i][iphi2+j]->Fill(fMomentum2.E());
753  }
754  }// j loop
755  }//i loop
756  }//group cells
757 
758  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",
759  iSupMod1,iphi1,ieta1,iSupMod2,iphi2,ieta2,fMomentum12.M(),e1i,c1->E(),e2i,c2->E()));
760  }
761  }
762  } // end of loop over EMCAL clusters
763 
764  for(Int_t iSM = 0; iSM < nSM; iSM++)
765  {
766  AliDebug(2,Form("nbClusterInTopo = %i\n",nbClusterInTopoHisto[iSM]));
767 
768  if(nbClusterInTopoHisto[iSM] == 0) continue;
769 
770  fhTopoClusterAmpCase0[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
771  fhTopoClusterAmpFractionCase0[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
772 
773  fhTopoClusterAmpCase1[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
774  fhTopoClusterAmpFractionCase1[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
775 
776  fhTopoClusterAmpCase2[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
777  fhTopoClusterAmpFractionCase2[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
778 
779  fhTopoClusterAmpCase3[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
780  fhTopoClusterAmpFractionCase3[iSM]->Scale(1./nbClusterInTopoHisto[iSM]);
781  }
782 
783 }
784 
785 
790 //______________________________________________________________________
792 {
793  if ( !fRecoUtils->IsRecalibrationOn() || fCalibFilePath == "" ) return ;
794 
795  if(!fEMCALGeo)fEMCALGeo = AliEMCALGeometry::GetInstance(fEMCALGeoName) ;
796 
797  TFile * calibFactorsFile = TFile::Open(fCalibFilePath.Data());
798 
799  if ( !calibFactorsFile ) AliFatal("Cannot recover the calibration factors");
800 
801  for(Int_t ism = 0; ism < fEMCALGeo->GetNumberOfSuperModules(); ism++)
802  {
803  TH2F * histo = (TH2F*) calibFactorsFile->Get(Form("EMCALRecalFactors_SM%d",ism));
804  printf("In AliAnalysisTaskEMCALPi0CalibSelection::InitEnergyCalibrationFactors \n ---Recover calibration factor for : EMCALRecalFactors_SM%d %p\n",ism,histo);
805 
806  if ( histo )
808  else
809  AliWarning(Form("Null histogram with calibration factors for SM%d, 1 will be used for the full SM!",ism));
810  }
811 }
812 
816 //________________________________________________________________
818 {
819  Int_t runnumber = InputEvent()->GetRunNumber() ;
820 
821  //
822  // Load default geo matrices if requested
823  if(fImportGeometryFromFile && !gGeoManager)
824  {
825  if(fImportGeometryFilePath=="") // If not specified, set location depending on run number
826  {
827  // "$ALICE_ROOT/EVE/alice-data/default_geo.root"
828  if (runnumber < 140000) fImportGeometryFilePath = AliDataFile::GetFileNameOADB("EMCAL/geometry_2010.root").data();
829  else if(runnumber < 171000) fImportGeometryFilePath = AliDataFile::GetFileNameOADB("EMCAL/geometry_2011.root").data();
830  else if(runnumber < 198000) fImportGeometryFilePath = AliDataFile::GetFileNameOADB("EMCAL/geometry_2012.root").data(); // 2012-2013
831  else fImportGeometryFilePath = AliDataFile::GetFileNameOADB("EMCAL/geometry_2015.root").data(); // >= 2015
832  }
833 
834  AliInfo(Form("Import %s",fImportGeometryFilePath.Data()));
835 
836  TGeoManager::Import(fImportGeometryFilePath) ; // default need file "geometry.root" in local dir!!!!
837  }
838 
839  //
840  if(fLoadMatrices)
841  {
842  AliInfo("Load user defined EMCAL geometry matrices");
843  // OADB if available
844  AliOADBContainer emcGeoMat("AliEMCALgeo");
845 
846  if(fOADBFilePath!="")
847  emcGeoMat.InitFromFile(Form("%s/EMCALlocal2master.root",fOADBFilePath.Data()),"AliEMCALgeo");
848  else
849  emcGeoMat.InitFromFile(AliDataFile::GetFileNameOADB("EMCAL/EMCALlocal2master.root").data(),"AliEMCALgeo");
850 
851  TObjArray *matEMCAL=(TObjArray*)emcGeoMat.GetObject(runnumber,"EmcalMatrices");
852 
853  for(Int_t mod = 0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
854  {
855  if (!fMatrix[mod]) // Get it from OADB
856  {
857  AliDebug(1,Form("EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
858  //((TGeoHMatrix*) matEMCAL->At(mod))->Print();
859 
860  fMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
861  }
862 
863  if(fMatrix[mod])
864  {
865  if(DebugLevel() > 1)
866  fMatrix[mod]->Print();
867 
868  fEMCALGeo->SetMisalMatrix(fMatrix[mod],mod) ;
869  }
870  else if(gGeoManager)
871  {
872  AliWarning(Form("Set matrix for SM %d from gGeoManager",mod));
873  fEMCALGeo->SetMisalMatrix(fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
874  }
875  else
876  {
877  AliError(Form("Alignment matrix for SM %d is not available",mod));
878  }
879  }//SM loop
880  }//Load matrices
881  else if(!gGeoManager)
882  {
883  AliInfo("Get geo matrices from data");
884  //Still not implemented in AOD, just a workaround to be able to work at least with ESDs
885  if(!strcmp(InputEvent()->GetName(),"AliAODEvent"))
886  {
887  AliWarning("Use ideal geometry, values geometry matrix not kept in AODs");
888  }//AOD
889  else
890  {
891  AliDebug(1,"AliAnalysisTaskEMCALClusterize Load Misaligned matrices");
892 
893  for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
894  {
895  if(InputEvent()->GetEMCALMatrix(mod))
896  {
897  if(DebugLevel() > 1)
898  InputEvent()->GetEMCALMatrix(mod)->Print();
899 
900  fEMCALGeo->SetMisalMatrix(InputEvent()->GetEMCALMatrix(mod),mod) ;
901  }
902 
903  }
904  }// ESD
905  }// Load matrices from Data
906  else if(gGeoManager) // Load default matrices
907  {
908  for(Int_t mod = 0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
909  {
910  AliWarning(Form("Set matrix for SM %d from gGeoManager",mod));
911  fEMCALGeo->SetMisalMatrix(fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
912  }
913  } // gGeoManager matrices
914 
915 }
916 
920 //______________________________________________________________________
922 {
923  if(!fRecoUtils->IsRunDepRecalibrationOn()) return;
924 
925  AliOADBContainer *contRFTD=new AliOADBContainer("");
926 
927  if(fOADBFilePath!="")
928  contRFTD->InitFromFile(Form("%s/EMCALTemperatureCorrCalib.root",fOADBFilePath.Data()),"AliEMCALRunDepTempCalibCorrections");
929  else
930  contRFTD->InitFromFile(AliDataFile::GetFileNameOADB("EMCAL/EMCALTemperatureCorrCalib.root").data(),"AliEMCALRunDepTempCalibCorrections");
931 
932  Int_t runnumber = InputEvent()->GetRunNumber() ;
933 
934  TH1S *htd=(TH1S*)contRFTD->GetObject(runnumber);
935 
936  //If it did not exist for this run, get closes one
937  if (!htd)
938  {
939  AliWarning(Form("No TemperatureCorrCalib Objects for run: %d",runnumber));
940 
941  // let's get the closest runnumber instead then..
942  Int_t lower = 0;
943  Int_t ic = 0;
944  Int_t maxEntry = contRFTD->GetNumberOfEntries();
945 
946  while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) < runnumber) )
947  {
948  lower = ic;
949  ic++;
950  }
951 
952  Int_t closest = lower;
953  if ( (ic<maxEntry) &&
954  (contRFTD->LowerLimit(ic)-runnumber) < (runnumber - contRFTD->UpperLimit(lower)) )
955  {
956  closest = ic;
957  }
958 
959  AliWarning(Form("TemperatureCorrCalib Objects found closest id %d from run: %d",
960  closest, contRFTD->LowerLimit(closest)));
961 
962  htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
963  }
964 
965  // Fill parameters
966  if(htd)
967  {
968  AliInfo("Recalibrate (Temperature) EMCAL");
969 
970  Int_t nSM = fEMCALGeo->GetNumberOfSuperModules();
971 
972  for (Int_t ism = 0; ism < nSM; ++ism)
973  {
974  for (Int_t icol = 0; icol < 48; ++icol)
975  {
976  for (Int_t irow = 0; irow < 24; ++irow)
977  {
978  Float_t factor = fRecoUtils->GetEMCALChannelRecalibrationFactor(ism,icol,irow);
979 
980  Int_t absID = fEMCALGeo->GetAbsCellIdFromCellIndexes(ism, irow, icol); // original calibration factor
981 
982  AliDebug(3,Form(" ism %d, icol %d, irow %d,absID %d - Calib factor %1.5f - ",ism, icol, irow, absID, factor));
983 
984  factor *= htd->GetBinContent(absID) / 10000. ; // correction dependent on T
985 
986  fRecoUtils->SetEMCALChannelRecalibrationFactor(ism,icol,irow,factor);
987 
988  AliDebug(3,Form("T factor %1.5f - final factor %1.5f",
989  htd->GetBinContent(absID) / 10000.,
991  } // columns
992  } // rows
993  } // SM loop
994  }
995  else AliInfo("Do NOT recalibrate EMCAL with T variations, no params TH1");
996 
997  delete contRFTD;
998 }
999 
1000 
1003 //___________________________________________________________________
1005 {
1006  if(!fEMCALGeo)fEMCALGeo = AliEMCALGeometry::GetInstance(fEMCALGeoName) ;
1007  Int_t nSM = (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
1008 
1009  fOutputContainer = new TList();
1010  const Int_t buffersize = 255;
1011  char hname[buffersize], htitl[buffersize], htitlEnergy[buffersize];
1012 
1013  fhNEvents = new TH1I("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
1015 
1016  if ( fCheckCentrality )
1017  {
1018  fhCentrality = new TH1F
1019  ("hCentrality",
1020  Form("Number of events in centrality bins, |vz|<10 cm, method <%s> ",fCentralityClass.Data()),
1021  1000,-1000.,1000.) ;
1022  fhCentrality->SetXTitle("Centrality bin");
1024 
1025  fhCentralitySelected = new TH1F
1026  ("hCentralitySelected",
1027  Form("Number of selected events in centrality bin, |vz|<10 cm, method <%s> ",fCentralityClass.Data()),
1028  100,0.,100.) ;
1029  fhCentralitySelected->SetXTitle("Centrality bin");
1031  }
1032 
1033  fHmgg = new TH2F("hmgg","2-cluster invariant mass",fNbins,fMinBin,fMaxBin,100,0,10);
1034  fHmgg->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1035  fHmgg->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1036  fOutputContainer->Add(fHmgg);
1037 
1038  fHmggDifferentSM = new TH2F("hmggDifferentSM","2-cluster invariant mass, different SM",fNbins,fMinBin,fMaxBin,100,0,10);
1039  fHmggDifferentSM->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1040  fHmggDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1042 
1043  fHOpeningAngle = new TH2F("hopang","2-cluster opening angle",100,0.,50.,100,0,10);
1044  fHOpeningAngle->SetXTitle("#alpha_{#gamma #gamma}");
1045  fHOpeningAngle->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1047 
1048  fHOpeningAngleDifferentSM = new TH2F("hopangDifferentSM","2-cluster opening angle, different SM",100,0,50.,100,0,10);
1049  fHOpeningAngleDifferentSM->SetXTitle("#alpha_{#gamma #gamma}");
1050  fHOpeningAngleDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1052 
1053  fHAsymmetry = new TH2F("hasym","2-cluster opening angle",100,0.,1.,100,0,10);
1054  fHAsymmetry->SetXTitle("a");
1055  fHAsymmetry->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1057 
1058  fHAsymmetryDifferentSM = new TH2F("hasymDifferentSM","2-cluster opening angle, different SM",100,0,1.,100,0,10);
1059  fHAsymmetryDifferentSM->SetXTitle("a");
1060  fHAsymmetryDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1062 
1063  //TString pairname[] = {"A side (0-2)", "C side (1-3)","Row 0 (0-1)", "Row 1 (2-3)"};
1064 
1065  fHmggMaskFrame = new TH2F("hmggMaskFrame","2-cluster invariant mass, frame masked",fNbins,fMinBin,fMaxBin,100,0,10);
1066  fHmggMaskFrame->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1067  fHmggMaskFrame->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1069 
1070  fHmggDifferentSMMaskFrame = new TH2F("hmggDifferentSMMaskFrame","2-cluster invariant mass, different SM, frame masked",
1071  fNbins,fMinBin,fMaxBin,100,0,10);
1072  fHmggDifferentSMMaskFrame->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1073  fHmggDifferentSMMaskFrame->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1075 
1076  for(Int_t iSM = 0; iSM < nSM; iSM++)
1077  {
1078  snprintf(hname, buffersize, "hmgg_SM%d",iSM);
1079  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d",iSM);
1080  fHmggSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1081  fHmggSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1082  fHmggSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1083  fOutputContainer->Add(fHmggSM[iSM]);
1084 
1085  snprintf(hname, buffersize, "hmgg_SM%d_MaskFrame",iSM);
1086  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d",iSM);
1087  fHmggSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1088  fHmggSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1089  fHmggSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1091 
1092  snprintf(hname, buffersize, "hmgg_SM%d_Zone1",iSM);
1093  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d in zone 1",iSM);
1094  fHmggSM_Zone1[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1095  fHmggSM_Zone1[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1096  fHmggSM_Zone1[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1097  fOutputContainer->Add(fHmggSM_Zone1[iSM]);
1098 
1099  snprintf(hname, buffersize, "hmgg_SM%d_Zone2",iSM);
1100  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d in zone 2",iSM);
1101  fHmggSM_Zone2[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1102  fHmggSM_Zone2[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1103  fHmggSM_Zone2[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1104  fOutputContainer->Add(fHmggSM_Zone2[iSM]);
1105 
1106  snprintf(hname, buffersize, "hmgg_SM%d_Zone3",iSM);
1107  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d in zone 3",iSM);
1108  fHmggSM_Zone3[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1109  fHmggSM_Zone3[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1110  fHmggSM_Zone3[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1111  fOutputContainer->Add(fHmggSM_Zone3[iSM]);
1112 
1113  snprintf(hname, buffersize, "hmgg_SM%d_Zone4",iSM);
1114  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d in zone 4",iSM);
1115  fHmggSM_Zone4[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1116  fHmggSM_Zone4[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1117  fHmggSM_Zone4[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1118  fOutputContainer->Add(fHmggSM_Zone4[iSM]);
1119 
1120  snprintf(hname, buffersize, "hmgg_SM%d_Zone5",iSM);
1121  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d in zone 5",iSM);
1122  fHmggSM_Zone5[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1123  fHmggSM_Zone5[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1124  fHmggSM_Zone5[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1125  fOutputContainer->Add(fHmggSM_Zone5[iSM]);
1126 
1127  snprintf(hname, buffersize, "hmgg_SM%d_Zone6",iSM);
1128  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d in zone 6",iSM);
1129  fHmggSM_Zone6[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1130  fHmggSM_Zone6[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1131  fHmggSM_Zone6[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1132  fOutputContainer->Add(fHmggSM_Zone6[iSM]);
1133 
1134  snprintf(hname, buffersize, "hmgg_SM%d_Zone7",iSM);
1135  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d in zone 7",iSM);
1136  fHmggSM_Zone7[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1137  fHmggSM_Zone7[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1138  fHmggSM_Zone7[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1139  fOutputContainer->Add(fHmggSM_Zone7[iSM]);
1140 
1141  if(iSM < nSM/2)
1142  {
1143  snprintf(hname,buffersize, "hmgg_PairSameSectorSM%d",iSM);
1144  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
1145  fHmggPairSameSectorSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1146  fHmggPairSameSectorSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1147  fHmggPairSameSectorSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1149 
1150  snprintf(hname,buffersize, "hmgg_PairSameSectorSM%d_MaskFrame",iSM);
1151  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
1152  fHmggPairSameSectorSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1153  fHmggPairSameSectorSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1154  fHmggPairSameSectorSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1156 
1157  fhClusterPairDiffTimeSameSector[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSector%d",iSM),
1158  Form("cluster pair time difference vs E, Sector %d",iSM),
1159  100,0,10, 200,-100,100);
1160  fhClusterPairDiffTimeSameSector[iSM]->SetXTitle("E_{pair} (GeV)");
1161  fhClusterPairDiffTimeSameSector[iSM]->SetYTitle("#Delta t (ns)");
1163  }
1164 
1165  if(iSM < nSM-2)
1166  {
1167  snprintf(hname,buffersize, "hmgg_PairSameSideSM%d",iSM);
1168  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
1169  fHmggPairSameSideSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1170  fHmggPairSameSideSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1171  fHmggPairSameSideSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1173 
1174  snprintf(hname,buffersize, "hmgg_PairSameSideSM%d_MaskFrame",iSM);
1175  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
1176  fHmggPairSameSideSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
1177  fHmggPairSameSideSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
1178  fHmggPairSameSideSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1180 
1181  fhClusterPairDiffTimeSameSide[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSide%d",iSM),
1182  Form("cluster pair time difference vs E, Side %d",iSM),
1183  100,0,10, 200,-100,100);
1184  fhClusterPairDiffTimeSameSide[iSM]->SetXTitle("E_{pair} (GeV)");
1185  fhClusterPairDiffTimeSameSide[iSM]->SetYTitle("#Delta t (ns)");
1187  }
1188 
1189  snprintf(hname, buffersize, "hopang_SM%d",iSM);
1190  snprintf(htitl, buffersize, "Opening angle for super mod %d",iSM);
1191  fHOpeningAngleSM[iSM] = new TH2F(hname,htitl,100,0.,50.,100,0,10);
1192  fHOpeningAngleSM[iSM]->SetXTitle("#alpha_{#gamma #gamma} (deg)");
1193  fHOpeningAngleSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1195 
1196  snprintf(hname,buffersize, "hopang_PairSM%d",iSM);
1197  snprintf(htitl,buffersize, "Opening angle for SM pair: %d",iSM);
1198  fHOpeningAnglePairSM[iSM] = new TH2F(hname,htitl,100,0.,50.,100,0,10);
1199  fHOpeningAnglePairSM[iSM]->SetXTitle("#alpha_{#gamma #gamma} (deg)");
1200  fHOpeningAnglePairSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1202 
1203  snprintf(hname, buffersize, "hasym_SM%d",iSM);
1204  snprintf(htitl, buffersize, "Asymmetry for super mod %d",iSM);
1205  fHAsymmetrySM[iSM] = new TH2F(hname,htitl,100,0.,1.,100,0,10);
1206  fHAsymmetrySM[iSM]->SetXTitle("a");
1207  fHAsymmetrySM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1208  fOutputContainer->Add(fHAsymmetrySM[iSM]);
1209 
1210  snprintf(hname,buffersize, "hasym_PairSM%d",iSM);
1211  snprintf(htitl,buffersize, "Asymmetry for SM pair: %d",iSM);
1212  fHAsymmetryPairSM[iSM] = new TH2F(hname,htitl,100,0.,1.,100,0,10);
1213  fHAsymmetryPairSM[iSM]->SetXTitle("a");
1214  fHAsymmetryPairSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
1215  fOutputContainer->Add(fHAsymmetryPairSM[iSM]);
1216 
1217  Int_t colmax = 48;
1218  Int_t rowmax = 24;
1219 
1220  fhTowerDecayPhotonHit[iSM] = new TH2F (Form("hTowerDecPhotonHit_Mod%d",iSM),
1221  Form("Entries in grid of cells in Module %d",iSM),
1222  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1223  fhTowerDecayPhotonHit[iSM]->SetYTitle("row (phi direction)");
1224  fhTowerDecayPhotonHit[iSM]->SetXTitle("column (eta direction)");
1226 
1227  fhTowerDecayPhotonEnergy[iSM] = new TH2F (Form("hTowerDecPhotonEnergy_Mod%d",iSM),
1228  Form("Accumulated energy in grid of cells in Module %d",iSM),
1229  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1230  fhTowerDecayPhotonEnergy[iSM]->SetYTitle("row (phi direction)");
1231  fhTowerDecayPhotonEnergy[iSM]->SetXTitle("column (eta direction)");
1233 
1234  fhTowerDecayPhotonAsymmetry[iSM] = new TH2F (Form("hTowerDecPhotonAsymmetry_Mod%d",iSM),
1235  Form("Accumulated asymmetry in grid of cells in Module %d",iSM),
1236  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1237  fhTowerDecayPhotonAsymmetry[iSM]->SetYTitle("row (phi direction)");
1238  fhTowerDecayPhotonAsymmetry[iSM]->SetXTitle("column (eta direction)");
1240 
1241  fhTowerDecayPhotonHitMaskFrame[iSM] = new TH2F (Form("hTowerDecPhotonHit_Mod%d_MaskFrame",iSM),Form("Entries in grid of cells in Module %d",iSM),
1242  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1243  fhTowerDecayPhotonHitMaskFrame[iSM]->SetYTitle("row (phi direction)");
1244  fhTowerDecayPhotonHitMaskFrame[iSM]->SetXTitle("column (eta direction)");
1246 
1247  fhClusterTimeSM[iSM] = new TH2F(Form("hClusterTime_SM%d",iSM),"cluster time vs E",100,0,10, 200,-1000,1000);
1248  fhClusterTimeSM[iSM]->SetXTitle("E (GeV)");
1249  fhClusterTimeSM[iSM]->SetYTitle("t (ns)");
1250  fOutputContainer->Add(fhClusterTimeSM[iSM]);
1251 
1252  fhClusterPairDiffTimeSameSM[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSM%d",iSM),
1253  Form("cluster pair time difference vs E, SM %d",iSM),
1254  100,0,10, 200,-100,100);
1255  fhClusterPairDiffTimeSameSM[iSM]->SetXTitle("E (GeV)");
1256  fhClusterPairDiffTimeSameSM[iSM]->SetYTitle("#Delta t (ns)");
1258 
1259 
1260  if(fClusterTopology)
1261  {
1262 
1263  fhTopoClusterCase0[iSM] = new TH2F(Form("hTopoClusterCase0SM%d",iSM),
1264  Form("cluster topology for cluster in position 0 in noisy quartet, SM %d",iSM),
1265  21,-10.5,10.5, 21,-10.5,10.5);
1266  fhTopoClusterCase0[iSM]->SetXTitle("column");
1267  fhTopoClusterCase0[iSM]->SetYTitle("row");
1269 
1270  fhTopoClusterCase1[iSM] = new TH2F(Form("hTopoClusterCase1SM%d",iSM),
1271  Form("cluster topology for cluster in position 1 in noisy quartet, SM %d",iSM),
1272  21,-10.5,10.5, 21,-10.5,10.5);
1273  fhTopoClusterCase1[iSM]->SetXTitle("column");
1274  fhTopoClusterCase1[iSM]->SetYTitle("row");
1276 
1277  fhTopoClusterCase2[iSM] = new TH2F(Form("hTopoClusterCase2SM%d",iSM),
1278  Form("cluster topology for cluster in position 2 in noisy quartet, SM %d",iSM),
1279  21,-10.5,10.5, 21,-10.5,10.5);
1280  fhTopoClusterCase2[iSM]->SetXTitle("column");
1281  fhTopoClusterCase2[iSM]->SetYTitle("row");
1283 
1284  fhTopoClusterCase3[iSM] = new TH2F(Form("hTopoClusterCase3SM%d",iSM),
1285  Form("cluster topology for cluster in position 3 in noisy quartet, SM %d",iSM),
1286  21,-10.5,10.5, 21,-10.5,10.5);
1287  fhTopoClusterCase3[iSM]->SetXTitle("column");
1288  fhTopoClusterCase3[iSM]->SetYTitle("row");
1290 
1291  fhTopoClusterAmpCase0[iSM] = new TH2F(Form("hTopoClusterAmpCase0SM%d",iSM),
1292  Form("cluster topology for cluster in position 0 in noisy quartet, SM %d",iSM),
1293  21,-10.5,10.5, 21,-10.5,10.5);
1294  fhTopoClusterAmpCase0[iSM]->SetXTitle("column");
1295  fhTopoClusterAmpCase0[iSM]->SetYTitle("row");
1297 
1298  fhTopoClusterAmpCase1[iSM] = new TH2F(Form("hTopoClusterAmpCase1SM%d",iSM),
1299  Form("cluster topology for cluster in position 1 in noisy quartet, SM %d",iSM),
1300  21,-10.5,10.5, 21,-10.5,10.5);
1301  fhTopoClusterAmpCase1[iSM]->SetXTitle("column");
1302  fhTopoClusterAmpCase1[iSM]->SetYTitle("row");
1304 
1305  fhTopoClusterAmpCase2[iSM] = new TH2F(Form("hTopoClusterAmpCase2SM%d",iSM),
1306  Form("cluster topology for cluster in position 2 in noisy quartet, SM %d",iSM),
1307  21,-10.5,10.5, 21,-10.5,10.5);
1308  fhTopoClusterAmpCase2[iSM]->SetXTitle("column");
1309  fhTopoClusterAmpCase2[iSM]->SetYTitle("row");
1311 
1312  fhTopoClusterAmpCase3[iSM] = new TH2F(Form("hTopoClusterAmpCase3SM%d",iSM),
1313  Form("cluster topology for cluster in position 3 in noisy quartet, SM %d",iSM),
1314  21,-10.5,10.5, 21,-10.5,10.5);
1315  fhTopoClusterAmpCase3[iSM]->SetXTitle("column");
1316  fhTopoClusterAmpCase3[iSM]->SetYTitle("row");
1318 
1319 
1320  fhTopoClusterAmpFractionCase0[iSM] = new TH2F(Form("hTopoClusterAmpFractionCase0SM%d",iSM),
1321  Form("cluster topology for cluster in position 0 in noisy quartet, SM %d",iSM),
1322  21,-10.5,10.5, 21,-10.5,10.5);
1323  fhTopoClusterAmpFractionCase0[iSM]->SetXTitle("column");
1324  fhTopoClusterAmpFractionCase0[iSM]->SetYTitle("row");
1326 
1327  fhTopoClusterAmpFractionCase1[iSM] = new TH2F(Form("hTopoClusterAmpFractionCase1SM%d",iSM),
1328  Form("cluster topology for cluster in position 1 in noisy quartet, SM %d",iSM),
1329  21,-10.5,10.5, 21,-10.5,10.5);
1330  fhTopoClusterAmpFractionCase1[iSM]->SetXTitle("column");
1331  fhTopoClusterAmpFractionCase1[iSM]->SetYTitle("row");
1333 
1334  fhTopoClusterAmpFractionCase2[iSM] = new TH2F(Form("hTopoClusterAmpFractionCase2SM%d",iSM),
1335  Form("cluster topology for cluster in position 2 in noisy quartet, SM %d",iSM),
1336  21,-10.5,10.5, 21,-10.5,10.5);
1337  fhTopoClusterAmpFractionCase2[iSM]->SetXTitle("column");
1338  fhTopoClusterAmpFractionCase2[iSM]->SetYTitle("row");
1340 
1341  fhTopoClusterAmpFractionCase3[iSM] = new TH2F(Form("hTopoClusterAmpFractionCase3SM%d",iSM),
1342  Form("cluster topology for cluster in position 3 in noisy quartet, SM %d",iSM),
1343  21,-10.5,10.5, 21,-10.5,10.5);
1344  fhTopoClusterAmpFractionCase3[iSM]->SetXTitle("column");
1345  fhTopoClusterAmpFractionCase3[iSM]->SetYTitle("row");
1347  }
1348  }
1349 
1350  Int_t nchannels = nSM*AliEMCALGeoParams::fgkEMCALRows*AliEMCALGeoParams::fgkEMCALCols;
1351  for(Int_t ibc = 0; ibc < 4; ibc++)
1352  {
1353  fHTpi0[ibc] = new TH2F(Form("hTime_BC%d",ibc),Form("Time of cell clusters under pi0 peak, bunch crossing %d",ibc),
1354  nchannels,0,nchannels, fNTimeBins,fMinTimeBin,fMaxTimeBin);
1355  fOutputContainer->Add(fHTpi0[ibc]);
1356  fHTpi0[ibc]->SetYTitle("time (ns)");
1357  fHTpi0[ibc]->SetXTitle("abs. Id. ");
1358  }
1359 
1360  fhClusterTime = new TH2F("hClusterTime","cluster time vs E",100,0,10, 100,0,1000);
1361  fhClusterTime->SetXTitle("E (GeV)");
1362  fhClusterTime->SetYTitle("t (ns)");
1364 
1365  fhClusterPairDiffTime = new TH2F("hClusterPairDiffTime","cluster pair time difference vs E",100,0,10, 800,-400,400);
1366  fhClusterPairDiffTime->SetXTitle("E_{pair} (GeV)");
1367  fhClusterPairDiffTime->SetYTitle("#Delta t (ns)");
1369 
1370  for(Int_t iMod=0; iMod < nSM; iMod++)
1371  {
1372  for(Int_t iRow=0; iRow < AliEMCALGeoParams::fgkEMCALRows; iRow++)
1373  {
1374  for(Int_t iCol=0; iCol < AliEMCALGeoParams::fgkEMCALCols; iCol++)
1375  {
1376  snprintf(hname,buffersize, "%d_%d_%d",iMod,iCol,iRow);
1377  snprintf(htitl,buffersize, "Two-gamma inv. mass for super mod %d, cell(col,row)=(%d,%d)",iMod,iCol,iRow);
1378  fHmpi0[iMod][iCol][iRow] = new TH1F(hname,htitl,fNbins,fMinBin,fMaxBin);
1379  fHmpi0[iMod][iCol][iRow]->SetXTitle("mass (MeV/c^{2})");
1380  fOutputContainer->Add(fHmpi0[iMod][iCol][iRow]);
1381 
1382  if(fCellEnergyHiso)
1383  {
1384  snprintf(htitlEnergy,buffersize, "Energy for super mod %d, cell(col,row)=(%d,%d)",iMod,iCol,iRow);
1385  fhEnergy[iMod][iCol][iRow] = new TH1F(Form("E_%s",hname),htitlEnergy,fNEnergybins,fMinEnergyBin,fMaxEnergyBin);
1386  fhEnergy[iMod][iCol][iRow]->SetXTitle("E (GeV)");
1387  fOutputContainer->Add(fhEnergy[iMod][iCol][iRow]);
1388  }
1389  }
1390  }
1391  }
1392 
1393  fOutputContainer->SetOwner(kTRUE);
1394 
1395  PostData(1,fOutputContainer);
1396 
1397 // // cuts container, set in terminate but init and post here
1398 //
1399 // fCuts = new TList();
1400 //
1401 // fCuts ->SetOwner(kTRUE);
1402 //
1403 // PostData(2, fCuts);
1404 }
1405 
1411 //______________________________________________________________________________________________________
1413 {
1414  Int_t icol = ieta;
1415  if(iSM%2) icol+=48; // Impair SM, shift index [0-47] to [48-96]
1416 
1418  {
1419  for (Int_t imask = 0; imask < fNMaskCellColumns; imask++)
1420  {
1421  if(icol==fMaskCellColumns[imask]) return kTRUE;
1422  }
1423  }
1424 
1425  return kFALSE;
1426 }
1427 
1428 
1437 //______________________________________________________________________________________________________
1439 {
1440  Int_t icol = ieta;
1441  Int_t irow = iphi;
1442 
1443 // printf("SM = %i\n",iSupMod);
1444 // printf("icol = %i\n",icol);
1445 // printf("irow = %i\n",irow);
1446 
1447  if(iSupMod%2) //Odd SM
1448  {
1449  if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1450  {
1451  if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1452  {
1453 // printf("zone 1\n");
1454  return kTRUE;
1455  }
1456  }
1457  }
1458  else //Even SM
1459  {
1460  if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1461  {
1462  if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1463  {
1464 // printf("zone 1\n");
1465  return kTRUE;
1466  }
1467  }
1468  }
1469 
1470  return kFALSE;
1471 }
1472 
1473 
1482 //______________________________________________________________________________________________________
1484 {
1485  Int_t icol = ieta;
1486  Int_t irow = iphi;
1487 
1488 // printf("SM = %i\n",iSupMod);
1489 // printf("icol = %i\n",icol);
1490 // printf("irow = %i\n",irow);
1491 
1492  if(iSupMod%2) //Odd SM
1493  {
1494  if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1495  {
1496  if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1497  {
1498  return kFALSE;
1499  }
1500  else
1501  {
1502 // printf("zone 2\n");
1503  return kTRUE;
1504  }
1505  }
1506  }
1507  else //Even SM
1508  {
1509  if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1510  {
1511  if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1512  {
1513  return kFALSE;
1514  }
1515  else
1516  {
1517 // printf("zone 2\n");
1518  return kTRUE;
1519  }
1520  }
1521  }
1522 
1523  return kFALSE;
1524 }
1525 
1526 
1535 //______________________________________________________________________________________________________
1537 {
1538  Int_t icol = ieta;
1539  Int_t irow = iphi;
1540 
1541 // printf("SM = %i\n",iSupMod);
1542 // printf("icol = %i\n",icol);
1543 // printf("irow = %i\n",irow);
1544 
1545  if(iSupMod%2) //Odd SM
1546  {
1547  if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1548  {
1549  if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1550  {
1551 // printf("zone 3\n");
1552  return kTRUE;
1553  }
1554  }
1555  }
1556  else //Even SM
1557  {
1558  if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1559  {
1560  if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1561  {
1562 // printf("zone 3\n");
1563  return kTRUE;
1564  }
1565  }
1566  }
1567 
1568  return kFALSE;
1569 }
1570 
1571 
1580 //______________________________________________________________________________________________________
1582 {
1583  Int_t icol = ieta;
1584  Int_t irow = iphi;
1585 
1586 // printf("SM = %i\n",iSupMod);
1587 // printf("icol = %i\n",icol);
1588 // printf("irow = %i\n",irow);
1589 
1590  if(iSupMod%2) //Odd SM
1591  {
1592  if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1593  {
1594  if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1595  {
1596  return kFALSE;
1597  }
1598  else
1599  {
1600 // printf("zone 4\n");
1601  return kTRUE;
1602  }
1603  }
1604  }
1605  else //Even SM
1606  {
1607  if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1608  {
1609  if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1610  {
1611  return kFALSE;
1612  }
1613  else
1614  {
1615 // printf("zone 4\n");
1616  return kTRUE;
1617  }
1618  }
1619  }
1620 
1621  return kFALSE;
1622 }
1623 
1624 
1634 //______________________________________________________________________________________________________
1636 {
1637  Int_t icol = ieta;
1638  Int_t irow = iphi;
1639 
1640  //Center of ellipse
1641  Float_t col0 = 47/2;
1642  Float_t row0 = 23/2;
1643 
1644  //Parameters
1645  Float_t a = 3-col0;
1646  Float_t b = 2-row0;
1647 
1648  if(((icol-col0)*(icol-col0)) / (a*a) + ((irow-row0)*(irow-row0) / (b*b)) > 1)
1649  {
1650  return kTRUE;
1651  }
1652  else
1653  {
1654  return kFALSE;
1655  }
1656 }
1657 
1658 
1668 //______________________________________________________________________________________________________
1670 {
1671  Int_t icol = ieta;
1672  Int_t irow = iphi;
1673 
1674  //Center of ellipse
1675  Float_t col0 = 47/2;
1676  Float_t row0 = 23/2;
1677 
1678  //Paramters
1679  Float_t aLarge = 3-col0;
1680  Float_t bLarge = 2-row0;
1681  Float_t aSmall = 16-col0;
1682  Float_t bSmall = 7-row0;
1683 
1684  if((((icol-col0)*(icol-col0)) / (aLarge*aLarge) + ((irow-row0)*(irow-row0) / (bLarge*bLarge)) < 1) && (((icol-col0)*(icol-col0)) / (aSmall*aSmall) + ((irow-row0)*(irow-row0) / (bSmall*bSmall)) > 1))
1685  {
1686  return kTRUE;
1687  }
1688  else
1689  {
1690  return kFALSE;
1691  }
1692 }
1693 
1694 
1704 //______________________________________________________________________________________________________
1706 {
1707  Int_t icol = ieta;
1708  Int_t irow = iphi;
1709 
1710  //Center of ellipse
1711  Float_t col0 = 47/2;
1712  Float_t row0 = 23/2;
1713 
1714  //Paramters
1715  Float_t a = 16-col0;
1716  Float_t b = 7-row0;
1717 
1718  if(((icol-col0)*(icol-col0)) / (a*a) + ((irow-row0)*(irow-row0) / (b*b)) < 1)
1719  {
1720  return kTRUE;
1721  }
1722  else
1723  {
1724  return kFALSE;
1725  }
1726 
1727 }
1728 
1729 
1735 //__________________________________________________________________________
1737 {
1738  // Event selection
1739 
1740  if(fTriggerName!="")
1741  {
1742  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (InputEvent());
1743  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (InputEvent());
1744 
1745  TString triggerClass = "";
1746  if (esdevent) triggerClass = esdevent->GetFiredTriggerClasses();
1747  else if(aodevent) triggerClass = aodevent->GetFiredTriggerClasses();
1748 
1749  AliDebug(1,Form("Event %d, FiredClass %s",
1750  (Int_t)Entry(),(((AliESDEvent*)InputEvent())->GetFiredTriggerClasses()).Data()));
1751 
1752  if(!triggerClass.Contains(fTriggerName))
1753  {
1754  AliDebug(1,"Reject event!");
1755  return;
1756  }
1757  else
1758  AliDebug(1,"Accept event!");
1759  }
1760 
1761  // Get the input event
1762 
1763  AliVEvent* event = 0;
1764  if(fFilteredInput) event = AODEvent();
1765  else event = InputEvent();
1766 
1767  if(!event)
1768  {
1769  AliWarning("Input event not available!");
1770  return;
1771  }
1772 
1773  // Centrality selection
1774 
1775  if ( fCheckCentrality )
1776  {
1777  AliMultSelection* multSelection = (AliMultSelection * ) event->FindListObject("MultSelection") ;
1778  if ( multSelection )
1779  {
1780  Float_t cent = multSelection->GetMultiplicityPercentile(fCentralityClass, fCentWithEventSel);
1781  fhCentrality->Fill(cent);
1782 
1783  AliDebug(1,Form("Centrality %2.1f for class <%s>, event sel %d\n",cent,fCentralityClass.Data(),fCentWithEventSel));
1784  //printf("Centrality %2.1f for class <%s>, select in [%1.1f,%1.1f]\n",cent,fCentralityClass.Data(),fCentMin,fCentMax);
1785 
1786  if ( cent < fCentMin || cent >= fCentMax ) return ;
1787 
1788  fhCentralitySelected->Fill(cent);
1789  }
1790  }
1791 
1792  AliDebug(1,Form("<<< %s: Event %d >>>",event->GetName(), (Int_t)Entry()));
1793 
1794  // Get the primary vertex
1795 
1796  event->GetPrimaryVertex()->GetXYZ(fVertex) ;
1797 
1798  AliDebug(1,Form("Vertex: (%.3f,%.3f,%.3f)",fVertex[0],fVertex[1],fVertex[2]));
1799 
1800  //Int_t runNum = aod->GetRunNumber();
1801  //if(DebugLevel() > 1) printf("Run number: %d\n",runNum);
1802 
1803  fhNEvents->Fill(0); //Count the events to be analyzed
1804 
1805  // Acccess once the geometry matrix and temperature corrections and calibration coefficients
1806  if(fhNEvents->GetEntries() == 1)
1807  {
1809 
1811 
1812 // InitEnergyCalibrationFactors();
1813  }
1814 
1815  //Get the list of clusters and cells
1816  fEMCALCells = event->GetEMCALCells();
1817 
1818  fCaloClustersArr = new TRefArray();
1819  event->GetEMCALClusters(fCaloClustersArr);
1820 
1821  AliDebug(1,Form("N CaloClusters: %d - N CaloCells %d",fCaloClustersArr->GetEntriesFast(), fEMCALCells->GetNumberOfCells()));
1822 
1823  // Apply non linearity, new calibration, T calibration to the clusters
1824  if( fCorrectClusters )
1825  CorrectClusters();
1826 
1827  FillHistograms();
1828 
1829  delete fCaloClustersArr;
1830 
1831  PostData(1,fOutputContainer);
1832 }
1833 
1836 //_____________________________________________________
1838 {
1839  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",
1841 
1842  printf("Group %d cells\n", fGroupNCells) ;
1843 
1844  printf("Cluster maximal cell away from border at least %d cells\n", fRecoUtils->GetNumberOfCellsFromEMCALBorder()) ;
1845 
1846  printf("Histograms: bins %d; energy range: %2.2f < E < %2.2f MeV\n",fNbins,fMinBin,fMaxBin) ;
1847 
1848  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",
1850 
1851  printf("OADB path : %s\n",fOADBFilePath .Data());
1852  printf("Calibration path : %s\n",fCalibFilePath.Data());
1853 
1854  printf("EMCAL Geometry name: < %s >, Load Matrices %d\n",fEMCALGeoName.Data(), fLoadMatrices) ;
1855 
1856  if ( fCheckCentrality )
1857  printf("Select centrality bin [%1.1f,%1.1f] for class <%s>, event sel. %d\n",fCentMin,fCentMax,fCentralityClass.Data(),fCentWithEventSel);
1858 
1859  if(fLoadMatrices) { for(Int_t ism = 0; ism < AliEMCALGeoParams::fgkEMCALModules; ism++) if(fMatrix[ism]) fMatrix[ism]->Print() ; }
1860 }
1861 
1865 //_____________________________________________________________________
1867 {
1868  if(n > fNMaskCellColumns)
1869  {
1870  delete [] fMaskCellColumns ;
1871 
1872  fMaskCellColumns = new Int_t[n] ;
1873  }
1874 
1875  fNMaskCellColumns = n ;
1876 }
1877 
1882 //___________________________________________________________________________________
1884 {
1885  if(ipos < fNMaskCellColumns) fMaskCellColumns[ipos] = icol ;
1886  else AliWarning("Mask column not set, position larger than allocated set size first") ;
1887 }
1888 
1894 //___________________________________________________________________________________
1896 {
1897  Int_t iPos;
1898 
1899  if(icol%2 == 0)
1900  {
1901  if(irow%8 < 4)
1902  {
1903  iPos = 0;
1904  }
1905  else if(irow%8 < 8)
1906  {
1907  iPos = 2;
1908  }
1909  else iPos = -1;
1910 
1911  }
1912  else
1913  {
1914  if(irow%8 < 4)
1915  {
1916  iPos = 1;
1917  }
1918  else if(irow%8 < 8)
1919  {
1920  iPos = 3;
1921  }
1922  else iPos = -1;
1923  }
1924 
1925  return iPos;
1926 }
1927 
1930 //______________________________________________________________
1932 {
1933  AliDebug(1,"Not implemented");
1934 // const Int_t buffersize = 255;
1935 // char onePar[buffersize] ;
1936 
1937 // 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",
1938 // fEmin,fEmax, fL0min, fL0max, fMinNCells, fAsyCut, fDTimeCut, fTimeMin, fTimeMax, fInvMassCutMin, fInvMassCutMax) ;
1939 // fCuts->Add(new TObjString(onePar));
1940 // snprintf(onePar,buffersize, "Group %d cells;", fGroupNCells) ;
1941 // fCuts->Add(new TObjString(onePar));
1942 // snprintf(onePar,buffersize, "Cluster maximal cell away from border at least %d cells;", fRecoUtils->GetNumberOfCellsFromEMCALBorder()) ;
1943 // fCuts->Add(new TObjString(onePar));
1944 // snprintf(onePar,buffersize, "Histograms, Mass bins %d; energy range: %2.2f < E < %2.2f GeV;",fNbins,fMinBin,fMaxBin) ;
1945 // fCuts->Add(new TObjString(onePar));
1946 // snprintf(onePar,buffersize, "Histograms, Time bins %d; energy range: %2.2f < E < %2.2f GeV;",fNTimeBins,fMinTimeBin,fMaxTimeBin) ;
1947 // fCuts->Add(new TObjString(onePar));
1948 // 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 ",
1949 // fRecoUtils->IsBadChannelsRemovalSwitchedOn(),fFilteredInput,fCorrectClusters, fRecalPosition, fSameSM) ;
1950 // fCuts->Add(new TObjString(onePar));
1951 // snprintf(onePar,buffersize, "EMCAL Geometry name: < %s >, Load Matrices? %d",fEMCALGeoName.Data(),fLoadMatrices) ;
1952 // fCuts->Add(new TObjString(onePar));
1953 //
1954 // // Post Data
1955 // PostData(2, fCuts);
1956 }
1957 
Bool_t IsRunDepRecalibrationOn() const
TH2F * fHmggSM_Zone4[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 4.
Float_t fDTimeCut
Maximum difference between time of cluster pairs (ns).
TH2F * fHmggPairSameSectorSMMaskFrame[AliEMCALGeoParams::fgkEMCALModules/2]
! Two-cluster invariant mass per Pair, mask clusters facing frames.
TGeoHMatrix * fMatrix[AliEMCALGeoParams::fgkEMCALModules]
Bool_t IsInZone3(Int_t iSupMod, Int_t ieta, Int_t iphi)
TH2F * fhClusterPairDiffTimeSameSide[AliEMCALGeoParams::fgkEMCALModules-2]
! Diference in time of clusters same side.
Bool_t IsInZone6(Int_t iSupMod, Int_t ieta, Int_t iphi)
Float_t fEBkgmin
Minimum cluster energy (GeV) for bkg shape study (only for high M02 clusters).
TH2F * fHmggSM_Zone3[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 3.
double Double_t
Definition: External.C:58
Int_t fNTimeBins
N time bins of invariant mass histograms.
Bool_t CheckCellFiducialRegion(const AliEMCALGeometry *geom, const AliVCluster *cluster, AliVCaloCells *cells)
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.
Definition: External.C:236
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 IsInZone4(Int_t iSupMod, Int_t ieta, Int_t iphi)
TH1F * fhCentralitySelected
! Centrality selected events.
TString fImportGeometryFilePath
Path fo geometry.root file.
TH2F * fhTopoClusterAmpCase0[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 0 cluster in noisy quartet
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.
void SetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow, Double_t c=1)
AliEMCALRecoUtils * fRecoUtils
Access to reconstruction utilities.
AliEMCALGeometry * fEMCALGeo
! EMCAL geometry pointer.
Int_t GetNumberOfCellsFromEMCALBorder() const
Float_t fMaxTimeBin
Maximum time bins of invariant mass histograms.
Bool_t fSelectOnlyPhotonsInDifferentSM
Select only pairs of photons that are not in the same SM.
Float_t fLogWeight
Logarithmic weight used in cluster recalibration.
Bool_t IsInZone7(Int_t iSupMod, Int_t ieta, Int_t iphi)
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...
Bool_t IsBadChannelsRemovalSwitchedOn() const
Float_t fMinTimeBin
Minimum time bins of invariant mass histograms.
Int_t GetParticleType() const
Bool_t IsInZone5(Int_t iSupMod, Int_t ieta, Int_t iphi)
Int_t FindPositionInNoisyQuartet(Int_t irow, Int_t icol, Int_t iSM)
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.
Bool_t IsRecalibrationOn() const
Some utilities for cluster and cell treatment.
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 * fHmggSM_Zone5[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 5.
TH2F * fHOpeningAngleSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster opening angle vs pt per SM,with mass close to pi0.
TLorentzVector fMomentum2
Cluster kinematics, temporal.
TH2F * fhTopoClusterAmpCase2[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 2 cluster in noisy quartet
Float_t fInvMassCutMin
Minimum mass cut for clusters to fill time or other histograms.
Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow) const
TH2F * fhTopoClusterAmpCase3[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 3 cluster in noisy quartet
Float_t fOpAnglemax
Maximum cluster opening angle for bkg shape study.
Float_t fMinEnergyBin
Minimum energy bins of cell energy histograms.
Bool_t IsInZone2(Int_t iSupMod, Int_t ieta, Int_t iphi)
int Int_t
Definition: External.C:63
Int_t fNEnergybins
N energy bins of cell energy histograms.
TH2F * fHAsymmetrySM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster asymmetry vs pt per SM,with mass close to pi0.
Definition: External.C:204
TString fCalibFilePath
Full path with file with energy calibration factors per channel from previous iteration.
Bool_t fCheckCentrality
Activate centrality selection.
void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster)
float Float_t
Definition: External.C:68
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 * fhTopoClusterAmpCase1[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 1 cluster in noisy quartet
TH2F * fhTopoClusterCase2[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 2 cluster in noisy quartet
Bool_t fSelectOnlyCellSignalOutOfCollision
Select cells / clusters that are due to noise, i.e. signal in EMCal that happens not during collision...
TH2F * fHmggSM_Zone6[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 6.
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 fEBkgmax
Maximum cluster energy (GeV) for bkg shape study (only for high M02 clusters).
AliAnalysisTaskEMCALPi0CalibSelection()
Default constructor. Arrays initialization is done here.
TH1F * fhEnergy[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
! Energy distribution for each cell.
Float_t fMinBin
Minimum mass bins of invariant mass histograms.
TH2F * fhTopoClusterAmpFractionCase2[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 2 cluster in noisy quartet
TH2F * fhTopoClusterCase0[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 0 cluster in noisy quartet
Bool_t fRecalPosition
Switch on/off cluster position calculation, in case alignment matrices are not available.
TH2F * fhTopoClusterCase1[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 1 cluster in noisy quartet
void RecalibrateClusterEnergy(const AliEMCALGeometry *geom, AliVCluster *cluster, AliVCaloCells *cells, Int_t bc=-1)
Float_t fMaxEnergyBin
Maximum energy bins of cell energy histograms.
TString fTriggerName
Trigger name must contain this name.
Bool_t fChangeBkgShape
Select clusters with nominal M02 cuts (fL0min,fL0max) plus high M02 clusters (fL0Bkgmin,fL0Bkgmax)
TH2F * fHmggDifferentSMMaskFrame
! Two-cluster invariant mass vs pt of pair, each cluster in different SM,mask clusters facing frames...
TH2F * fhTopoClusterAmpFractionCase3[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 3 cluster in noisy quartet
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 * fHmggSM_Zone2[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 2.
Bool_t IsGoodCluster(AliVCluster *cluster, const AliEMCALGeometry *geom, AliVCaloCells *cells, Int_t bc=-1)
TH2F * fhClusterTime
! Timing of clusters vs energy.
void GetMaxEnergyCell(const AliEMCALGeometry *geom, AliVCaloCells *cells, const AliVCluster *clu, Int_t &absId, Int_t &iSupMod, Int_t &ieta, Int_t &iphi, Bool_t &shared)
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.
void RecalculateClusterPosition(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *clu)
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. Comment out for the moment.
TH2F * fhTowerDecayPhotonEnergy[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, accumulated energy in the tower by decay photons...
void RecalculateClusterPID(AliVCluster *cluster)
Float_t fL0Bkgmax
Maximum cluster L0 for bkg shape study.
TH2F * fHmggPairSameSideSM[AliEMCALGeoParams::fgkEMCALModules-2]
! Two-cluster invariant mass per Pair.
TH2F * fhTopoClusterAmpFractionCase0[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 0 cluster in noisy quartet
Float_t fL0Bkgmin
Minimum cluster L0 for bkg shape study.
TH2F * fhTopoClusterCase3[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 3 cluster in noisy quartet
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.
const char Option_t
Definition: External.C:48
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.
Bool_t fImportGeometryFromFile
Import geometry settings in geometry.root file.
Bool_t IsInZone1(Int_t iSupMod, Int_t ieta, Int_t iphi)
bool Bool_t
Definition: External.C:53
Float_t CorrectClusterEnergyLinearity(AliVCluster *clu)
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 ClusterContainsBadChannel(const AliEMCALGeometry *geom, const UShort_t *cellList, Int_t nCells)
Float_t fOpAnglemin
Minimum cluster opening angle for bkg shape study.
void SetEMCALChannelRecalibrationFactors(const TObjArray *map)
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 * fHmggSM_Zone1[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 1.
TH2F * fhTopoClusterAmpFractionCase1[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 1 cluster in noisy quartet
TH2F * fHmggSM_Zone7[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 7.
TH2F * fHmggPairSameSectorSM[AliEMCALGeoParams::fgkEMCALModules/2]
! Two-cluster invariant mass per Pair.