AliPhysics  3bba2fe (3bba2fe)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliCalorimeterUtils.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // --- ROOT system ---
17 #include <TGeoManager.h>
18 #include <TH2F.h>
19 #include <TCanvas.h>
20 #include <TStyle.h>
21 #include <TPad.h>
22 #include <TFile.h>
23 #include <TParticle.h>
24 
25 // --- ANALYSIS system ---
26 #include "AliCalorimeterUtils.h"
27 #include "AliESDEvent.h"
28 #include "AliMCEvent.h"
29 #include "AliStack.h"
30 #include "AliAODPWG4Particle.h"
31 #include "AliVCluster.h"
32 #include "AliVCaloCells.h"
33 #include "AliAODCaloCluster.h"
34 #include "AliOADBContainer.h"
35 #include "AliAnalysisManager.h"
36 #include "AliAODMCParticle.h"
37 #include "AliLog.h"
38 
39 // --- Detector ---
40 #include "AliEMCALGeometry.h"
41 #include "AliPHOSGeoUtils.h"
42 
43 #include "AliFiducialCut.h" // Needed for detector flag enum kEMCAL, kPHOS
44 
48 
49 
50 //____________________________________________
52 //____________________________________________
54 TObject(), fDebug(0),
55 fEMCALGeoName(""),
56 fPHOSGeoName (""),
57 fEMCALGeo(0x0), fPHOSGeo(0x0),
58 fEMCALGeoMatrixSet(kFALSE), fPHOSGeoMatrixSet(kFALSE),
59 fLoadEMCALMatrices(kFALSE), fLoadPHOSMatrices(kFALSE),
60 fRemoveBadChannels(kFALSE), fPHOSBadChannelMap(0x0),
61 fNCellsFromPHOSBorder(0),
62 fNMaskCellColumns(0), fMaskCellColumns(0x0),
63 fRecalibration(kFALSE), fRunDependentCorrection(kFALSE),
64 fPHOSRecalibrationFactors(), fEMCALRecoUtils(new AliEMCALRecoUtils),
65 fRecalculatePosition(kFALSE), fCorrectELinearity(kFALSE),
66 fRecalculateMatching(kFALSE),
67 fCutR(20), fCutZ(20),
68 fCutEta(20), fCutPhi(20),
69 fLocMaxCutE(0), fLocMaxCutEDiff(0),
70 fPlotCluster(0), fOADBSet(kFALSE),
71 fOADBForEMCAL(kFALSE), fOADBForPHOS(kFALSE),
72 fOADBFilePathEMCAL(""), fOADBFilePathPHOS(""),
73 fImportGeometryFromFile(0), fImportGeometryFilePath(""),
74 fNSuperModulesUsed(0), fRunNumber(0),
75 fMCECellClusFracCorrOn(0), fMCECellClusFracCorrParam()
76 {
78  for(Int_t i = 0; i < 22; i++) fEMCALMatrix[i] = 0 ;
79  for(Int_t i = 0; i < 5 ; i++) fPHOSMatrix [i] = 0 ;
80 }
81 
82 //_________________________________________
83 // Destructor.
84 //_________________________________________
86 {
87  //if(fPHOSGeo) delete fPHOSGeo ;
88  if(fEMCALGeo) delete fEMCALGeo ;
89 
91 {
92  fPHOSBadChannelMap->Clear();
93  delete fPHOSBadChannelMap;
94  }
95 
97 {
100  }
101 
102  if(fEMCALRecoUtils) delete fEMCALRecoUtils ;
103  if(fNMaskCellColumns) delete [] fMaskCellColumns;
104 }
105 
106 //____________________________________________________
109 //____________________________________________________
110 void AliCalorimeterUtils::AccessOADB(AliVEvent* event)
111 {
112  // Set it only once
113  if(fOADBSet) return ;
114 
115  if(fRunNumber <= 0) fRunNumber = event->GetRunNumber() ; // take the run number from the event itself
116  TString pass = GetPass();
117 
118  // EMCAL
119  if(fOADBForEMCAL)
120  {
121  AliInfo(Form("Get AODB parameters from EMCAL in %s for run %d, and <%s>",fOADBFilePathEMCAL.Data(),fRunNumber,pass.Data()));
122 
123  Int_t nSM = fEMCALGeo->GetNumberOfSuperModules();
124 
125  // Bad map
127  {
128  AliOADBContainer *contBC=new AliOADBContainer("");
129  contBC->InitFromFile(Form("%s/EMCALBadChannels.root",fOADBFilePathEMCAL.Data()),"AliEMCALBadChannels");
130 
131  TObjArray *arrayBC=(TObjArray*)contBC->GetObject(fRunNumber);
132 
133  if(arrayBC)
134  {
136  AliInfo("Remove EMCAL bad cells");
137 
138  for (Int_t i=0; i<nSM; ++i)
139  {
140  TH2I *hbm = GetEMCALChannelStatusMap(i);
141 
142  if (hbm)
143  delete hbm;
144 
145  hbm=(TH2I*)arrayBC->FindObject(Form("EMCALBadChannelMap_Mod%d",i));
146 
147  if (!hbm)
148  {
149  AliError(Form("Can not get EMCALBadChannelMap_Mod%d",i));
150  continue;
151  }
152 
153  hbm->SetDirectory(0);
155 
156  } // loop
157  } else AliInfo("Do NOT remove EMCAL bad channels\n"); // run array
158 
159  delete contBC;
160  } // Remove bad
161 
162  // Energy Recalibration
163  if(fRecalibration)
164  {
165  AliOADBContainer *contRF=new AliOADBContainer("");
166 
167  contRF->InitFromFile(Form("%s/EMCALRecalib.root",fOADBFilePathEMCAL.Data()),"AliEMCALRecalib");
168 
169  TObjArray *recal=(TObjArray*)contRF->GetObject(fRunNumber);
170 
171  if(recal)
172  {
173  TObjArray *recalpass=(TObjArray*)recal->FindObject(pass);
174 
175  if(recalpass)
176  {
177  TObjArray *recalib=(TObjArray*)recalpass->FindObject("Recalib");
178 
179  if(recalib)
180  {
181  AliInfo("Recalibrate EMCAL");
182  for (Int_t i=0; i < nSM; ++i)
183  {
185 
186  if (h)
187  delete h;
188 
189  h = (TH2F*)recalib->FindObject(Form("EMCALRecalFactors_SM%d",i));
190 
191  if (!h)
192  {
193  AliError(Form("Could not load EMCALRecalFactors_SM%d",i));
194  continue;
195  }
196 
197  h->SetDirectory(0);
198 
200  } // SM loop
201  } else AliInfo("Do NOT recalibrate EMCAL, no params object array"); // array ok
202  } else AliInfo("Do NOT recalibrate EMCAL, no params for pass"); // array pass ok
203  } else AliInfo("Do NOT recalibrate EMCAL, no params for run"); // run number array ok
204 
205  delete contRF;
206  // once set, apply run dependent corrections if requested
207  //fEMCALRecoUtils->SetRunDependentCorrections(fRunNumber);
208 
209  } // Recalibration on
210 
211  // Energy Recalibration, apply on top of previous calibration factors
213  {
214  AliOADBContainer *contRFTD=new AliOADBContainer("");
215 
216  contRFTD->InitFromFile(Form("%s/EMCALTemperatureCorrCalib.root",fOADBFilePathEMCAL.Data()),"AliEMCALRunDepTempCalibCorrections");
217 
218  TH1S *htd=(TH1S*)contRFTD->GetObject(fRunNumber);
219 
220  //If it did not exist for this run, get closes one
221  if (!htd)
222  {
223  AliWarning(Form("No TemperatureCorrCalib Objects for run: %d",fRunNumber));
224  // let's get the closest fRunNumber instead then..
225  Int_t lower = 0;
226  Int_t ic = 0;
227  Int_t maxEntry = contRFTD->GetNumberOfEntries();
228 
229  while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) < fRunNumber) )
230  {
231  lower = ic;
232  ic++;
233  }
234 
235  Int_t closest = lower;
236  if ( (ic<maxEntry) &&
237  (contRFTD->LowerLimit(ic)-fRunNumber) < (fRunNumber - contRFTD->UpperLimit(lower)) )
238  {
239  closest = ic;
240  }
241 
242  AliWarning(Form("TemperatureCorrCalib Objects found closest id %d from run: %d", closest, contRFTD->LowerLimit(closest)));
243  htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
244  }
245 
246  if(htd)
247  {
248  AliInfo("Recalibrate (Temperature) EMCAL");
249 
250  for (Int_t ism=0; ism<nSM; ++ism)
251  {
252  for (Int_t icol=0; icol<48; ++icol)
253  {
254  for (Int_t irow=0; irow<24; ++irow)
255  {
256  Float_t factor = GetEMCALChannelRecalibrationFactor(ism,icol,irow);
257 
258  Int_t absID = fEMCALGeo->GetAbsCellIdFromCellIndexes(ism, irow, icol); // original calibration factor
259  factor *= htd->GetBinContent(absID) / 10000. ; // correction dependent on T
260 
261  //printf("\t ism %d, icol %d, irow %d,absID %d, corrA %2.3f, corrB %2.3f, corrAB %2.3f\n",ism, icol, irow, absID,
262  // GetEMCALChannelRecalibrationFactor(ism,icol,irow) , htd->GetBinContent(absID) / 10000., factor);
263 
264  SetEMCALChannelRecalibrationFactor(ism,icol,irow,factor);
265  } // columns
266  } // rows
267  } // SM loop
268  } else AliInfo("Do NOT recalibrate EMCAL with T variations, no params TH1");
269 
270  delete contRFTD;
271  } // Run by Run T calibration
272 
273  // Time Recalibration
274  if(fEMCALRecoUtils->IsTimeRecalibrationOn())
275  {
276  AliOADBContainer *contTRF=new AliOADBContainer("");
277 
278  contTRF->InitFromFile(Form("%s/EMCALTimeCalib.root",fOADBFilePathEMCAL.Data()),"AliEMCALTimeCalib");
279 
280  TObjArray *trecal=(TObjArray*)contTRF->GetObject(fRunNumber);
281 
282  if(trecal)
283  {
284  TString passM = pass;
285  if(pass=="spc_calo") passM = "pass3";
286  TObjArray *trecalpass=(TObjArray*)trecal->FindObject(passM);
287 
288  if(trecalpass)
289  {
290  AliInfo("Time Recalibrate EMCAL");
291  for (Int_t ibc = 0; ibc < 4; ++ibc)
292  {
294 
295  if (h)
296  delete h;
297 
298  h = (TH1F*)trecalpass->FindObject(Form("hAllTimeAvBC%d",ibc));
299 
300  if (!h)
301  {
302  AliError(Form("Could not load hAllTimeAvBC%d",ibc));
303  continue;
304  }
305 
306  h->SetDirectory(0);
307 
309  } // bunch crossing loop
310  } else AliInfo("Do NOT recalibrate time EMCAL, no params for pass"); // array pass ok
311  } else AliInfo("Do NOT recalibrate time EMCAL, no params for run"); // run number array ok
312 
313  delete contTRF;
314  } // Time Recalibration on
315 
316  // Time L1 phase racalibration
317  if(fEMCALRecoUtils->IsL1PhaseInTimeRecalibrationOn())
318  {
319  AliOADBContainer *contTRF=new AliOADBContainer("");
320  contTRF->InitFromFile(Form("%s/EMCALTimeL1PhaseCalib.root",fOADBFilePathEMCAL.Data()),"AliEMCALTimeL1PhaseCalib");
321 
322  TObjArray *trecal=(TObjArray*)contTRF->GetObject(fRunNumber);
323  if(!trecal)
324  {
325  AliError(Form("L1 phase time recal: No params for run %d. Default used.",fRunNumber)); // run number array ok
326  trecal=(TObjArray*)contTRF->GetObject(0); // Try default object
327  }
328 
329  if(trecal)
330  {
331  // Here, it looks for a specific pass
332  TString passM = pass;
333  if (pass=="calo_spc") passM ="pass1";
334  if (pass=="muon_calo_pass1") passM ="pass0";
335  if (pass=="muon_calo_pass2" || pass=="pass2" || pass=="pass3" || pass=="pass4") passM ="pass1";
336 
337  TObjArray *trecalpass=(TObjArray*)trecal->FindObject(passM);
338  if(!trecalpass)
339  {
340  AliInfo(Form("L1 phase time recal: No params for run %d and pass %s, try default", fRunNumber, passM.Data()));
341 
342  trecal->Delete();
343 
344  trecal=(TObjArray*)contTRF->GetObject(0);
345 
346  if(trecal)
347  trecalpass=(TObjArray*)trecal->FindObject("pass1");
348 
349  AliInfo("Time L1 phase Recalibrate EMCAL");
350  }
351 
352  if(trecalpass)
353  {
355 
356  if (h) delete h;
357 
358  h = (TH1C*)trecalpass->FindObject(Form("h%d",fRunNumber));
359 
360  if (!h) AliError(Form("Could not load h%d",fRunNumber));
361 
362  h->SetDirectory(0);
363 
365  }
366  else
367  {
368  AliError("Do not calibrate L1 phase time");
369  fEMCALRecoUtils->SwitchOffL1PhaseInTimeRecalibration();
370  }
371  }
372  else
373  {
374  AliError("Do not calibrate L1 phase time");
375  fEMCALRecoUtils->SwitchOffL1PhaseInTimeRecalibration();
376  }
377 
378  delete contTRF;
379  }//End of Time L1 phase racalibration
380 
381  }// EMCAL
382 
383  // PHOS
384  if(fOADBForPHOS)
385  {
386  AliInfo(Form("Get AODB parameters from PHOS in %s for run %d, and <%s>",fOADBFilePathPHOS.Data(),fRunNumber,pass.Data()));
387 
388  // Bad map
390  {
391  AliOADBContainer badmapContainer(Form("phosBadMap"));
392  TString fileName="$ALICE_PHYSICS/OADB/PHOS/PHOSBadMaps.root";
393  badmapContainer.InitFromFile(Form("%s/PHOSBadMaps.root",fOADBFilePathPHOS.Data()),"phosBadMap");
394 
395  //Use a fixed run number from year 2010, this year not available yet.
396  TObjArray *maps = (TObjArray*)badmapContainer.GetObject(139000,"phosBadMap");
397  if(!maps)
398  {
399  AliInfo(Form("Can not read PHOS bad map for run %d",fRunNumber)) ;
400  }
401  else
402  {
403  AliInfo(Form("Setting PHOS bad map with name %s",maps->GetName())) ;
404 
405  for(Int_t mod = 1; mod < 5; mod++)
406  {
407  TH2I *hbmPH = GetPHOSChannelStatusMap(mod);
408 
409  if(hbmPH)
410  delete hbmPH ;
411 
412  hbmPH = (TH2I*)maps->At(mod);
413 
414  if(hbmPH) hbmPH->SetDirectory(0);
415 
416  SetPHOSChannelStatusMap(mod-1,hbmPH);
417 
418  } // modules loop
419  } // maps exist
420  } // Remove bad channels
421  } // PHOS
422 
423  // Parameters already set once, so do not it again
424  fOADBSet = kTRUE;
425 }
426 
427 //_____________________________________________________________
430 //_____________________________________________________________
431 void AliCalorimeterUtils::AccessGeometry(AliVEvent* inputEvent)
432 {
433  // First init the geometry, a priory not done before
434  if(fRunNumber <=0 ) fRunNumber = inputEvent->GetRunNumber() ;
435 
436  InitPHOSGeometry ();
438 
439  //Get the EMCAL transformation geometry matrices from ESD
441  {
443  {
444  AliInfo("Load user defined EMCAL geometry matrices");
445 
446  // OADB if available
447  AliOADBContainer emcGeoMat("AliEMCALgeo");
448  emcGeoMat.InitFromFile(Form("%s/EMCALlocal2master.root",fOADBFilePathEMCAL.Data()),"AliEMCALgeo");
449  TObjArray *matEMCAL=(TObjArray*)emcGeoMat.GetObject(fRunNumber,"EmcalMatrices");
450 
451  for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
452  {
453  if (!fEMCALMatrix[mod]) // Get it from OADB
454  {
455  AliDebug(1,Form("EMCAL matrices SM %d, %p", mod,((TGeoHMatrix*) matEMCAL->At(mod))));
456  //((TGeoHMatrix*) matEMCAL->At(mod))->Print();
457 
458  fEMCALMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
459  }
460 
461  if(fEMCALMatrix[mod])
462  {
463  if(fDebug > 1)
464  fEMCALMatrix[mod]->Print();
465 
466  fEMCALGeo->SetMisalMatrix(fEMCALMatrix[mod],mod) ;
467  }
468  else if(gGeoManager)
469  {
470  AliWarning(Form("Set matrix for SM %d from gGeoManager",mod));
471  fEMCALGeo->SetMisalMatrix(fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
472  }
473  else
474  {
475  AliError(Form("Alignment atrix for SM %d is not available",mod));
476  }
477  } // SM loop
478 
479  fEMCALGeoMatrixSet = kTRUE;//At least one, so good
480 
481  } // Load matrices
482  else if (!gGeoManager)
483  {
484  AliDebug(1,"Load EMCAL misalignment matrices");
485  if(!strcmp(inputEvent->GetName(),"AliESDEvent"))
486  {
487  for(Int_t mod = 0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
488  {
489  //printf("Load ESD matrix %d, %p\n",mod,((AliESDEvent*)inputEvent)->GetEMCALMatrix(mod));
490  if(((AliESDEvent*)inputEvent)->GetEMCALMatrix(mod))
491  {
492  fEMCALGeo->SetMisalMatrix(((AliESDEvent*)inputEvent)->GetEMCALMatrix(mod),mod) ;
493  }
494  }// loop over super modules
495 
496  fEMCALGeoMatrixSet = kTRUE;//At least one, so good
497 
498  }//ESD as input
499  else
500  {
501  AliDebug(1,"Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file");
502  }//AOD as input
503  }//Get matrix from data
504  else if(gGeoManager)
505  {
506  fEMCALGeoMatrixSet = kTRUE;
507  }
508  }//EMCAL geo && no geoManager
509 
510  //Get the PHOS transformation geometry matrices from ESD
512  {
514  {
515  AliInfo("Load user defined PHOS geometry matrices");
516 
517  // OADB if available
518  AliOADBContainer geomContainer("phosGeo");
519  geomContainer.InitFromFile(Form("%s/PHOSGeometry.root",fOADBFilePathPHOS.Data()),"PHOSRotationMatrixes");
520  TObjArray *matPHOS = (TObjArray*)geomContainer.GetObject(139000,"PHOSRotationMatrixes");
521 
522  for(Int_t mod = 0 ; mod < 5 ; mod++)
523  {
524  if (!fPHOSMatrix[mod]) // Get it from OADB
525  {
526  AliDebug(1,Form("PHOS matrices module %d, %p",mod,((TGeoHMatrix*) matPHOS->At(mod))));
527  //((TGeoHMatrix*) matPHOS->At(mod))->Print();
528 
529  fPHOSMatrix[mod] = (TGeoHMatrix*) matPHOS->At(mod) ;
530  }
531 
532  // Set it, if it exists
533  if(fPHOSMatrix[mod])
534  {
535  if(fDebug > 1 )
536  fPHOSMatrix[mod]->Print();
537 
538  fPHOSGeo->SetMisalMatrix(fPHOSMatrix[mod],mod) ;
539  }
540  }// SM loop
541 
542  fPHOSGeoMatrixSet = kTRUE;//At least one, so good
543 
544  }//Load matrices
545  else if (!gGeoManager)
546  {
547  AliDebug(1,"Load PHOS misalignment matrices.");
548  if(!strcmp(inputEvent->GetName(),"AliESDEvent"))
549  {
550  for(Int_t mod = 0; mod < 5; mod++)
551  {
552  if( ((AliESDEvent*)inputEvent)->GetPHOSMatrix(mod))
553  {
554  //printf("PHOS: mod %d, matrix %p\n",mod, ((AliESDEvent*)inputEvent)->GetPHOSMatrix(mod));
555  fPHOSGeo->SetMisalMatrix( ((AliESDEvent*)inputEvent)->GetPHOSMatrix(mod),mod) ;
556  }
557  } // loop over modules
558 
559  fPHOSGeoMatrixSet = kTRUE; //At least one so good
560  } // ESD as input
561  else
562  {
563  AliDebug(1,"Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file");
564  } // AOD as input
565  } // get matrix from data
566  else if(gGeoManager)
567  {
568  fPHOSGeoMatrixSet = kTRUE;
569  }
570  }//PHOS geo and geoManager was not set
571 }
572 
573 //______________________________________________________________________________________
576 //______________________________________________________________________________________
578 {
579  Bool_t areNeighbours = kFALSE ;
580 
581  Int_t iRCU1 = -1, irow1 = -1, icol1 = -1;
582  Int_t iRCU2 = -1, irow2 = -1, icol2 = -1;
583 
584  Int_t rowdiff = 0, coldiff = 0;
585 
586  Int_t nSupMod1 = GetModuleNumberCellIndexes(absId1, calo, icol1, irow1, iRCU1);
587  Int_t nSupMod2 = GetModuleNumberCellIndexes(absId2, calo, icol2, irow2, iRCU2);
588 
589  if(calo==AliFiducialCut::kEMCAL && nSupMod1!=nSupMod2)
590  {
591  // In case of a shared cluster, index of SM in C side, columns start at 48 and ends at 48*2-1
592  // C Side impair SM, nSupMod%2=1; A side pair SM nSupMod%2=0
593  if(nSupMod1%2) icol1+=AliEMCALGeoParams::fgkEMCALCols;
594  else icol2+=AliEMCALGeoParams::fgkEMCALCols;
595  }
596 
597  rowdiff = TMath::Abs( irow1 - irow2 ) ;
598  coldiff = TMath::Abs( icol1 - icol2 ) ;
599 
600  //if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0))
601  if ((coldiff + rowdiff == 1 ))
602  areNeighbours = kTRUE ;
603 
604  return areNeighbours;
605 }
606 
607 //_________________________________________________________________________________________
610 //_________________________________________________________________________________________
612  AliVCluster* cluster)
613 {
614  Int_t iSupMod = -1;
615  Int_t iSM0 = -1;
616  Int_t iTower = -1;
617  Int_t iIphi = -1;
618  Int_t iIeta = -1;
619  Int_t iphi = -1;
620  Int_t ieta = -1;
621 
622  for(Int_t iDigit = 0; iDigit < cluster->GetNCells(); iDigit++)
623  {
624  // Get from the absid the supermodule, tower and eta/phi numbers
625  geom->GetCellIndex(cluster->GetCellAbsId(iDigit),iSupMod,iTower,iIphi,iIeta);
626  geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
627 
628  // Check if there are cells of different SM
629  if (iDigit == 0 ) iSM0 = iSupMod;
630  else if(iSupMod != iSM0)
631  {
632  if(iSupMod > 11 && iSupMod < 18)
633  AliWarning(Form("Cluster shared in 2 DCal: SM%d, SM%d??",iSupMod,iSM0));
634 
635  return kTRUE;
636  }
637  }
638 
639  return kFALSE;
640 }
641 
642 //______________________________________________________________________________
645 //______________________________________________________________________________
647  AliVCaloCells* cells) const
648 {
649  //If the distance to the border is 0 or negative just exit accept all clusters
650 
651  if ( cells->GetType()==AliVCaloCells::kEMCALCell && fEMCALRecoUtils->GetNumberOfCellsFromEMCALBorder() <= 0 ) return kTRUE;
652 
653  if ( cells->GetType()==AliVCaloCells::kPHOSCell && fNCellsFromPHOSBorder <= 0 ) return kTRUE;
654 
655  Int_t absIdMax = -1;
656  Float_t ampMax = -1;
657 
658  for(Int_t i = 0; i < cluster->GetNCells() ; i++)
659  {
660  Int_t absId = cluster->GetCellAbsId(i) ;
661  Float_t amp = cells->GetCellAmplitude(absId);
662 
663  if(amp > ampMax)
664  {
665  ampMax = amp;
666  absIdMax = absId;
667  }
668  }
669 
670  AliDebug(1,Form("Cluster Max AbsId %d, Cell Energy %2.2f, Cluster Energy %2.2f",
671  absIdMax, ampMax, cluster->E()));
672 
673  if ( absIdMax == -1 ) return kFALSE;
674 
675  // Check if the cell is close to the borders:
676  Bool_t okrow = kFALSE;
677  Bool_t okcol = kFALSE;
678 
679  if ( cells->GetType() == AliVCaloCells::kEMCALCell )
680  {
681  // It should be the same as AliEMCALRecoUtils::CheckCellFiducialRegion()
682  // Why not calling it?
683 
684  Int_t iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1, iSM = -1;
685 
686  fEMCALGeo->GetCellIndex(absIdMax,iSM,iTower,iIphi,iIeta);
687 
688  fEMCALGeo->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
689 
690  if(iSM < 0 || iphi < 0 || ieta < 0 )
691  {
692  AliFatal(Form("Negative value for super module: %d, or cell ieta: %d, or cell iphi: %d, check EMCAL geometry name",iSM,ieta,iphi));
693  }
694 
695  // Check rows/phi
696  Int_t nborder = fEMCALRecoUtils->GetNumberOfCellsFromEMCALBorder();
697 
698  if ( iSM < 10 || (iSM > 11 && iSM < 18) ) // Full EMCal (SM0-9) and DCal 2/3 (SM12-17)
699  {
700  if(iphi >= nborder && iphi < 24-nborder) okrow = kTRUE;
701  }
702  else // 1/3 SMs (SM10-11, SM18-19)
703  {
704  if(iphi >= nborder && iphi < 8-nborder) okrow = kTRUE;
705  }
706 
707  // Check columns/eta
708 
709  // Remove all borders if IsEMCALNoBorderAtEta0 or DCal SMs(12-17)
710  if(!fEMCALRecoUtils->IsEMCALNoBorderAtEta0() || (iSM > 11 && iSM < 18))
711  {
712  if(ieta > nborder && ieta < 48-nborder) okcol =kTRUE;
713  }
714  else // Do not remove borders close at eta = 0 for Full EMCal SMs and 1/3 EMCal
715  {
716  if ( iSM%2 == 0 )
717  {
718  if(ieta >= nborder) okcol = kTRUE;
719  }
720  else
721  {
722  if(ieta < 48-nborder) okcol = kTRUE;
723  }
724  } // eta 0 not checked
725 
726  AliDebug(1,Form("EMCAL Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d ? ok row %d, ok column %d",
727  nborder, ieta, iphi, iSM,okrow,okcol));
728 
729  }//EMCAL
730  else if ( cells->GetType() == AliVCaloCells::kPHOSCell )
731  {
732  Int_t relId[4];
733  Int_t irow = -1, icol = -1;
734  fPHOSGeo->AbsToRelNumbering(absIdMax,relId);
735 
736  if (relId[1] != 0 ) return kFALSE; // skip CPV only PHOS
737 
738  irow = relId[2];
739  icol = relId[3];
740  //imod = relId[0]-1;
741 
742  if(irow >= fNCellsFromPHOSBorder && irow < 64-fNCellsFromPHOSBorder) okrow =kTRUE;
743  if(icol >= fNCellsFromPHOSBorder && icol < 56-fNCellsFromPHOSBorder) okcol =kTRUE;
744 
745  AliDebug(1,Form("PHOS Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d ? ok row %d, ok column %d",
746  fNCellsFromPHOSBorder, icol, irow, relId[0]-1,okrow,okcol));
747  }//PHOS
748 
749  if (okcol && okrow) return kTRUE;
750  else return kFALSE;
751 }
752 
753 //________________________________________________________________________________________________________
756 //________________________________________________________________________________________________________
758 {
759  if (!fRemoveBadChannels) return kFALSE;
760 
761  //printf("fEMCALBadChannelMap %p, fPHOSBadChannelMap %p \n",fEMCALBadChannelMap,fPHOSBadChannelMap);
762  if(calorimeter == AliFiducialCut::kEMCAL && !fEMCALRecoUtils->GetEMCALChannelStatusMap(0)) return kFALSE;
763  if(calorimeter == AliFiducialCut::kPHOS && !fPHOSBadChannelMap) return kFALSE;
764 
765  Int_t icol = -1;
766  Int_t irow = -1;
767  Int_t imod = -1;
768  for(Int_t iCell = 0; iCell<nCells; iCell++)
769  {
770  // Get the column and row
771  if ( calorimeter == AliFiducialCut::kEMCAL )
772  {
773  return fEMCALRecoUtils->ClusterContainsBadChannel((AliEMCALGeometry*)fEMCALGeo,cellList,nCells);
774  }
775  else if ( calorimeter == AliFiducialCut::kPHOS )
776  {
777  Int_t relId[4];
778  fPHOSGeo->AbsToRelNumbering(cellList[iCell],relId);
779 
780  if (relId[1] != 0 ) return kTRUE; // skip CPV only PHOS
781 
782  irow = relId[2];
783  icol = relId[3];
784  imod = relId[0]-1;
785 
786  if ( fPHOSBadChannelMap->GetEntries() <= imod ) continue;
787 
788  //printf("PHOS bad channels imod %d, icol %d, irow %d\n",imod, irow, icol);
789  if ( GetPHOSChannelStatus(imod, irow, icol) ) return kTRUE;
790  }
791  else return kFALSE;
792  } // cell cluster loop
793 
794  return kFALSE;
795 }
796 
797 //_______________________________________________________________
799 //_______________________________________________________________
801 {
802  clus->SetE(fEMCALRecoUtils->CorrectClusterEnergyLinearity(clus));
803 }
804 
805 //_______________________________________________________________
813 //______________________________________________________________________________
814 void AliCalorimeterUtils::GetEMCALSubregion(AliVCluster * clus, AliVCaloCells * cells,
815  Int_t & regEta, Int_t & regPhi) const
816 {
817  regEta = regPhi = -1 ;
818 
819  if(!clus->IsEMCAL()) return ;
820 
821  Int_t icol = -1, irow = -1, iRCU = -1;
822  Float_t clusterFraction = 0;
823 
824  Int_t absId = GetMaxEnergyCell(cells,clus,clusterFraction);
825 
826  Int_t sm = GetModuleNumberCellIndexes(absId,AliFiducialCut::kEMCAL,icol,irow,iRCU);
827 
828  // Shift by 48 to for impair SM
829  if( sm%2 == 1) icol+=AliEMCALGeoParams::fgkEMCALCols;
830 
831  // Avoid borders
832  if(icol < 2 || icol > 93 || irow < 2 || irow > 21) return;
833 
834  //
835  // Eta regions
836  //
837 
838  // Region 0: center of SM ~0.18<|eta|<0.55
839  if ( icol > 9 && icol < 34 ) regEta = 0;
840  else if ( icol > 62 && icol < 87 ) regEta = 0;
841 
842  // Region 3: frames ~0.1<|eta|<~0.22 ~0.51<|eta|<0.62
843 
844  else if ( icol <= 9 && icol >= 5 ) regEta = 3;
845  else if ( icol <= 38 && icol >= 34 ) regEta = 3;
846  else if ( icol <= 62 && icol >= 58 ) regEta = 3;
847  else if ( icol <= 91 && icol >= 87 ) regEta = 3;
848 
849  // Region 1: |eta| < ~0.15
850 
851  else if ( icol < 58 && icol > 38 ) regEta = 1 ;
852 
853  // Region 2: |eta| > ~0.6
854 
855  else regEta = 2 ;
856 
857  //
858  // Phi regions
859  //
860 
861  if ( irow >= 2 && irow <= 5 ) regPhi = 0; // External
862  else if ( irow >= 18 && irow <= 21 ) regPhi = 0; // External
863  else if ( irow >= 6 && irow <= 9 ) regPhi = 1; // Mid
864  else if ( irow >= 14 && irow <= 17 ) regPhi = 1; // Mid
865  else regPhi = 2; //10-13 Central
866 
867 }
868 
869 //________________________________________________________________________________________
871 //________________________________________________________________________________________
873  AliVCluster * clu,
874  Float_t & clusterFraction) const
875 {
876  if( !clu || !cells )
877  {
878  AliInfo("Cluster or cells pointer is null!");
879  return -1;
880  }
881 
882  Double_t eMax =-1.;
883  Double_t eTot = 0.;
884  Double_t eCell =-1.;
885  Float_t fraction = 1.;
886  Float_t recalFactor = 1.;
887  Int_t cellAbsId =-1 , absId =-1 ;
888  Int_t iSupMod =-1 , ieta =-1 , iphi = -1, iRCU = -1;
889 
891  if(clu->IsPHOS()) calo = AliFiducialCut::kPHOS ;
892 
893  for (Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
894  {
895  cellAbsId = clu->GetCellAbsId(iDig);
896 
897  fraction = clu->GetCellAmplitudeFraction(iDig);
898  if(fraction < 1e-4) fraction = 1.; // in case unfolding is off
899 
900  iSupMod = GetModuleNumberCellIndexes(cellAbsId, calo, ieta, iphi, iRCU);
901 
902  if(IsRecalibrationOn())
903  {
904  if(calo == AliFiducialCut::kEMCAL)
905  recalFactor = GetEMCALChannelRecalibrationFactor(iSupMod,ieta,iphi);
906  else
907  recalFactor = GetPHOSChannelRecalibrationFactor (iSupMod,iphi,ieta);
908  }
909 
910  eCell = cells->GetCellAmplitude(cellAbsId)*fraction*recalFactor;
911 
912  if(eCell > eMax)
913  {
914  eMax = eCell;
915  absId = cellAbsId;
916  }
917 
918  eTot+=eCell;
919 
920  }// cell loop
921 
922  if(eTot > 0.1)
923  clusterFraction = (eTot-eMax)/eTot; //Do not use cluster energy in case it was corrected for non linearity.
924  else
925  clusterFraction =1.;
926 
927  return absId;
928 }
929 
930 //___________________________________________________________________________________
934 //___________________________________________________________________________________
935 AliVTrack * AliCalorimeterUtils::GetMatchedTrack(AliVCluster* cluster,
936  AliVEvent* event, Int_t index) const
937 {
938  AliVTrack *track = 0x0;
939 
940  //
941  // EMCAL case only when matching is recalculated
942  //
943  if(cluster->IsEMCAL() && IsRecalculationOfClusterTrackMatchingOn())
944  {
945  Int_t trackIndex = fEMCALRecoUtils->GetMatchedTrackIndex(cluster->GetID());
946  //printf("track index %d, cluster ID %d \n ",trackIndex,cluster->GetID());
947 
948  if(trackIndex < 0 )
949  AliInfo(Form("Wrong track index %d, from recalculation", trackIndex));
950  else
951  track = dynamic_cast<AliVTrack*> (event->GetTrack(trackIndex));
952 
953  return track ;
954  }
955 
956  //
957  // Normal case, get info from ESD or AOD
958  //
959 
960  // No tracks matched
961  if( cluster->GetNTracksMatched() < 1 ) return 0x0;
962 
963  // At least one match
964  Int_t iTrack = 0; // only one match for AODs with index 0.
965 
966  // ESDs
967  if(!strcmp("AliESDCaloCluster",Form("%s",cluster->ClassName())))
968  {
969  if( index >= 0 ) iTrack = index;
970  else iTrack = ((AliESDCaloCluster*)cluster)->GetTracksMatched()->At(0); //cluster->GetTrackMatchedIndex();
971 
972  track = dynamic_cast<AliVTrack*> ( event->GetTrack(iTrack) );
973  }
974  else // AODs
975  {
976  if( index > 0 ) iTrack = index;
977 
978  track = dynamic_cast<AliVTrack*>( cluster->GetTrackMatched(iTrack) );
979  }
980 
981  return track ;
982 }
983 
989 {
990  if( eCluster <= 0 || eCluster < eCell )
991  {
992  AliWarning(Form("Bad values eCell=%f, eCluster %f",eCell,eCluster));
993  return 1;
994  }
995 
996  Float_t frac = eCell / eCluster;
997 
998  Float_t correction = fMCECellClusFracCorrParam[0] +
999  TMath::Exp( frac*fMCECellClusFracCorrParam[2]+fMCECellClusFracCorrParam[1] ) +
1000  fMCECellClusFracCorrParam[3]/TMath::Sqrt(frac);
1001 
1002 // printf("AliCalorimeterUtils::GetMCECellClusFracCorrection(eCell=%f, eCluster %f, frac %f) = %f\n",eCell, eCluster, frac, correction);
1003 // printf("\t %2.2f + TMath::Exp( %2.3f*%2.2f + %2.2f ) + %2.2f/TMath::Sqrt(%2.3f)) = %f\n",
1004 // fMCECellClusFracCorrParam[0],frac,fMCECellClusFracCorrParam[2],fMCECellClusFracCorrParam[1],fMCECellClusFracCorrParam[3], frac, correction);
1005 
1006  return correction;
1007 }
1008 
1009 //_____________________________________________________________________________________________________
1011 //_____________________________________________________________________________________________________
1012 Int_t AliCalorimeterUtils::GetModuleNumber(AliAODPWG4Particle * particle, AliVEvent * inputEvent) const
1013 {
1014  Int_t absId = -1;
1015 
1016  if(particle->GetDetectorTag()==AliFiducialCut::kEMCAL)
1017  {
1018  fEMCALGeo->GetAbsCellIdFromEtaPhi(particle->Eta(),particle->Phi(), absId);
1019 
1020  AliDebug(2,Form("EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d",
1021  particle->Eta(), particle->Phi()*TMath::RadToDeg(),absId, fEMCALGeo->GetSuperModuleNumber(absId)));
1022 
1023  return fEMCALGeo->GetSuperModuleNumber(absId) ;
1024  } // EMCAL
1025  else if ( particle->GetDetectorTag() == AliFiducialCut::kPHOS )
1026  {
1027  // In case we use the MC reader, the input are TParticles,
1028  // in this case use the corresponing method in PHOS Geometry to get the particle.
1029  if(strcmp(inputEvent->ClassName(), "AliMCEvent") == 0 )
1030  {
1031  Int_t mod =-1;
1032  Double_t z = 0., x=0.;
1033  TParticle* primary = 0x0;
1034  AliStack * stack = ((AliMCEvent*)inputEvent)->Stack();
1035 
1036  if(stack)
1037  {
1038  primary = stack->Particle(particle->GetCaloLabel(0));
1039  }
1040  else
1041  {
1042  AliFatal("Stack not available, stop!");
1043  }
1044 
1045  if(primary)
1046  {
1047  fPHOSGeo->ImpactOnEmc(primary,mod,z,x) ;
1048  }
1049  else
1050  {
1051  AliFatal("Primary not available, stop!");
1052  }
1053  return mod;
1054  }
1055  // Input are ESDs or AODs, get the PHOS module number like this.
1056  else
1057  {
1058  //FIXME
1059  //AliVCluster *cluster = inputEvent->GetCaloCluster(particle->GetCaloLabel(0));
1060  //return GetModuleNumber(cluster);
1061  //MEFIX
1062  return -1;
1063  }
1064  } // PHOS
1065 
1066  return -1;
1067 }
1068 
1069 //_____________________________________________________________________
1071 //_____________________________________________________________________
1072 Int_t AliCalorimeterUtils::GetModuleNumber(AliVCluster * cluster) const
1073 {
1074  if(!cluster)
1075  {
1076  AliDebug(1,"AliCalorimeterUtils::GetModuleNumber() - NUL Cluster, please check!!!");
1077 
1078  return -1;
1079  }
1080 
1081  if ( cluster->GetNCells() <= 0 ) return -1;
1082 
1083  Int_t absId = cluster->GetCellAbsId(0);
1084 
1085  if ( absId < 0 ) return -1;
1086 
1087  if( cluster->IsEMCAL() )
1088  {
1089  AliDebug(2,Form("EMCAL absid %d, SuperModule %d",absId, fEMCALGeo->GetSuperModuleNumber(absId)));
1090 
1091  return fEMCALGeo->GetSuperModuleNumber(absId) ;
1092  } // EMCAL
1093  else if ( cluster->IsPHOS() )
1094  {
1095  Int_t relId[4];
1096  fPHOSGeo->AbsToRelNumbering(absId,relId);
1097 
1098  if (relId[1] != 0 ) return -1; // skip CPV only PHOS
1099 
1100  AliDebug(2,Form("PHOS absid %d Module %d",absId, relId[0]-1));
1101 
1102  return relId[0]-1;
1103  } // PHOS
1104 
1105  return -1;
1106 }
1107 
1108 //___________________________________________________________________________________________________
1110 //___________________________________________________________________________________________________
1112  Int_t & icol, Int_t & irow, Int_t & iRCU) const
1113 {
1114  Int_t imod = -1;
1115 
1116  if ( absId < 0 ) return -1 ;
1117 
1118  if ( calo == AliFiducialCut::kEMCAL )
1119  {
1120  Int_t iTower = -1, iIphi = -1, iIeta = -1;
1121  fEMCALGeo->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1122  fEMCALGeo->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
1123 
1124  if(imod < 0 || irow < 0 || icol < 0 )
1125  {
1126  AliFatal(Form("Negative value for super module: %d, or cell icol: %d, or cell irow: %d, check EMCAL geometry name",imod,icol,irow));
1127  }
1128 
1129  // In case of DCal C side, shift columns to match offline/online numbering
1130  // when calculating the DDL for Run2
1131  // See AliEMCALRawUtils::Digits2Raw and Raw2Digits.
1132  Int_t ico2 = icol ;
1133  if ( imod == 13 || imod == 15 || imod == 17 ) ico2 += 16;
1134 
1135  // RCU / DDL
1136  if(imod < 10 || (imod > 11 && imod < 18)) // (EMCAL Full || DCAL 2/3)
1137  {
1138  // RCU0 / DDL0
1139  if ( 0 <= irow && irow < 8 ) iRCU = 0; // first cable row
1140  else if ( 8 <= irow && irow < 16 &&
1141  0 <= ico2 && ico2 < 24 ) iRCU = 0; // first half;
1142  //second cable row
1143 
1144  // RCU1 / DDL1
1145  else if ( 8 <= irow && irow < 16 &&
1146  24 <= ico2 && ico2 < 48 ) iRCU = 1; // second half;
1147  //second cable row
1148  else if ( 16 <= irow && irow < 24 ) iRCU = 1; // third cable row
1149 
1150  if ( imod%2 == 1 ) iRCU = 1 - iRCU; // swap for odd=C side, to allow us to cable both sides the same
1151  }
1152  else
1153  {
1154  // 1/3 SM have one single SRU, just assign RCU/DDL 0
1155  iRCU = 0 ;
1156  }
1157 
1158  if ( iRCU < 0 )
1159  AliFatal(Form("Wrong EMCAL RCU number = %d", iRCU));
1160 
1161  return imod ;
1162  } // EMCAL
1163  else // PHOS
1164  {
1165  Int_t relId[4];
1166  fPHOSGeo->AbsToRelNumbering(absId,relId);
1167 
1168  if (relId[1] != 0 ) return -1; // skip CPV only PHOS
1169 
1170  irow = relId[2];
1171  icol = relId[3];
1172  imod = relId[0]-1;
1173  iRCU= (Int_t)(relId[2]-1)/16 ;
1174 
1175  //Int_t iBranch= (Int_t)(relid[3]-1)/28 ; //0 to 1
1176 
1177  if ( iRCU >= 4 )
1178  AliFatal(Form("Wrong PHOS RCU number = %d", iRCU));
1179 
1180  return imod;
1181  } // PHOS
1182 
1183  return -1;
1184 }
1185 
1186 //___________________________________________________________________________________________________
1189 //___________________________________________________________________________________________________
1191  Int_t & icol , Int_t & irow , Int_t & iRCU,
1192  Int_t & icolAbs, Int_t & irowAbs) const
1193 {
1194  Int_t imod = GetModuleNumberCellIndexes(absId, calo, icol, irow,iRCU);
1195 
1196  icolAbs = icol;
1197  irowAbs = irow;
1198 
1199  //
1200  // PHOS
1201  //
1202  if(calo == AliFiducialCut::kPHOS)
1203  {
1204  irowAbs = irow + 64 * imod;
1205 
1206  return imod;
1207  }
1208  //
1209  // EMCal/DCal
1210  //
1211  else
1212  {
1213  //
1214  // Shift collumns in even SM
1215  Int_t shiftEta = 48;
1216 
1217  // Shift collumn even more due to smaller acceptance of DCal collumns
1218  if ( imod > 11 && imod < 18) shiftEta+=48/3;
1219 
1220  icolAbs = (imod % 2) ? icol + shiftEta : icol;
1221 
1222  //
1223  // Shift rows per sector
1224  irowAbs = irow + 24 * Int_t(imod / 2);
1225 
1226  // Shift row less due to smaller acceptance of SM 10 and 11 to count DCal rows
1227  if ( imod > 11 && imod < 20) irowAbs -= (2*24 / 3);
1228 
1229  return imod ;
1230  }
1231 }
1232 
1233 
1234 //___________________________________________________________________________________________
1236 //___________________________________________________________________________________________
1237 Int_t AliCalorimeterUtils::GetNumberOfLocalMaxima(AliVCluster* cluster, AliVCaloCells* cells)
1238 {
1239  const Int_t nc = cluster->GetNCells();
1240 
1241  Int_t absIdList[nc];
1242  Float_t maxEList[nc];
1243 
1244  Int_t nMax = GetNumberOfLocalMaxima(cluster, cells, absIdList, maxEList);
1245 
1246  return nMax;
1247 }
1248 
1249 //___________________________________________________________________________________________
1251 //___________________________________________________________________________________________
1252 Int_t AliCalorimeterUtils::GetNumberOfLocalMaxima(AliVCluster* cluster, AliVCaloCells* cells,
1253  Int_t *absIdList, Float_t *maxEList)
1254 {
1255  Int_t iDigitN = 0 ;
1256  Int_t iDigit = 0 ;
1257  Int_t absId1 = -1 ;
1258  Int_t absId2 = -1 ;
1259  const Int_t nCells = cluster->GetNCells();
1260 
1261  Float_t eCluster = RecalibrateClusterEnergy(cluster, cells);// recalculate cluster energy, avoid non lin correction.
1262 
1263  Float_t simuTotWeight = 0;
1265  {
1266  simuTotWeight = RecalibrateClusterEnergyWeightCell(cluster, cells,eCluster);// same but apply a weight
1267  simuTotWeight/= eCluster;
1268  }
1269 
1271  if(!cluster->IsEMCAL()) calorimeter = AliFiducialCut::kPHOS;
1272 
1273  //printf("cluster : ncells %d \n",nCells);
1274 
1275  Float_t emax = 0;
1276  Int_t idmax =-1;
1277  for(iDigit = 0; iDigit < nCells ; iDigit++)
1278  {
1279  absIdList[iDigit] = cluster->GetCellsAbsId()[iDigit] ;
1280  Float_t en = cells->GetCellAmplitude(absIdList[iDigit]);
1281  RecalibrateCellAmplitude(en,calorimeter,absIdList[iDigit]);
1282 
1284  en*=GetMCECellClusFracCorrection(en,eCluster)/simuTotWeight;
1285 
1286  if( en > emax )
1287  {
1288  emax = en ;
1289  idmax = absIdList[iDigit] ;
1290  }
1291  //Int_t icol = -1, irow = -1, iRCU = -1;
1292  //Int_t sm = GetModuleNumberCellIndexes(absIdList[iDigit], calorimeter, icol, irow, iRCU) ;
1293  //printf("\t cell %d, id %d, sm %d, col %d, row %d, e %f\n", iDigit, absIdList[iDigit], sm, icol, irow, en );
1294  }
1295 
1296  for(iDigit = 0 ; iDigit < nCells; iDigit++)
1297  {
1298  if( absIdList[iDigit] >= 0 )
1299  {
1300  absId1 = cluster->GetCellsAbsId()[iDigit];
1301 
1302  Float_t en1 = cells->GetCellAmplitude(absId1);
1303  RecalibrateCellAmplitude(en1,calorimeter,absId1);
1304 
1306  en1*=GetMCECellClusFracCorrection(en1,eCluster)/simuTotWeight;
1307 
1308  //printf("%d : absIDi %d, E %f\n",iDigit, absId1,en1);
1309 
1310  for(iDigitN = 0; iDigitN < nCells; iDigitN++)
1311  {
1312  absId2 = cluster->GetCellsAbsId()[iDigitN] ;
1313 
1314  if(absId2==-1 || absId2==absId1) continue;
1315 
1316  //printf("\t %d : absIDj %d\n",iDigitN, absId2);
1317 
1318  Float_t en2 = cells->GetCellAmplitude(absId2);
1319  RecalibrateCellAmplitude(en2,calorimeter,absId2);
1320 
1322  en2*=GetMCECellClusFracCorrection(en2,eCluster)/simuTotWeight;
1323 
1324  //printf("\t %d : absIDj %d, E %f\n",iDigitN, absId2,en2);
1325 
1326  if ( AreNeighbours(calorimeter, absId1, absId2) )
1327  {
1328  // printf("\t \t Neighbours \n");
1329  if ( en1 > en2 )
1330  {
1331  absIdList[iDigitN] = -1 ;
1332  //printf("\t \t indexN %d not local max\n",iDigitN);
1333  // but may be digit too is not local max ?
1334  if(en1 < en2 + fLocMaxCutEDiff) {
1335  //printf("\t \t index %d not local max cause locMaxCutEDiff\n",iDigit);
1336  absIdList[iDigit] = -1 ;
1337  }
1338  }
1339  else
1340  {
1341  absIdList[iDigit] = -1 ;
1342  //printf("\t \t index %d not local max\n",iDigitN);
1343  // but may be digitN too is not local max ?
1344  if(en1 > en2 - fLocMaxCutEDiff)
1345  {
1346  absIdList[iDigitN] = -1 ;
1347  //printf("\t \t indexN %d not local max cause locMaxCutEDiff\n",iDigit);
1348  }
1349  }
1350  } // if Are neighbours
1351  //else printf("\t \t NOT Neighbours \n");
1352  } // while digitN
1353  } // slot not empty
1354  } // while digit
1355 
1356  iDigitN = 0 ;
1357  for(iDigit = 0; iDigit < nCells; iDigit++)
1358  {
1359  if( absIdList[iDigit] >= 0 )
1360  {
1361  absIdList[iDigitN] = absIdList[iDigit] ;
1362 
1363  Float_t en = cells->GetCellAmplitude(absIdList[iDigit]);
1364  RecalibrateCellAmplitude(en,calorimeter,absIdList[iDigit]);
1365 
1367  en*=GetMCECellClusFracCorrection(en,eCluster)/simuTotWeight;
1368 
1369  if(en < fLocMaxCutE) continue; // Maxima only with seed energy at least
1370 
1371  maxEList[iDigitN] = en ;
1372 
1373  //printf("Local max %d, id %d, en %f\n", iDigit,absIdList[iDigitN],en);
1374  iDigitN++ ;
1375  }
1376  }
1377 
1378  if ( iDigitN == 0 )
1379  {
1380  AliDebug(1,Form("No local maxima found, assign highest energy cell as maxima, id %d, en cell %2.2f, en cluster %2.2f",
1381  idmax,emax,cluster->E()));
1382  iDigitN = 1 ;
1383  maxEList[0] = emax ;
1384  absIdList[0] = idmax ;
1385  }
1386 
1387 
1388  AliDebug(1,Form("In cluster E %2.2f (wth non lin. %2.2f), M02 %2.2f, M20 %2.2f, N maxima %d",
1389  cluster->E(),eCluster, cluster->GetM02(),cluster->GetM20(), iDigitN));
1390 
1391 // if(fDebug > 1) for(Int_t imax = 0; imax < iDigitN; imax++)
1392 // {
1393 // printf(" \t i %d, absId %d, Ecell %f\n",imax,absIdList[imax],maxEList[imax]);
1394 // }
1395 
1396  return iDigitN ;
1397 }
1398 
1399 //____________________________________
1401 //____________________________________
1403 {
1404  if (!AliAnalysisManager::GetAnalysisManager()->GetTree())
1405  {
1406  AliError("AliCalorimeterUtils::GetPass() - Pointer to tree = 0, returning null");
1407  return TString("");
1408  }
1409 
1410  if (!AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile())
1411  {
1412  AliError("AliCalorimeterUtils::GetPass() - Null pointer input file, returning null");
1413  return TString("");
1414  }
1415 
1416  TString pass(AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile()->GetName());
1417  if (pass.Contains("ass1")) return TString("pass1");
1418  else if (pass.Contains("ass2")) return TString("pass2");
1419  else if (pass.Contains("ass3")) return TString("pass3");
1420  else if (pass.Contains("ass4")) return TString("pass4");
1421  else if (pass.Contains("ass5")) return TString("pass5");
1422  else if (pass.Contains("LHC11c") && pass.Contains("spc_calo") ) return TString("spc_calo");
1423  else if (pass.Contains("calo") || pass.Contains("high_lumi"))
1424  {
1425  AliInfo("Path contains <calo> or <high-lumi>, set as <pass1>");
1426  return TString("pass1");
1427  }
1428  else if (pass.Contains("LHC14a1a"))
1429  {
1430  AliInfo("Check that Energy calibration was enabled for this MC production in the tender, clusterizer or here!!");
1431 
1432  return TString("LHC14a1a");
1433  }
1434 
1435  // No condition fullfilled, give a default value
1436  AliInfo("Pass number string not found");
1437  return TString("");
1438 }
1439 
1440 //________________________________________
1442 //________________________________________
1444 {
1445  fEMCALGeoName = "";
1446  fPHOSGeoName = "";
1447 
1448  fEMCALGeoMatrixSet = kFALSE;
1449  fPHOSGeoMatrixSet = kFALSE;
1450 
1451  fRemoveBadChannels = kFALSE;
1452 
1454 
1455  fLocMaxCutE = 0.1 ;
1456  fLocMaxCutEDiff = 0.0 ;
1457 
1458  // fMaskCellColumns = new Int_t[fNMaskCellColumns];
1459  // fMaskCellColumns[0] = 6 ; fMaskCellColumns[1] = 7 ; fMaskCellColumns[2] = 8 ;
1460  // fMaskCellColumns[3] = 35; fMaskCellColumns[4] = 36; fMaskCellColumns[5] = 37;
1461  // fMaskCellColumns[6] = 12+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[7] = 13+AliEMCALGeoParams::fgkEMCALCols;
1462  // fMaskCellColumns[8] = 40+AliEMCALGeoParams::fgkEMCALCols; fMaskCellColumns[9] = 41+AliEMCALGeoParams::fgkEMCALCols;
1463  // fMaskCellColumns[10]= 42+AliEMCALGeoParams::fgkEMCALCols;
1464 
1465  fOADBSet = kFALSE;
1466  fOADBForEMCAL = kTRUE ;
1467  fOADBForPHOS = kFALSE;
1468 
1469  fOADBFilePathEMCAL = "$ALICE_PHYSICS/OADB/EMCAL" ;
1470  fOADBFilePathPHOS = "$ALICE_PHYSICS/OADB/PHOS" ;
1471 
1472  fImportGeometryFromFile = kTRUE;
1474 
1475  fNSuperModulesUsed = 22;
1476 
1477  fMCECellClusFracCorrParam[0] = 0.78;
1478  fMCECellClusFracCorrParam[1] =-1.8;
1479  fMCECellClusFracCorrParam[2] =-6.3;
1480  fMCECellClusFracCorrParam[3] = 0.014;
1481 }
1482 
1483 //_____________________________________________________
1485 //_____________________________________________________
1487 {
1488  AliDebug(1,"Init bad channel map");
1489 
1490  // In order to avoid rewriting the same histograms
1491  Bool_t oldStatus = TH1::AddDirectoryStatus();
1492  TH1::AddDirectory(kFALSE);
1493 
1494  fPHOSBadChannelMap = new TObjArray(5);
1495  for (int i = 0; i < 5; i++)fPHOSBadChannelMap->Add(new TH2I(Form("PHOS_BadMap_mod%d",i),
1496  Form("PHOS_BadMap_mod%d",i),
1497  64, 0, 64, 56, 0, 56));
1498 
1499  fPHOSBadChannelMap->SetOwner(kTRUE);
1500  fPHOSBadChannelMap->Compress();
1501 
1502  //In order to avoid rewriting the same histograms
1503  TH1::AddDirectory(oldStatus);
1504 }
1505 
1506 //______________________________________________________
1508 //______________________________________________________
1510 {
1511  AliDebug(1,"Init recalibration map");
1512 
1513  // In order to avoid rewriting the same histograms
1514  Bool_t oldStatus = TH1::AddDirectoryStatus();
1515  TH1::AddDirectory(kFALSE);
1516 
1518  for (int i = 0; i < 5; i++)
1519  {
1520  fPHOSRecalibrationFactors->Add(new TH2F(Form("PHOSRecalFactors_Mod%d",i),
1521  Form("PHOSRecalFactors_Mod%d",i),
1522  64, 0, 64, 56, 0, 56));
1523  }
1524 
1525  // Init the histograms with 1
1526  for (Int_t m = 0; m < 5; m++)
1527  {
1528  for (Int_t i = 0; i < 56; i++)
1529  {
1530  for (Int_t j = 0; j < 64; j++)
1531  {
1533  }
1534  }
1535  }
1536 
1537  fPHOSRecalibrationFactors->SetOwner(kTRUE);
1538  fPHOSRecalibrationFactors->Compress();
1539 
1540  // In order to avoid rewriting the same histograms
1541  TH1::AddDirectory(oldStatus);
1542 }
1543 
1548 {
1549  if (fEMCALGeo) return;
1550 
1551  AliDebug(1,Form(" for run=%d",fRunNumber));
1552 
1553  if(fEMCALGeoName=="")
1554  {
1555  fEMCALGeo = AliEMCALGeometry::GetInstanceFromRunNumber(fRunNumber);
1556  AliInfo(Form("Get EMCAL geometry name to <%s> for run %d",fEMCALGeo->GetName(),fRunNumber));
1557  }
1558  else
1559  {
1560  fEMCALGeo = AliEMCALGeometry::GetInstance(fEMCALGeoName);
1561  AliInfo(Form("Set EMCAL geometry name to <%s>",fEMCALGeoName.Data()));
1562  }
1563 
1564  // Init geometry, I do not like much to do it like this ...
1565  if(fImportGeometryFromFile && !gGeoManager)
1566  {
1567  if(fImportGeometryFilePath=="") // If not specified, set location depending on run number
1568  {
1569  // "$ALICE_ROOT/EVE/alice-data/default_geo.root"
1570  if (fRunNumber < 140000) fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2010.root";
1571  else if(fRunNumber < 171000) fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2011.root";
1572  else if(fRunNumber < 198000) fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2012.root"; // 2012-2013
1573  else fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2015.root"; // >= 2015
1574  }
1575 
1576  AliInfo(Form("Import %s",fImportGeometryFilePath.Data()));
1577 
1578  TGeoManager::Import(fImportGeometryFilePath) ; // default need file "geometry.root" in local dir!!!!
1579  }
1580  else if (!gGeoManager) AliInfo("Careful!, gGeoManager not loaded, load misalign matrices");
1581 }
1582 
1587 {
1588  if (fPHOSGeo) return;
1589 
1590  AliDebug(1,Form(" for run=%d",fRunNumber));
1591 
1592  if(fPHOSGeoName=="") fPHOSGeoName = "PHOSgeo";
1593 
1594  fPHOSGeo = new AliPHOSGeoUtils(fPHOSGeoName);
1595 
1596  //if (!gGeoManager) AliInfo("Careful!, gGeoManager not loaded, load misalign matrices");
1597 }
1598 
1599 //______________________________________________________________________________________________
1600 // Check that a MC ESD is in the calorimeter acceptance
1601 //______________________________________________________________________________________________
1603 {
1604  if(!particle || (calo!=AliFiducialCut::kEMCAL && calo!=AliFiducialCut::kPHOS)) return kFALSE ;
1605 
1606  if( (!IsPHOSGeoMatrixSet () && calo == AliFiducialCut::kPHOS ) ||
1608  {
1609  AliFatal(Form("Careful Geo Matrix for calo <%d> is not set, use AliFidutialCut instead",calo));
1610  return kFALSE ;
1611  }
1612 
1613  if(calo == AliFiducialCut::kPHOS )
1614  {
1615  Int_t mod = 0 ;
1616  Double_t x = 0, z = 0 ;
1617  return GetPHOSGeometry()->ImpactOnEmc( particle, mod, z, x);
1618  }
1619  else if(calo == AliFiducialCut::kEMCAL)
1620  {
1621  Int_t absID = 0 ;
1622  Bool_t ok = GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(particle->Eta(),particle->Phi(),absID);
1623  if(ok)
1624  {
1625  Int_t icol = -1, irow = -1, iRCU = -1;
1626  Int_t nModule = GetModuleNumberCellIndexes(absID,calo, icol, irow, iRCU);
1627  Int_t status = GetEMCALChannelStatus(nModule,icol,irow);
1628  if(status > 0) ok = kFALSE;
1629  }
1630 
1631  return ok ;
1632  }
1633 
1634  return kFALSE ;
1635 }
1636 
1637 //______________________________________________________________________________________________________
1639 //______________________________________________________________________________________________________
1641 {
1642  if(!particle || (calo!=AliFiducialCut::kEMCAL && calo!=AliFiducialCut::kPHOS)) return kFALSE ;
1643 
1644  if( (!IsPHOSGeoMatrixSet () && calo == AliFiducialCut::kPHOS ) ||
1646  {
1647  AliFatal(Form("Careful Geo Matrix for calo <%d> is not set, use AliFidutialCut instead",calo));
1648  return kFALSE ;
1649  }
1650 
1651  Float_t phi = particle->Phi();
1652  if(phi < 0) phi+=TMath::TwoPi();
1653 
1654  if(calo == AliFiducialCut::kPHOS )
1655  {
1656  Int_t mod = 0 ;
1657  Double_t x = 0, z = 0 ;
1658  Double_t vtx[]={ particle->Xv(), particle->Yv(), particle->Zv() } ;
1659  return GetPHOSGeometry()->ImpactOnEmc(vtx, particle->Theta(), phi, mod, z, x) ;
1660  }
1661  else if(calo == AliFiducialCut::kEMCAL)
1662  {
1663  Int_t absID = 0 ;
1664  Bool_t ok = GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(particle->Eta(),phi,absID);
1665  if(ok)
1666  {
1667  Int_t icol = -1, irow = -1, iRCU = -1;
1668  Int_t nModule = GetModuleNumberCellIndexes(absID,calo, icol, irow, iRCU);
1669  Int_t status = GetEMCALChannelStatus(nModule,icol,irow);
1670  if(status > 0) ok = kFALSE;
1671  }
1672 
1673  return ok ;
1674  }
1675 
1676  return kFALSE ;
1677 }
1678 
1679 //_____________________________________________________________________________________________________
1680 // Check that a TLorentzVector is in the calorimeter acceptance, give the cell number where it hit.
1681 //_____________________________________________________________________________________________________
1683  Float_t phiOrg, Int_t & absID)
1684 {
1685  if(calo!=AliFiducialCut::kEMCAL && calo!=AliFiducialCut::kPHOS) return kFALSE ;
1686 
1687  if( (!IsPHOSGeoMatrixSet () && calo == AliFiducialCut::kPHOS ) ||
1689  {
1690  AliFatal(Form("Careful Geo Matrix for calo <%d> is not set, use AliFidutialCut instead",calo));
1691  return kFALSE ;
1692  }
1693 
1694  Float_t phi = phiOrg;
1695  if(phi < 0) phi+=TMath::TwoPi();
1696 
1697  if(calo == AliFiducialCut::kPHOS )
1698  {
1699  Int_t mod = 0 ;
1700  Double_t x = 0, z = 0 ;
1701  Double_t vtx[]={0,0,0} ;
1702  return GetPHOSGeometry()->ImpactOnEmc(vtx, theta, phi, mod, z, x) ;
1703  }
1704  else if(calo == AliFiducialCut::kEMCAL)
1705  {
1706  Bool_t ok = GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(eta,phi,absID);
1707  if(ok)
1708  {
1709  Int_t icol = -1, irow = -1, iRCU = -1;
1710  Int_t nModule = GetModuleNumberCellIndexes(absID,calo, icol, irow, iRCU);
1711  Int_t status = GetEMCALChannelStatus(nModule,icol,irow);
1712  if(status > 0) ok = kFALSE;
1713  }
1714 
1715  return ok ;
1716  }
1717 
1718  return kFALSE ;
1719 }
1720 
1721 //_______________________________________________________________________
1724 //_______________________________________________________________________
1726 {
1727  Int_t icol = ieta;
1728  if ( iSM%2 ) icol+=48; // Impair SM, shift index [0-47] to [48-96]
1729 
1731  {
1732  for (Int_t imask = 0; imask < fNMaskCellColumns; imask++)
1733  {
1734  if(icol==fMaskCellColumns[imask]) return kTRUE;
1735  }
1736  }
1737 
1738  return kFALSE;
1739 }
1740 
1741 //_________________________________________________________
1743 //_________________________________________________________
1744 void AliCalorimeterUtils::Print(const Option_t * opt) const
1745 {
1746  if(! opt)
1747  return;
1748 
1749  printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
1750  printf("Remove Clusters with bad channels? %d\n",fRemoveBadChannels);
1751  printf("Remove Clusters with max cell at less than %d cells from EMCAL border and %d cells from PHOS border\n",
1752  fEMCALRecoUtils->GetNumberOfCellsFromEMCALBorder(), fNCellsFromPHOSBorder);
1753  if(fEMCALRecoUtils->IsEMCALNoBorderAtEta0()) printf("Do not remove EMCAL clusters at Eta = 0\n");
1754  printf("Recalibrate Clusters? %d, run by run %d\n",fRecalibration,fRunDependentCorrection);
1755  printf("Recalculate Clusters Position? %d\n",fRecalculatePosition);
1756  printf("Recalculate Clusters Energy? %d\n",fCorrectELinearity);
1757  printf("Matching criteria: dR < %2.2f[cm], dZ < %2.2f[cm]\n",fCutR,fCutZ);
1758 
1759  printf("Recalibrate time? %d, With L1 phase run by run? %d\n",IsTimeRecalibrationOn(),IsL1PhaseInTimeRecalibrationOn());
1760 
1761  printf("Loc. Max. E > %2.2f\n", fLocMaxCutE);
1762  printf("Loc. Max. E Diff > %2.2f\n", fLocMaxCutEDiff);
1763 
1764  printf(" \n") ;
1765 }
1766 
1767 //_____________________________________________________________________________________________
1769 //_____________________________________________________________________________________________
1771 {
1772  Int_t icol = -1; Int_t irow = -1; Int_t iRCU = -1;
1773  Int_t nModule = GetModuleNumberCellIndexes(id,calo, icol, irow, iRCU);
1774 
1775  if (IsRecalibrationOn())
1776  {
1777  if(calo == AliFiducialCut::kPHOS)
1778  {
1779  amp *= GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1780  }
1781  else
1782  {
1783  amp *= GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1784  }
1785  }
1786 }
1787 
1788 //____________________________________________________________________________________________________
1790 //____________________________________________________________________________________________________
1792 {
1794  {
1795  GetEMCALRecoUtils()->RecalibrateCellTime(id,bc,time);
1796  }
1797 }
1798 
1799 
1800 //____________________________________________________________________________________________________
1802 //____________________________________________________________________________________________________
1803 void AliCalorimeterUtils::RecalibrateCellTimeL1Phase(Double_t & time, Int_t calo, Int_t iSM, Int_t bunchCrossNumber) const
1804 {
1806  {
1807  GetEMCALRecoUtils()->RecalibrateCellTimeL1Phase(iSM, bunchCrossNumber, time);
1808  }
1809 }
1810 
1811 
1812 //__________________________________________________________________________
1814 //__________________________________________________________________________
1816  AliVCaloCells * cells)
1817 {
1818  // Initialize some used variables
1819  Float_t frac = 0., energy = 0.;
1820 
1821  if(cells)
1822  {
1823  //Get the cluster number of cells and list of absId, check what kind of cluster do we have.
1824 
1825  UShort_t * index = cluster->GetCellsAbsId() ;
1826  Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
1827 
1828  Int_t ncells = cluster->GetNCells();
1829 
1831  if(cluster->IsPHOS()) calo = AliFiducialCut::kPHOS ;
1832 
1833  // Loop on the cells, get the cell amplitude and recalibration factor, multiply and and to the new energy
1834  for(Int_t icell = 0; icell < ncells; icell++)
1835  {
1836  Int_t absId = index[icell];
1837 
1838  frac = fraction[icell];
1839  if(frac < 1e-3) frac = 1; //in case of EMCAL, this is set as 0, not used.
1840 
1841  Float_t amp = cells->GetCellAmplitude(absId);
1842  RecalibrateCellAmplitude(amp,calo, absId);
1843 
1844  AliDebug(2,Form("Recalibrate cell: calo <%d>, cell fraction %f, cell energy: before cal %f; after cal %f",
1845  calo,frac,cells->GetCellAmplitude(absId),amp));
1846 
1847  energy += amp*frac;
1848  }
1849 
1850  AliDebug(1,Form("Energy before %f, after %f",cluster->E(),energy));
1851 
1852  } // cells available
1853  else
1854  {
1855  AliFatal("Cells pointer does not exist!");
1856  }
1857 
1858  return energy;
1859 }
1860 
1861 //_______________________________________________________________________________________________________
1864 //_______________________________________________________________________________________________________
1866  AliVCaloCells * cells, Float_t energyOrg)
1867 {
1868  //Initialize some used variables
1869  Float_t frac = 0., energy = 0.;
1870 
1871  if(cells)
1872  {
1873  // Get the cluster number of cells and list of absId, check what kind of cluster do we have.
1874 
1875  UShort_t * index = cluster->GetCellsAbsId() ;
1876  Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
1877 
1878  Int_t ncells = cluster->GetNCells();
1879 
1881  if(cluster->IsPHOS()) calo = AliFiducialCut::kPHOS ;
1882 
1883  // Loop on the cells, get the cell amplitude and recalibration factor, multiply and and to the new energy
1884  for(Int_t icell = 0; icell < ncells; icell++)
1885  {
1886  Int_t absId = index[icell];
1887 
1888  frac = fraction[icell];
1889  if(frac < 1e-3) frac = 1; //in case of EMCAL, this is set as 0, not used.
1890 
1891  Float_t amp = cells->GetCellAmplitude(absId);
1892  RecalibrateCellAmplitude(amp,calo, absId);
1893 
1894  amp*=GetMCECellClusFracCorrection(amp,energyOrg);
1895 
1896  AliDebug(2,Form("Recalibrate cell: calo <%d>, cell fraction %f, cell energy %f",
1897  calo,frac,cells->GetCellAmplitude(absId)));
1898 
1899  energy += amp*frac;
1900  }
1901 
1902  AliDebug(1,Form("Energy before %f, after %f",cluster->E(),energy));
1903  } // cells available
1904  else
1905  {
1906  AliFatal("Cells pointer does not exist!");
1907  }
1908 
1909  return energy;
1910 }
1911 
1912 //__________________________________________________________________________________________
1915 //__________________________________________________________________________________________
1916 void AliCalorimeterUtils::RecalculateClusterPosition(AliVCaloCells* cells, AliVCluster* clu)
1917 {
1918  fEMCALRecoUtils->RecalculateClusterPosition((AliEMCALGeometry*)fEMCALGeo, cells,clu);
1919 }
1920 
1921 //________________________________________________________________________________
1927 //________________________________________________________________________________
1929  TObjArray* clusterArray)
1930 {
1931  if (!fRecalculateMatching) return ;
1932 
1933  fEMCALRecoUtils->FindMatches(event,clusterArray,fEMCALGeo) ;
1934 
1935  Float_t dZ = 2000;
1936  Float_t dR = 2000;
1937 
1938  Int_t nClusters = event->GetNumberOfCaloClusters();
1939  if(clusterArray) nClusters = clusterArray->GetEntriesFast();
1940 
1941  AliVCluster * clus = 0;
1942 
1943  for (Int_t iclus = 0; iclus < nClusters ; iclus++)
1944  {
1945  if ( clusterArray ) clus = (AliVCluster*) clusterArray->At(iclus) ;
1946  else clus = event->GetCaloCluster(iclus) ;
1947 
1948  if (!clus->IsEMCAL()) continue ;
1949 
1950  //
1951  // Put track residuals in cluster
1952  //
1953  fEMCALRecoUtils->GetMatchedResiduals(clus->GetID(),dZ,dR);
1954 
1955  if ( TMath::Abs(clus->GetTrackDx()) < 500 )
1956  AliDebug(2,Form("Residuals (Old, New): z (%2.4f,%2.4f), x (%2.4f,%2.4f)\n",
1957  clus->GetTrackDz(),dZ,clus->GetTrackDx(),dR));
1958 
1959  clus->SetTrackDistance(dR,dZ);
1960 
1961  //
1962  // Remove old matches in cluster
1963  //
1964  if(clus->GetNTracksMatched() > 0)
1965  {
1966  if(!strcmp("AliESDCaloCluster",Form("%s",clus->ClassName())))
1967  {
1968  TArrayI arrayTrackMatched(0);
1969  ((AliESDCaloCluster*)clus)->AddTracksMatched(arrayTrackMatched);
1970  }
1971  else
1972  {
1973  for(Int_t iTrack = 0; iTrack < clus->GetNTracksMatched(); iTrack++)
1974  {
1975  ((AliAODCaloCluster*)clus)->RemoveTrackMatched((TObject*)((AliAODCaloCluster*)clus)->GetTrackMatched(iTrack));
1976  }
1977  }
1978  }
1979 
1980  //
1981  // Now put first track index in cluster.
1982  //
1983  Int_t trackIndex = fEMCALRecoUtils->GetMatchedTrackIndex(iclus);
1984  if ( trackIndex >= 0 )
1985  {
1986  if(!strcmp("AliESDCaloCluster",Form("%s",clus->ClassName())))
1987  {
1988  TArrayI arrayTrackMatched(1);
1989  arrayTrackMatched[0] = trackIndex;
1990  ((AliESDCaloCluster*)clus)->AddTracksMatched(arrayTrackMatched);
1991  }
1992  else
1993  {
1994  ((AliAODCaloCluster*)clus)->AddTrackMatched((TObject*)event->GetTrack(trackIndex));
1995  }
1996  }
1997 
1998  } // cluster loop
1999 }
2000 
2001 //___________________________________________________________________________
2014 //___________________________________________________________________________
2016  AliVCluster* cluster,
2017  AliVCaloCells* cells,
2018  //Float_t & e1, Float_t & e2,
2019  AliAODCaloCluster* cluster1,
2020  AliAODCaloCluster* cluster2,
2021  Int_t nMax, Int_t eventNumber)
2022 {
2023  TH2F* hClusterMap = 0 ;
2024  TH2F* hClusterLocMax = 0 ;
2025  TH2F* hCluster1 = 0 ;
2026  TH2F* hCluster2 = 0 ;
2027 
2028  if(fPlotCluster)
2029  {
2030  hClusterMap = new TH2F("hClusterMap","Cluster Map",48,0,48,24,0,24);
2031  hClusterLocMax = new TH2F("hClusterLocMax","Cluster 2 highest local maxima",48,0,48,24,0,24);
2032  hCluster1 = new TH2F("hCluster1","Cluster 1",48,0,48,24,0,24);
2033  hCluster2 = new TH2F("hCluster2","Cluster 2",48,0,48,24,0,24);
2034  hClusterMap ->SetXTitle("column");
2035  hClusterMap ->SetYTitle("row");
2036  hClusterLocMax ->SetXTitle("column");
2037  hClusterLocMax ->SetYTitle("row");
2038  hCluster1 ->SetXTitle("column");
2039  hCluster1 ->SetYTitle("row");
2040  hCluster2 ->SetXTitle("column");
2041  hCluster2 ->SetYTitle("row");
2042  }
2043 
2045  if(cluster->IsPHOS())
2046  {
2047  calorimeter = AliFiducialCut::kPHOS;
2048  AliWarning("Not supported for PHOS yet");
2049  return;
2050  }
2051 
2052  const Int_t ncells = cluster->GetNCells();
2053  Int_t absIdList[ncells];
2054 
2055  Float_t e1 = 0, e2 = 0 ;
2056  Int_t icol = -1, irow = -1, iRCU = -1, sm = -1;
2057  Float_t eCluster = 0;
2058  Float_t minCol = 100, minRow = 100, maxCol = -1, maxRow = -1;
2059  for(Int_t iDigit = 0; iDigit < ncells; iDigit++ )
2060  {
2061  absIdList[iDigit] = cluster->GetCellsAbsId()[iDigit];
2062 
2063  Float_t ec = cells->GetCellAmplitude(absIdList[iDigit]);
2064  RecalibrateCellAmplitude(ec,calorimeter, absIdList[iDigit]);
2065  eCluster+=ec;
2066 
2067  if(fPlotCluster)
2068  {
2069  //printf("iDigit %d, absId %d, Ecell %f\n",iDigit,absIdList[iDigit], cells->GetCellAmplitude(absIdList[iDigit]));
2070  sm = GetModuleNumberCellIndexes(absIdList[iDigit], calorimeter, icol, irow, iRCU) ;
2071  if(sm > -1 && sm < 12) // just to avoid compilation warning
2072  {
2073  if(icol > maxCol) maxCol = icol;
2074  if(icol < minCol) minCol = icol;
2075  if(irow > maxRow) maxRow = irow;
2076  if(irow < minRow) minRow = irow;
2077  hClusterMap->Fill(icol,irow,ec);
2078  }
2079  }
2080  }
2081 
2082  // Init counters and variables
2083  Int_t ncells1 = 1 ;
2084  UShort_t absIdList1[9] ;
2085  Double_t fracList1 [9] ;
2086  absIdList1[0] = absId1 ;
2087  fracList1 [0] = 1. ;
2088 
2089  Float_t ecell1 = cells->GetCellAmplitude(absId1);
2090  RecalibrateCellAmplitude(ecell1, calorimeter, absId1);
2091  e1 = ecell1;
2092 
2093  Int_t ncells2 = 1 ;
2094  UShort_t absIdList2[9] ;
2095  Double_t fracList2 [9] ;
2096  absIdList2[0] = absId2 ;
2097  fracList2 [0] = 1. ;
2098 
2099  Float_t ecell2 = cells->GetCellAmplitude(absId2);
2100  RecalibrateCellAmplitude(ecell2, calorimeter, absId2);
2101  e2 = ecell2;
2102 
2103  if(fPlotCluster)
2104  {
2105  Int_t icol1 = -1, irow1 = -1, icol2 = -1, irow2 = -1;
2106  sm = GetModuleNumberCellIndexes(absId1, calorimeter, icol1, irow1, iRCU) ;
2107  hClusterLocMax->Fill(icol1,irow1,ecell1);
2108  sm = GetModuleNumberCellIndexes(absId2, calorimeter, icol2, irow2, iRCU) ;
2109  hClusterLocMax->Fill(icol2,irow2,ecell2);
2110  }
2111 
2112  // Very rough way to share the cluster energy
2113  Float_t eRemain = (eCluster-ecell1-ecell2)/2;
2114  Float_t shareFraction1 = ecell1/eCluster+eRemain/eCluster;
2115  Float_t shareFraction2 = ecell2/eCluster+eRemain/eCluster;
2116 
2117  for(Int_t iDigit = 0; iDigit < ncells; iDigit++)
2118  {
2119  Int_t absId = absIdList[iDigit];
2120 
2121  if ( absId==absId1 || absId==absId2 || absId < 0 ) continue;
2122 
2123  Float_t ecell = cells->GetCellAmplitude(absId);
2124  RecalibrateCellAmplitude(ecell, calorimeter, absId);
2125 
2126  if(AreNeighbours(calorimeter, absId1,absId ))
2127  {
2128  absIdList1[ncells1]= absId;
2129 
2130  if(AreNeighbours(calorimeter, absId2,absId ))
2131  {
2132  fracList1[ncells1] = shareFraction1;
2133  e1 += ecell*shareFraction1;
2134  }
2135  else
2136  {
2137  fracList1[ncells1] = 1.;
2138  e1 += ecell;
2139  }
2140 
2141  ncells1++;
2142 
2143  } // neigbour to cell1
2144 
2145  if(AreNeighbours(calorimeter, absId2,absId ))
2146  {
2147  absIdList2[ncells2]= absId;
2148 
2149  if(AreNeighbours(calorimeter, absId1,absId ))
2150  {
2151  fracList2[ncells2] = shareFraction2;
2152  e2 += ecell*shareFraction2;
2153  }
2154  else
2155  {
2156  fracList2[ncells2] = 1.;
2157  e2 += ecell;
2158  }
2159 
2160  ncells2++;
2161 
2162  } // neigbour to cell2
2163  }
2164 
2165  AliDebug(1,Form("N Local Max %d, Cluster energy = %f, Ecell1 = %f, Ecell2 = %f, Enew1 = %f, Enew2 = %f, Remain %f, \n ncells %d, ncells1 %d, ncells2 %d, f1 %f, f2 %f, sum f12 = %f",
2166  nMax, eCluster,ecell1,ecell2,e1,e2,eCluster-e1-e2,ncells,ncells1,ncells2,shareFraction1,shareFraction2,shareFraction1+shareFraction2));
2167 
2168  cluster1->SetE(e1);
2169  cluster2->SetE(e2);
2170 
2171  cluster1->SetNCells(ncells1);
2172  cluster2->SetNCells(ncells2);
2173 
2174  cluster1->SetCellsAbsId(absIdList1);
2175  cluster2->SetCellsAbsId(absIdList2);
2176 
2177  cluster1->SetCellsAmplitudeFraction(fracList1);
2178  cluster2->SetCellsAmplitudeFraction(fracList2);
2179 
2180  // Correct linearity
2181  CorrectClusterEnergy(cluster1) ;
2182  CorrectClusterEnergy(cluster2) ;
2183 
2184  if(calorimeter==AliFiducialCut::kEMCAL)
2185  {
2186  GetEMCALRecoUtils()->RecalculateClusterPosition(GetEMCALGeometry(), cells, cluster1);
2187  GetEMCALRecoUtils()->RecalculateClusterPosition(GetEMCALGeometry(), cells, cluster2);
2188  }
2189 
2190  if(fPlotCluster)
2191  {
2192  //printf("Cells of cluster1: ");
2193  for(Int_t iDigit = 0; iDigit < ncells1; iDigit++ )
2194  {
2195  //printf(" %d ",absIdList1[iDigit]);
2196 
2197  sm = GetModuleNumberCellIndexes(absIdList1[iDigit], calorimeter, icol, irow, iRCU) ;
2198 
2199  Float_t ecell = cells->GetCellAmplitude(absIdList1[iDigit]);
2200  RecalibrateCellAmplitude(ecell, calorimeter, absIdList1[iDigit]);
2201 
2202  if( AreNeighbours(calorimeter, absId2,absIdList1[iDigit]) && absId1!=absIdList1[iDigit])
2203  hCluster1->Fill(icol,irow,ecell*shareFraction1);
2204  else
2205  hCluster1->Fill(icol,irow,ecell);
2206  }
2207 
2208  //printf(" \n ");
2209  //printf("Cells of cluster2: ");
2210 
2211  for(Int_t iDigit = 0; iDigit < ncells2; iDigit++ )
2212  {
2213  //printf(" %d ",absIdList2[iDigit]);
2214 
2215  sm = GetModuleNumberCellIndexes(absIdList2[iDigit], calorimeter, icol, irow, iRCU) ;
2216 
2217  Float_t ecell = cells->GetCellAmplitude(absIdList2[iDigit]);
2218  RecalibrateCellAmplitude(ecell, calorimeter, absIdList2[iDigit]);
2219 
2220  if( AreNeighbours(calorimeter, absId1,absIdList2[iDigit]) && absId2!=absIdList2[iDigit])
2221  hCluster2->Fill(icol,irow,ecell*shareFraction2);
2222  else
2223  hCluster2->Fill(icol,irow,ecell);
2224  }
2225  //printf(" \n ");
2226 
2227  gStyle->SetPadRightMargin(0.1);
2228  gStyle->SetPadLeftMargin(0.1);
2229  gStyle->SetOptStat(0);
2230  gStyle->SetOptFit(000000);
2231 
2232  if(maxCol-minCol > maxRow-minRow)
2233  {
2234  maxRow+= maxCol-minCol;
2235  }
2236  else
2237  {
2238  maxCol+= maxRow-minRow;
2239  }
2240 
2241  TCanvas * c= new TCanvas("canvas", "canvas", 4000, 4000) ;
2242  c->Divide(2,2);
2243  c->cd(1);
2244  gPad->SetGridy();
2245  gPad->SetGridx();
2246  gPad->SetLogz();
2247  hClusterMap ->SetAxisRange(minCol, maxCol,"X");
2248  hClusterMap ->SetAxisRange(minRow, maxRow,"Y");
2249  hClusterMap ->Draw("colz TEXT");
2250  c->cd(2);
2251  gPad->SetGridy();
2252  gPad->SetGridx();
2253  gPad->SetLogz();
2254  hClusterLocMax ->SetAxisRange(minCol, maxCol,"X");
2255  hClusterLocMax ->SetAxisRange(minRow, maxRow,"Y");
2256  hClusterLocMax ->Draw("colz TEXT");
2257  c->cd(3);
2258  gPad->SetGridy();
2259  gPad->SetGridx();
2260  gPad->SetLogz();
2261  hCluster1 ->SetAxisRange(minCol, maxCol,"X");
2262  hCluster1 ->SetAxisRange(minRow, maxRow,"Y");
2263  hCluster1 ->Draw("colz TEXT");
2264  c->cd(4);
2265  gPad->SetGridy();
2266  gPad->SetGridx();
2267  gPad->SetLogz();
2268  hCluster2 ->SetAxisRange(minCol, maxCol,"X");
2269  hCluster2 ->SetAxisRange(minRow, maxRow,"Y");
2270  hCluster2 ->Draw("colz TEXT");
2271 
2272  if(eCluster > 6 )c->Print(Form("clusterFigures/Event%d_E%1.0f_nMax%d_NCell1_%d_NCell2_%d.eps",
2273  eventNumber,cluster->E(),nMax,ncells1,ncells2));
2274 
2275  delete c;
2276  delete hClusterMap;
2277  delete hClusterLocMax;
2278  delete hCluster1;
2279  delete hCluster2;
2280  }
2281 }
2282 
Bool_t fRecalculatePosition
Recalculate cluster position.
AliEMCALGeometry * fEMCALGeo
! EMCAL geometry pointer.
double Double_t
Definition: External.C:58
void InitPHOSRecalibrationFactors()
Init PHOS recalibration factors.
Bool_t IsRecalculationOfClusterTrackMatchingOn() const
Definition: External.C:236
TGeoHMatrix * fEMCALMatrix[22]
Geometry matrices with alignments.
Int_t GetPHOSChannelStatus(Int_t imod, Int_t iCol, Int_t iRow) const
Float_t fLocMaxCutEDiff
Local maxima cut, when aggregating cells, next can be a bit higher.
TGeoHMatrix * fPHOSMatrix[5]
Geometry matrices with alignments.
Bool_t ClusterContainsBadChannel(Int_t calo, UShort_t *cellList, Int_t nCells)
AliPHOSGeoUtils * fPHOSGeo
! PHOS geometry pointer.
AliEMCALRecoUtils * GetEMCALRecoUtils() const
void SetEMCALL1PhaseInTimeRecalibrationForAllSM(TObjArray *map)
TString fileName
void SwitchOnDistToBadChannelRecalculation()
AliPHOSGeoUtils * GetPHOSGeometry() const
Bool_t fOADBForEMCAL
Get calibration from OADB for EMCAL.
Float_t GetPHOSChannelRecalibrationFactor(Int_t imod, Int_t iCol, Int_t iRow) const
void RecalculateClusterTrackMatching(AliVEvent *event, TObjArray *clusterArray=0x0)
Float_t fLocMaxCutE
Local maxima cut must have more than this energy.
Float_t GetMCECellClusFracCorrection(Float_t eCell, Float_t eCluster) const
void SetEMCALChannelStatusMap(Int_t iSM, TH2I *h)
Bool_t fRunDependentCorrection
Switch on or off the recalibration dependent on T.
TCanvas * c
Definition: TestFitELoss.C:172
TObjArray * fPHOSRecalibrationFactors
Array of histograms with map of recalibration factors, PHOS.
TString fEMCALGeoName
Name of geometry to use for EMCAL.
TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const
Bool_t fRecalibration
Switch on or off the recalibration.
Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow) const
TH1F * GetEMCALChannelTimeRecalibrationFactors(Int_t bc) const
const TString calorimeter
Definition: anaM.C:35
Int_t fDebug
Debugging level.
TH1C * GetEMCALL1PhaseInTimeRecalibrationForAllSM() const
Bool_t IsRecalibrationOn() const
Bool_t IsMCParticleInCalorimeterAcceptance(Int_t calo, TParticle *particle)
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
Int_t GetModuleNumber(AliAODPWG4Particle *particle, AliVEvent *inputEvent) const
Get the EMCAL/PHOS module number that corresponds to this particle.
Bool_t fLoadEMCALMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
AliEMCALGeometry * GetEMCALGeometry() const
int Int_t
Definition: External.C:63
Bool_t IsL1PhaseInTimeRecalibrationOn() const
Bool_t fRecalculateMatching
Recalculate cluster position.
Bool_t MaskFrameCluster(Int_t iSM, Int_t ieta) const
float Float_t
Definition: External.C:68
Bool_t fOADBForPHOS
Get calibration from OADB for PHOS.
Int_t * fMaskCellColumns
List of masked cells collumn index.
Bool_t fRemoveBadChannels
Check the channel status provided and remove clusters with bad channels.
void InitPHOSBadChannelStatusMap()
Init PHOS bad channels map.
AliCalorimeterUtils()
Constructor. Initialize parameters.
virtual void InitParameters()
Initialize the parameters of the analysis.
Int_t fNMaskCellColumns
Number of masked columns.
Bool_t IsClusterSharedByTwoSuperModules(const AliEMCALGeometry *geom, AliVCluster *cluster)
Int_t GetNumberOfLocalMaxima(AliVCluster *cluster, AliVCaloCells *cells)
Find the number of local maxima in cluster.
Float_t fMCECellClusFracCorrParam[4]
Parameters for the function correcting the weight of the cells in the cluster.
Bool_t fEMCALGeoMatrixSet
Check if the transformation matrix is set for EMCAL.
TH2I * GetPHOSChannelStatusMap(Int_t imod) const
void SetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow, Double_t c=1)
TString GetPass()
Get passx from filename.
energy
void RecalculateClusterPosition(AliVCaloCells *cells, AliVCluster *clu)
Bool_t fImportGeometryFromFile
Import geometry settings in geometry.root file.
Bool_t fCorrectELinearity
Correct cluster energy linearity.
Bool_t fPHOSGeoMatrixSet
Check if the transformation matrix is set for PHOS.
TString fOADBFilePathPHOS
Default path $ALICE_PHYSICS/OADB/PHOS, if needed change.
void CorrectClusterEnergy(AliVCluster *cl)
Correct cluster energy non linearity.
Float_t fCutZ
dZ cut on matching (EMCAL/PHOS).
Bool_t fLoadPHOSMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
void SetPHOSChannelStatusMap(Int_t imod, TH2I *h)
Int_t fNCellsFromPHOSBorder
Number of cells from PHOS border the cell with maximum amplitude has to be.
AliVTrack * GetMatchedTrack(AliVCluster *cluster, AliVEvent *event, Int_t index=-1) const
void RecalibrateCellTimeL1Phase(Double_t &time, Int_t calo, Int_t iSM, Int_t bunchCrossNumber) const
Recalculate time L1 phase shift if time recalibration available for EMCAL.
Bool_t fMCECellClusFracCorrOn
Correct or not the weight of cells in cluster.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Int_t fNSuperModulesUsed
Number of supermodules to be used in analysis, can be different than the real geo, to be used at initialization of histograms.
TString fImportGeometryFilePath
Path fo geometry.root file.
Bool_t fPlotCluster
Plot cluster in splitting method.
Int_t fRunNumber
Run number of the data, take it from data itself unless set by user.
void RecalibrateCellAmplitude(Float_t &amp, Int_t calo, Int_t absId) const
Recalculate cell energy if recalibration factor.
void SetEMCALChannelTimeRecalibrationFactors(TObjArray *map)
Bool_t IsPHOSGeoMatrixSet() const
Bool_t IsTimeRecalibrationOn() const
Bool_t fOADBSet
AODB parameters already set.
unsigned short UShort_t
Definition: External.C:28
TObjArray * fPHOSBadChannelMap
Array of histograms with map of bad channels, PHOS.
TString fPHOSGeoName
Name of geometry to use for PHOS.
Bool_t AreNeighbours(Int_t calo, Int_t absId1, Int_t absId2) const
const char Option_t
Definition: External.C:48
Int_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow) const
bool Bool_t
Definition: External.C:53
Bool_t IsEMCALGeoMatrixSet() const
Class with utils specific to calorimeter clusters/cells.
void AccessGeometry(AliVEvent *inputEvent)
AliEMCALRecoUtils * fEMCALRecoUtils
EMCAL utils for cluster rereconstruction.
void SetEMCALChannelRecalibrationFactors(Int_t iSM, TH2F *h)
void AccessOADB(AliVEvent *event)
TString fOADBFilePathEMCAL
Default path $ALICE_PHYSICS/OADB/EMCAL, if needed change.
void RecalibrateCellTime(Double_t &time, Int_t calo, Int_t absId, Int_t bunchCrossNumber) const
Recalculate time if time recalibration available for EMCAL not ready for PHOS.
Int_t GetMaxEnergyCell(AliVCaloCells *cells, AliVCluster *clu, Float_t &fraction) const
For a given CaloCluster, it gets the absId of the cell with maximum energy deposit.
Float_t fCutR
dR cut on matching (PHOS).
Float_t RecalibrateClusterEnergyWeightCell(AliVCluster *cluster, AliVCaloCells *cells, Float_t energyOrg)
void SplitEnergy(Int_t absId1, Int_t absId2, AliVCluster *cluster, AliVCaloCells *cells, AliAODCaloCluster *cluster1, AliAODCaloCluster *cluster2, Int_t nMax, Int_t eventNumber=0)
Int_t GetModuleNumberCellIndexes(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU) const
Get the EMCAL/PHOS module, columns, row and RCU/DDL number that corresponds to this absId...
TH2I * GetEMCALChannelStatusMap(Int_t iSM) const
void SetPHOSChannelRecalibrationFactor(Int_t imod, Int_t iCol, Int_t iRow, Double_t c=1)
Float_t RecalibrateClusterEnergy(AliVCluster *cluster, AliVCaloCells *cells)
Recalibrate the cluster energy, considering the recalibration map and the energy of the cells that co...
void GetEMCALSubregion(AliVCluster *clus, AliVCaloCells *cells, Int_t &regEta, Int_t &regPhi) const
Bool_t CheckCellFiducialRegion(AliVCluster *cluster, AliVCaloCells *cells) const
Int_t GetModuleNumberCellIndexesAbsCaloMap(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU, Int_t &icolAbs, Int_t &irowAbs) const