ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
// Class for bad channels & bad runs identification
//
// This class is designed for the following tasks:
//   1. find bad (dead/noisy/strange) cells on a per run basis;
//   2. find the status/quality of analysed data (e.g. missing RCUs, run quality);
//   3. find the extent of problems related to bad cells: required for
//      systematics estimation for a physical quantity related to a cluster.
//
// See also AliAnalysisTaskCellsQA.
// Works for EMCAL and PHOS. Requires initialized geometry.
// Class defaults are optimized for EMCAL.
//
// Usage example for EMCAL:
//
// a) In LocalInit():
//
//    // to check the quality of analysed data and detect most of the problems:
//    AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
//    cellsQA = new AliCaloCellsQA(10, AliCaloCellsQA::kEMCAL); // 10 supermodules
//
//    // add this line for a full analysis (fills additional histograms):
//    cellsQA->ActivateFullAnalysis();
//
// b) In UserCreateOutputObjects():
//
//    // not required, but suggested
//    cellsQA->InitSummaryHistograms();
//
//
// c) In UserExec():
//
//    AliVEvent *event = InputEvent();
//    AliVCaloCells* cells = event->GetEMCALCells();
//
//    AliVVertex *vertex = (AliVVertex*) event->GetPrimaryVertex();
//    Double_t vertexXYZ[3];
//    vertex->GetXYZ(vertexXYZ);
//
//    // clusters
//    TObjArray clusArray;
//    for (Int_t i = 0; i < event->GetNumberOfCaloClusters(); i++) {
//      AliVCluster *clus = event->GetCaloCluster(i);
//
//      // filter clusters here, if necessary
//      // if (clus->E() < 0.3) continue;
//      // if (clus->GetNCells() < 2) continue;
//
//      clusArray.Add(clus);
//    }
//
//    // apply afterburners, etc.
//    // ...
//
//    cellsQA->Fill(event->GetRunNumber(), &clusArray, cells, vertexXYZ);
//
// d) Do not forget to post data, where necessary:
//    PostData(1,cellsQA->GetListOfHistos());
//
// TODO: add DCAL (up to 6 supermodules?)
//
//----
//  Author: Olga Driga (SUBATECH)

// --- ROOT system ---
#include <TLorentzVector.h>

// --- AliRoot header files ---
#include <AliLog.h>
#include <AliEMCALGeometry.h>
#include <AliPHOSGeometry.h>
#include <AliCaloCellsQA.h>

ClassImp(AliCaloCellsQA)

//_________________________________________________________________________
AliCaloCellsQA::AliCaloCellsQA() :
  fDetector(0),
  fNMods(0),
  fClusElowMin(0),
  fClusEhighMin(0),
  fPi0EClusMin(0),
  fkFullAnalysis(0),
  fNBinsECells(0),
  fNBinsPi0Mass(0),
  fNBinsXNCellsInCluster(0),
  fNBinsYNCellsInCluster(0),
  fXMaxECells(0),
  fXMaxPi0Mass(0),
  fXMaxNCellsInCluster(0),
  fRunNumbers(),
  fNRuns(0),
  fRI(0),
  fAbsIdMin(0),
  fAbsIdMax(0),
  fListOfHistos(0),
  fhNEventsProcessedPerRun(0),
  fhCellLocMaxNTimesInClusterElow(),
  fhCellLocMaxNTimesInClusterEhigh(),
  fhCellLocMaxETotalClusterElow(),
  fhCellLocMaxETotalClusterEhigh(),
  fhCellNonLocMaxNTimesInClusterElow(),
  fhCellNonLocMaxNTimesInClusterEhigh(),
  fhCellNonLocMaxETotalClusterElow(),
  fhCellNonLocMaxETotalClusterEhigh(),
  fhECells(),
  fhPi0Mass(),
  fhNCellsInCluster(),
  fhCellAmplitude(0),
  fhCellAmplitudeEhigh(0),
  fhCellAmplitudeNonLocMax(0),
  fhCellAmplitudeEhighNonLocMax(0),
  fhCellTime(0)
{
  // Default constructor (for root I/O). Do not use it.

  // tells the class to reinitialize its transient members
  fRI = -1;
}

//_________________________________________________________________________
AliCaloCellsQA::AliCaloCellsQA(Int_t nmods, Int_t det, Int_t startRunNumber, Int_t endRunNumber) :
  fDetector(0),
  fNMods(0),
  fClusElowMin(0),
  fClusEhighMin(0),
  fPi0EClusMin(0),
  fkFullAnalysis(0),
  fNBinsECells(0),
  fNBinsPi0Mass(0),
  fNBinsXNCellsInCluster(0),
  fNBinsYNCellsInCluster(0),
  fXMaxECells(0),
  fXMaxPi0Mass(0),
  fXMaxNCellsInCluster(0),
  fRunNumbers(),
  fNRuns(0),
  fRI(0),
  fAbsIdMin(0),
  fAbsIdMax(0),
  fListOfHistos(0),
  fhNEventsProcessedPerRun(0),
  fhCellLocMaxNTimesInClusterElow(),
  fhCellLocMaxNTimesInClusterEhigh(),
  fhCellLocMaxETotalClusterElow(),
  fhCellLocMaxETotalClusterEhigh(),
  fhCellNonLocMaxNTimesInClusterElow(),
  fhCellNonLocMaxNTimesInClusterEhigh(),
  fhCellNonLocMaxETotalClusterElow(),
  fhCellNonLocMaxETotalClusterEhigh(),
  fhECells(),
  fhPi0Mass(),
  fhNCellsInCluster(),
  fhCellAmplitude(0),
  fhCellAmplitudeEhigh(0),
  fhCellAmplitudeNonLocMax(0),
  fhCellAmplitudeEhighNonLocMax(0),
  fhCellTime(0)
{
  // Allows to set main class parameters.
  //
  // nmods -- maximum supermodule number + 1:
  //   use 4 for EMCAL <= 2010;
  //   use 4 for PHOS (PHOS numbers start from 1, not from zero);
  //   use 10 for EMCAL >= 2011.
  //
  // det -- detector: AliCaloCellsQA::kEMCAL or AliCaloCellsQA::kPHOS.
  //   Note: DCAL not yet implemented.
  //
  // startRunNumber, endRunNumber -- run range the analysis will run on
  //   (to allow later merging); wide (but reasonable) range can be provided.

  fRI = -1;

  Init(nmods, det, startRunNumber, endRunNumber);
}

//_________________________________________________________________________
AliCaloCellsQA::~AliCaloCellsQA()
{
  delete fListOfHistos;
}

//_________________________________________________________________________
void AliCaloCellsQA::ActivateFullAnalysis()
{
  // Activate initialization and filling of all the designed histograms.
  // Must be called before InitSummaryHistograms() and Fill() methods, if necessary.

  fkFullAnalysis = kTRUE;
}

