// -0.7 to 0.7 in eta
// Number of Modules and Layers may be controlled by
// the name of the instance defined
-// EMCALArch2x has more modules along both phi and eta
-// EMCALArchxa has less Layers in the Radial Direction
//*-- Author: Sahal Yacoob (LBL / UCT)
// and : Yves Schutz (SUBATECH)
// and : Jennifer Klay (LBL)
// --- EMCAL headers
#include "AliEMCALGeometry.h"
-ClassImp(AliEMCALGeometry);
+ClassImp(AliEMCALGeometry)
AliEMCALGeometry *AliEMCALGeometry::fgGeom = 0;
Bool_t AliEMCALGeometry::fgInit = kFALSE;
fECScintThick = 0.5; // cm, Thickness of the scintillator
fNECLayers = 25; // number of scintillator layers
- fSampling = 11.8;
+ fSampling = 13.1; // calculated with Birk's law implementation
fAlFrontThick = 3.5; // cm, Thickness of front Al layer
fGap2Active = 1.0; // cm, Gap between Al and 1st Scintillator
// Int_t index // Tower index number
if ( (ieta <= 0 || ieta>GetNEta()) ||
- (iphi <= 0 || iphi>GetNPhi()))
- Fatal("TowerIndex", "Unexpected parameters eta = %d phi = %d!", ieta, iphi) ;
-
+ (iphi <= 0 || iphi>GetNPhi())) {
+ Error("TowerIndex", "Unexpected parameters eta = %d phi = %d!", ieta, iphi) ;
+ return -1;
+ }
return ( (iphi - 1)*GetNEta() + ieta );
}
if ( IsInECA(index) ) { // ECAL index
nindex = index ;
}
- else
- Fatal("TowerIndexes", "Unexpected Id number!") ;
-
+ else {
+ Error("TowerIndexes", "Unexpected Id number!") ;
+ ieta = -1;
+ iphi = -1;
+ return;
+ }
+
if (nindex%GetNZ())
iphi = nindex / GetNZ() + 1 ;
else
return TowerIndex(ieta,iphi);
}
-//______________________________________________________________________
-Int_t AliEMCALGeometry::PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi) const {
- // returns the pretower index number based on the eta and phi of the tower.
- // Inputs:
- // Float_t eta // eta of center of tower in pseudorapidity
- // Float_t phi // phi of center of tower in degrees
- // Outputs:
- // none.
- // Returned
- // Int_t index // PreTower index number [fNZ*fNPhi-2*fNZ*fNPhi]
-
- return GetNEta()*GetNPhi()+TowerIndexFromEtaPhi(eta,phi);
-}
-
//______________________________________________________________________
Bool_t AliEMCALGeometry::AbsToRelNumbering(Int_t AbsId, Int_t *relid) const {
// Converts the absolute numbering into the following array/
- // relid[0] = EMCAL Arm number 1:1
- // relid[1] = Row number inside EMCAL
- // relid[2] = Column number inside EMCAL
+ // relid[0] = Row number inside EMCAL
+ // relid[1] = Column number inside EMCAL
// Input:
// Int_t AbsId // Tower index number [1-2*fNZ*fNPhi]
// Outputs:
- // Int_t *relid // array of 3. Discribed above.
+ // Int_t *relid // array of 2. Described above.
Bool_t rv = kTRUE ;
Int_t ieta=0,iphi=0,index=AbsId;
TowerIndexes(index,ieta,iphi);
- relid[0] = 1;
- relid[1] = ieta;
- relid[2] = iphi;
+ relid[0] = ieta;
+ relid[1] = iphi;
return rv;
}
{
// Converts the relative numbering into the local EMCAL-module (x, z)
// coordinates
- Int_t ieta = relid[1]; // offset along x axis
- Int_t iphi = relid[2]; // offset along z axis
+ Int_t ieta = relid[0]; // offset along x axis
+ Int_t iphi = relid[1]; // offset along z axis
Int_t index;
Float_t eta;
{
// Converts the relative numbering into the local EMCAL-module (x, z)
// coordinates
-
- Int_t relid[3] ;
+ Int_t relid[2] ;
AbsToRelNumbering(absid, relid) ;
- Int_t ieta = relid[1]; // offset along x axis
- Int_t iphi = relid[2]; // offset along z axis
+ Int_t ieta = relid[0]; // offset along x axis
+ Int_t iphi = relid[1]; // offset along z axis
Int_t index;
Float_t eta;
Float_t d = 0. ;
if (IsInECA(absid))
d = GetIP2ECASection() - GetIPDistance() ;
- else
- Fatal("PosInAlice", "Unexpected id # %d!", absid) ;
+ else {
+ Error("PosInAlice", "Unexpected id # %d!", absid) ;
+ return;
+ }
Float_t correction = 1 + d/GetIPDistance() ;
Float_t tantheta = TMath::Tan(theta) * correction ;
Float_t eta,theta, phi,cylradius=0. ;
- Int_t ieta = relid[1]; // offset along x axis
- Int_t iphi = relid[2]; // offset along z axis.
+ Int_t ieta = relid[0]; // offset along x axis
+ Int_t iphi = relid[1]; // offset along z axis.
Int_t index;
index = TowerIndex(ieta,iphi);
if ( IsInECA(absid) )
cylradius = GetIP2ECASection() ;
- else
- Fatal("XYZFromIndex", "Unexpected Tower section") ;
+ else {
+ Error("XYZFromIndex", "Unexpected Tower section") ;
+ return;
+ }
Double_t kDeg2Rad = TMath::DegToRad() ;
v.SetX(cylradius * TMath::Cos(phi * kDeg2Rad ) );
return;
}
-//______________________________________________________________________
-/*
-Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2) const {
- // Returns kTRUE if the two towers are neighbours or not, including
- // diagonals. Both indexes are required to be either towers or preshower.
- // Inputs:
- // Int_t index1 // index of tower 1
- // Int_t index2 // index of tower 2
- // Outputs:
- // none.
- // Returned
- // Boot_t kTRUE if the towers are neighbours otherwise false.
- Boot_t anb = kFALSE;
- Int_t ieta1 = 0, ieta2 = 0, iphi1 = 0, iphi2 = 0;
-
- TowerIndexes(index1,ieta1,iphi1);
- TowerIndexes(index2,ieta2,iphi2);
- if((ieta1>=ieta2-1 && ieta1<=ieta2+1) && (iphi1>=iphi2-1 &&iphi1<=iphi2+1))
- anb = kTRUE;
- return anb;
+Bool_t AliEMCALGeometry::IsInEMCAL(Double_t x, Double_t y, Double_t z) const {
+ // Checks whether point is inside the EMCal volume
+ //
+ // Code uses cylindrical approximation made of inner radius (for speed)
+ //
+ // Points behind EMCAl, i.e. R > outer radius, but eta, phi in acceptance
+ // are considered to inside
+
+ Double_t r=sqrt(x*x+y*y);
+
+ if ( r > fEnvelop[0] ) {
+ Double_t theta;
+ 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 > fArm1PhiMin && phi < fArm1PhiMax)
+ return 1;
+ }
+ return 0;
}
- */