AliPhysics  vAN-20150630 (513c479)
 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 
569  }//SM loop
570  }//Load matrices
571  else if(!gGeoManager)
572  {
573  AliInfo("Get geo matrices from data");
574  //Still not implemented in AOD, just a workaround to be able to work at least with ESDs
575  if(!strcmp(InputEvent()->GetName(),"AliAODEvent"))
576  {
577  AliWarning("Use ideal geometry, values geometry matrix not kept in AODs");
578  }//AOD
579  else
580  {
581  AliDebug(1,"AliAnalysisTaskEMCALClusterize Load Misaligned matrices");
582 
583  for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
584  {
585  if(DebugLevel() > 1)
586  InputEvent()->GetEMCALMatrix(mod)->Print();
587 
588  if(InputEvent()->GetEMCALMatrix(mod)) fEMCALGeo->SetMisalMatrix(InputEvent()->GetEMCALMatrix(mod),mod) ;
589 
590  }
591  }// ESD
592  }// Load matrices from Data
593 }
594 
598 //______________________________________________________________________
600 {
601  if(!fRecoUtils->IsRunDepRecalibrationOn()) return;
602 
603  AliOADBContainer *contRFTD=new AliOADBContainer("");
604 
605  contRFTD->InitFromFile(Form("%s/EMCALTemperatureCorrCalib.root",fOADBFilePath.Data()),"AliEMCALRunDepTempCalibCorrections");
606 
607  Int_t runnumber = InputEvent()->GetRunNumber() ;
608 
609  TH1S *htd=(TH1S*)contRFTD->GetObject(runnumber);
610 
611  //If it did not exist for this run, get closes one
612  if (!htd)
613  {
614  AliWarning(Form("No TemperatureCorrCalib Objects for run: %d",runnumber));
615 
616  // let's get the closest runnumber instead then..
617  Int_t lower = 0;
618  Int_t ic = 0;
619  Int_t maxEntry = contRFTD->GetNumberOfEntries();
620 
621  while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) < runnumber) )
622  {
623  lower = ic;
624  ic++;
625  }
626 
627  Int_t closest = lower;
628  if ( (ic<maxEntry) &&
629  (contRFTD->LowerLimit(ic)-runnumber) < (runnumber - contRFTD->UpperLimit(lower)) )
630  {
631  closest = ic;
632  }
633 
634  AliWarning(Form("TemperatureCorrCalib Objects found closest id %d from run: %d",
635  closest, contRFTD->LowerLimit(closest)));
636 
637  htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
638  }
639 
640  // Fill parameters
641  if(htd)
642  {
643  AliInfo("Recalibrate (Temperature) EMCAL");
644 
645  Int_t nSM = fEMCALGeo->GetNumberOfSuperModules();
646 
647  for (Int_t ism = 0; ism < nSM; ++ism)
648  {
649  for (Int_t icol = 0; icol < 48; ++icol)
650  {
651  for (Int_t irow = 0; irow < 24; ++irow)
652  {
653  Float_t factor = fRecoUtils->GetEMCALChannelRecalibrationFactor(ism,icol,irow);
654 
655  Int_t absID = fEMCALGeo->GetAbsCellIdFromCellIndexes(ism, irow, icol); // original calibration factor
656 
657  AliDebug(3,Form(" ism %d, icol %d, irow %d,absID %d - Calib factor %1.5f - ",ism, icol, irow, absID, factor));
658 
659  factor *= htd->GetBinContent(absID) / 10000. ; // correction dependent on T
660 
661  fRecoUtils->SetEMCALChannelRecalibrationFactor(ism,icol,irow,factor);
662 
663  AliDebug(3,Form("T factor %1.5f - final factor %1.5f",
664  htd->GetBinContent(absID) / 10000.,
665  fRecoUtils->GetEMCALChannelRecalibrationFactor(ism,icol,irow)));
666  } // columns
667  } // rows
668  } // SM loop
669  }
670  else AliInfo("Do NOT recalibrate EMCAL with T variations, no params TH1");
671 }
672 
673 
676 //___________________________________________________________________
678 {
679  fEMCALGeo = AliEMCALGeometry::GetInstance(fEMCALGeoName) ;
680  Int_t nSM = (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
681 
682  fOutputContainer = new TList();
683  const Int_t buffersize = 255;
684  char hname[buffersize], htitl[buffersize];
685 
686  fhNEvents = new TH1I("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
688 
689  fHmgg = new TH2F("hmgg","2-cluster invariant mass",fNbins,fMinBin,fMaxBin,100,0,10);
690  fHmgg->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
691  fHmgg->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
692  fOutputContainer->Add(fHmgg);
693 
694  fHmggDifferentSM = new TH2F("hmggDifferentSM","2-cluster invariant mass, different SM",fNbins,fMinBin,fMaxBin,100,0,10);
695  fHmggDifferentSM->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
696  fHmggDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
698 
699  fHOpeningAngle = new TH2F("hopang","2-cluster opening angle",100,0.,50.,100,0,10);
700  fHOpeningAngle->SetXTitle("#alpha_{#gamma #gamma}");
701  fHOpeningAngle->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
703 
704  fHOpeningAngleDifferentSM = new TH2F("hopangDifferentSM","2-cluster opening angle, different SM",100,0,50.,100,0,10);
705  fHOpeningAngleDifferentSM->SetXTitle("#alpha_{#gamma #gamma}");
706  fHOpeningAngleDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
708 
709  fHAsymmetry = new TH2F("hasym","2-cluster opening angle",100,0.,1.,100,0,10);
710  fHAsymmetry->SetXTitle("a");
711  fHAsymmetry->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
713 
714  fHAsymmetryDifferentSM = new TH2F("hasymDifferentSM","2-cluster opening angle, different SM",100,0,1.,100,0,10);
715  fHAsymmetryDifferentSM->SetXTitle("a");
716  fHAsymmetryDifferentSM->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
718 
719  //TString pairname[] = {"A side (0-2)", "C side (1-3)","Row 0 (0-1)", "Row 1 (2-3)"};
720 
721  fHmggMaskFrame = new TH2F("hmggMaskFrame","2-cluster invariant mass, frame masked",fNbins,fMinBin,fMaxBin,100,0,10);
722  fHmggMaskFrame->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
723  fHmggMaskFrame->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
725 
726  fHmggDifferentSMMaskFrame = new TH2F("hmggDifferentSMMaskFrame","2-cluster invariant mass, different SM, frame masked",
727  fNbins,fMinBin,fMaxBin,100,0,10);
728  fHmggDifferentSMMaskFrame->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
729  fHmggDifferentSMMaskFrame->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
731 
732  for(Int_t iSM = 0; iSM < nSM; iSM++)
733  {
734  snprintf(hname, buffersize, "hmgg_SM%d",iSM);
735  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d",iSM);
736  fHmggSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
737  fHmggSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
738  fHmggSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
739  fOutputContainer->Add(fHmggSM[iSM]);
740 
741  snprintf(hname, buffersize, "hmgg_SM%d_MaskFrame",iSM);
742  snprintf(htitl, buffersize, "Two-gamma inv. mass for super mod %d",iSM);
743  fHmggSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
744  fHmggSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
745  fHmggSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
747 
748  if(iSM < nSM/2)
749  {
750  snprintf(hname,buffersize, "hmgg_PairSameSectorSM%d",iSM);
751  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
752  fHmggPairSameSectorSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
753  fHmggPairSameSectorSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
754  fHmggPairSameSectorSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
756 
757  snprintf(hname,buffersize, "hmgg_PairSameSectorSM%d_MaskFrame",iSM);
758  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
759  fHmggPairSameSectorSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
760  fHmggPairSameSectorSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
761  fHmggPairSameSectorSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
763 
764  fhClusterPairDiffTimeSameSector[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSector%d",iSM),
765  Form("cluster pair time difference vs E, Sector %d",iSM),
766  100,0,10, 200,-100,100);
767  fhClusterPairDiffTimeSameSector[iSM]->SetXTitle("E_{pair} (GeV)");
768  fhClusterPairDiffTimeSameSector[iSM]->SetYTitle("#Delta t (ns)");
770  }
771 
772  if(iSM < nSM-2)
773  {
774  snprintf(hname,buffersize, "hmgg_PairSameSideSM%d",iSM);
775  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
776  fHmggPairSameSideSM[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
777  fHmggPairSameSideSM[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
778  fHmggPairSameSideSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
780 
781  snprintf(hname,buffersize, "hmgg_PairSameSideSM%d_MaskFrame",iSM);
782  snprintf(htitl,buffersize, "Two-gamma inv. mass for SM pair Sector: %d",iSM);
783  fHmggPairSameSideSMMaskFrame[iSM] = new TH2F(hname,htitl,fNbins,fMinBin,fMaxBin,100,0,10);
784  fHmggPairSameSideSMMaskFrame[iSM]->SetXTitle("m_{#gamma #gamma} (MeV/c^{2})");
785  fHmggPairSameSideSMMaskFrame[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
787 
788  fhClusterPairDiffTimeSameSide[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSide%d",iSM),
789  Form("cluster pair time difference vs E, Side %d",iSM),
790  100,0,10, 200,-100,100);
791  fhClusterPairDiffTimeSameSide[iSM]->SetXTitle("E_{pair} (GeV)");
792  fhClusterPairDiffTimeSameSide[iSM]->SetYTitle("#Delta t (ns)");
794  }
795 
796  snprintf(hname, buffersize, "hopang_SM%d",iSM);
797  snprintf(htitl, buffersize, "Opening angle for super mod %d",iSM);
798  fHOpeningAngleSM[iSM] = new TH2F(hname,htitl,100,0.,50.,100,0,10);
799  fHOpeningAngleSM[iSM]->SetXTitle("#alpha_{#gamma #gamma} (deg)");
800  fHOpeningAngleSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
802 
803  snprintf(hname,buffersize, "hopang_PairSM%d",iSM);
804  snprintf(htitl,buffersize, "Opening angle for SM pair: %d",iSM);
805  fHOpeningAnglePairSM[iSM] = new TH2F(hname,htitl,100,0.,50.,100,0,10);
806  fHOpeningAnglePairSM[iSM]->SetXTitle("#alpha_{#gamma #gamma} (deg)");
807  fHOpeningAnglePairSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
809 
810  snprintf(hname, buffersize, "hasym_SM%d",iSM);
811  snprintf(htitl, buffersize, "Asymmetry for super mod %d",iSM);
812  fHAsymmetrySM[iSM] = new TH2F(hname,htitl,100,0.,1.,100,0,10);
813  fHAsymmetrySM[iSM]->SetXTitle("a");
814  fHAsymmetrySM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
815  fOutputContainer->Add(fHAsymmetrySM[iSM]);
816 
817  snprintf(hname,buffersize, "hasym_PairSM%d",iSM);
818  snprintf(htitl,buffersize, "Asymmetry for SM pair: %d",iSM);
819  fHAsymmetryPairSM[iSM] = new TH2F(hname,htitl,100,0.,1.,100,0,10);
820  fHAsymmetryPairSM[iSM]->SetXTitle("a");
821  fHAsymmetryPairSM[iSM]->SetYTitle("p_{T #gamma #gamma} (GeV/c)");
823 
824  Int_t colmax = 48;
825  Int_t rowmax = 24;
826 
827  fhTowerDecayPhotonHit[iSM] = new TH2F (Form("hTowerDecPhotonHit_Mod%d",iSM),
828  Form("Entries in grid of cells in Module %d",iSM),
829  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
830  fhTowerDecayPhotonHit[iSM]->SetYTitle("row (phi direction)");
831  fhTowerDecayPhotonHit[iSM]->SetXTitle("column (eta direction)");
833 
834  fhTowerDecayPhotonEnergy[iSM] = new TH2F (Form("hTowerDecPhotonEnergy_Mod%d",iSM),
835  Form("Accumulated energy in grid of cells in Module %d",iSM),
836  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
837  fhTowerDecayPhotonEnergy[iSM]->SetYTitle("row (phi direction)");
838  fhTowerDecayPhotonEnergy[iSM]->SetXTitle("column (eta direction)");
840 
841  fhTowerDecayPhotonAsymmetry[iSM] = new TH2F (Form("hTowerDecPhotonAsymmetry_Mod%d",iSM),
842  Form("Accumulated asymmetry in grid of cells in Module %d",iSM),
843  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
844  fhTowerDecayPhotonAsymmetry[iSM]->SetYTitle("row (phi direction)");
845  fhTowerDecayPhotonAsymmetry[iSM]->SetXTitle("column (eta direction)");
847 
848  fhTowerDecayPhotonHitMaskFrame[iSM] = new TH2F (Form("hTowerDecPhotonHit_Mod%d_MaskFrame",iSM),Form("Entries in grid of cells in Module %d",iSM),
849  colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
850  fhTowerDecayPhotonHitMaskFrame[iSM]->SetYTitle("row (phi direction)");
851  fhTowerDecayPhotonHitMaskFrame[iSM]->SetXTitle("column (eta direction)");
853 
854  fhClusterTimeSM[iSM] = new TH2F(Form("hClusterTime_SM%d",iSM),"cluster time vs E",100,0,10, 100,0,1000);
855  fhClusterTimeSM[iSM]->SetXTitle("E (GeV)");
856  fhClusterTimeSM[iSM]->SetYTitle("t (ns)");
858 
859  fhClusterPairDiffTimeSameSM[iSM] = new TH2F(Form("hClusterPairDiffTimeSameSM%d",iSM),
860  Form("cluster pair time difference vs E, SM %d",iSM),
861  100,0,10, 200,-100,100);
862  fhClusterPairDiffTimeSameSM[iSM]->SetXTitle("E (GeV)");
863  fhClusterPairDiffTimeSameSM[iSM]->SetYTitle("#Delta t (ns)");
865  }
866 
867  Int_t nchannels = nSM*AliEMCALGeoParams::fgkEMCALRows*AliEMCALGeoParams::fgkEMCALCols;
868  for(Int_t ibc = 0; ibc < 4; ibc++)
869  {
870  fHTpi0[ibc] = new TH2F(Form("hTime_BC%d",ibc),Form("Time of cell clusters under pi0 peak, bunch crossing %d",ibc),
871  nchannels,0,nchannels, fNTimeBins,fMinTimeBin,fMaxTimeBin);
872  fOutputContainer->Add(fHTpi0[ibc]);
873  fHTpi0[ibc]->SetYTitle("time (ns)");
874  fHTpi0[ibc]->SetXTitle("abs. Id. ");
875  }
876 
877  fhClusterTime = new TH2F("hClusterTime","cluster time vs E",100,0,10, 100,0,1000);
878  fhClusterTime->SetXTitle("E (GeV)");
879  fhClusterTime->SetYTitle("t (ns)");
881 
882  fhClusterPairDiffTime = new TH2F("hClusterPairDiffTime","cluster pair time difference vs E",100,0,10, 800,-400,400);
883  fhClusterPairDiffTime->SetXTitle("E_{pair} (GeV)");
884  fhClusterPairDiffTime->SetYTitle("#Delta t (ns)");
886 
887  for(Int_t iMod=0; iMod < nSM; iMod++)
888  {
889  for(Int_t iRow=0; iRow < AliEMCALGeoParams::fgkEMCALRows; iRow++)
890  {
891  for(Int_t iCol=0; iCol < AliEMCALGeoParams::fgkEMCALCols; iCol++)
892  {
893  snprintf(hname,buffersize, "%d_%d_%d",iMod,iCol,iRow);
894  snprintf(htitl,buffersize, "Two-gamma inv. mass for super mod %d, cell(col,row)=(%d,%d)",iMod,iCol,iRow);
895  fHmpi0[iMod][iCol][iRow] = new TH1F(hname,htitl,fNbins,fMinBin,fMaxBin);
896  fHmpi0[iMod][iCol][iRow]->SetXTitle("mass (MeV/c^{2})");
897  fOutputContainer->Add(fHmpi0[iMod][iCol][iRow]);
898  }
899  }
900  }
901 
902  fOutputContainer->SetOwner(kTRUE);
903 
904  PostData(1,fOutputContainer);
905 
906  // cuts container, set in terminate but init and post here
907 
908  fCuts = new TList();
909 
910  fCuts ->SetOwner(kTRUE);
911 
912  PostData(2, fCuts);
913 }
914 
920 //______________________________________________________________________________________________________
922 {
923  Int_t icol = ieta;
924  if(iSM%2) icol+=48; // Impair SM, shift index [0-47] to [48-96]
925 
927  {
928  for (Int_t imask = 0; imask < fNMaskCellColumns; imask++)
929  {
930  if(icol==fMaskCellColumns[imask]) return kTRUE;
931  }
932  }
933 
934  return kFALSE;
935 }
936 
942 //__________________________________________________________________________
944 {
945  // Event selection
946 
947  if(fTriggerName!="")
948  {
949  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (InputEvent());
950  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (InputEvent());
951 
952  TString triggerClass = "";
953  if (esdevent) triggerClass = esdevent->GetFiredTriggerClasses();
954  else if(aodevent) triggerClass = aodevent->GetFiredTriggerClasses();
955 
956  AliDebug(1,Form("Event %d, FiredClass %s",
957  (Int_t)Entry(),(((AliESDEvent*)InputEvent())->GetFiredTriggerClasses()).Data()));
958 
959  if(!triggerClass.Contains(fTriggerName))
960  {
961  AliDebug(1,"Reject event!");
962  return;
963  }
964  else
965  AliDebug(1,"Accept event!");
966  }
967 
968  // Get the input event
969 
970  AliVEvent* event = 0;
971  if(fFilteredInput) event = AODEvent();
972  else event = InputEvent();
973 
974  if(!event)
975  {
976  AliWarning("Input event not available!");
977  return;
978  }
979 
980  AliDebug(1,Form("<<< %s: Event %d >>>",event->GetName(), (Int_t)Entry()));
981 
982  // Get the primary vertex
983 
984  event->GetPrimaryVertex()->GetXYZ(fVertex) ;
985 
986  AliDebug(1,Form("Vertex: (%.3f,%.3f,%.3f)",fVertex[0],fVertex[1],fVertex[2]));
987 
988  //Int_t runNum = aod->GetRunNumber();
989  //if(DebugLevel() > 1) printf("Run number: %d\n",runNum);
990 
991  fhNEvents->Fill(0); //Count the events to be analyzed
992 
993  // Acccess once the geometry matrix and temperature corrections and calibration coefficients
994  if(fhNEvents->GetEntries() == 1)
995  {
997 
999 
1001  }
1002 
1003  //Get the list of clusters and cells
1004  fEMCALCells = event->GetEMCALCells();
1005 
1006  fCaloClustersArr = new TRefArray();
1007  event->GetEMCALClusters(fCaloClustersArr);
1008 
1009  AliDebug(1,Form("N CaloClusters: %d - N CaloCells %d",fCaloClustersArr->GetEntriesFast(), fEMCALCells->GetNumberOfCells()));
1010 
1011  // Apply non linearity, new calibration, T calibration to the clusters
1012  if( fCorrectClusters )
1013  CorrectClusters();
1014 
1015  FillHistograms();
1016 
1017  delete fCaloClustersArr;
1018 
1019  PostData(1,fOutputContainer);
1020 }
1021 
1024 //_____________________________________________________
1026 {
1027  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",
1029 
1030  printf("Group %d cells\n", fGroupNCells) ;
1031 
1032  printf("Cluster maximal cell away from border at least %d cells\n", fRecoUtils->GetNumberOfCellsFromEMCALBorder()) ;
1033 
1034  printf("Histograms: bins %d; energy range: %2.2f < E < %2.2f MeV\n",fNbins,fMinBin,fMaxBin) ;
1035 
1036  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",
1037  fRecoUtils->IsBadChannelsRemovalSwitchedOn(),fFilteredInput,fCorrectClusters, fRecalPosition, fSameSM) ;
1038 
1039  printf("OADB path : %s\n",fOADBFilePath .Data());
1040  printf("Calibration path : %s\n",fCalibFilePath.Data());
1041 
1042  printf("EMCAL Geometry name: < %s >, Load Matrices %d\n",fEMCALGeoName.Data(), fLoadMatrices) ;
1043 
1044  if(fLoadMatrices) { for(Int_t ism = 0; ism < AliEMCALGeoParams::fgkEMCALModules; ism++) if(fMatrix[ism]) fMatrix[ism]->Print() ; }
1045 }
1046 
1050 //_____________________________________________________________________
1052 {
1053  if(n > fNMaskCellColumns)
1054  {
1055  delete [] fMaskCellColumns ;
1056 
1057  fMaskCellColumns = new Int_t[n] ;
1058  }
1059 
1060  fNMaskCellColumns = n ;
1061 }
1062 
1067 //___________________________________________________________________________________
1069 {
1070  if(ipos < fNMaskCellColumns) fMaskCellColumns[ipos] = icol ;
1071  else AliWarning("Mask column not set, position larger than allocated set size first") ;
1072 }
1073 
1074 
1077 //______________________________________________________________
1079 {
1080  const Int_t buffersize = 255;
1081  char onePar[buffersize] ;
1082 
1083  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",
1085  fCuts->Add(new TObjString(onePar));
1086  snprintf(onePar,buffersize, "Group %d cells;", fGroupNCells) ;
1087  fCuts->Add(new TObjString(onePar));
1088  snprintf(onePar,buffersize, "Cluster maximal cell away from border at least %d cells;", fRecoUtils->GetNumberOfCellsFromEMCALBorder()) ;
1089  fCuts->Add(new TObjString(onePar));
1090  snprintf(onePar,buffersize, "Histograms, Mass bins %d; energy range: %2.2f < E < %2.2f GeV;",fNbins,fMinBin,fMaxBin) ;
1091  fCuts->Add(new TObjString(onePar));
1092  snprintf(onePar,buffersize, "Histograms, Time bins %d; energy range: %2.2f < E < %2.2f GeV;",fNTimeBins,fMinTimeBin,fMaxTimeBin) ;
1093  fCuts->Add(new TObjString(onePar));
1094  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 ",
1095  fRecoUtils->IsBadChannelsRemovalSwitchedOn(),fFilteredInput,fCorrectClusters, fRecalPosition, fSameSM) ;
1096  fCuts->Add(new TObjString(onePar));
1097  snprintf(onePar,buffersize, "EMCAL Geometry name: < %s >, Load Matrices? %d",fEMCALGeoName.Data(),fLoadMatrices) ;
1098  fCuts->Add(new TObjString(onePar));
1099 
1100  // Post Data
1101  PostData(2, fCuts);
1102 }
1103 
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.
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.