//_________________________________________________________________________
void AliCaloCellsQA::InitSummaryHistograms(Int_t nbins, Double_t emax,
                                           Int_t nbinsh, Double_t emaxh,
                                           Int_t nbinst, Double_t tmin, Double_t tmax)
{
  // Initialize summary (not per run) histograms.
  // Must be called after ActivateFullAnalysis(), before calling Fill() method, if necessary.
  //
  // nbins, emax -- number of bins and maximum amplitude for fhCellAmplitude and fhCellAmplitudeNonLocMax;
  // nbinsh, emaxh -- number of bins and maximum amplitude for fhCellAmplitudeEhigh and fhCellAmplitudeEhighNonLocMax;
  // nbinst, tmin, tmax -- number of bins and minimum/maximum time for fhCellTime.

  // do not add histograms to the current directory
  Bool_t ads = TH1::AddDirectoryStatus();
  TH1::AddDirectory(kFALSE);

  fhCellAmplitude = new TH2F("hCellAmplitude",
     "Amplitude distribution per cell", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax, nbins,0,emax);
  fhCellAmplitude->SetXTitle("AbsId");
  fhCellAmplitude->SetYTitle("Amplitude, GeV");
  fhCellAmplitude->SetZTitle("Counts");

  fhCellAmplitudeEhigh = new TH2F("hCellAmplitudeEhigh",
     "Amplitude distribution per cell, high energies", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax, nbinsh,0,emaxh);
  fhCellAmplitudeEhigh->SetXTitle("AbsId");
  fhCellAmplitudeEhigh->SetYTitle("Amplitude, GeV");
  fhCellAmplitudeEhigh->SetZTitle("Counts");

  fhCellTime = new TH2F("hCellTime", "Time distribution per cell",
                        fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax, nbinst,tmin,tmax);
  fhCellTime->SetXTitle("AbsId");
  fhCellTime->SetYTitle("Time, microseconds");
  fhCellTime->SetZTitle("Counts");

  fListOfHistos->Add(fhCellAmplitude);
  fListOfHistos->Add(fhCellAmplitudeEhigh);
  fListOfHistos->Add(fhCellTime);

  if (fkFullAnalysis) {
    fhCellAmplitudeNonLocMax = new TH2F("hCellAmplitudeNonLocMax",
      "Amplitude distribution per cell which is not a local maximum",
        fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax, nbins,0,emax);
    fhCellAmplitudeNonLocMax->SetXTitle("AbsId");
    fhCellAmplitudeNonLocMax->SetYTitle("Amplitude, GeV");
    fhCellAmplitudeNonLocMax->SetZTitle("Counts");

    fhCellAmplitudeEhighNonLocMax = new TH2F("hCellAmplitudeEhighNonLocMax",
      "Amplitude distribution per cell which is not a local maximum, high energies",
        fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax, nbinsh,0,emaxh);
    fhCellAmplitudeEhighNonLocMax->SetXTitle("AbsId");
    fhCellAmplitudeEhighNonLocMax->SetYTitle("Amplitude, GeV");
    fhCellAmplitudeEhighNonLocMax->SetZTitle("Counts");

    fListOfHistos->Add(fhCellAmplitudeNonLocMax);
    fListOfHistos->Add(fhCellAmplitudeEhighNonLocMax);
  }

  // return to the previous add directory status
  TH1::AddDirectory(ads);
}

//_________________________________________________________________________
void AliCaloCellsQA::Fill(Int_t runNumber, TObjArray *clusArray, AliVCaloCells *cells, Double_t vertexXYZ[3])
{
  // Does the job: fills histograms for current event.
  //
  // runNumber -- current run number;
  // clusArray -- array of clusters (TObjArray or TClonesArray);
  // cells -- EMCAL or PHOS cells;
  // vertexXYZ -- primary vertex position.

  InitTransientFindCurrentRun(runNumber);

  fhNEventsProcessedPerRun->Fill(runNumber);

  FillCellsInCluster(clusArray, cells);
  FillJustCells(cells);
  FillPi0Mass(clusArray, vertexXYZ);
}

//_________________________________________________________________________
void AliCaloCellsQA::SetClusterEnergyCuts(Double_t pi0EClusMin, Double_t elowMin, Double_t ehighMin)
{
  // Set cuts for minimum cluster energies.
  // Must be called before calling Fill() method, if necessary.

  fClusElowMin = elowMin;
  fClusEhighMin = ehighMin;
  fPi0EClusMin = pi0EClusMin;
}

//_________________________________________________________________________
void AliCaloCellsQA::SetBinningParameters(Int_t nbins1, Int_t nbins2, Int_t nbins3x, Int_t nbins3y,
                                          Double_t xmax1, Double_t xmax2, Double_t xmax3)
{
  // Set binning parameters for histograms hECells, hNCellsInCluster and hPi0Mass.
  // Must be called before Fill() method, if necessary.
  //
  // nbins1, xmax1 -- number of bins and maximum X axis value for hECells;
  // nbins2, xmax2 -- number of bins and maximum X axis value for hPi0Mass;
  // nbins3x, nbins3y, xmax3 -- number of bins in X and Y axes and maximum X axis value for hNCellsInCluster.

  fNBinsECells = nbins1;
  fNBinsPi0Mass = nbins2;
  fNBinsXNCellsInCluster = nbins3x;
  fNBinsYNCellsInCluster = nbins3y;
  fXMaxECells = xmax1;
  fXMaxPi0Mass = xmax2;
  fXMaxNCellsInCluster = xmax3;
}

//_________________________________________________________________________
void AliCaloCellsQA::Init(Int_t nmods, Int_t det, Int_t startRunNumber, Int_t endRunNumber)
{
  // Class initialization.
  // Defaults: fClusElowMin = 0.3GeV, fClusEhighMin = 1GeV, fPi0EClusMin = 0.5GeV, fkFullAnalysis = false.

  // check input (for design limitations only)
  if (det != kEMCAL && det != kPHOS) {
    AliError("Wrong detector provided");
    AliInfo("I will use EMCAL");
    det = kEMCAL;
  }
  if (nmods < 1 || nmods > 10) {
    AliError("Wrong last supermodule number + 1 provided");
    AliInfo("I will use nmods = 10");
    nmods = 10;
  }

  fDetector = det;
  fNMods = nmods;
  fkFullAnalysis = kFALSE;
  SetClusterEnergyCuts();
  SetBinningParameters();

  // minimum/maximum cell absId;
  // straightforward solution avoids complications
  fAbsIdMin = 0;
  fAbsIdMax = fNMods * 1152;
  if (fDetector == kPHOS) {
    fAbsIdMin = 1;
    fAbsIdMax = 1 + (fNMods-1)*3584;
  }

  fListOfHistos = new TObjArray;
  fListOfHistos->SetOwner(kTRUE);

  fhNEventsProcessedPerRun = new TH1D("hNEventsProcessedPerRun",
        "Number of processed events vs run number", endRunNumber - startRunNumber, startRunNumber, endRunNumber);
  fhNEventsProcessedPerRun->SetDirectory(0);
  fhNEventsProcessedPerRun->SetXTitle("Run number");
  fhNEventsProcessedPerRun->SetYTitle("Events");
  fListOfHistos->Add(fhNEventsProcessedPerRun);
}

//_________________________________________________________________________
void AliCaloCellsQA::InitTransientFindCurrentRun(Int_t runNumber)
{
  // Initialize transient members, add a new run if necessary.

  // try previous value ...
  if (fRI >= 0 && fRunNumbers[fRI] == runNumber) return;

  // ... or find current run index ...
  for (fRI = 0; fRI < fNRuns; fRI++)
    if (fRunNumbers[fRI] == runNumber) break;

  // ... or add a new run
  if (fRI == fNRuns) {
    if (fNRuns >= 1000) AliFatal("Too many runs, how is this possible?");

    fRunNumbers[fNRuns] = runNumber;
    InitHistosForRun(runNumber);
    fNRuns++;
  }

  // initialize transient class members;
  // this happens once per run, i.e. not a big overhead
  InitTransientMembers(runNumber);
}

//_________________________________________________________________________
void AliCaloCellsQA::InitTransientMembers(Int_t run)
{
  // Initializes transient data members -- references to histograms
  // (e.g. in case the class was restored from a file);
  // run -- current run number.

  fhNEventsProcessedPerRun = (TH1D*) fListOfHistos->FindObject("hNEventsProcessedPerRun");

  fhCellAmplitude               = (TH2F*) fListOfHistos->FindObject("hCellAmplitude");
  fhCellAmplitudeEhigh          = (TH2F*) fListOfHistos->FindObject("hCellAmplitudeEhigh");
  fhCellAmplitudeNonLocMax      = (TH2F*) fListOfHistos->FindObject("hCellAmplitudeNonLocMax");
  fhCellAmplitudeEhighNonLocMax = (TH2F*) fListOfHistos->FindObject("hCellAmplitudeEhighNonLocMax");
  fhCellTime                    = (TH2F*) fListOfHistos->FindObject("hCellTime");

  fhCellLocMaxNTimesInClusterElow     = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellLocMaxNTimesInClusterElow",run));
  fhCellLocMaxNTimesInClusterEhigh    = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellLocMaxNTimesInClusterEhigh",run));
  fhCellLocMaxETotalClusterElow       = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellLocMaxETotalClusterElow",run));
  fhCellLocMaxETotalClusterEhigh      = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellLocMaxETotalClusterEhigh",run));
  fhCellNonLocMaxNTimesInClusterElow  = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellNonLocMaxNTimesInClusterElow",run));
  fhCellNonLocMaxNTimesInClusterEhigh = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellNonLocMaxNTimesInClusterEhigh",run));
  fhCellNonLocMaxETotalClusterElow    = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellNonLocMaxETotalClusterElow",run));
  fhCellNonLocMaxETotalClusterEhigh   = (TH1F*) fListOfHistos->FindObject(Form("run%i_hCellNonLocMaxETotalClusterEhigh",run));

  Int_t minsm = 0;
  if (fDetector == kPHOS) minsm = 1;

  // per supermodule histograms
  for (Int_t sm = minsm; sm < fNMods; sm++) {
    fhECells[sm]          = (TH1F*) fListOfHistos->FindObject(Form("run%i_hECellsSM%i",run,sm));
    fhNCellsInCluster[sm] = (TH2F*) fListOfHistos->FindObject(Form("run%i_hNCellsInClusterSM%i",run,sm));

    for (Int_t sm2 = sm; sm2 < fNMods; sm2++)
      fhPi0Mass[sm][sm2]  = (TH1F*) fListOfHistos->FindObject(Form("run%i_hPi0MassSM%iSM%i",run,sm,sm2));
  }
}

