#include <TLorentzVector.h>
#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)
{
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)
{
fRI = -1;
Init(nmods, det, startRunNumber, endRunNumber);
}
AliCaloCellsQA::~AliCaloCellsQA()
{
delete fListOfHistos;
}
void AliCaloCellsQA::ActivateFullAnalysis()
{
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)
{
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);
}
TH1::AddDirectory(ads);
}
void AliCaloCellsQA::Fill(Int_t runNumber, TObjArray *clusArray, AliVCaloCells *cells, Double_t vertexXYZ[3])
{
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)
{
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)
{
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)
{
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();
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)
{
if (fRI >= 0 && fRunNumbers[fRI] == runNumber) return;
for (fRI = 0; fRI < fNRuns; fRI++)
if (fRunNumbers[fRI] == runNumber) break;
if (fRI == fNRuns) {
if (fNRuns >= 1000) AliFatal("Too many runs, how is this possible?");
fRunNumbers[fNRuns] = runNumber;
InitHistosForRun(runNumber);
fNRuns++;
}
InitTransientMembers(runNumber);
}
void AliCaloCellsQA::InitTransientMembers(Int_t run)
{
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;
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)
{
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;
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]);
}
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]);
}
TH1::AddDirectory(ads);
}
void AliCaloCellsQA::FillCellsInCluster(TObjArray *clusArray, AliVCaloCells *cells)
{
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)) {
if (clus->E() < fClusEhighMin) {
fhCellLocMaxNTimesInClusterElow->Fill(absId);
fhCellLocMaxETotalClusterElow->Fill(absId, clus->E());
} else {
fhCellLocMaxNTimesInClusterEhigh->Fill(absId);
fhCellLocMaxETotalClusterEhigh->Fill(absId, clus->E());
}
}
else if (fkFullAnalysis) {
if (clus->E() < fClusEhighMin) {
fhCellNonLocMaxNTimesInClusterElow->Fill(absId);
fhCellNonLocMaxETotalClusterElow->Fill(absId, clus->E());
} else {
fhCellNonLocMaxNTimesInClusterEhigh->Fill(absId);
fhCellNonLocMaxETotalClusterEhigh->Fill(absId, clus->E());
}
}
}
}
}
void AliCaloCellsQA::FillJustCells(AliVCaloCells *cells)
{
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) {
fhCellAmplitude->Fill(absId, amp);
fhCellAmplitudeEhigh->Fill(absId, amp);
fhCellTime->Fill(absId, time);
if (fkFullAnalysis && !IsCellLocalMaximum(absId, cells)) {
fhCellAmplitudeNonLocMax->Fill(absId, amp);
fhCellAmplitudeEhighNonLocMax->Fill(absId, amp);
}
}
}
}
void AliCaloCellsQA::FillPi0Mass(TObjArray *clusArray, Double_t vertexXYZ[3])
{
Int_t sm1, sm2;
TLorentzVector p1, p2, psum;
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);
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;
Int_t s1 = (sm1 <= sm2) ? sm1 : sm2;
Int_t s2 = (sm1 <= sm2) ? sm2 : sm1;
if (fhPi0Mass[s1][s2])
fhPi0Mass[s1][s2]->Fill(psum.M());
}
}
}
Int_t AliCaloCellsQA::CheckClusterGetSM(AliVCluster* clus)
{
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)
{
Int_t sm = -1;
if (fDetector == kEMCAL) sm = absId/1152;
if (fDetector == kPHOS) sm = 1 + (absId-1)/3584;
if (sm < 0 || sm > 9) {
AliError("Data corrupted");
return -1;
}
return sm;
}
Bool_t AliCaloCellsQA::IsCellLocalMaximum(Int_t c, AliVCluster* clus, AliVCaloCells* cells)
{
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);
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;
}
return kTRUE;
}
Bool_t AliCaloCellsQA::IsCellLocalMaximum(Int_t absId, AliVCaloCells* cells)
{
Int_t sm, eta, phi, sm2, eta2, phi2;
Double_t amp = cells->GetCellAmplitude(absId);
AbsIdToSMEtaPhi(absId, sm, eta, phi);
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;
}
return kTRUE;
}
void AliCaloCellsQA::AbsIdToSMEtaPhi(Int_t absId, Int_t &sm, Int_t &eta, Int_t &phi)
{
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;
}
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];
}
}