#include <TParticle.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoBBox.h>
#include <TList.h>
#include <TBrowser.h>
#include "AliLog.h"
#include "AliEMCALGeometry.h"
#include "AliEMCALShishKebabTrd1Module.h"
ClassImp(AliEMCALGeometry)
AliEMCALGeometry *AliEMCALGeometry::fgGeom = 0;
const Char_t* AliEMCALGeometry::fgkDefaultGeometryName = "EMCAL_COMPLETE12SMV1";
AliEMCALGeometry::AliEMCALGeometry():
fEMCGeometry(0x0),fGeoName(0),fEMCSMSystem(0x0),
fKey110DEG(0),fnSupModInDCAL(0),fNCellsInSupMod(0),fNETAdiv(0),fNPHIdiv(0),
fNCellsInModule(0),fPhiBoundariesOfSM(0x0),fPhiCentersOfSM(0x0),
fPhiCentersOfSMSec(0x0),fPhiCentersOfCells(0x0),fCentersOfCellsEtaDir(0x0),
fCentersOfCellsPhiDir(0x0),fEtaCentersOfCells(0x0),
fNCells(0),fNPhi(0),fCentersOfCellsXDir(0x0),fArm1EtaMin(0),
fArm1EtaMax(0),fArm1PhiMin(0),fArm1PhiMax(0),fEtaMaxOfTRD1(0),
fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),fDCALStandardPhiMax(0),
fDCALInnerExtandedEta(0),fShishKebabTrd1Modules(0),fPhiModuleSize(0.),
fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fNZ(0),
fIPDistance(0.),fLongModuleSize(0.),fShellThickness(0.),
fZLength(0.),fSampling(0.),fUseExternalMatrices(kFALSE)
{
fEnvelop[0] = 0.;
fEnvelop[1] = 0.;
fEnvelop[2] = 0.;
fParSM[0] = 0.;
fParSM[1] = 0.;
fParSM[2] = 0.;
for (Int_t i=0;i<AliEMCALGeoParams::fgkEMCALModules;i++)
fkSModuleMatrix[i]=0 ;
for (Int_t i = 0; i < 48; i++)
for (Int_t j = 0; j < 124; j++) fFastOR2DMap[i][j] = -1;
}
AliEMCALGeometry::AliEMCALGeometry(const AliEMCALGeometry & geo)
: TNamed(geo),
fEMCGeometry(geo.fEMCGeometry),fGeoName(geo.fGeoName),fEMCSMSystem(geo.fEMCSMSystem),
fKey110DEG(geo.fKey110DEG),fnSupModInDCAL(geo.fnSupModInDCAL),fNCellsInSupMod(geo.fNCellsInSupMod),fNETAdiv(geo.fNETAdiv),fNPHIdiv(geo.fNPHIdiv),
fNCellsInModule(geo.fNCellsInModule),fPhiBoundariesOfSM(geo.fPhiBoundariesOfSM),fPhiCentersOfSM(geo.fPhiCentersOfSM),
fPhiCentersOfSMSec(geo.fPhiCentersOfSMSec),fPhiCentersOfCells(geo.fPhiCentersOfCells),fCentersOfCellsEtaDir(geo.fCentersOfCellsEtaDir),
fCentersOfCellsPhiDir(geo.fCentersOfCellsPhiDir),fEtaCentersOfCells(geo.fEtaCentersOfCells),
fNCells(geo.fNCells),fNPhi(geo.fNPhi),fCentersOfCellsXDir(geo.fCentersOfCellsXDir),fArm1EtaMin(geo.fArm1EtaMin),
fArm1EtaMax(geo.fArm1EtaMax),fArm1PhiMin(geo.fArm1PhiMin),fArm1PhiMax(geo.fArm1PhiMax),fEtaMaxOfTRD1(geo.fEtaMaxOfTRD1),
fDCALPhiMin(geo.fDCALPhiMin),fDCALPhiMax(geo.fDCALPhiMax),fEMCALPhiMax(geo.fEMCALPhiMax),fDCALStandardPhiMax(geo.fDCALStandardPhiMax),
fDCALInnerExtandedEta(geo.fDCALInnerExtandedEta),fShishKebabTrd1Modules(geo.fShishKebabTrd1Modules),fPhiModuleSize(geo.fPhiModuleSize),
fEtaModuleSize(geo.fEtaModuleSize),fPhiTileSize(geo.fPhiTileSize),fEtaTileSize(geo.fEtaTileSize),fNZ(geo.fNZ),
fIPDistance(geo.fIPDistance),fLongModuleSize(geo.fLongModuleSize),fShellThickness(geo.fShellThickness),
fZLength(geo.fZLength),fSampling(geo.fSampling),fUseExternalMatrices(geo.fUseExternalMatrices)
{
fEnvelop[0] = geo.fEnvelop[0];
fEnvelop[1] = geo.fEnvelop[1];
fEnvelop[2] = geo.fEnvelop[2];
fParSM[0] = geo.fParSM[0];
fParSM[1] = geo.fParSM[1];
fParSM[2] = geo.fParSM[2];
for (Int_t i=0;i<AliEMCALGeoParams::fgkEMCALModules;i++)
fkSModuleMatrix[i]=0 ;
for (Int_t i = 0; i < 48; i++)
for (Int_t j = 0; j < 124; j++) fFastOR2DMap[i][j] = geo.fFastOR2DMap[i][j];
}
AliEMCALGeometry::AliEMCALGeometry(const Text_t* name, const Text_t* title,
const Text_t* mcname, const Text_t* mctitle)
: TNamed(name, title),
fEMCGeometry(0x0),fGeoName(0),fEMCSMSystem(0x0),
fKey110DEG(0),fnSupModInDCAL(0),fNCellsInSupMod(0),fNETAdiv(0),fNPHIdiv(0),
fNCellsInModule(0),fPhiBoundariesOfSM(0x0),fPhiCentersOfSM(0x0),
fPhiCentersOfSMSec(0x0),fPhiCentersOfCells(0x0),fCentersOfCellsEtaDir(0x0),
fCentersOfCellsPhiDir(0x0),fEtaCentersOfCells(0x0),
fNCells(0),fNPhi(0),fCentersOfCellsXDir(0x0),fArm1EtaMin(0),
fArm1EtaMax(0),fArm1PhiMin(0),fArm1PhiMax(0),fEtaMaxOfTRD1(0),
fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),fDCALStandardPhiMax(0),
fDCALInnerExtandedEta(0),fShishKebabTrd1Modules(0),fPhiModuleSize(0.),
fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fNZ(0),
fIPDistance(0.),fLongModuleSize(0.),fShellThickness(0.),
fZLength(0.),fSampling(0.), fUseExternalMatrices(kFALSE)
{
fEMCGeometry = new AliEMCALEMCGeometry(name,title,mcname,mctitle);
fGeoName = fEMCGeometry->GetGeoName();
fEMCSMSystem = fEMCGeometry->GetEMCSystem();
fKey110DEG = fEMCGeometry->GetKey110DEG();
fnSupModInDCAL = fEMCGeometry->GetnSupModInDCAL();
fNCellsInSupMod = fEMCGeometry->GetNCellsInSupMod();
fNETAdiv = fEMCGeometry->GetNETAdiv();
fNPHIdiv = fEMCGeometry->GetNPHIdiv();
fNCellsInModule = fNPHIdiv*fNETAdiv;
static int i=0;
Int_t nSMod = fEMCGeometry->GetNumberOfSuperModules();
fPhiBoundariesOfSM.Set(nSMod);
fPhiCentersOfSM.Set(nSMod/2);
fPhiCentersOfSMSec.Set(nSMod/2);
for(Int_t sm=0; sm<nSMod; sm++) {
i = sm/2;
fEMCGeometry->GetPhiBoundariesOfSM(sm,fPhiBoundariesOfSM[2*i],fPhiBoundariesOfSM[2*i+1]);
}
Double_t phiMin = 0.;
Double_t phiMax = 0.;
for(Int_t sm=0; sm<nSMod; sm++) {
fEMCGeometry->GetPhiBoundariesOfSM(sm,phiMin,phiMax);
i=sm/2;
fPhiCentersOfSM[i] = fEMCGeometry->GetPhiCenterOfSM(sm);
fPhiCentersOfSMSec[i] = fEMCGeometry->GetPhiCenterOfSMSec(sm);
}
fNCells = fEMCGeometry->GetNCells();
fNPhi = fEMCGeometry->GetNPhi();
fEnvelop[0] = fEMCGeometry->GetEnvelop(0);
fEnvelop[1] = fEMCGeometry->GetEnvelop(1);
fEnvelop[2] = fEMCGeometry->GetEnvelop(2);
fParSM[0] = fEMCGeometry->GetSuperModulesPar(0);
fParSM[1] = fEMCGeometry->GetSuperModulesPar(1);
fParSM[2] = fEMCGeometry->GetSuperModulesPar(2);
fArm1EtaMin = fEMCGeometry->GetArm1EtaMin();
fArm1EtaMax = fEMCGeometry->GetArm1EtaMax();
fArm1PhiMin = fEMCGeometry->GetArm1PhiMin();
fArm1PhiMax = fEMCGeometry->GetArm1PhiMax();
fDCALPhiMin = fEMCGeometry->GetDCALPhiMin();
fDCALPhiMax = fEMCGeometry->GetDCALPhiMax();
fEMCALPhiMax = fEMCGeometry->GetEMCALPhiMax();
fDCALStandardPhiMax = fEMCGeometry->GetDCALStandardPhiMax();
fDCALInnerExtandedEta = fEMCGeometry->GetDCALInnerExtandedEta();
fShellThickness = fEMCGeometry->GetShellThickness();
fZLength = fEMCGeometry->GetZLength();
fSampling = fEMCGeometry->GetSampling();
fEtaModuleSize = fEMCGeometry->GetEtaModuleSize();
fPhiModuleSize = fEMCGeometry->GetPhiModuleSize();
fEtaTileSize = fEMCGeometry->GetEtaTileSize();
fPhiTileSize = fEMCGeometry->GetPhiTileSize();
fNZ = fEMCGeometry->GetNZ();
fIPDistance = fEMCGeometry->GetIPDistance();
fLongModuleSize = fEMCGeometry->GetLongModuleSize();
CreateListOfTrd1Modules();
for(Int_t smod=0; smod < AliEMCALGeoParams::fgkEMCALModules; smod++)
fkSModuleMatrix[smod]=0 ;
if (AliDebugLevel()>=2) {
fEMCGeometry->Print();
PrintGeometryGeoUtils();
}
for (Int_t ix = 0; ix < 48; ix++)
for(Int_t jx = 0; jx < 124; jx++) fFastOR2DMap[ix][jx] = -1;
BuildFastOR2DMap();
}
AliEMCALGeometry & AliEMCALGeometry::operator = (const AliEMCALGeometry & )
{
Fatal("assignment operator", "not implemented") ;
return *this ;
}
AliEMCALGeometry::~AliEMCALGeometry(void)
{
if (this==fgGeom)
{
AliError("Do not call delete on me");
return;
}
if (fEMCGeometry)
{
for(Int_t smod = 0 ; smod < fEMCGeometry->GetNumberOfSuperModules(); smod++)
{
if(fkSModuleMatrix[smod])
delete fkSModuleMatrix[smod] ;
fkSModuleMatrix[smod]=0 ;
}
delete fEMCGeometry;
}
}
AliEMCALGeometry * AliEMCALGeometry::GetInstance()
{
AliEMCALGeometry * rv = static_cast<AliEMCALGeometry *>( fgGeom );
return rv;
}
AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name, const Text_t* title,
const Text_t* mcname, const Text_t* mctitle )
{
AliEMCALGeometry * rv = 0;
if ( fgGeom == 0 ) {
if ( strcmp(name,"") == 0 ) {
fgGeom = new AliEMCALGeometry(fgkDefaultGeometryName, title,mcname,mctitle);
} else {
fgGeom = new AliEMCALGeometry(name, title,mcname,mctitle);
}
if ( AliEMCALEMCGeometry::fgInit ) rv = (AliEMCALGeometry * ) fgGeom;
else {
rv = 0;
delete fgGeom;
fgGeom = 0;
}
}else{
if ( strcmp(fgGeom->GetName(), name) != 0) {
printf("\ncurrent geometry is %s : ", fgGeom->GetName());
printf(" you cannot call %s ",name);
}else{
rv = (AliEMCALGeometry *) fgGeom;
}
}
return rv;
}
void AliEMCALGeometry::Browse(TBrowser* b)
{
if(fShishKebabTrd1Modules) b->Add(fShishKebabTrd1Modules);
}
Bool_t AliEMCALGeometry::IsFolder() const
{
if(fShishKebabTrd1Modules) return kTRUE;
else return kFALSE;
}
void AliEMCALGeometry::GetGlobal(const Double_t *loc, Double_t *glob, int ind) const
{
const TGeoHMatrix* m = GetMatrixForSuperModule(ind);
if(m) {
m->LocalToMaster(loc, glob);
} else {
AliFatal("Geo matrixes are not loaded \n") ;
}
}
void AliEMCALGeometry::GetGlobal(const TVector3 &vloc, TVector3 &vglob, int ind) const
{
static Double_t tglob[3], tloc[3];
vloc.GetXYZ(tloc);
GetGlobal(tloc, tglob, ind);
vglob.SetXYZ(tglob[0], tglob[1], tglob[2]);
}
void AliEMCALGeometry::GetGlobal(Int_t absId , double glob[3]) const
{
static Int_t nSupMod=-1, nModule=-1, nIphi=-1, nIeta=-1;
static double loc[3];
glob[0]=glob[1]=glob[2]=0.0;
if(RelPosCellInSModule(absId, loc)) {
GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
const TGeoHMatrix* m = GetMatrixForSuperModule(nSupMod);
if(m) {
m->LocalToMaster(loc, glob);
} else {
AliFatal("Geo matrixes are not loaded \n") ;
}
}
}
void AliEMCALGeometry::GetGlobal(Int_t absId , TVector3 &vglob) const
{
static Double_t glob[3];
GetGlobal(absId, glob);
vglob.SetXYZ(glob[0], glob[1], glob[2]);
}
void AliEMCALGeometry::PrintCellIndexes(Int_t absId, int pri, const char *tit) const
{
Int_t nSupMod, nModule, nIphi, nIeta;
Int_t iphi, ieta;
TVector3 vg;
GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
printf(" %s | absId : %i -> nSupMod %i nModule %i nIphi %i nIeta %i \n", tit, absId, nSupMod, nModule, nIphi, nIeta);
if(pri>0) {
GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi,ieta);
printf(" local SM index : iphi %i : ieta %i \n", iphi,ieta);
GetGlobal(absId, vg);
printf(" vglob : mag %7.2f : perp %7.2f : z %7.2f : eta %6.4f : phi %6.4f(%6.2f) \n",
vg.Mag(), vg.Perp(), vg.Z(), vg.Eta(), vg.Phi(), vg.Phi()*TMath::RadToDeg());
}
}
void AliEMCALGeometry::PrintLocalTrd1(Int_t pri) const
{
for(Int_t i=0; i<GetShishKebabTrd1Modules()->GetSize(); i++){
printf(" %s | ", GetShishKebabModule(i)->GetName());
if(i==0 && pri<1) GetShishKebabModule(i)->PrintShish(1);
else GetShishKebabModule(i)->PrintShish(pri);
}
}
void AliEMCALGeometry::EtaPhiFromIndex(Int_t absId,Double_t &eta,Double_t &phi) const
{
static TVector3 vglob;
GetGlobal(absId, vglob);
eta = vglob.Eta();
phi = vglob.Phi();
}
void AliEMCALGeometry::EtaPhiFromIndex(Int_t absId,Float_t &eta,Float_t &phi) const
{
static TVector3 vglob;
GetGlobal(absId, vglob);
eta = float(vglob.Eta());
phi = float(vglob.Phi());
}
Int_t AliEMCALGeometry::GetAbsCellId(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta) const
{
Int_t id=0;
for( int i = 0 ; i < nSupMod; i++) {
if( GetSMType(i) == kEMCAL_Standard) id += fNCellsInSupMod;
else if( GetSMType(i) == kEMCAL_Half) id += fNCellsInSupMod/2;
else if( GetSMType(i) == kEMCAL_3rd) id += fNCellsInSupMod/3;
else if( GetSMType(i) == kDCAL_Standard) id += 2*fNCellsInSupMod/3;
else if( GetSMType(i) == kDCAL_Ext) id += fNCellsInSupMod/3;
else {
AliError(Form("Uknown SuperModule Type !!"));
}
}
id += fNCellsInModule *nModule;
id += fNPHIdiv *nIphi;
id += nIeta;
if( !CheckAbsCellId(id) ) {
id = -TMath::Abs(id);
}
return id;
}
void AliEMCALGeometry::GetModuleIndexesFromCellIndexesInSModule(Int_t nSupMod, Int_t iphi, Int_t ieta,
Int_t &iphim, Int_t &ietam, Int_t &nModule) const
{
static Int_t nphi=-1;
nphi = GetNumberOfModuleInPhiDirection(nSupMod);
ietam = ieta/fNETAdiv;
iphim = iphi/fNPHIdiv;
nModule = ietam * nphi + iphim;
}
Int_t AliEMCALGeometry::GetAbsCellIdFromCellIndexes(Int_t nSupMod, Int_t iphi, Int_t ieta) const
{
if(iphi < 0 || iphi >= AliEMCALGeoParams::fgkEMCALRows ||
ieta < 0 || ieta >= AliEMCALGeoParams::fgkEMCALCols ||
nSupMod < 0 || nSupMod >= GetNumberOfSuperModules() )
{
AliDebug(1,Form("Wrong cell indexes : SM %d, column (eta) %d, row (phi) %d", nSupMod,ieta,iphi));
return -1 ;
}
static Int_t ietam=-1, iphim=-1, nModule=-1;
static Int_t nIeta=-1, nIphi=-1;
GetModuleIndexesFromCellIndexesInSModule(nSupMod, iphi, ieta, ietam, iphim, nModule);
nIeta = ieta%fNETAdiv;
nIeta = fNETAdiv - 1 - nIeta;
nIphi = iphi%fNPHIdiv;
return GetAbsCellId(nSupMod, nModule, nIphi, nIeta);
}
Bool_t AliEMCALGeometry::SuperModuleNumberFromEtaPhi(Double_t eta, Double_t phi, Int_t &nSupMod) const
{
static Int_t i=0;
if(TMath::Abs(eta) > fEtaMaxOfTRD1) return kFALSE;
phi = TVector2::Phi_0_2pi(phi);
Int_t nphism = fEMCGeometry->GetNumberOfSuperModules()/2;
for(i=0; i<nphism; i++) {
if(phi>=fPhiBoundariesOfSM[2*i] && phi<=fPhiBoundariesOfSM[2*i+1]) {
nSupMod = 2*i;
if(eta < 0.0) nSupMod++;
if( GetSMType(nSupMod) == kDCAL_Standard) {
if(TMath::Abs(eta) < GetNEta()/3*(GetEMCGeometry()->GetTrd1Angle())*TMath::DegToRad()) return kFALSE;
}
AliDebug(1,Form("eta %f phi %f(%5.2f) : nSupMod %i : #bound %i", eta,phi,phi*TMath::RadToDeg(), nSupMod,i));
return kTRUE;
}
}
return kFALSE;
}
Bool_t AliEMCALGeometry::GetAbsCellIdFromEtaPhi(Double_t eta, Double_t phi, Int_t &absId) const
{
static Int_t nSupMod=-1, i=0, ieta=-1, iphi=-1, etaShift=0, neta=-1, nphi=-1;
static Double_t absEta=0.0, d=0.0, dmin=0.0, phiLoc=0;
absId = nSupMod = - 1;
if(SuperModuleNumberFromEtaPhi(eta, phi, nSupMod)) {
phi = TVector2::Phi_0_2pi(phi);
phiLoc = phi - fPhiCentersOfSMSec[nSupMod/2];
nphi = fPhiCentersOfCells.GetSize();
if ( GetSMType(nSupMod) == kEMCAL_Half ) nphi /= 2;
else if( GetSMType(nSupMod) == kEMCAL_3rd ) nphi /= 3;
else if( GetSMType(nSupMod) == kDCAL_Ext ) nphi /= 3;
dmin = TMath::Abs(fPhiCentersOfCells[0]-phiLoc);
iphi = 0;
for(i=1; i<nphi; i++) {
d = TMath::Abs(fPhiCentersOfCells[i] - phiLoc);
if(d < dmin) {
dmin = d;
iphi = i;
}
}
AliDebug(2,Form(" iphi %i : dmin %f (phi %f, phiLoc %f ) ", iphi, dmin, phi, phiLoc));
absEta = TMath::Abs(eta);
neta = fCentersOfCellsEtaDir.GetSize();
etaShift = iphi*neta;
ieta = 0;
if( GetSMType(nSupMod) == kDCAL_Standard) ieta += 16;
dmin = TMath::Abs(fEtaCentersOfCells[etaShift + ieta]-absEta);
for(i= ieta+1 ; i<neta; i++) {
d = TMath::Abs(fEtaCentersOfCells[i+etaShift] - absEta);
if(d < dmin) {
dmin = d;
ieta = i;
}
}
if( GetSMType(nSupMod) == kDCAL_Standard) ieta -= 16;
AliDebug(2,Form(" ieta %i : dmin %f (eta=%f) : nSupMod %i ", ieta, dmin, eta, nSupMod));
if(nSupMod%2 == 0) {
ieta = (neta -1)-ieta;
if( GetSMType(nSupMod) == kDCAL_Standard) ieta -= 16;
}
absId = GetAbsCellIdFromCellIndexes(nSupMod, iphi, ieta);
return kTRUE;
}
return kFALSE;
}
Bool_t AliEMCALGeometry::CheckAbsCellId(Int_t absId) const
{
if(absId<0 || absId >= fNCells) return kFALSE;
else return kTRUE;
}
Bool_t AliEMCALGeometry::GetCellIndex(Int_t absId,Int_t &nSupMod,Int_t &nModule,Int_t &nIphi,Int_t &nIeta) const
{
if(!CheckAbsCellId(absId)) return kFALSE;
static Int_t tmp = absId;
Int_t test = absId;
for(nSupMod = -1; test >= 0; ) {
nSupMod++;
tmp = test;
if( GetSMType(nSupMod) == kEMCAL_Standard) test -= fNCellsInSupMod;
else if( GetSMType(nSupMod) == kEMCAL_Half) test -= fNCellsInSupMod/2;
else if( GetSMType(nSupMod) == kEMCAL_3rd) test -= fNCellsInSupMod/3;
else if( GetSMType(nSupMod) == kDCAL_Standard) test -= 2*fNCellsInSupMod/3;
else if( GetSMType(nSupMod) == kDCAL_Ext) test -= fNCellsInSupMod/3;
else {
AliError(Form("Uknown SuperModule Type !!"));
return kFALSE;
}
}
nModule = tmp / fNCellsInModule;
tmp = tmp % fNCellsInModule;
nIphi = tmp / fNPHIdiv;
nIeta = tmp % fNPHIdiv;
return kTRUE;
}
Int_t AliEMCALGeometry::GetSuperModuleNumber(Int_t absId) const
{
static Int_t nSupMod=-1, nModule=-1, nIphi=-1, nIeta=-1;
GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
return nSupMod;
}
void AliEMCALGeometry::GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, int &iphim, int &ietam) const
{
static Int_t nphi=-1;
if( GetSMType(nSupMod) == kEMCAL_Half ) nphi = fNPhi/2;
else if( GetSMType(nSupMod) == kEMCAL_3rd ) nphi = fNPhi/3;
else if( GetSMType(nSupMod) == kDCAL_Ext ) nphi = fNPhi/3;
else nphi = fNPhi;
ietam = nModule/nphi;
iphim = nModule%nphi;
}
void AliEMCALGeometry::GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta,
int &iphi, int &ieta) const
{
static Int_t iphim=-1, ietam=-1;
GetModulePhiEtaIndexInSModule(nSupMod,nModule, iphim, ietam);
ieta = ietam*fNETAdiv + (fNETAdiv - 1 - nIeta);
iphi = iphim*fNPHIdiv + nIphi;
if(iphi<0 || ieta<0)
AliDebug(1,Form(" nSupMod %i nModule %i nIphi %i nIeta %i => ieta %i iphi %i\n",
nSupMod, nModule, nIphi, nIeta, ieta, iphi));
}
Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t &yr, Double_t &zr) const
{
const Int_t kNphiIndex = fCentersOfCellsPhiDir.GetSize();
Double_t zshift = 0.5*GetDCALInnerEdge();
static Int_t nSupMod=-1, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1;
if(!CheckAbsCellId(absId)) return kFALSE;
GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi, ieta);
Int_t ieta2 = ieta;
if(nSupMod%2 == 0) {
ieta2 = (fCentersOfCellsEtaDir.GetSize()-1)-ieta;
}
if( GetSMType(nSupMod) == kDCAL_Standard && nSupMod%2 ) ieta2 += 16;
zr = fCentersOfCellsEtaDir.At(ieta2);
if( GetSMType(nSupMod) == kDCAL_Standard ) zr -= zshift;
xr = fCentersOfCellsXDir.At(ieta2);
Int_t iphi2 = iphi;
if( GetSMType(nSupMod) == kDCAL_Ext ) {
if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
} else if( GetSMType(nSupMod) == kEMCAL_Half ){
if(nSupMod%2 != 0) iphi2 = (kNphiIndex/2 -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/4);
} else if( GetSMType(nSupMod) == kEMCAL_3rd ){
if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
} else {
if(nSupMod%2 != 0) iphi2 = (kNphiIndex -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2);
}
AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr));
return kTRUE;
}
Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t loc[3]) const
{
loc[0] = loc[1] = loc[2]=0.0;
if(RelPosCellInSModule(absId, loc[0],loc[1],loc[2])) {
return kTRUE;
}
return kFALSE;
}
Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, TVector3 &vloc) const
{
static Double_t loc[3];
if(RelPosCellInSModule(absId,loc)) {
vloc.SetXYZ(loc[0], loc[1], loc[2]);
return kTRUE;
} else {
vloc.SetXYZ(0,0,0);
return kFALSE;
}
}
Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t distEff, Double_t &xr, Double_t &yr, Double_t &zr) const
{
const Int_t kNphiIndex = fCentersOfCellsPhiDir.GetSize();
Double_t zshift = 0.5*GetDCALInnerEdge();
Int_t kDCalshift = 8;
static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1;
static Int_t iphim=-1, ietam=-1;
static AliEMCALShishKebabTrd1Module *mod = 0;
static TVector2 v;
if(!CheckAbsCellId(absId)) return kFALSE;
GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
GetModulePhiEtaIndexInSModule(nSupMod, nModule, iphim, ietam);
GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi, ieta);
if(nSupMod%2 == 0) {
ietam = (fCentersOfCellsEtaDir.GetSize()/2-1)-ietam;
if(nIeta == 0) nIeta = 1;
else nIeta = 0;
}
if( GetSMType(nSupMod) == kDCAL_Standard && nSupMod%2) ietam += kDCalshift;
mod = GetShishKebabModule(ietam);
mod ->GetPositionAtCenterCellLine(nIeta, distEff, v);
xr = v.Y() - fParSM[0];
zr = v.X() - fParSM[2];
if( GetSMType(nSupMod) == kDCAL_Standard ) zr -= zshift;
Int_t iphi2 = iphi;
if( GetSMType(nSupMod) == kDCAL_Ext ) {
if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
} else if( GetSMType(nSupMod) == kEMCAL_Half ){
if(nSupMod%2 != 0) iphi2 = (kNphiIndex/2 -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/2);
} else if( GetSMType(nSupMod) == kEMCAL_3rd ){
if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
} else {
if(nSupMod%2 != 0) iphi2 = (kNphiIndex -1)-iphi;
yr = fCentersOfCellsPhiDir.At(iphi2);
}
AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr));
return kTRUE;
}
void AliEMCALGeometry::CreateListOfTrd1Modules()
{
AliDebug(2,Form(" AliEMCALGeometry::CreateListOfTrd1Modules() started "));
AliEMCALShishKebabTrd1Module *mod=0, *mTmp=0;
if(fShishKebabTrd1Modules == 0) {
fShishKebabTrd1Modules = new TList;
fShishKebabTrd1Modules->SetName("ListOfTRD1");
for(int iz=0; iz< fEMCGeometry->GetNZ(); iz++) {
if(iz==0) {
mod = new AliEMCALShishKebabTrd1Module(TMath::Pi()/2.,fEMCGeometry);
} else {
mTmp = new AliEMCALShishKebabTrd1Module(*mod);
mod = mTmp;
}
fShishKebabTrd1Modules->Add(mod);
}
} else {
AliDebug(2,Form(" Already exits : "));
}
mod = (AliEMCALShishKebabTrd1Module*)fShishKebabTrd1Modules->At(fShishKebabTrd1Modules->GetSize()-1);
fEtaMaxOfTRD1 = mod->GetMaxEtaOfModule(0);
AliDebug(2,Form(" fShishKebabTrd1Modules has %i modules : max eta %5.4f \n",
fShishKebabTrd1Modules->GetSize(),fEtaMaxOfTRD1));
AliDebug(2,Form(" Cells grid in phi directions : size %i\n", fCentersOfCellsPhiDir.GetSize()));
Int_t ind=0;
Int_t ieta=0, nModule=0, iphiTemp;
Double_t xr=0., zr=0., theta=0., phi=0., eta=0., r=0., x=0.,y=0.;
TVector3 vglob;
Double_t ytCenterModule=0.0, ytCenterCell=0.0;
fCentersOfCellsPhiDir.Set(fNPhi*fNPHIdiv);
fPhiCentersOfCells.Set(fNPhi*fNPHIdiv);
Double_t r0 = fIPDistance + fLongModuleSize/2.;
for(Int_t it=0; it<fNPhi; it++) {
ytCenterModule = -fParSM[1] + fPhiModuleSize*(2*it+1)/2;
for(Int_t ic=0; ic<fNPHIdiv; ic++) {
if(fNPHIdiv==2) {
ytCenterCell = ytCenterModule + fPhiTileSize *(2*ic-1)/2.;
} else if(fNPHIdiv==3){
ytCenterCell = ytCenterModule + fPhiTileSize *(ic-1);
} else if(fNPHIdiv==1){
ytCenterCell = ytCenterModule;
}
fCentersOfCellsPhiDir.AddAt(ytCenterCell,ind);
phi = TMath::ATan2(ytCenterCell, r0);
fPhiCentersOfCells.AddAt(phi, ind);
AliDebug(2,Form(" ind %2.2i : y %8.3f ", ind, fCentersOfCellsPhiDir.At(ind)));
ind++;
}
}
fCentersOfCellsEtaDir.Set(fNZ *fNETAdiv);
fCentersOfCellsXDir.Set(fNZ *fNETAdiv);
fEtaCentersOfCells.Set(fNZ *fNETAdiv * fNPhi*fNPHIdiv);
AliDebug(2,Form(" Cells grid in eta directions : size %i\n", fCentersOfCellsEtaDir.GetSize()));
for(Int_t it=0; it<fNZ; it++) {
AliEMCALShishKebabTrd1Module *trd1 = GetShishKebabModule(it);
nModule = fNPhi*it;
for(Int_t ic=0; ic<fNETAdiv; ic++) {
if(fNPHIdiv==2) {
trd1->GetCenterOfCellInLocalCoordinateofSM(ic, xr, zr);
GetCellPhiEtaIndexInSModule(0, nModule, 0, ic, iphiTemp, ieta);
} if(fNPHIdiv==3) {
trd1->GetCenterOfCellInLocalCoordinateofSM3X3(ic, xr, zr);
GetCellPhiEtaIndexInSModule(0, nModule, 0, ic, iphiTemp, ieta);
} if(fNPHIdiv==1) {
trd1->GetCenterOfCellInLocalCoordinateofSM1X1(xr, zr);
GetCellPhiEtaIndexInSModule(0, nModule, 0, ic, iphiTemp, ieta);
}
fCentersOfCellsXDir.AddAt(float(xr) - fParSM[0],ieta);
fCentersOfCellsEtaDir.AddAt(float(zr) - fParSM[2],ieta);
for(int iphi=0; iphi<fCentersOfCellsPhiDir.GetSize(); iphi++) {
x = xr + trd1->GetRadius();
y = fCentersOfCellsPhiDir[iphi];
r = TMath::Sqrt(x*x + y*y + zr*zr);
theta = TMath::ACos(zr/r);
eta = AliEMCALShishKebabTrd1Module::ThetaToEta(theta);
ind = iphi*fCentersOfCellsEtaDir.GetSize() + ieta;
fEtaCentersOfCells.AddAt(eta, ind);
}
}
}
for(Int_t i=0; i<fCentersOfCellsEtaDir.GetSize(); i++) {
AliDebug(2,Form(" ind %2.2i : z %8.3f : x %8.3f", i+1,
fCentersOfCellsEtaDir.At(i),fCentersOfCellsXDir.At(i)));
}
}
AliEMCALShishKebabTrd1Module* AliEMCALGeometry::GetShishKebabModule(Int_t neta) const
{
static AliEMCALShishKebabTrd1Module* trd1=0;
if(fShishKebabTrd1Modules && neta>=0 && neta<fShishKebabTrd1Modules->GetSize()) {
trd1 = (AliEMCALShishKebabTrd1Module*)fShishKebabTrd1Modules->At(neta);
} else trd1 = 0;
return trd1;
}
void AliEMCALGeometry::PrintGeometryGeoUtils()
{
fEMCGeometry->PrintGeometry();
printf(" fShishKebabTrd1Modules has %i modules : max eta %5.4f \n",
fShishKebabTrd1Modules->GetSize(),fEtaMaxOfTRD1);
printf("\n Cells grid in eta directions : size %i\n", fCentersOfCellsEtaDir.GetSize());
for(Int_t i=0; i<fCentersOfCellsEtaDir.GetSize(); i++) {
printf(" ind %2.2i : z %8.3f : x %8.3f \n", i,
fCentersOfCellsEtaDir.At(i),fCentersOfCellsXDir.At(i));
int ind=0;
for(Int_t iphi=0; iphi<fCentersOfCellsPhiDir.GetSize(); iphi++) {
ind = iphi*fCentersOfCellsEtaDir.GetSize() + i;
printf("%6.4f ", fEtaCentersOfCells[ind]);
if((iphi+1)%12 == 0) printf("\n");
}
printf("\n");
}
printf("\n Cells grid in phi directions : size %i\n", fCentersOfCellsPhiDir.GetSize());
for(Int_t i=0; i<fCentersOfCellsPhiDir.GetSize(); i++) {
double phi=fPhiCentersOfCells.At(i);
printf(" ind %2.2i : y %8.3f : phi %7.5f(%6.2f) \n", i, fCentersOfCellsPhiDir.At(i),
phi, phi*TMath::RadToDeg());
}
}
Bool_t AliEMCALGeometry::Impact(const TParticle * particle) const
{
Bool_t in=kFALSE;
Int_t absID=0;
TVector3 vtx(particle->Vx(),particle->Vy(),particle->Vz());
TVector3 vimpact(0,0,0);
ImpactOnEmcal(vtx,particle->Theta(),particle->Phi(),absID,vimpact);
if(absID>=0)
in=kTRUE;
return in;
}
void AliEMCALGeometry::ImpactOnEmcal(TVector3 vtx, Double_t theta, Double_t phi,
Int_t & absId, TVector3 & vimpact) const
{
TVector3 p(TMath::Sin(theta)*TMath::Cos(phi),TMath::Sin(theta)*TMath::Sin(phi),TMath::Cos(theta)) ;
vimpact.SetXYZ(0,0,0);
absId=-1;
if(phi==0 || theta==0) return;
TVector3 direction;
Double_t factor = (fIPDistance-vtx[1])/p[1];
direction = vtx + factor*p;
GetAbsCellIdFromEtaPhi(direction.Eta(),direction.Phi(),absId);
Int_t nSupMod=-1, nModule=-1, nIphi=-1, nIeta=-1;
Double_t loc[3],loc2[3],loc3[3];
Double_t glob[3]={},glob2[3]={},glob3[3]={};
if(!RelPosCellInSModule(absId,loc)) return;
GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
Int_t nIphi2=-1,nIeta2=-1,absId2=-1,absId3=-1;
if(nIeta==0) nIeta2=1;
else nIeta2=0;
absId2=GetAbsCellId(nSupMod,nModule,nIphi,nIeta2);
if(nIphi==0) nIphi2=1;
else nIphi2=0;
absId3=GetAbsCellId(nSupMod,nModule,nIphi2,nIeta);
if(!RelPosCellInSModule(absId2,loc2)) return;
if(!RelPosCellInSModule(absId3,loc3)) return;
const TGeoHMatrix* m = GetMatrixForSuperModule(nSupMod);
if(m) {
m->LocalToMaster(loc, glob);
m->LocalToMaster(loc2, glob2);
m->LocalToMaster(loc3, glob3);
} else {
AliFatal("Geo matrixes are not loaded \n") ;
}
Double_t a = glob[1]*(glob2[2]-glob3[2]) + glob2[1]*(glob3[2]-glob[2]) + glob3[1]*(glob[2]-glob2[2]);
Double_t b = glob[2]*(glob2[0]-glob3[0]) + glob2[2]*(glob3[0]-glob[0]) + glob3[2]*(glob[0]-glob2[0]);
Double_t c = glob[0]*(glob2[1]-glob3[1]) + glob2[0]*(glob3[1]-glob[1]) + glob3[0]*(glob[1]-glob2[1]);
Double_t d = glob[0]*(glob2[1]*glob3[2]-glob3[1]*glob2[2]) + glob2[0]*(glob3[1]*glob[2]-glob[1]*glob3[2]) + glob3[0]*(glob[1]*glob2[2]-glob2[1]*glob[2]);
d=-d;
Double_t dist = fLongModuleSize/2.;
Double_t norm = TMath::Sqrt(a*a+b*b+c*c);
Double_t glob4[3]={};
TVector3 dir(a,b,c);
TVector3 point(glob[0],glob[1],glob[2]);
if(point.Dot(dir)<0) dist*=-1;
glob4[0]=glob[0]-dist*a/norm;
glob4[1]=glob[1]-dist*b/norm;
glob4[2]=glob[2]-dist*c/norm;
d = glob4[0]*a + glob4[1]*b + glob4[2]*c ;
d = -d;
Double_t den = a*(vtx(0)-direction(0)) + b*(vtx(1)-direction(1)) + c*(vtx(2)-direction(2));
if(den==0){
printf("ImpactOnEmcal() No solution :\n");
return;
}
Double_t length = a*vtx(0)+b*vtx(1)+c*vtx(2)+d;
length /=den;
vimpact.SetXYZ(vtx(0)+length*(direction(0)-vtx(0)),vtx(1)+length*(direction(1)-vtx(1)),vtx(2)+length*(direction(2)-vtx(2)));
vimpact.SetXYZ(vimpact(0)+dist*a/norm,vimpact(1)+dist*b/norm,vimpact(2)+dist*c/norm);
return;
}
Bool_t AliEMCALGeometry::IsInEMCAL(Double_t x, Double_t y, Double_t z) const
{
if( IsInEMCALOrDCAL(x,y,z) == 1 ) return kTRUE;
else return kFALSE;
}
Bool_t AliEMCALGeometry::IsInDCAL(Double_t x, Double_t y, Double_t z) const
{
if( IsInEMCALOrDCAL(x,y,z) == 2 ) return kTRUE;
else return kFALSE;
}
Int_t AliEMCALGeometry::IsInEMCALOrDCAL(Double_t x, Double_t y, Double_t z) const
{
Double_t r=sqrt(x*x+y*y);
if ( r <= fEnvelop[0] ) return 0;
else {
Double_t theta = TMath::ATan2(r,z);
Double_t eta;
if(theta == 0) eta = 9999;
else eta = -TMath::Log(TMath::Tan(theta/2.));
if (eta < fArm1EtaMin || eta > fArm1EtaMax) return 0;
Double_t phi = TMath::ATan2(y,x) * 180./TMath::Pi();
if (phi < 0) phi += 360;
if ( phi >= fArm1PhiMin && phi <= fEMCALPhiMax ) return 1;
else if ( phi >= fDCALPhiMin && phi <= fDCALStandardPhiMax && TMath::Abs(eta) > fDCALInnerExtandedEta ) return 2;
else if ( phi > fDCALStandardPhiMax && phi <= fDCALPhiMax ) return 2;
else return 0;
}
}
Int_t AliEMCALGeometry::GetAbsTRUNumberFromNumberInSm(const Int_t row, const Int_t col, const Int_t sm) const
{
Int_t itru = row + col*fEMCGeometry->GetNModulesInTRUPhi() + sm*fEMCGeometry->GetNTRU();
return itru;
}
Bool_t AliEMCALGeometry::GetAbsFastORIndexFromTRU(const Int_t iTRU, const Int_t iADC, Int_t& id) const
{
if (iTRU > GetNTotalTRU()-1 || iTRU < 0 || iADC > 95 || iADC < 0)
{
AliError("TRU out of range!");
return kFALSE;
}
id = ( iTRU % 2 ) ? iADC%4 + 4 * (23 - int(iADC/4)) : (3 - iADC%4) + 4 * int(iADC/4);
id += iTRU * 96;
return kTRUE;
}
Bool_t AliEMCALGeometry::GetTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iADC) const
{
Int_t nModule = GetNTotalTRU()*96;
if (id > nModule-1 || id < 0)
{
AliError("Id out of range!");
return kFALSE;
}
iTRU = id / 96;
iADC = id % 96;
iADC = ( iTRU % 2 ) ? iADC%4 + 4 * (23 - int(iADC/4)) : (3 - iADC%4) + 4 * int(iADC/4);
return kTRUE;
}
Bool_t AliEMCALGeometry::GetPositionInTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iEta, Int_t& iPhi) const
{
Int_t iADC=-1;
if (!GetTRUFromAbsFastORIndex(id, iTRU, iADC)) return kFALSE;
Int_t x = iADC / 4;
Int_t y = iADC % 4;
if ( iTRU % 2 )
{
iEta = 23 - x;
iPhi = y;
}
else
{
iEta = x;
iPhi = 3 - y;
}
return kTRUE;
}
Bool_t AliEMCALGeometry::GetPositionInSMFromAbsFastORIndex(const Int_t id, Int_t& iSM, Int_t& iEta, Int_t& iPhi) const
{
Int_t iTRU=-1;
if (!GetPositionInTRUFromAbsFastORIndex(id, iTRU, iEta, iPhi)) return kFALSE;
if (iTRU % 2)
{
iSM = 2 * ( int( int(iTRU / 2) / 3 ) ) + 1;
}
else
{
iSM = 2 * ( int( int(iTRU / 2) / 3 ) );
}
iPhi += 4 * int((iTRU % 6) / 2);
return kTRUE;
}
Bool_t AliEMCALGeometry::GetPositionInEMCALFromAbsFastORIndex(const Int_t id, Int_t& iEta, Int_t& iPhi) const
{
Int_t iSM=-1;
if (GetPositionInSMFromAbsFastORIndex(id, iSM, iEta, iPhi))
{
if (iSM % 2) iEta += 24;
iPhi += 12 * int(iSM / 2);
return kTRUE;
}
return kFALSE;
}
Bool_t AliEMCALGeometry::GetAbsFastORIndexFromPositionInTRU(const Int_t iTRU, const Int_t iEta, const Int_t iPhi, Int_t& id) const
{
if (iTRU < 0 || iTRU > GetNTotalTRU()-1 || iEta < 0 || iEta > 23 || iPhi < 0 || iPhi > 3)
{
AliError(Form("Out of range! iTRU=%d, iEta=%d, iPhi=%d", iTRU, iEta, iPhi));
return kFALSE;
}
id = iPhi + 4 * iEta + iTRU * 96;
return kTRUE;
}
Bool_t AliEMCALGeometry::GetAbsFastORIndexFromPositionInSM(const Int_t iSM, const Int_t iEta, const Int_t iPhi, Int_t& id) const
{
Int_t iSMMax = fEMCGeometry->GetNumberOfSuperModules();
Int_t iEtaMax = fEMCGeometry->GetNZ();
Int_t iPhiMax = fEMCGeometry->GetNPhi();
if( GetSMType(iSM) == kEMCAL_3rd || GetSMType(iSM) == kDCAL_Ext ) iPhiMax /= 3;
if( GetSMType(iSM) == kEMCAL_Half ) iPhiMax /= 2;
if( GetSMType(iSM) == kDCAL_Standard ) iEtaMax = iEtaMax*2/3;
if (iSM < 0 || iSM >= iSMMax || iEta < 0 || iEta >= iEtaMax || iPhi < 0 || iPhi >= iPhiMax)
{
AliError("Out of range!");
return kFALSE;
}
Int_t x = iEta;
Int_t y = iPhi % 4;
Int_t iOff = (iSM % 2) ? 1 : 0;
Int_t iTRU = 2 * int(iPhi / 4) + 6 * int(iSM / 2) + iOff;
if(IsDCALSM(iSM) ) iTRU -=4;
if (GetAbsFastORIndexFromPositionInTRU(iTRU, x, y, id))
{
return kTRUE;
}
return kFALSE;
}
Bool_t AliEMCALGeometry::GetAbsFastORIndexFromPositionInEMCAL(const Int_t iEta, const Int_t iPhi, Int_t& id) const
{
if (iEta < 0 || iEta > 47 || iPhi < 0 || iPhi >= 2*GetNTotalTRU() )
{
AliError(Form("Out of range! eta: %2d phi: %2d", iEta, iPhi));
return kFALSE;
}
if (fFastOR2DMap[iEta][iPhi] == -1)
{
AliError("Invalid index!");
return kFALSE;
}
id = fFastOR2DMap[iEta][iPhi];
return kTRUE;
}
Bool_t AliEMCALGeometry::GetFastORIndexFromCellIndex(const Int_t id, Int_t& idx) const
{
Int_t iSupMod, nModule, nIphi, nIeta, iphim, ietam;
Bool_t isOK = GetCellIndex( id, iSupMod, nModule, nIphi, nIeta );
GetModulePhiEtaIndexInSModule( iSupMod, nModule, iphim, ietam );
if (isOK && GetAbsFastORIndexFromPositionInSM(iSupMod, ietam, iphim, idx))
{
return kTRUE;
}
return kFALSE;
}
Bool_t AliEMCALGeometry::GetCellIndexFromFastORIndex(const Int_t id, Int_t idx[4]) const
{
Int_t iSM=-1, iEta=-1, iPhi=-1;
if (GetPositionInSMFromAbsFastORIndex(id, iSM, iEta, iPhi))
{
Int_t ix = 2 * iEta;
Int_t iy = 2 * iPhi;
for (Int_t i=0; i<2; i++)
{
for (Int_t j=0; j<2; j++)
{
idx[2*i+j] = GetAbsCellIdFromCellIndexes(iSM, iy + i, ix + j);
}
}
return kTRUE;
}
return kFALSE;
}
Bool_t AliEMCALGeometry::GetTRUIndexFromSTUIndex(const Int_t id, Int_t& idx) const
{
idx = GetTRUIndexFromSTUIndex(id);
if (idx > GetNTotalTRU()-1 || idx < 0)
{
AliError(Form("TRU index out of range: %d",idx));
return kFALSE;
}
return kTRUE;
}
Int_t AliEMCALGeometry::GetTRUIndexFromSTUIndex(const Int_t id) const
{
if (id > GetNTotalTRU()-1 || id < 0)
{
AliError(Form("TRU index out of range: %d",id));
}
Int_t idx = 0;
if(id < 32){
idx = (id > 15) ? 2 * (31 - id) : 2 * (15 - id) + 1;
} else if(id >= 32){
idx = (id > 32+3*fnSupModInDCAL/2-1) ? 2 * (GetNTotalTRU()-1 - id)+32 : 2 * (32+3*fnSupModInDCAL/2-1 - id) + 32+1;
}
return idx;
}
void AliEMCALGeometry::BuildFastOR2DMap()
{
for (Int_t i = 0; i < GetNTotalTRU(); i++)
{
for (Int_t j = 0; j < 24; j++)
{
for (Int_t k = 0; k < 4; k++)
{
Int_t id;
if (GetAbsFastORIndexFromPositionInTRU(i, j, k, id))
{
Int_t x = j, y = k + 4 * int(i / 2);
if (i % 2) x += 24;
fFastOR2DMap[x][y] = id;
}
}
}
}
}
Bool_t AliEMCALGeometry::GetTRUIndexFromOnlineIndex(const Int_t id, Int_t& idx) const
{
idx = GetOnlineIndexFromTRUIndex(id);
if (idx > GetNTotalTRU()-1 || idx < 0)
{
AliError(Form("TRU index out of range: %d",idx));
return kFALSE;
}
return kTRUE;
}
Int_t AliEMCALGeometry::GetTRUIndexFromOnlineIndex(const Int_t id) const
{
if (id > GetNTotalTRU()-1 || id < 0)
{
AliError(Form("TRU index out of range: %d",id));
}
if (id == 31) {
return 31;
}
if (fGeoName.Contains("DCAL_8SM") && id == 51) {
return 51;
}
Int_t tmp=0;
if(id > 31) tmp = id+4;
else tmp = id;
Int_t idx = ((tmp% 6) < 3) ? 6 * int(tmp/ 6) + 2 * (tmp% 3) : 6 * int(tmp/ 6) + 2 * (2 - (tmp% 3)) + 1;
if(id > 31) idx-=4;
return idx;
}
Bool_t AliEMCALGeometry::GetOnlineIndexFromTRUIndex(const Int_t id, Int_t& idx) const
{
idx = GetOnlineIndexFromTRUIndex(id);
if (idx > GetNTotalTRU()-1 || idx < 0)
{
AliError(Form("TRU index out of range: %d",idx));
return kFALSE;
}
return kTRUE;
}
Int_t AliEMCALGeometry::GetOnlineIndexFromTRUIndex(const Int_t id) const
{
if (id > GetNTotalTRU()-1 || id < 0)
{
AliError(Form("TRU index out of range: %d",id));
}
if (id == 31) {
return 31;
}
if (fGeoName.Contains("DCAL_8SM") && id == 51) {
return 51;
}
Int_t tmp=0;
if(id > 31) tmp = id+4;
else tmp = id;
Int_t idx = (tmp % 2) ? int((6 - (tmp % 6)) / 2) + 3 * (2 * int(tmp / 6) + 1) : 3 * int(tmp / 6) + int(tmp / 2);
if(id > 31) idx-=4;
return idx;
}
Bool_t AliEMCALGeometry::GetFastORIndexFromL0Index(const Int_t iTRU, const Int_t id, Int_t idx[], const Int_t size) const
{
if (size <= 0 ||size > 4)
{
AliError("Size not supported!");
return kFALSE;
}
Int_t motif[4] = {0, 1, 4, 5};
switch (size)
{
case 1:
if (!GetAbsFastORIndexFromTRU(iTRU, id, idx[1])) return kFALSE;
break;
case 4:
for (Int_t k = 0; k < 4; k++)
{
Int_t iADC = motif[k] + 4 * int(id / 3) + (id % 3);
if (!GetAbsFastORIndexFromTRU(iTRU, iADC, idx[k])) return kFALSE;
}
break;
default:
break;
}
return kTRUE;
}
const TGeoHMatrix * AliEMCALGeometry::GetMatrixForSuperModule(Int_t smod) const
{
if(smod < 0 || smod > fEMCGeometry->GetNumberOfSuperModules())
AliFatal(Form("Wrong supermodule index -> %d",smod));
if(!gGeoManager || (gGeoManager && fUseExternalMatrices)){
if(fkSModuleMatrix[smod]){
return fkSModuleMatrix[smod] ;
}
else{
AliInfo("Stop:");
printf("\t Can not find EMCAL misalignment matrixes\n") ;
printf("\t Either import TGeoManager from geometry.root or \n");
printf("\t read stored matrixes from AliESD Header: \n") ;
printf("\t AliEMCALGeometry::SetMisalMatrixes(header->GetEMCALMisalMatrix()) \n") ;
AliFatal("") ;
}
}
if(gGeoManager){
const Int_t buffersize = 255;
char path[buffersize] ;
TString SMName;
Int_t tmpType = -1;
Int_t SMOrder = 0;
for( Int_t i = 0; i < smod+1; i++){
if(GetSMType(i) == tmpType) {
SMOrder++;
} else {
tmpType = GetSMType(i);
SMOrder = 1;
}
}
if(GetSMType(smod) == kEMCAL_Standard ) SMName = "SMOD";
else if(GetSMType(smod) == kEMCAL_Half ) SMName = "SM10";
else if(GetSMType(smod) == kEMCAL_3rd ) SMName = "SM3rd";
else if( GetSMType(smod) == kDCAL_Standard ) SMName = "DCSM";
else if( GetSMType(smod) == kDCAL_Ext ) SMName = "DCEXT";
else AliError("Unkown SM Type!!");
snprintf(path,buffersize,"/ALIC_1/XEN1_1/%s_%d", SMName.Data(), SMOrder) ;
if (!gGeoManager->cd(path)){
AliFatal(Form("Geo manager can not find path %s!\n",path));
}
return gGeoManager->GetCurrentMatrix();
}
return 0 ;
}
void AliEMCALGeometry::GetModulePhiEtaIndexInSModuleFromTRUIndex(Int_t itru, Int_t iphitru, Int_t ietatru, Int_t &iphiSM, Int_t &ietaSM) const
{
Int_t col = itru/fEMCGeometry->GetNTRUPhi() ;
Int_t row = itru - col*fEMCGeometry->GetNTRUPhi();
iphiSM = fEMCGeometry->GetNModulesInTRUPhi()*row + iphitru ;
ietaSM = fEMCGeometry->GetNModulesInTRUEta()*col + ietatru ;
}
void AliEMCALGeometry::RecalculateTowerPosition(Float_t drow, Float_t dcol, const Int_t sm, const Float_t depth,
const Float_t misaligTransShifts[15], const Float_t misaligRotShifts[15], Float_t global[3]) const
{
Float_t droworg = drow;
Float_t dcolorg = dcol;
if(gGeoManager){
const Int_t nSMod = fEMCGeometry->GetNumberOfSuperModules();
gGeoManager->cd("ALIC_1/XEN1_1");
TGeoNode *geoXEn1 = gGeoManager->GetCurrentNode();
TGeoNodeMatrix *geoSM[nSMod];
TGeoVolume *geoSMVol[nSMod];
TGeoShape *geoSMShape[nSMod];
TGeoBBox *geoBox[nSMod];
TGeoMatrix *geoSMMatrix[nSMod];
for(int iSM = 0; iSM < nSMod; iSM++) {
geoSM[iSM] = dynamic_cast<TGeoNodeMatrix *>(geoXEn1->GetDaughter(iSM));
geoSMVol[iSM] = geoSM[iSM]->GetVolume();
geoSMShape[iSM] = geoSMVol[iSM]->GetShape();
geoBox[iSM] = dynamic_cast<TGeoBBox *>(geoSMShape[iSM]);
geoSMMatrix[iSM] = geoSM[iSM]->GetMatrix();
}
if(sm % 2 == 0) {
dcol = 47. - dcol;
drow = 23. - drow;
}
Int_t istrip = 0;
Float_t z0 = 0;
Float_t zb = 0;
Float_t zIs = 0;
Float_t x,y,z;
Float_t dz = 6.0;
Float_t dx = 6.004;
Float_t teta1 = 0.;
if (dcol >= 47.5 || dcol<-0.5) {
AliError(Form("Bad tower coordinate dcol=%f, where dcol >= 47.5 || dcol<-0.5; org: %f", dcol, dcolorg));
return;
}
if (drow >= 23.5 || drow<-0.5) {
AliError(Form("Bad tower coordinate drow=%f, where drow >= 23.5 || drow<-0.5; org: %f", drow, droworg));
return;
}
if (sm >= nSMod || sm < 0) {
AliError(Form("Bad SM number sm=%d, where sm >= %d || sm < 0", nSMod, sm));
return;
}
istrip = int ((dcol+0.5)/2);
teta1 = TMath::DegToRad() * istrip * 1.5;
for (int is=0; is<= istrip; is++) {
teta1 = TMath::DegToRad() * (is*1.5 + 0.75);
if(is==0)
zIs = zIs + 2*dz*TMath::Cos(teta1);
else
zIs = zIs + 2*dz*TMath::Cos(teta1) + 2*dz*TMath::Sin(teta1)*TMath::Tan(teta1-0.75*TMath::DegToRad());
}
z0 = dz*(dcol-2*istrip+0.5);
zb = (2*dz-z0-depth*TMath::Tan(teta1));
z = zIs - zb*TMath::Cos(teta1);
y = depth/TMath::Cos(teta1) + zb*TMath::Sin(teta1);
x = (drow + 0.5)*dx;
double xx = y - geoBox[sm]->GetDX();
double yy = -x + geoBox[sm]->GetDY();
double zz = z - geoBox[sm]->GetDZ();
const double localIn[3] = {xx, yy, zz};
double dglobal[3];
geoSMMatrix[sm]->LocalToMaster(localIn, dglobal);
if(sm == 2 || sm == 3) {
global[0] = dglobal[0] + misaligTransShifts[3] + misaligRotShifts[3]*TMath::Sin(TMath::DegToRad()*20) ;
global[1] = dglobal[1] + misaligTransShifts[4] + misaligRotShifts[4]*TMath::Cos(TMath::DegToRad()*20) ;
global[2] = dglobal[2] + misaligTransShifts[5];
}
else if(sm == 0 || sm == 1){
global[0] = dglobal[0] + misaligTransShifts[0];
global[1] = dglobal[1] + misaligTransShifts[1];
global[2] = dglobal[2] + misaligTransShifts[2];
}
else {
AliInfo("Careful, correction not implemented yet!");
global[0] = dglobal[0] ;
global[1] = dglobal[1] ;
global[2] = dglobal[2] ;
}
}
else{
AliFatal("Geometry boxes information, check that geometry.root is loaded\n");
}
}
void AliEMCALGeometry::SetMisalMatrix(const TGeoHMatrix * m, Int_t smod)
{
fUseExternalMatrices = kTRUE;
if (smod >= 0 && smod < fEMCGeometry->GetNumberOfSuperModules()){
if(!fkSModuleMatrix[smod]) fkSModuleMatrix[smod] = new TGeoHMatrix(*m) ;
} else AliFatal(Form("Wrong supermodule index -> %d",smod));
}
Bool_t AliEMCALGeometry::IsDCALSM(Int_t iSupMod) const
{
if( fEMCSMSystem[iSupMod] == kDCAL_Standard || fEMCSMSystem[iSupMod] == kDCAL_Ext ) return kTRUE;
return kFALSE;
}
Bool_t AliEMCALGeometry::IsDCALExtSM(Int_t iSupMod) const
{
if( fEMCSMSystem[iSupMod] == kDCAL_Ext ) return kTRUE;
return kFALSE;
}
AliEMCALGeometry.cxx:1000 AliEMCALGeometry.cxx:1001 AliEMCALGeometry.cxx:1002 AliEMCALGeometry.cxx:1003 AliEMCALGeometry.cxx:1004 AliEMCALGeometry.cxx:1005 AliEMCALGeometry.cxx:1006 AliEMCALGeometry.cxx:1007 AliEMCALGeometry.cxx:1008 AliEMCALGeometry.cxx:1009 AliEMCALGeometry.cxx:1010 AliEMCALGeometry.cxx:1011 AliEMCALGeometry.cxx:1012 AliEMCALGeometry.cxx:1013 AliEMCALGeometry.cxx:1014 AliEMCALGeometry.cxx:1015 AliEMCALGeometry.cxx:1016 AliEMCALGeometry.cxx:1017 AliEMCALGeometry.cxx:1018 AliEMCALGeometry.cxx:1019 AliEMCALGeometry.cxx:1020 AliEMCALGeometry.cxx:1021 AliEMCALGeometry.cxx:1022 AliEMCALGeometry.cxx:1023 AliEMCALGeometry.cxx:1024 AliEMCALGeometry.cxx:1025 AliEMCALGeometry.cxx:1026 AliEMCALGeometry.cxx:1027 AliEMCALGeometry.cxx:1028 AliEMCALGeometry.cxx:1029 AliEMCALGeometry.cxx:1030 AliEMCALGeometry.cxx:1031 AliEMCALGeometry.cxx:1032 AliEMCALGeometry.cxx:1033 AliEMCALGeometry.cxx:1034 AliEMCALGeometry.cxx:1035 AliEMCALGeometry.cxx:1036 AliEMCALGeometry.cxx:1037 AliEMCALGeometry.cxx:1038 AliEMCALGeometry.cxx:1039 AliEMCALGeometry.cxx:1040 AliEMCALGeometry.cxx:1041 AliEMCALGeometry.cxx:1042 AliEMCALGeometry.cxx:1043 AliEMCALGeometry.cxx:1044 AliEMCALGeometry.cxx:1045 AliEMCALGeometry.cxx:1046 AliEMCALGeometry.cxx:1047 AliEMCALGeometry.cxx:1048 AliEMCALGeometry.cxx:1049 AliEMCALGeometry.cxx:1050 AliEMCALGeometry.cxx:1051 AliEMCALGeometry.cxx:1052 AliEMCALGeometry.cxx:1053 AliEMCALGeometry.cxx:1054 AliEMCALGeometry.cxx:1055 AliEMCALGeometry.cxx:1056 AliEMCALGeometry.cxx:1057 AliEMCALGeometry.cxx:1058 AliEMCALGeometry.cxx:1059 AliEMCALGeometry.cxx:1060 AliEMCALGeometry.cxx:1061 AliEMCALGeometry.cxx:1062 AliEMCALGeometry.cxx:1063 AliEMCALGeometry.cxx:1064 AliEMCALGeometry.cxx:1065 AliEMCALGeometry.cxx:1066 AliEMCALGeometry.cxx:1067 AliEMCALGeometry.cxx:1068 AliEMCALGeometry.cxx:1069 AliEMCALGeometry.cxx:1070 AliEMCALGeometry.cxx:1071 AliEMCALGeometry.cxx:1072 AliEMCALGeometry.cxx:1073 AliEMCALGeometry.cxx:1074 AliEMCALGeometry.cxx:1075 AliEMCALGeometry.cxx:1076 AliEMCALGeometry.cxx:1077 AliEMCALGeometry.cxx:1078 AliEMCALGeometry.cxx:1079 AliEMCALGeometry.cxx:1080 AliEMCALGeometry.cxx:1081 AliEMCALGeometry.cxx:1082 AliEMCALGeometry.cxx:1083 AliEMCALGeometry.cxx:1084 AliEMCALGeometry.cxx:1085 AliEMCALGeometry.cxx:1086 AliEMCALGeometry.cxx:1087 AliEMCALGeometry.cxx:1088 AliEMCALGeometry.cxx:1089 AliEMCALGeometry.cxx:1090 AliEMCALGeometry.cxx:1091 AliEMCALGeometry.cxx:1092 AliEMCALGeometry.cxx:1093 AliEMCALGeometry.cxx:1094 AliEMCALGeometry.cxx:1095 AliEMCALGeometry.cxx:1096 AliEMCALGeometry.cxx:1097 AliEMCALGeometry.cxx:1098 AliEMCALGeometry.cxx:1099 AliEMCALGeometry.cxx:1100 AliEMCALGeometry.cxx:1101 AliEMCALGeometry.cxx:1102 AliEMCALGeometry.cxx:1103 AliEMCALGeometry.cxx:1104 AliEMCALGeometry.cxx:1105 AliEMCALGeometry.cxx:1106 AliEMCALGeometry.cxx:1107 AliEMCALGeometry.cxx:1108 AliEMCALGeometry.cxx:1109 AliEMCALGeometry.cxx:1110 AliEMCALGeometry.cxx:1111 AliEMCALGeometry.cxx:1112 AliEMCALGeometry.cxx:1113 AliEMCALGeometry.cxx:1114 AliEMCALGeometry.cxx:1115 AliEMCALGeometry.cxx:1116 AliEMCALGeometry.cxx:1117 AliEMCALGeometry.cxx:1118 AliEMCALGeometry.cxx:1119 AliEMCALGeometry.cxx:1120 AliEMCALGeometry.cxx:1121 AliEMCALGeometry.cxx:1122 AliEMCALGeometry.cxx:1123 AliEMCALGeometry.cxx:1124 AliEMCALGeometry.cxx:1125 AliEMCALGeometry.cxx:1126 AliEMCALGeometry.cxx:1127 AliEMCALGeometry.cxx:1128 AliEMCALGeometry.cxx:1129 AliEMCALGeometry.cxx:1130 AliEMCALGeometry.cxx:1131 AliEMCALGeometry.cxx:1132 AliEMCALGeometry.cxx:1133 AliEMCALGeometry.cxx:1134 AliEMCALGeometry.cxx:1135 AliEMCALGeometry.cxx:1136 AliEMCALGeometry.cxx:1137 AliEMCALGeometry.cxx:1138 AliEMCALGeometry.cxx:1139 AliEMCALGeometry.cxx:1140 AliEMCALGeometry.cxx:1141 AliEMCALGeometry.cxx:1142 AliEMCALGeometry.cxx:1143 AliEMCALGeometry.cxx:1144 AliEMCALGeometry.cxx:1145 AliEMCALGeometry.cxx:1146 AliEMCALGeometry.cxx:1147 AliEMCALGeometry.cxx:1148 AliEMCALGeometry.cxx:1149 AliEMCALGeometry.cxx:1150 AliEMCALGeometry.cxx:1151 AliEMCALGeometry.cxx:1152 AliEMCALGeometry.cxx:1153 AliEMCALGeometry.cxx:1154 AliEMCALGeometry.cxx:1155 AliEMCALGeometry.cxx:1156 AliEMCALGeometry.cxx:1157 AliEMCALGeometry.cxx:1158 AliEMCALGeometry.cxx:1159 AliEMCALGeometry.cxx:1160 AliEMCALGeometry.cxx:1161 AliEMCALGeometry.cxx:1162 AliEMCALGeometry.cxx:1163 AliEMCALGeometry.cxx:1164 AliEMCALGeometry.cxx:1165 AliEMCALGeometry.cxx:1166 AliEMCALGeometry.cxx:1167 AliEMCALGeometry.cxx:1168 AliEMCALGeometry.cxx:1169 AliEMCALGeometry.cxx:1170 AliEMCALGeometry.cxx:1171 AliEMCALGeometry.cxx:1172 AliEMCALGeometry.cxx:1173 AliEMCALGeometry.cxx:1174 AliEMCALGeometry.cxx:1175 AliEMCALGeometry.cxx:1176 AliEMCALGeometry.cxx:1177 AliEMCALGeometry.cxx:1178 AliEMCALGeometry.cxx:1179 AliEMCALGeometry.cxx:1180 AliEMCALGeometry.cxx:1181 AliEMCALGeometry.cxx:1182 AliEMCALGeometry.cxx:1183 AliEMCALGeometry.cxx:1184 AliEMCALGeometry.cxx:1185 AliEMCALGeometry.cxx:1186 AliEMCALGeometry.cxx:1187 AliEMCALGeometry.cxx:1188 AliEMCALGeometry.cxx:1189 AliEMCALGeometry.cxx:1190 AliEMCALGeometry.cxx:1191 AliEMCALGeometry.cxx:1192 AliEMCALGeometry.cxx:1193 AliEMCALGeometry.cxx:1194 AliEMCALGeometry.cxx:1195 AliEMCALGeometry.cxx:1196 AliEMCALGeometry.cxx:1197 AliEMCALGeometry.cxx:1198 AliEMCALGeometry.cxx:1199 AliEMCALGeometry.cxx:1200 AliEMCALGeometry.cxx:1201 AliEMCALGeometry.cxx:1202 AliEMCALGeometry.cxx:1203 AliEMCALGeometry.cxx:1204 AliEMCALGeometry.cxx:1205 AliEMCALGeometry.cxx:1206 AliEMCALGeometry.cxx:1207 AliEMCALGeometry.cxx:1208 AliEMCALGeometry.cxx:1209 AliEMCALGeometry.cxx:1210 AliEMCALGeometry.cxx:1211 AliEMCALGeometry.cxx:1212 AliEMCALGeometry.cxx:1213 AliEMCALGeometry.cxx:1214 AliEMCALGeometry.cxx:1215 AliEMCALGeometry.cxx:1216 AliEMCALGeometry.cxx:1217 AliEMCALGeometry.cxx:1218 AliEMCALGeometry.cxx:1219 AliEMCALGeometry.cxx:1220 AliEMCALGeometry.cxx:1221 AliEMCALGeometry.cxx:1222 AliEMCALGeometry.cxx:1223 AliEMCALGeometry.cxx:1224 AliEMCALGeometry.cxx:1225 AliEMCALGeometry.cxx:1226 AliEMCALGeometry.cxx:1227 AliEMCALGeometry.cxx:1228 AliEMCALGeometry.cxx:1229 AliEMCALGeometry.cxx:1230 AliEMCALGeometry.cxx:1231 AliEMCALGeometry.cxx:1232 AliEMCALGeometry.cxx:1233 AliEMCALGeometry.cxx:1234 AliEMCALGeometry.cxx:1235 AliEMCALGeometry.cxx:1236 AliEMCALGeometry.cxx:1237 AliEMCALGeometry.cxx:1238 AliEMCALGeometry.cxx:1239 AliEMCALGeometry.cxx:1240 AliEMCALGeometry.cxx:1241 AliEMCALGeometry.cxx:1242 AliEMCALGeometry.cxx:1243 AliEMCALGeometry.cxx:1244 AliEMCALGeometry.cxx:1245 AliEMCALGeometry.cxx:1246 AliEMCALGeometry.cxx:1247 AliEMCALGeometry.cxx:1248 AliEMCALGeometry.cxx:1249 AliEMCALGeometry.cxx:1250 AliEMCALGeometry.cxx:1251 AliEMCALGeometry.cxx:1252 AliEMCALGeometry.cxx:1253 AliEMCALGeometry.cxx:1254 AliEMCALGeometry.cxx:1255 AliEMCALGeometry.cxx:1256 AliEMCALGeometry.cxx:1257 AliEMCALGeometry.cxx:1258 AliEMCALGeometry.cxx:1259 AliEMCALGeometry.cxx:1260 AliEMCALGeometry.cxx:1261 AliEMCALGeometry.cxx:1262 AliEMCALGeometry.cxx:1263 AliEMCALGeometry.cxx:1264 AliEMCALGeometry.cxx:1265 AliEMCALGeometry.cxx:1266 AliEMCALGeometry.cxx:1267 AliEMCALGeometry.cxx:1268 AliEMCALGeometry.cxx:1269 AliEMCALGeometry.cxx:1270 AliEMCALGeometry.cxx:1271 AliEMCALGeometry.cxx:1272 AliEMCALGeometry.cxx:1273 AliEMCALGeometry.cxx:1274 AliEMCALGeometry.cxx:1275 AliEMCALGeometry.cxx:1276 AliEMCALGeometry.cxx:1277 AliEMCALGeometry.cxx:1278 AliEMCALGeometry.cxx:1279 AliEMCALGeometry.cxx:1280 AliEMCALGeometry.cxx:1281 AliEMCALGeometry.cxx:1282 AliEMCALGeometry.cxx:1283 AliEMCALGeometry.cxx:1284 AliEMCALGeometry.cxx:1285 AliEMCALGeometry.cxx:1286 AliEMCALGeometry.cxx:1287 AliEMCALGeometry.cxx:1288 AliEMCALGeometry.cxx:1289 AliEMCALGeometry.cxx:1290 AliEMCALGeometry.cxx:1291 AliEMCALGeometry.cxx:1292 AliEMCALGeometry.cxx:1293 AliEMCALGeometry.cxx:1294 AliEMCALGeometry.cxx:1295 AliEMCALGeometry.cxx:1296 AliEMCALGeometry.cxx:1297 AliEMCALGeometry.cxx:1298 AliEMCALGeometry.cxx:1299 AliEMCALGeometry.cxx:1300 AliEMCALGeometry.cxx:1301 AliEMCALGeometry.cxx:1302 AliEMCALGeometry.cxx:1303 AliEMCALGeometry.cxx:1304 AliEMCALGeometry.cxx:1305 AliEMCALGeometry.cxx:1306 AliEMCALGeometry.cxx:1307 AliEMCALGeometry.cxx:1308 AliEMCALGeometry.cxx:1309 AliEMCALGeometry.cxx:1310 AliEMCALGeometry.cxx:1311 AliEMCALGeometry.cxx:1312 AliEMCALGeometry.cxx:1313 AliEMCALGeometry.cxx:1314 AliEMCALGeometry.cxx:1315 AliEMCALGeometry.cxx:1316 AliEMCALGeometry.cxx:1317 AliEMCALGeometry.cxx:1318 AliEMCALGeometry.cxx:1319 AliEMCALGeometry.cxx:1320 AliEMCALGeometry.cxx:1321 AliEMCALGeometry.cxx:1322 AliEMCALGeometry.cxx:1323 AliEMCALGeometry.cxx:1324 AliEMCALGeometry.cxx:1325 AliEMCALGeometry.cxx:1326 AliEMCALGeometry.cxx:1327 AliEMCALGeometry.cxx:1328 AliEMCALGeometry.cxx:1329 AliEMCALGeometry.cxx:1330 AliEMCALGeometry.cxx:1331 AliEMCALGeometry.cxx:1332 AliEMCALGeometry.cxx:1333 AliEMCALGeometry.cxx:1334 AliEMCALGeometry.cxx:1335 AliEMCALGeometry.cxx:1336 AliEMCALGeometry.cxx:1337 AliEMCALGeometry.cxx:1338 AliEMCALGeometry.cxx:1339 AliEMCALGeometry.cxx:1340 AliEMCALGeometry.cxx:1341 AliEMCALGeometry.cxx:1342 AliEMCALGeometry.cxx:1343 AliEMCALGeometry.cxx:1344 AliEMCALGeometry.cxx:1345 AliEMCALGeometry.cxx:1346 AliEMCALGeometry.cxx:1347 AliEMCALGeometry.cxx:1348 AliEMCALGeometry.cxx:1349 AliEMCALGeometry.cxx:1350 AliEMCALGeometry.cxx:1351 AliEMCALGeometry.cxx:1352 AliEMCALGeometry.cxx:1353 AliEMCALGeometry.cxx:1354 AliEMCALGeometry.cxx:1355 AliEMCALGeometry.cxx:1356 AliEMCALGeometry.cxx:1357 AliEMCALGeometry.cxx:1358 AliEMCALGeometry.cxx:1359 AliEMCALGeometry.cxx:1360 AliEMCALGeometry.cxx:1361 AliEMCALGeometry.cxx:1362 AliEMCALGeometry.cxx:1363 AliEMCALGeometry.cxx:1364 AliEMCALGeometry.cxx:1365 AliEMCALGeometry.cxx:1366 AliEMCALGeometry.cxx:1367 AliEMCALGeometry.cxx:1368 AliEMCALGeometry.cxx:1369 AliEMCALGeometry.cxx:1370 AliEMCALGeometry.cxx:1371 AliEMCALGeometry.cxx:1372 AliEMCALGeometry.cxx:1373 AliEMCALGeometry.cxx:1374 AliEMCALGeometry.cxx:1375 AliEMCALGeometry.cxx:1376 AliEMCALGeometry.cxx:1377 AliEMCALGeometry.cxx:1378 AliEMCALGeometry.cxx:1379 AliEMCALGeometry.cxx:1380 AliEMCALGeometry.cxx:1381 AliEMCALGeometry.cxx:1382 AliEMCALGeometry.cxx:1383 AliEMCALGeometry.cxx:1384 AliEMCALGeometry.cxx:1385 AliEMCALGeometry.cxx:1386 AliEMCALGeometry.cxx:1387 AliEMCALGeometry.cxx:1388 AliEMCALGeometry.cxx:1389 AliEMCALGeometry.cxx:1390 AliEMCALGeometry.cxx:1391 AliEMCALGeometry.cxx:1392 AliEMCALGeometry.cxx:1393 AliEMCALGeometry.cxx:1394 AliEMCALGeometry.cxx:1395 AliEMCALGeometry.cxx:1396 AliEMCALGeometry.cxx:1397 AliEMCALGeometry.cxx:1398 AliEMCALGeometry.cxx:1399 AliEMCALGeometry.cxx:1400 AliEMCALGeometry.cxx:1401 AliEMCALGeometry.cxx:1402 AliEMCALGeometry.cxx:1403 AliEMCALGeometry.cxx:1404 AliEMCALGeometry.cxx:1405 AliEMCALGeometry.cxx:1406 AliEMCALGeometry.cxx:1407 AliEMCALGeometry.cxx:1408 AliEMCALGeometry.cxx:1409 AliEMCALGeometry.cxx:1410 AliEMCALGeometry.cxx:1411 AliEMCALGeometry.cxx:1412 AliEMCALGeometry.cxx:1413 AliEMCALGeometry.cxx:1414 AliEMCALGeometry.cxx:1415 AliEMCALGeometry.cxx:1416 AliEMCALGeometry.cxx:1417 AliEMCALGeometry.cxx:1418 AliEMCALGeometry.cxx:1419 AliEMCALGeometry.cxx:1420 AliEMCALGeometry.cxx:1421 AliEMCALGeometry.cxx:1422 AliEMCALGeometry.cxx:1423 AliEMCALGeometry.cxx:1424 AliEMCALGeometry.cxx:1425 AliEMCALGeometry.cxx:1426 AliEMCALGeometry.cxx:1427 AliEMCALGeometry.cxx:1428 AliEMCALGeometry.cxx:1429 AliEMCALGeometry.cxx:1430 AliEMCALGeometry.cxx:1431 AliEMCALGeometry.cxx:1432 AliEMCALGeometry.cxx:1433 AliEMCALGeometry.cxx:1434 AliEMCALGeometry.cxx:1435 AliEMCALGeometry.cxx:1436 AliEMCALGeometry.cxx:1437 AliEMCALGeometry.cxx:1438 AliEMCALGeometry.cxx:1439 AliEMCALGeometry.cxx:1440 AliEMCALGeometry.cxx:1441 AliEMCALGeometry.cxx:1442 AliEMCALGeometry.cxx:1443 AliEMCALGeometry.cxx:1444 AliEMCALGeometry.cxx:1445 AliEMCALGeometry.cxx:1446 AliEMCALGeometry.cxx:1447 AliEMCALGeometry.cxx:1448 AliEMCALGeometry.cxx:1449 AliEMCALGeometry.cxx:1450 AliEMCALGeometry.cxx:1451 AliEMCALGeometry.cxx:1452 AliEMCALGeometry.cxx:1453 AliEMCALGeometry.cxx:1454 AliEMCALGeometry.cxx:1455 AliEMCALGeometry.cxx:1456 AliEMCALGeometry.cxx:1457 AliEMCALGeometry.cxx:1458 AliEMCALGeometry.cxx:1459 AliEMCALGeometry.cxx:1460 AliEMCALGeometry.cxx:1461 AliEMCALGeometry.cxx:1462 AliEMCALGeometry.cxx:1463 AliEMCALGeometry.cxx:1464 AliEMCALGeometry.cxx:1465 AliEMCALGeometry.cxx:1466 AliEMCALGeometry.cxx:1467 AliEMCALGeometry.cxx:1468 AliEMCALGeometry.cxx:1469 AliEMCALGeometry.cxx:1470 AliEMCALGeometry.cxx:1471 AliEMCALGeometry.cxx:1472 AliEMCALGeometry.cxx:1473 AliEMCALGeometry.cxx:1474 AliEMCALGeometry.cxx:1475 AliEMCALGeometry.cxx:1476 AliEMCALGeometry.cxx:1477 AliEMCALGeometry.cxx:1478 AliEMCALGeometry.cxx:1479 AliEMCALGeometry.cxx:1480 AliEMCALGeometry.cxx:1481 AliEMCALGeometry.cxx:1482 AliEMCALGeometry.cxx:1483 AliEMCALGeometry.cxx:1484 AliEMCALGeometry.cxx:1485 AliEMCALGeometry.cxx:1486 AliEMCALGeometry.cxx:1487 AliEMCALGeometry.cxx:1488 AliEMCALGeometry.cxx:1489 AliEMCALGeometry.cxx:1490 AliEMCALGeometry.cxx:1491 AliEMCALGeometry.cxx:1492 AliEMCALGeometry.cxx:1493 AliEMCALGeometry.cxx:1494 AliEMCALGeometry.cxx:1495 AliEMCALGeometry.cxx:1496 AliEMCALGeometry.cxx:1497 AliEMCALGeometry.cxx:1498 AliEMCALGeometry.cxx:1499 AliEMCALGeometry.cxx:1500 AliEMCALGeometry.cxx:1501 AliEMCALGeometry.cxx:1502 AliEMCALGeometry.cxx:1503 AliEMCALGeometry.cxx:1504 AliEMCALGeometry.cxx:1505 AliEMCALGeometry.cxx:1506 AliEMCALGeometry.cxx:1507 AliEMCALGeometry.cxx:1508 AliEMCALGeometry.cxx:1509 AliEMCALGeometry.cxx:1510 AliEMCALGeometry.cxx:1511 AliEMCALGeometry.cxx:1512 AliEMCALGeometry.cxx:1513 AliEMCALGeometry.cxx:1514 AliEMCALGeometry.cxx:1515 AliEMCALGeometry.cxx:1516 AliEMCALGeometry.cxx:1517 AliEMCALGeometry.cxx:1518 AliEMCALGeometry.cxx:1519 AliEMCALGeometry.cxx:1520 AliEMCALGeometry.cxx:1521 AliEMCALGeometry.cxx:1522 AliEMCALGeometry.cxx:1523 AliEMCALGeometry.cxx:1524 AliEMCALGeometry.cxx:1525 AliEMCALGeometry.cxx:1526 AliEMCALGeometry.cxx:1527 AliEMCALGeometry.cxx:1528 AliEMCALGeometry.cxx:1529 AliEMCALGeometry.cxx:1530 AliEMCALGeometry.cxx:1531 AliEMCALGeometry.cxx:1532 AliEMCALGeometry.cxx:1533 AliEMCALGeometry.cxx:1534 AliEMCALGeometry.cxx:1535 AliEMCALGeometry.cxx:1536 AliEMCALGeometry.cxx:1537 AliEMCALGeometry.cxx:1538 AliEMCALGeometry.cxx:1539 AliEMCALGeometry.cxx:1540 AliEMCALGeometry.cxx:1541 AliEMCALGeometry.cxx:1542 AliEMCALGeometry.cxx:1543 AliEMCALGeometry.cxx:1544 AliEMCALGeometry.cxx:1545 AliEMCALGeometry.cxx:1546 AliEMCALGeometry.cxx:1547 AliEMCALGeometry.cxx:1548 AliEMCALGeometry.cxx:1549 AliEMCALGeometry.cxx:1550 AliEMCALGeometry.cxx:1551 AliEMCALGeometry.cxx:1552 AliEMCALGeometry.cxx:1553 AliEMCALGeometry.cxx:1554 AliEMCALGeometry.cxx:1555 AliEMCALGeometry.cxx:1556 AliEMCALGeometry.cxx:1557 AliEMCALGeometry.cxx:1558 AliEMCALGeometry.cxx:1559 AliEMCALGeometry.cxx:1560 AliEMCALGeometry.cxx:1561 AliEMCALGeometry.cxx:1562 AliEMCALGeometry.cxx:1563 AliEMCALGeometry.cxx:1564 AliEMCALGeometry.cxx:1565 AliEMCALGeometry.cxx:1566 AliEMCALGeometry.cxx:1567 AliEMCALGeometry.cxx:1568 AliEMCALGeometry.cxx:1569 AliEMCALGeometry.cxx:1570 AliEMCALGeometry.cxx:1571 AliEMCALGeometry.cxx:1572 AliEMCALGeometry.cxx:1573 AliEMCALGeometry.cxx:1574 AliEMCALGeometry.cxx:1575 AliEMCALGeometry.cxx:1576 AliEMCALGeometry.cxx:1577 AliEMCALGeometry.cxx:1578 AliEMCALGeometry.cxx:1579 AliEMCALGeometry.cxx:1580 AliEMCALGeometry.cxx:1581 AliEMCALGeometry.cxx:1582 AliEMCALGeometry.cxx:1583 AliEMCALGeometry.cxx:1584 AliEMCALGeometry.cxx:1585 AliEMCALGeometry.cxx:1586 AliEMCALGeometry.cxx:1587 AliEMCALGeometry.cxx:1588 AliEMCALGeometry.cxx:1589 AliEMCALGeometry.cxx:1590 AliEMCALGeometry.cxx:1591 AliEMCALGeometry.cxx:1592 AliEMCALGeometry.cxx:1593 AliEMCALGeometry.cxx:1594 AliEMCALGeometry.cxx:1595 AliEMCALGeometry.cxx:1596 AliEMCALGeometry.cxx:1597 AliEMCALGeometry.cxx:1598 AliEMCALGeometry.cxx:1599 AliEMCALGeometry.cxx:1600 AliEMCALGeometry.cxx:1601 AliEMCALGeometry.cxx:1602 AliEMCALGeometry.cxx:1603 AliEMCALGeometry.cxx:1604 AliEMCALGeometry.cxx:1605 AliEMCALGeometry.cxx:1606 AliEMCALGeometry.cxx:1607 AliEMCALGeometry.cxx:1608 AliEMCALGeometry.cxx:1609 AliEMCALGeometry.cxx:1610 AliEMCALGeometry.cxx:1611 AliEMCALGeometry.cxx:1612 AliEMCALGeometry.cxx:1613 AliEMCALGeometry.cxx:1614 AliEMCALGeometry.cxx:1615 AliEMCALGeometry.cxx:1616 AliEMCALGeometry.cxx:1617 AliEMCALGeometry.cxx:1618 AliEMCALGeometry.cxx:1619 AliEMCALGeometry.cxx:1620 AliEMCALGeometry.cxx:1621 AliEMCALGeometry.cxx:1622 AliEMCALGeometry.cxx:1623 AliEMCALGeometry.cxx:1624 AliEMCALGeometry.cxx:1625 AliEMCALGeometry.cxx:1626 AliEMCALGeometry.cxx:1627 AliEMCALGeometry.cxx:1628 AliEMCALGeometry.cxx:1629 AliEMCALGeometry.cxx:1630 AliEMCALGeometry.cxx:1631 AliEMCALGeometry.cxx:1632 AliEMCALGeometry.cxx:1633 AliEMCALGeometry.cxx:1634 AliEMCALGeometry.cxx:1635 AliEMCALGeometry.cxx:1636 AliEMCALGeometry.cxx:1637 AliEMCALGeometry.cxx:1638 AliEMCALGeometry.cxx:1639 AliEMCALGeometry.cxx:1640 AliEMCALGeometry.cxx:1641 AliEMCALGeometry.cxx:1642 AliEMCALGeometry.cxx:1643 AliEMCALGeometry.cxx:1644 AliEMCALGeometry.cxx:1645 AliEMCALGeometry.cxx:1646 AliEMCALGeometry.cxx:1647 AliEMCALGeometry.cxx:1648 AliEMCALGeometry.cxx:1649 AliEMCALGeometry.cxx:1650 AliEMCALGeometry.cxx:1651 AliEMCALGeometry.cxx:1652 AliEMCALGeometry.cxx:1653 AliEMCALGeometry.cxx:1654 AliEMCALGeometry.cxx:1655 AliEMCALGeometry.cxx:1656 AliEMCALGeometry.cxx:1657 AliEMCALGeometry.cxx:1658 AliEMCALGeometry.cxx:1659 AliEMCALGeometry.cxx:1660 AliEMCALGeometry.cxx:1661 AliEMCALGeometry.cxx:1662 AliEMCALGeometry.cxx:1663 AliEMCALGeometry.cxx:1664 AliEMCALGeometry.cxx:1665 AliEMCALGeometry.cxx:1666 AliEMCALGeometry.cxx:1667 AliEMCALGeometry.cxx:1668 AliEMCALGeometry.cxx:1669 AliEMCALGeometry.cxx:1670 AliEMCALGeometry.cxx:1671 AliEMCALGeometry.cxx:1672 AliEMCALGeometry.cxx:1673 AliEMCALGeometry.cxx:1674 AliEMCALGeometry.cxx:1675 AliEMCALGeometry.cxx:1676 AliEMCALGeometry.cxx:1677 AliEMCALGeometry.cxx:1678 AliEMCALGeometry.cxx:1679 AliEMCALGeometry.cxx:1680 AliEMCALGeometry.cxx:1681 AliEMCALGeometry.cxx:1682 AliEMCALGeometry.cxx:1683 AliEMCALGeometry.cxx:1684 AliEMCALGeometry.cxx:1685 AliEMCALGeometry.cxx:1686 AliEMCALGeometry.cxx:1687 AliEMCALGeometry.cxx:1688 AliEMCALGeometry.cxx:1689 AliEMCALGeometry.cxx:1690 AliEMCALGeometry.cxx:1691 AliEMCALGeometry.cxx:1692 AliEMCALGeometry.cxx:1693 AliEMCALGeometry.cxx:1694 AliEMCALGeometry.cxx:1695 AliEMCALGeometry.cxx:1696 AliEMCALGeometry.cxx:1697 AliEMCALGeometry.cxx:1698 AliEMCALGeometry.cxx:1699 AliEMCALGeometry.cxx:1700 AliEMCALGeometry.cxx:1701 AliEMCALGeometry.cxx:1702 AliEMCALGeometry.cxx:1703 AliEMCALGeometry.cxx:1704 AliEMCALGeometry.cxx:1705 AliEMCALGeometry.cxx:1706 AliEMCALGeometry.cxx:1707 AliEMCALGeometry.cxx:1708 AliEMCALGeometry.cxx:1709 AliEMCALGeometry.cxx:1710 AliEMCALGeometry.cxx:1711 AliEMCALGeometry.cxx:1712 AliEMCALGeometry.cxx:1713 AliEMCALGeometry.cxx:1714 AliEMCALGeometry.cxx:1715 AliEMCALGeometry.cxx:1716 AliEMCALGeometry.cxx:1717 AliEMCALGeometry.cxx:1718 AliEMCALGeometry.cxx:1719 AliEMCALGeometry.cxx:1720 AliEMCALGeometry.cxx:1721 AliEMCALGeometry.cxx:1722 AliEMCALGeometry.cxx:1723 AliEMCALGeometry.cxx:1724 AliEMCALGeometry.cxx:1725 AliEMCALGeometry.cxx:1726 AliEMCALGeometry.cxx:1727 AliEMCALGeometry.cxx:1728 AliEMCALGeometry.cxx:1729 AliEMCALGeometry.cxx:1730 AliEMCALGeometry.cxx:1731 AliEMCALGeometry.cxx:1732 AliEMCALGeometry.cxx:1733 AliEMCALGeometry.cxx:1734 AliEMCALGeometry.cxx:1735 AliEMCALGeometry.cxx:1736 AliEMCALGeometry.cxx:1737 AliEMCALGeometry.cxx:1738 AliEMCALGeometry.cxx:1739 AliEMCALGeometry.cxx:1740 AliEMCALGeometry.cxx:1741 AliEMCALGeometry.cxx:1742 AliEMCALGeometry.cxx:1743 AliEMCALGeometry.cxx:1744 AliEMCALGeometry.cxx:1745 AliEMCALGeometry.cxx:1746 AliEMCALGeometry.cxx:1747 AliEMCALGeometry.cxx:1748 AliEMCALGeometry.cxx:1749 AliEMCALGeometry.cxx:1750 AliEMCALGeometry.cxx:1751 AliEMCALGeometry.cxx:1752 AliEMCALGeometry.cxx:1753 AliEMCALGeometry.cxx:1754 AliEMCALGeometry.cxx:1755 AliEMCALGeometry.cxx:1756 AliEMCALGeometry.cxx:1757 AliEMCALGeometry.cxx:1758 AliEMCALGeometry.cxx:1759 AliEMCALGeometry.cxx:1760 AliEMCALGeometry.cxx:1761 AliEMCALGeometry.cxx:1762 AliEMCALGeometry.cxx:1763 AliEMCALGeometry.cxx:1764 AliEMCALGeometry.cxx:1765 AliEMCALGeometry.cxx:1766 AliEMCALGeometry.cxx:1767 AliEMCALGeometry.cxx:1768 AliEMCALGeometry.cxx:1769 AliEMCALGeometry.cxx:1770 AliEMCALGeometry.cxx:1771 AliEMCALGeometry.cxx:1772 AliEMCALGeometry.cxx:1773 AliEMCALGeometry.cxx:1774 AliEMCALGeometry.cxx:1775 AliEMCALGeometry.cxx:1776 AliEMCALGeometry.cxx:1777 AliEMCALGeometry.cxx:1778 AliEMCALGeometry.cxx:1779 AliEMCALGeometry.cxx:1780 AliEMCALGeometry.cxx:1781 AliEMCALGeometry.cxx:1782 AliEMCALGeometry.cxx:1783 AliEMCALGeometry.cxx:1784 AliEMCALGeometry.cxx:1785 AliEMCALGeometry.cxx:1786 AliEMCALGeometry.cxx:1787 AliEMCALGeometry.cxx:1788 AliEMCALGeometry.cxx:1789 AliEMCALGeometry.cxx:1790 AliEMCALGeometry.cxx:1791 AliEMCALGeometry.cxx:1792 AliEMCALGeometry.cxx:1793 AliEMCALGeometry.cxx:1794 AliEMCALGeometry.cxx:1795 AliEMCALGeometry.cxx:1796 AliEMCALGeometry.cxx:1797 AliEMCALGeometry.cxx:1798 AliEMCALGeometry.cxx:1799 AliEMCALGeometry.cxx:1800 AliEMCALGeometry.cxx:1801 AliEMCALGeometry.cxx:1802 AliEMCALGeometry.cxx:1803 AliEMCALGeometry.cxx:1804 AliEMCALGeometry.cxx:1805 AliEMCALGeometry.cxx:1806 AliEMCALGeometry.cxx:1807 AliEMCALGeometry.cxx:1808 AliEMCALGeometry.cxx:1809 AliEMCALGeometry.cxx:1810 AliEMCALGeometry.cxx:1811 AliEMCALGeometry.cxx:1812