//_________________________________________________________________________
void AliCaloCellsQA::InitHistosForRun(Int_t run)
{
  // Initialize per run histograms for a new run number;
  // run -- run number.

  // do not add histograms to the current directory
  Bool_t ads = TH1::AddDirectoryStatus();
  TH1::AddDirectory(kFALSE);

  fhCellLocMaxNTimesInClusterElow = new TH1F(Form("run%i_hCellLocMaxNTimesInClusterElow",run),
      "Number of times cell was local maximum in a low energy cluster", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
  fhCellLocMaxNTimesInClusterElow->SetXTitle("AbsId");
  fhCellLocMaxNTimesInClusterElow->SetYTitle("Counts");

  fhCellLocMaxNTimesInClusterEhigh = new TH1F(Form("run%i_hCellLocMaxNTimesInClusterEhigh",run),
      "Number of times cell was local maximum in a high energy cluster", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
  fhCellLocMaxNTimesInClusterEhigh->SetXTitle("AbsId");
  fhCellLocMaxNTimesInClusterEhigh->SetYTitle("Counts");

  fhCellLocMaxETotalClusterElow = new TH1F(Form("run%i_hCellLocMaxETotalClusterElow",run),
      "Total cluster energy for local maximum cell, low energy", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
  fhCellLocMaxETotalClusterElow->SetXTitle("AbsId");
  fhCellLocMaxETotalClusterElow->SetYTitle("Energy");

  fhCellLocMaxETotalClusterEhigh = new TH1F(Form("run%i_hCellLocMaxETotalClusterEhigh",run),
      "Total cluster energy for local maximum cell, high energy", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
  fhCellLocMaxETotalClusterEhigh->SetXTitle("AbsId");
  fhCellLocMaxETotalClusterEhigh->SetYTitle("Energy");

  fListOfHistos->Add(fhCellLocMaxNTimesInClusterElow);
  fListOfHistos->Add(fhCellLocMaxNTimesInClusterEhigh);
  fListOfHistos->Add(fhCellLocMaxETotalClusterElow);
  fListOfHistos->Add(fhCellLocMaxETotalClusterEhigh);


  if (fkFullAnalysis) {
    fhCellNonLocMaxNTimesInClusterElow = new TH1F(Form("run%i_hCellNonLocMaxNTimesInClusterElow",run),
        "Number of times cell wasn't local maximum in a low energy cluster", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
    fhCellNonLocMaxNTimesInClusterElow->SetXTitle("AbsId");
    fhCellNonLocMaxNTimesInClusterElow->SetYTitle("Counts");

    fhCellNonLocMaxNTimesInClusterEhigh = new TH1F(Form("run%i_hCellNonLocMaxNTimesInClusterEhigh",run),
        "Number of times cell wasn't local maximum in a high energy cluster", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
    fhCellNonLocMaxNTimesInClusterEhigh->SetXTitle("AbsId");
    fhCellNonLocMaxNTimesInClusterEhigh->SetYTitle("Counts");

    fhCellNonLocMaxETotalClusterElow = new TH1F(Form("run%i_hCellNonLocMaxETotalClusterElow",run),
        "Total cluster energy for not local maximum cell, low energy", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
    fhCellNonLocMaxETotalClusterElow->SetXTitle("AbsId");
    fhCellNonLocMaxETotalClusterElow->SetYTitle("Energy");

    fhCellNonLocMaxETotalClusterEhigh = new TH1F(Form("run%i_hCellNonLocMaxETotalClusterEhigh",run),
        "Total cluster energy for not local maximum cell, high energy", fAbsIdMax-fAbsIdMin,fAbsIdMin,fAbsIdMax);
    fhCellNonLocMaxETotalClusterEhigh->SetXTitle("AbsId");
    fhCellNonLocMaxETotalClusterEhigh->SetYTitle("Energy");

    fListOfHistos->Add(fhCellNonLocMaxNTimesInClusterElow);
    fListOfHistos->Add(fhCellNonLocMaxNTimesInClusterEhigh);
    fListOfHistos->Add(fhCellNonLocMaxETotalClusterElow);
    fListOfHistos->Add(fhCellNonLocMaxETotalClusterEhigh);
  }


  Int_t minsm = 0;
  if (fDetector == kPHOS) minsm = 1;

  // per supermodule histograms
  for (Int_t sm = minsm; sm < fNMods; sm++) {
    fhECells[sm] = new TH1F(Form("run%i_hECellsSM%i",run,sm),
      "Cell amplitude distribution", fNBinsECells,0,fXMaxECells);
    fhECells[sm]->SetXTitle("Amplitude, GeV");
    fhECells[sm]->SetYTitle("Number of cells");

    fhNCellsInCluster[sm] = new TH2F(Form("run%i_hNCellsInClusterSM%i",run,sm),
      "Distrubution of number of cells in cluster vs cluster energy",
        fNBinsXNCellsInCluster,0,fXMaxNCellsInCluster, fNBinsYNCellsInCluster,0,fNBinsYNCellsInCluster);
    fhNCellsInCluster[sm]->SetXTitle("Energy, GeV");
    fhNCellsInCluster[sm]->SetYTitle("Number of cells");
    fhNCellsInCluster[sm]->SetZTitle("Counts");

    fListOfHistos->Add(fhECells[sm]);
    fListOfHistos->Add(fhNCellsInCluster[sm]);
  }

  // pi0 mass spectrum
  for (Int_t sm = minsm; sm < fNMods; sm++)
    for (Int_t sm2 = sm; sm2 < fNMods; sm2++) {
      fhPi0Mass[sm][sm2] = new TH1F(Form("run%i_hPi0MassSM%iSM%i",run,sm,sm2),
                                        "#pi^{0} mass spectrum", fNBinsPi0Mass,0,fXMaxPi0Mass);
      fhPi0Mass[sm][sm2]->SetXTitle("M_{#gamma#gamma}, GeV");
      fhPi0Mass[sm][sm2]->SetYTitle("Counts");

      fListOfHistos->Add(fhPi0Mass[sm][sm2]);
    }

  // return to the previous add directory status
  TH1::AddDirectory(ads);
}

//_________________________________________________________________________
void AliCaloCellsQA::FillCellsInCluster(TObjArray *clusArray, AliVCaloCells *cells)
{
  // Fill histograms related to a cluster

  Int_t sm;

  for (Int_t i = 0; i < clusArray->GetEntriesFast(); i++)
  {
    AliVCluster *clus = (AliVCluster*) clusArray->At(i);
    if ((sm = CheckClusterGetSM(clus)) < 0) continue;

    if (fhNCellsInCluster[sm])
      fhNCellsInCluster[sm]->Fill(clus->E(), clus->GetNCells());

    if (clus->E() >= fClusElowMin)
      for (Int_t c = 0; c < clus->GetNCells(); c++) {
        Int_t absId = clus->GetCellAbsId(c);

        if (IsCellLocalMaximum(c, clus, cells)) {// local maximum
          if (clus->E() < fClusEhighMin) {
            fhCellLocMaxNTimesInClusterElow->Fill(absId);
            fhCellLocMaxETotalClusterElow->Fill(absId, clus->E());
          } else {
            fhCellLocMaxNTimesInClusterEhigh->Fill(absId);
            fhCellLocMaxETotalClusterEhigh->Fill(absId, clus->E());
          }
        }
        else if (fkFullAnalysis) {// not a local maximum
          if (clus->E() < fClusEhighMin) {
            fhCellNonLocMaxNTimesInClusterElow->Fill(absId);
            fhCellNonLocMaxETotalClusterElow->Fill(absId, clus->E());
          } else {
            fhCellNonLocMaxNTimesInClusterEhigh->Fill(absId);
            fhCellNonLocMaxETotalClusterEhigh->Fill(absId, clus->E());
          }
        }
      } // cells loop

  } // cluster loop

}

//_________________________________________________________________________
void AliCaloCellsQA::FillJustCells(AliVCaloCells *cells)
{
  // Fill cell histograms not related with a cluster

  Short_t absId;
  Int_t mclabel;
  Double_t amp, time,efrac;
  Int_t sm;

  for (Short_t c = 0; c < cells->GetNumberOfCells(); c++) {
    cells->GetCell(c, absId, amp, time,mclabel,efrac);
    if ((sm = GetSM(absId)) < 0) continue;

    if (fhECells[sm]) fhECells[sm]->Fill(amp);

    if (fhCellAmplitude) { // in case InitSummaryHistograms() was not called
      fhCellAmplitude->Fill(absId, amp);
      fhCellAmplitudeEhigh->Fill(absId, amp);
      fhCellTime->Fill(absId, time);

      // fill not a local maximum distributions
      if (fkFullAnalysis && !IsCellLocalMaximum(absId, cells)) {
        fhCellAmplitudeNonLocMax->Fill(absId, amp);
        fhCellAmplitudeEhighNonLocMax->Fill(absId, amp);
      }
    }
  } // cell loop

}

//_________________________________________________________________________
void AliCaloCellsQA::FillPi0Mass(TObjArray *clusArray, Double_t vertexXYZ[3])
{
  // Fill gamma+gamma invariant mass histograms.
  // ri -- run index.

  Int_t sm1, sm2;
  TLorentzVector p1, p2, psum;

  // cluster loop
  for (Int_t i = 0; i < clusArray->GetEntriesFast(); i++)
  {
    AliVCluster *clus = (AliVCluster*) clusArray->At(i);
    if (clus->E() < fPi0EClusMin) continue;
    if ((sm1 = CheckClusterGetSM(clus)) < 0) continue;

    clus->GetMomentum(p1, vertexXYZ);

    // second cluster loop
    for (Int_t j = i+1; j < clusArray->GetEntriesFast(); j++)
    {
      AliVCluster *clus2 = (AliVCluster*) clusArray->At(j);
      if (clus2->E() < fPi0EClusMin) continue;
      if ((sm2 = CheckClusterGetSM(clus2)) < 0) continue;

      clus2->GetMomentum(p2, vertexXYZ);

      psum = p1 + p2;
      if (psum.M2() < 0) continue;

      // s1 <= s2
      Int_t s1 = (sm1 <= sm2) ? sm1 : sm2;
      Int_t s2 = (sm1 <= sm2) ? sm2 : sm1;

      if (fhPi0Mass[s1][s2])
        fhPi0Mass[s1][s2]->Fill(psum.M());
    } // second cluster loop
  } // cluster loop
}

//_________________________________________________________________________
Int_t AliCaloCellsQA::CheckClusterGetSM(AliVCluster* clus)
{
  // Apply common cluster cuts and return supermodule number on success.
  // Return -1 if cuts not passed or an error occured.

  // check detector and number of cells in cluster
  if (fDetector == kEMCAL && !clus->IsEMCAL()) return -1;
  if (fDetector == kPHOS && !clus->IsPHOS()) return -1;
  if (clus->GetNCells() < 1) return -1;

  return GetSM(clus->GetCellAbsId(0));
}

//_________________________________________________________________________
Int_t AliCaloCellsQA::GetSM(Int_t absId)
{
  // Convert cell absId --> supermodule number. Return -1 in case of error.
  // Note: we use simple and straightforward way to find supermodule number.
  // This allows to avoid unnecessary external dependencies (on geometry).

  Int_t sm = -1;

  if (fDetector == kEMCAL) sm = absId/1152;
  if (fDetector == kPHOS) sm = 1 + (absId-1)/3584;

  // check for data corruption to avoid segfaults
  if (sm < 0 || sm > 9) {
    AliError("Data corrupted");
    return -1;
  }

  return sm;
}

//____________________________________________________________
Bool_t AliCaloCellsQA::IsCellLocalMaximum(Int_t c, AliVCluster* clus, AliVCaloCells* cells)
{
  // Returns true if cell is a local maximum in cluster (clusterizer dependent).
  // Cell fractions are taken into account.
  //
  // c -- cell number in the cluster.

  Int_t sm, eta, phi, sm2, eta2, phi2;

  Int_t absId = clus->GetCellAbsId(c);
  Double_t amp = cells->GetCellAmplitude(absId);
  if (clus->GetCellAmplitudeFraction(c) > 1e-5) amp *= clus->GetCellAmplitudeFraction(c);

  AbsIdToSMEtaPhi(absId, sm, eta, phi);

  // try to find a neighbour which has bigger amplitude
  for (Int_t c2 = 0; c2 < clus->GetNCells(); c2++) {
    if (c == c2) continue;

    Int_t absId2 = clus->GetCellAbsId(c2);
    Double_t amp2 = cells->GetCellAmplitude(absId2);
    if (clus->GetCellAmplitudeFraction(c2) > 1e-5) amp2 *= clus->GetCellAmplitudeFraction(c2);

    AbsIdToSMEtaPhi(absId2, sm2, eta2, phi2);
    if (sm != sm2) continue;

    Int_t deta = TMath::Abs(eta-eta2);
    Int_t dphi = TMath::Abs(phi-phi2);

    if ((deta == 0 && dphi == 1) || (deta == 1 && dphi == 0) || (deta == 1 && dphi == 1))
      if (amp < amp2) return kFALSE;
  } // cell loop

  return kTRUE;
}

//____________________________________________________________
Bool_t AliCaloCellsQA::IsCellLocalMaximum(Int_t absId, AliVCaloCells* cells)
{
  // Returns true if cell is a local maximum among cells (clusterizer independent).

  Int_t sm, eta, phi, sm2, eta2, phi2;

  Double_t amp = cells->GetCellAmplitude(absId);
  AbsIdToSMEtaPhi(absId, sm, eta, phi);

  // try to find a neighbour which has bigger amplitude
  for (Short_t c2 = 0; c2 < cells->GetNumberOfCells(); c2++) {
    Short_t absId2 = cells->GetCellNumber(c2);
    if (absId2 == absId) continue;

    AbsIdToSMEtaPhi(absId2, sm2, eta2, phi2);
    if (sm != sm2) continue;

    Int_t deta = TMath::Abs(eta-eta2);
    Int_t dphi = TMath::Abs(phi-phi2);

    if ((deta == 0 && dphi == 1) || (deta == 1 && dphi == 0) || (deta == 1 && dphi == 1))
      if (amp < cells->GetAmplitude(c2))
        return kFALSE;
  } // cell loop

  return kTRUE;
}

//____________________________________________________________
void AliCaloCellsQA::AbsIdToSMEtaPhi(Int_t absId, Int_t &sm, Int_t &eta, Int_t &phi)
{
  // Converts absId --> (sm, eta, phi) for a cell.
  // Works both for EMCAL and for PHOS.
  // Geometry must be already initialized.

  // EMCAL
  if (fDetector == kEMCAL) {
    AliEMCALGeometry *geomEMCAL = AliEMCALGeometry::GetInstance();
    if (!geomEMCAL)
      AliFatal("EMCAL geometry is not initialized");

    Int_t nModule, nIphi, nIeta;
    geomEMCAL->GetCellIndex(absId, sm, nModule, nIphi, nIeta);
    geomEMCAL->GetCellPhiEtaIndexInSModule(sm, nModule, nIphi, nIeta, phi, eta);
    return;
  }

  // PHOS
  if (fDetector == kPHOS) {
    AliPHOSGeometry *geomPHOS = AliPHOSGeometry::GetInstance();
    if (!geomPHOS)
      AliFatal("PHOS geometry is not initialized");

    Int_t relid[4];
    geomPHOS->AbsToRelNumbering(absId, relid);
    sm = relid[0];
    eta = relid[2];
    phi = relid[3];
  }

  // DCAL
  // not implemented
}
 AliCaloCellsQA.cxx:1
 AliCaloCellsQA.cxx:2
 AliCaloCellsQA.cxx:3
 AliCaloCellsQA.cxx:4
 AliCaloCellsQA.cxx:5
 AliCaloCellsQA.cxx:6
 AliCaloCellsQA.cxx:7
 AliCaloCellsQA.cxx:8
 AliCaloCellsQA.cxx:9
 AliCaloCellsQA.cxx:10
 AliCaloCellsQA.cxx:11
 AliCaloCellsQA.cxx:12
 AliCaloCellsQA.cxx:13
 AliCaloCellsQA.cxx:14
 AliCaloCellsQA.cxx:15
 AliCaloCellsQA.cxx:16
 AliCaloCellsQA.cxx:17
 AliCaloCellsQA.cxx:18
 AliCaloCellsQA.cxx:19
 AliCaloCellsQA.cxx:20
 AliCaloCellsQA.cxx:21
 AliCaloCellsQA.cxx:22
 AliCaloCellsQA.cxx:23
 AliCaloCellsQA.cxx:24
 AliCaloCellsQA.cxx:25
 AliCaloCellsQA.cxx:26
 AliCaloCellsQA.cxx:27
 AliCaloCellsQA.cxx:28
 AliCaloCellsQA.cxx:29
 AliCaloCellsQA.cxx:30
 AliCaloCellsQA.cxx:31
 AliCaloCellsQA.cxx:32
 AliCaloCellsQA.cxx:33
 AliCaloCellsQA.cxx:34
 AliCaloCellsQA.cxx:35
 AliCaloCellsQA.cxx:36
 AliCaloCellsQA.cxx:37
 AliCaloCellsQA.cxx:38
 AliCaloCellsQA.cxx:39
 AliCaloCellsQA.cxx:40
 AliCaloCellsQA.cxx:41
 AliCaloCellsQA.cxx:42
 AliCaloCellsQA.cxx:43
 AliCaloCellsQA.cxx:44
 AliCaloCellsQA.cxx:45
 AliCaloCellsQA.cxx:46
 AliCaloCellsQA.cxx:47
 AliCaloCellsQA.cxx:48
 AliCaloCellsQA.cxx:49
 AliCaloCellsQA.cxx:50
 AliCaloCellsQA.cxx:51
 AliCaloCellsQA.cxx:52
 AliCaloCellsQA.cxx:53
 AliCaloCellsQA.cxx:54
 AliCaloCellsQA.cxx:55
 AliCaloCellsQA.cxx:56
 AliCaloCellsQA.cxx:57
 AliCaloCellsQA.cxx:58
 AliCaloCellsQA.cxx:59
 AliCaloCellsQA.cxx:60
 AliCaloCellsQA.cxx:61
 AliCaloCellsQA.cxx:62
 AliCaloCellsQA.cxx:63
 AliCaloCellsQA.cxx:64
 AliCaloCellsQA.cxx:65
 AliCaloCellsQA.cxx:66
 AliCaloCellsQA.cxx:67
 AliCaloCellsQA.cxx:68
 AliCaloCellsQA.cxx:69
 AliCaloCellsQA.cxx:70
 AliCaloCellsQA.cxx:71
 AliCaloCellsQA.cxx:72
 AliCaloCellsQA.cxx:73
 AliCaloCellsQA.cxx:74
 AliCaloCellsQA.cxx:75
 AliCaloCellsQA.cxx:76
 AliCaloCellsQA.cxx:77
 AliCaloCellsQA.cxx:78
 AliCaloCellsQA.cxx:79
 AliCaloCellsQA.cxx:80
 AliCaloCellsQA.cxx:81
 AliCaloCellsQA.cxx:82
 AliCaloCellsQA.cxx:83
 AliCaloCellsQA.cxx:84
 AliCaloCellsQA.cxx:85
 AliCaloCellsQA.cxx:86
 AliCaloCellsQA.cxx:87
 AliCaloCellsQA.cxx:88
 AliCaloCellsQA.cxx:89
 AliCaloCellsQA.cxx:90
 AliCaloCellsQA.cxx:91
 AliCaloCellsQA.cxx:92
 AliCaloCellsQA.cxx:93
 AliCaloCellsQA.cxx:94
 AliCaloCellsQA.cxx:95
 AliCaloCellsQA.cxx:96
 AliCaloCellsQA.cxx:97
 AliCaloCellsQA.cxx:98
 AliCaloCellsQA.cxx:99
 AliCaloCellsQA.cxx:100
 AliCaloCellsQA.cxx:101
 AliCaloCellsQA.cxx:102
 AliCaloCellsQA.cxx:103
 AliCaloCellsQA.cxx:104
 AliCaloCellsQA.cxx:105
 AliCaloCellsQA.cxx:106
 AliCaloCellsQA.cxx:107
 AliCaloCellsQA.cxx:108
 AliCaloCellsQA.cxx:109
 AliCaloCellsQA.cxx:110
 AliCaloCellsQA.cxx:111
 AliCaloCellsQA.cxx:112
 AliCaloCellsQA.cxx:113
 AliCaloCellsQA.cxx:114
 AliCaloCellsQA.cxx:115
 AliCaloCellsQA.cxx:116
 AliCaloCellsQA.cxx:117
 AliCaloCellsQA.cxx:118
 AliCaloCellsQA.cxx:119
 AliCaloCellsQA.cxx:120
 AliCaloCellsQA.cxx:121
 AliCaloCellsQA.cxx:122
 AliCaloCellsQA.cxx:123
 AliCaloCellsQA.cxx:124
 AliCaloCellsQA.cxx:125
 AliCaloCellsQA.cxx:126
 AliCaloCellsQA.cxx:127
 AliCaloCellsQA.cxx:128
 AliCaloCellsQA.cxx:129
 AliCaloCellsQA.cxx:130
 AliCaloCellsQA.cxx:131
 AliCaloCellsQA.cxx:132
 AliCaloCellsQA.cxx:133
 AliCaloCellsQA.cxx:134
 AliCaloCellsQA.cxx:135
 AliCaloCellsQA.cxx:136
 AliCaloCellsQA.cxx:137
 AliCaloCellsQA.cxx:138
 AliCaloCellsQA.cxx:139
 AliCaloCellsQA.cxx:140
 AliCaloCellsQA.cxx:141
 AliCaloCellsQA.cxx:142
 AliCaloCellsQA.cxx:143
 AliCaloCellsQA.cxx:144
 AliCaloCellsQA.cxx:145
 AliCaloCellsQA.cxx:146
 AliCaloCellsQA.cxx:147
 AliCaloCellsQA.cxx:148
 AliCaloCellsQA.cxx:149
 AliCaloCellsQA.cxx:150
 AliCaloCellsQA.cxx:151
 AliCaloCellsQA.cxx:152
 AliCaloCellsQA.cxx:153
 AliCaloCellsQA.cxx:154
 AliCaloCellsQA.cxx:155
 AliCaloCellsQA.cxx:156
 AliCaloCellsQA.cxx:157
 AliCaloCellsQA.cxx:158
 AliCaloCellsQA.cxx:159
 AliCaloCellsQA.cxx:160
 AliCaloCellsQA.cxx:161
 AliCaloCellsQA.cxx:162
 AliCaloCellsQA.cxx:163
 AliCaloCellsQA.cxx:164
 AliCaloCellsQA.cxx:165
 AliCaloCellsQA.cxx:166
 AliCaloCellsQA.cxx:167
 AliCaloCellsQA.cxx:168
 AliCaloCellsQA.cxx:169
 AliCaloCellsQA.cxx:170
 AliCaloCellsQA.cxx:171
 AliCaloCellsQA.cxx:172
 AliCaloCellsQA.cxx:173
 AliCaloCellsQA.cxx:174
 AliCaloCellsQA.cxx:175
 AliCaloCellsQA.cxx:176
 AliCaloCellsQA.cxx:177
 AliCaloCellsQA.cxx:178
 AliCaloCellsQA.cxx:179
 AliCaloCellsQA.cxx:180
 AliCaloCellsQA.cxx:181
 AliCaloCellsQA.cxx:182
 AliCaloCellsQA.cxx:183
 AliCaloCellsQA.cxx:184
 AliCaloCellsQA.cxx:185
 AliCaloCellsQA.cxx:186
 AliCaloCellsQA.cxx:187
 AliCaloCellsQA.cxx:188
 AliCaloCellsQA.cxx:189
 AliCaloCellsQA.cxx:190
 AliCaloCellsQA.cxx:191
 AliCaloCellsQA.cxx:192
 AliCaloCellsQA.cxx:193
 AliCaloCellsQA.cxx:194
 AliCaloCellsQA.cxx:195
 AliCaloCellsQA.cxx:196
 AliCaloCellsQA.cxx:197
 AliCaloCellsQA.cxx:198
 AliCaloCellsQA.cxx:199
 AliCaloCellsQA.cxx:200
 AliCaloCellsQA.cxx:201
 AliCaloCellsQA.cxx:202
 AliCaloCellsQA.cxx:203
 AliCaloCellsQA.cxx:204
 AliCaloCellsQA.cxx:205
 AliCaloCellsQA.cxx:206
 AliCaloCellsQA.cxx:207
 AliCaloCellsQA.cxx:208
 AliCaloCellsQA.cxx:209
 AliCaloCellsQA.cxx:210
 AliCaloCellsQA.cxx:211
 AliCaloCellsQA.cxx:212
 AliCaloCellsQA.cxx:213
 AliCaloCellsQA.cxx:214
 AliCaloCellsQA.cxx:215
 AliCaloCellsQA.cxx:216
 AliCaloCellsQA.cxx:217
 AliCaloCellsQA.cxx:218
 AliCaloCellsQA.cxx:219
 AliCaloCellsQA.cxx:220
 AliCaloCellsQA.cxx:221
 AliCaloCellsQA.cxx:222
 AliCaloCellsQA.cxx:223
 AliCaloCellsQA.cxx:224
 AliCaloCellsQA.cxx:225
 AliCaloCellsQA.cxx:226
 AliCaloCellsQA.cxx:227
 AliCaloCellsQA.cxx:228
 AliCaloCellsQA.cxx:229
 AliCaloCellsQA.cxx:230
 AliCaloCellsQA.cxx:231
 AliCaloCellsQA.cxx:232
 AliCaloCellsQA.cxx:233
 AliCaloCellsQA.cxx:234
 AliCaloCellsQA.cxx:235
 AliCaloCellsQA.cxx:236
 AliCaloCellsQA.cxx:237
 AliCaloCellsQA.cxx:238
 AliCaloCellsQA.cxx:239
 AliCaloCellsQA.cxx:240
 AliCaloCellsQA.cxx:241
 AliCaloCellsQA.cxx:242
 AliCaloCellsQA.cxx:243
 AliCaloCellsQA.cxx:244
 AliCaloCellsQA.cxx:245
 AliCaloCellsQA.cxx:246
 AliCaloCellsQA.cxx:247
 AliCaloCellsQA.cxx:248
 AliCaloCellsQA.cxx:249
 AliCaloCellsQA.cxx:250
 AliCaloCellsQA.cxx:251
 AliCaloCellsQA.cxx:252
 AliCaloCellsQA.cxx:253
 AliCaloCellsQA.cxx:254
 AliCaloCellsQA.cxx:255
 AliCaloCellsQA.cxx:256
 AliCaloCellsQA.cxx:257
 AliCaloCellsQA.cxx:258
 AliCaloCellsQA.cxx:259
 AliCaloCellsQA.cxx:260
 AliCaloCellsQA.cxx:261
 AliCaloCellsQA.cxx:262
 AliCaloCellsQA.cxx:263
 AliCaloCellsQA.cxx:264
 AliCaloCellsQA.cxx:265
 AliCaloCellsQA.cxx:266
 AliCaloCellsQA.cxx:267
 AliCaloCellsQA.cxx:268
 AliCaloCellsQA.cxx:269
 AliCaloCellsQA.cxx:270
 AliCaloCellsQA.cxx:271
 AliCaloCellsQA.cxx:272
 AliCaloCellsQA.cxx:273
 AliCaloCellsQA.cxx:274
 AliCaloCellsQA.cxx:275
 AliCaloCellsQA.cxx:276
 AliCaloCellsQA.cxx:277
 AliCaloCellsQA.cxx:278
 AliCaloCellsQA.cxx:279
 AliCaloCellsQA.cxx:280
 AliCaloCellsQA.cxx:281
 AliCaloCellsQA.cxx:282
 AliCaloCellsQA.cxx:283
 AliCaloCellsQA.cxx:284
 AliCaloCellsQA.cxx:285
 AliCaloCellsQA.cxx:286
 AliCaloCellsQA.cxx:287
 AliCaloCellsQA.cxx:288
 AliCaloCellsQA.cxx:289
 AliCaloCellsQA.cxx:290
 AliCaloCellsQA.cxx:291
 AliCaloCellsQA.cxx:292
 AliCaloCellsQA.cxx:293
 AliCaloCellsQA.cxx:294
 AliCaloCellsQA.cxx:295
 AliCaloCellsQA.cxx:296
 AliCaloCellsQA.cxx:297
 AliCaloCellsQA.cxx:298
 AliCaloCellsQA.cxx:299
 AliCaloCellsQA.cxx:300
 AliCaloCellsQA.cxx:301
 AliCaloCellsQA.cxx:302
 AliCaloCellsQA.cxx:303
 AliCaloCellsQA.cxx:304
 AliCaloCellsQA.cxx:305
 AliCaloCellsQA.cxx:306
 AliCaloCellsQA.cxx:307
 AliCaloCellsQA.cxx:308
 AliCaloCellsQA.cxx:309
 AliCaloCellsQA.cxx:310
 AliCaloCellsQA.cxx:311
 AliCaloCellsQA.cxx:312
 AliCaloCellsQA.cxx:313
 AliCaloCellsQA.cxx:314
 AliCaloCellsQA.cxx:315
 AliCaloCellsQA.cxx:316
 AliCaloCellsQA.cxx:317
 AliCaloCellsQA.cxx:318
 AliCaloCellsQA.cxx:319
 AliCaloCellsQA.cxx:320
 AliCaloCellsQA.cxx:321
 AliCaloCellsQA.cxx:322
 AliCaloCellsQA.cxx:323
 AliCaloCellsQA.cxx:324
 AliCaloCellsQA.cxx:325
 AliCaloCellsQA.cxx:326
 AliCaloCellsQA.cxx:327
 AliCaloCellsQA.cxx:328
 AliCaloCellsQA.cxx:329
 AliCaloCellsQA.cxx:330
 AliCaloCellsQA.cxx:331
 AliCaloCellsQA.cxx:332
 AliCaloCellsQA.cxx:333
 AliCaloCellsQA.cxx:334
 AliCaloCellsQA.cxx:335
 AliCaloCellsQA.cxx:336
 AliCaloCellsQA.cxx:337
 AliCaloCellsQA.cxx:338
 AliCaloCellsQA.cxx:339
 AliCaloCellsQA.cxx:340
 AliCaloCellsQA.cxx:341
 AliCaloCellsQA.cxx:342
 AliCaloCellsQA.cxx:343
 AliCaloCellsQA.cxx:344
 AliCaloCellsQA.cxx:345
 AliCaloCellsQA.cxx:346
 AliCaloCellsQA.cxx:347
 AliCaloCellsQA.cxx:348
 AliCaloCellsQA.cxx:349
 AliCaloCellsQA.cxx:350
 AliCaloCellsQA.cxx:351
 AliCaloCellsQA.cxx:352
 AliCaloCellsQA.cxx:353
 AliCaloCellsQA.cxx:354
 AliCaloCellsQA.cxx:355
 AliCaloCellsQA.cxx:356
 AliCaloCellsQA.cxx:357
 AliCaloCellsQA.cxx:358
 AliCaloCellsQA.cxx:359
 AliCaloCellsQA.cxx:360
 AliCaloCellsQA.cxx:361
 AliCaloCellsQA.cxx:362
 AliCaloCellsQA.cxx:363
 AliCaloCellsQA.cxx:364
 AliCaloCellsQA.cxx:365
 AliCaloCellsQA.cxx:366
 AliCaloCellsQA.cxx:367
 AliCaloCellsQA.cxx:368
 AliCaloCellsQA.cxx:369
 AliCaloCellsQA.cxx:370
 AliCaloCellsQA.cxx:371
 AliCaloCellsQA.cxx:372
 AliCaloCellsQA.cxx:373
 AliCaloCellsQA.cxx:374
 AliCaloCellsQA.cxx:375
 AliCaloCellsQA.cxx:376
 AliCaloCellsQA.cxx:377
 AliCaloCellsQA.cxx:378
 AliCaloCellsQA.cxx:379
 AliCaloCellsQA.cxx:380
 AliCaloCellsQA.cxx:381
 AliCaloCellsQA.cxx:382
 AliCaloCellsQA.cxx:383
 AliCaloCellsQA.cxx:384
 AliCaloCellsQA.cxx:385
 AliCaloCellsQA.cxx:386
 AliCaloCellsQA.cxx:387
 AliCaloCellsQA.cxx:388
 AliCaloCellsQA.cxx:389
 AliCaloCellsQA.cxx:390
 AliCaloCellsQA.cxx:391
 AliCaloCellsQA.cxx:392
 AliCaloCellsQA.cxx:393
 AliCaloCellsQA.cxx:394
 AliCaloCellsQA.cxx:395
 AliCaloCellsQA.cxx:396
 AliCaloCellsQA.cxx:397
 AliCaloCellsQA.cxx:398
 AliCaloCellsQA.cxx:399
 AliCaloCellsQA.cxx:400
 AliCaloCellsQA.cxx:401
 AliCaloCellsQA.cxx:402
 AliCaloCellsQA.cxx:403
 AliCaloCellsQA.cxx:404
 AliCaloCellsQA.cxx:405
 AliCaloCellsQA.cxx:406
 AliCaloCellsQA.cxx:407
 AliCaloCellsQA.cxx:408
 AliCaloCellsQA.cxx:409
 AliCaloCellsQA.cxx:410
 AliCaloCellsQA.cxx:411
 AliCaloCellsQA.cxx:412
 AliCaloCellsQA.cxx:413
 AliCaloCellsQA.cxx:414
 AliCaloCellsQA.cxx:415
 AliCaloCellsQA.cxx:416
 AliCaloCellsQA.cxx:417
 AliCaloCellsQA.cxx:418
 AliCaloCellsQA.cxx:419
 AliCaloCellsQA.cxx:420
 AliCaloCellsQA.cxx:421
 AliCaloCellsQA.cxx:422
 AliCaloCellsQA.cxx:423
 AliCaloCellsQA.cxx:424
 AliCaloCellsQA.cxx:425
 AliCaloCellsQA.cxx:426
 AliCaloCellsQA.cxx:427
 AliCaloCellsQA.cxx:428
 AliCaloCellsQA.cxx:429
 AliCaloCellsQA.cxx:430
 AliCaloCellsQA.cxx:431
 AliCaloCellsQA.cxx:432
 AliCaloCellsQA.cxx:433
 AliCaloCellsQA.cxx:434
 AliCaloCellsQA.cxx:435
 AliCaloCellsQA.cxx:436
 AliCaloCellsQA.cxx:437
 AliCaloCellsQA.cxx:438
 AliCaloCellsQA.cxx:439
 AliCaloCellsQA.cxx:440
 AliCaloCellsQA.cxx:441
 AliCaloCellsQA.cxx:442
 AliCaloCellsQA.cxx:443
 AliCaloCellsQA.cxx:444
 AliCaloCellsQA.cxx:445
 AliCaloCellsQA.cxx:446
 AliCaloCellsQA.cxx:447
 AliCaloCellsQA.cxx:448
 AliCaloCellsQA.cxx:449
 AliCaloCellsQA.cxx:450
 AliCaloCellsQA.cxx:451
 AliCaloCellsQA.cxx:452
 AliCaloCellsQA.cxx:453
 AliCaloCellsQA.cxx:454
 AliCaloCellsQA.cxx:455
 AliCaloCellsQA.cxx:456
 AliCaloCellsQA.cxx:457
 AliCaloCellsQA.cxx:458
 AliCaloCellsQA.cxx:459
 AliCaloCellsQA.cxx:460
 AliCaloCellsQA.cxx:461
 AliCaloCellsQA.cxx:462
 AliCaloCellsQA.cxx:463
 AliCaloCellsQA.cxx:464
 AliCaloCellsQA.cxx:465
 AliCaloCellsQA.cxx:466
 AliCaloCellsQA.cxx:467
 AliCaloCellsQA.cxx:468
 AliCaloCellsQA.cxx:469
 AliCaloCellsQA.cxx:470
 AliCaloCellsQA.cxx:471
 AliCaloCellsQA.cxx:472
 AliCaloCellsQA.cxx:473
 AliCaloCellsQA.cxx:474
 AliCaloCellsQA.cxx:475
 AliCaloCellsQA.cxx:476
 AliCaloCellsQA.cxx:477
 AliCaloCellsQA.cxx:478
 AliCaloCellsQA.cxx:479
 AliCaloCellsQA.cxx:480
 AliCaloCellsQA.cxx:481
 AliCaloCellsQA.cxx:482
 AliCaloCellsQA.cxx:483
 AliCaloCellsQA.cxx:484
 AliCaloCellsQA.cxx:485
 AliCaloCellsQA.cxx:486
 AliCaloCellsQA.cxx:487
 AliCaloCellsQA.cxx:488
 AliCaloCellsQA.cxx:489
 AliCaloCellsQA.cxx:490
 AliCaloCellsQA.cxx:491
 AliCaloCellsQA.cxx:492
 AliCaloCellsQA.cxx:493
 AliCaloCellsQA.cxx:494
 AliCaloCellsQA.cxx:495
 AliCaloCellsQA.cxx:496
 AliCaloCellsQA.cxx:497
 AliCaloCellsQA.cxx:498
 AliCaloCellsQA.cxx:499
 AliCaloCellsQA.cxx:500
 AliCaloCellsQA.cxx:501
 AliCaloCellsQA.cxx:502
 AliCaloCellsQA.cxx:503
 AliCaloCellsQA.cxx:504
 AliCaloCellsQA.cxx:505
 AliCaloCellsQA.cxx:506
 AliCaloCellsQA.cxx:507
 AliCaloCellsQA.cxx:508
 AliCaloCellsQA.cxx:509
 AliCaloCellsQA.cxx:510
 AliCaloCellsQA.cxx:511
 AliCaloCellsQA.cxx:512
 AliCaloCellsQA.cxx:513
 AliCaloCellsQA.cxx:514
 AliCaloCellsQA.cxx:515
 AliCaloCellsQA.cxx:516
 AliCaloCellsQA.cxx:517
 AliCaloCellsQA.cxx:518
 AliCaloCellsQA.cxx:519
 AliCaloCellsQA.cxx:520
 AliCaloCellsQA.cxx:521
 AliCaloCellsQA.cxx:522
 AliCaloCellsQA.cxx:523
 AliCaloCellsQA.cxx:524
 AliCaloCellsQA.cxx:525
 AliCaloCellsQA.cxx:526
 AliCaloCellsQA.cxx:527
 AliCaloCellsQA.cxx:528
 AliCaloCellsQA.cxx:529
 AliCaloCellsQA.cxx:530
 AliCaloCellsQA.cxx:531
 AliCaloCellsQA.cxx:532
 AliCaloCellsQA.cxx:533
 AliCaloCellsQA.cxx:534
 AliCaloCellsQA.cxx:535
 AliCaloCellsQA.cxx:536
 AliCaloCellsQA.cxx:537
 AliCaloCellsQA.cxx:538
 AliCaloCellsQA.cxx:539
 AliCaloCellsQA.cxx:540
 AliCaloCellsQA.cxx:541
 AliCaloCellsQA.cxx:542
 AliCaloCellsQA.cxx:543
 AliCaloCellsQA.cxx:544
 AliCaloCellsQA.cxx:545
 AliCaloCellsQA.cxx:546
 AliCaloCellsQA.cxx:547
 AliCaloCellsQA.cxx:548
 AliCaloCellsQA.cxx:549
 AliCaloCellsQA.cxx:550
 AliCaloCellsQA.cxx:551
 AliCaloCellsQA.cxx:552
 AliCaloCellsQA.cxx:553
 AliCaloCellsQA.cxx:554
 AliCaloCellsQA.cxx:555
 AliCaloCellsQA.cxx:556
 AliCaloCellsQA.cxx:557
 AliCaloCellsQA.cxx:558
 AliCaloCellsQA.cxx:559
 AliCaloCellsQA.cxx:560
 AliCaloCellsQA.cxx:561
 AliCaloCellsQA.cxx:562
 AliCaloCellsQA.cxx:563
 AliCaloCellsQA.cxx:564
 AliCaloCellsQA.cxx:565
 AliCaloCellsQA.cxx:566
 AliCaloCellsQA.cxx:567
 AliCaloCellsQA.cxx:568
 AliCaloCellsQA.cxx:569
 AliCaloCellsQA.cxx:570
 AliCaloCellsQA.cxx:571
 AliCaloCellsQA.cxx:572
 AliCaloCellsQA.cxx:573
 AliCaloCellsQA.cxx:574
 AliCaloCellsQA.cxx:575
 AliCaloCellsQA.cxx:576
 AliCaloCellsQA.cxx:577
 AliCaloCellsQA.cxx:578
 AliCaloCellsQA.cxx:579
 AliCaloCellsQA.cxx:580
 AliCaloCellsQA.cxx:581
 AliCaloCellsQA.cxx:582
 AliCaloCellsQA.cxx:583
 AliCaloCellsQA.cxx:584
 AliCaloCellsQA.cxx:585
 AliCaloCellsQA.cxx:586
 AliCaloCellsQA.cxx:587
 AliCaloCellsQA.cxx:588
 AliCaloCellsQA.cxx:589
 AliCaloCellsQA.cxx:590
 AliCaloCellsQA.cxx:591
 AliCaloCellsQA.cxx:592
 AliCaloCellsQA.cxx:593
 AliCaloCellsQA.cxx:594
 AliCaloCellsQA.cxx:595
 AliCaloCellsQA.cxx:596
 AliCaloCellsQA.cxx:597
 AliCaloCellsQA.cxx:598
 AliCaloCellsQA.cxx:599
 AliCaloCellsQA.cxx:600
 AliCaloCellsQA.cxx:601
 AliCaloCellsQA.cxx:602
 AliCaloCellsQA.cxx:603
 AliCaloCellsQA.cxx:604
 AliCaloCellsQA.cxx:605
 AliCaloCellsQA.cxx:606
 AliCaloCellsQA.cxx:607
 AliCaloCellsQA.cxx:608
 AliCaloCellsQA.cxx:609
 AliCaloCellsQA.cxx:610
 AliCaloCellsQA.cxx:611
 AliCaloCellsQA.cxx:612
 AliCaloCellsQA.cxx:613
 AliCaloCellsQA.cxx:614
 AliCaloCellsQA.cxx:615
 AliCaloCellsQA.cxx:616
 AliCaloCellsQA.cxx:617
 AliCaloCellsQA.cxx:618
 AliCaloCellsQA.cxx:619
 AliCaloCellsQA.cxx:620
 AliCaloCellsQA.cxx:621
 AliCaloCellsQA.cxx:622
 AliCaloCellsQA.cxx:623
 AliCaloCellsQA.cxx:624
 AliCaloCellsQA.cxx:625
 AliCaloCellsQA.cxx:626
 AliCaloCellsQA.cxx:627
 AliCaloCellsQA.cxx:628
 AliCaloCellsQA.cxx:629
 AliCaloCellsQA.cxx:630
 AliCaloCellsQA.cxx:631
 AliCaloCellsQA.cxx:632
 AliCaloCellsQA.cxx:633
 AliCaloCellsQA.cxx:634
 AliCaloCellsQA.cxx:635
 AliCaloCellsQA.cxx:636
 AliCaloCellsQA.cxx:637
 AliCaloCellsQA.cxx:638
 AliCaloCellsQA.cxx:639
 AliCaloCellsQA.cxx:640
 AliCaloCellsQA.cxx:641
 AliCaloCellsQA.cxx:642
 AliCaloCellsQA.cxx:643
 AliCaloCellsQA.cxx:644
 AliCaloCellsQA.cxx:645
 AliCaloCellsQA.cxx:646
 AliCaloCellsQA.cxx:647
 AliCaloCellsQA.cxx:648
 AliCaloCellsQA.cxx:649
 AliCaloCellsQA.cxx:650
 AliCaloCellsQA.cxx:651
 AliCaloCellsQA.cxx:652
 AliCaloCellsQA.cxx:653
 AliCaloCellsQA.cxx:654
 AliCaloCellsQA.cxx:655
 AliCaloCellsQA.cxx:656
 AliCaloCellsQA.cxx:657
 AliCaloCellsQA.cxx:658
 AliCaloCellsQA.cxx:659
 AliCaloCellsQA.cxx:660
 AliCaloCellsQA.cxx:661
 AliCaloCellsQA.cxx:662
 AliCaloCellsQA.cxx:663
 AliCaloCellsQA.cxx:664
 AliCaloCellsQA.cxx:665
 AliCaloCellsQA.cxx:666
 AliCaloCellsQA.cxx:667
 AliCaloCellsQA.cxx:668
 AliCaloCellsQA.cxx:669
 AliCaloCellsQA.cxx:670
 AliCaloCellsQA.cxx:671
 AliCaloCellsQA.cxx:672
 AliCaloCellsQA.cxx:673
 AliCaloCellsQA.cxx:674
 AliCaloCellsQA.cxx:675
 AliCaloCellsQA.cxx:676
 AliCaloCellsQA.cxx:677
 AliCaloCellsQA.cxx:678
 AliCaloCellsQA.cxx:679
 AliCaloCellsQA.cxx:680
 AliCaloCellsQA.cxx:681
 AliCaloCellsQA.cxx:682
 AliCaloCellsQA.cxx:683
 AliCaloCellsQA.cxx:684
 AliCaloCellsQA.cxx:685
 AliCaloCellsQA.cxx:686
 AliCaloCellsQA.cxx:687
 AliCaloCellsQA.cxx:688
 AliCaloCellsQA.cxx:689
 AliCaloCellsQA.cxx:690
 AliCaloCellsQA.cxx:691
 AliCaloCellsQA.cxx:692
 AliCaloCellsQA.cxx:693
 AliCaloCellsQA.cxx:694
 AliCaloCellsQA.cxx:695
 AliCaloCellsQA.cxx:696
 AliCaloCellsQA.cxx:697
 AliCaloCellsQA.cxx:698
 AliCaloCellsQA.cxx:699
 AliCaloCellsQA.cxx:700
 AliCaloCellsQA.cxx:701
 AliCaloCellsQA.cxx:702
 AliCaloCellsQA.cxx:703
 AliCaloCellsQA.cxx:704
 AliCaloCellsQA.cxx:705
 AliCaloCellsQA.cxx:706
 AliCaloCellsQA.cxx:707
 AliCaloCellsQA.cxx:708
 AliCaloCellsQA.cxx:709
 AliCaloCellsQA.cxx:710
 AliCaloCellsQA.cxx:711
 AliCaloCellsQA.cxx:712
 AliCaloCellsQA.cxx:713
 AliCaloCellsQA.cxx:714
 AliCaloCellsQA.cxx:715
 AliCaloCellsQA.cxx:716
 AliCaloCellsQA.cxx:717
 AliCaloCellsQA.cxx:718
 AliCaloCellsQA.cxx:719
 AliCaloCellsQA.cxx:720
 AliCaloCellsQA.cxx:721
 AliCaloCellsQA.cxx:722
 AliCaloCellsQA.cxx:723
 AliCaloCellsQA.cxx:724
 AliCaloCellsQA.cxx:725
 AliCaloCellsQA.cxx:726
 AliCaloCellsQA.cxx:727
 AliCaloCellsQA.cxx:728
 AliCaloCellsQA.cxx:729
 AliCaloCellsQA.cxx:730
 AliCaloCellsQA.cxx:731
 AliCaloCellsQA.cxx:732
 AliCaloCellsQA.cxx:733
 AliCaloCellsQA.cxx:734
 AliCaloCellsQA.cxx:735
 AliCaloCellsQA.cxx:736
 AliCaloCellsQA.cxx:737
 AliCaloCellsQA.cxx:738
 AliCaloCellsQA.cxx:739
 AliCaloCellsQA.cxx:740
 AliCaloCellsQA.cxx:741
 AliCaloCellsQA.cxx:742
 AliCaloCellsQA.cxx:743
 AliCaloCellsQA.cxx:744
 AliCaloCellsQA.cxx:745
 AliCaloCellsQA.cxx:746
 AliCaloCellsQA.cxx:747
 AliCaloCellsQA.cxx:748
 AliCaloCellsQA.cxx:749
 AliCaloCellsQA.cxx:750
 AliCaloCellsQA.cxx:751
 AliCaloCellsQA.cxx:752
 AliCaloCellsQA.cxx:753
 AliCaloCellsQA.cxx:754
 AliCaloCellsQA.cxx:755
 AliCaloCellsQA.cxx:756
 AliCaloCellsQA.cxx:757
 AliCaloCellsQA.cxx:758
 AliCaloCellsQA.cxx:759
 AliCaloCellsQA.cxx:760
 AliCaloCellsQA.cxx:761
 AliCaloCellsQA.cxx:762
 AliCaloCellsQA.cxx:763
 AliCaloCellsQA.cxx:764
 AliCaloCellsQA.cxx:765
 AliCaloCellsQA.cxx:766
 AliCaloCellsQA.cxx:767
 AliCaloCellsQA.cxx:768
 AliCaloCellsQA.cxx:769
 AliCaloCellsQA.cxx:770
 AliCaloCellsQA.cxx:771
 AliCaloCellsQA.cxx:772
 AliCaloCellsQA.cxx:773