]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added new methods
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jan 2002 15:43:37 +0000 (15:43 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jan 2002 15:43:37 +0000 (15:43 +0000)
EMCAL/AliEMCALGeometry.cxx
EMCAL/AliEMCALGeometry.h

index cddfb51cfe758f5a1afa469c0e26d21bc099f9c4..e8164114229b59a2bc19f1d943c29e6635878c16 100644 (file)
@@ -308,6 +308,43 @@ void AliEMCALGeometry::PosInAlice(const Int_t *relid,Float_t &theta,
 
     return;
 }
+
+//______________________________________________________________________
+void AliEMCALGeometry::XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const {
+    // given the tower relative number it returns the X, Y and Z
+    // of the tower.
+    
+    // Outputs:
+    //   Float_t x  // x of center of tower in cm
+    //   Float_t y  // y of center of tower in cm
+    //   Float_t z  // z of centre of tower in cm
+    // Returned
+    //   none.
+    
+    Float_t eta,theta, phi,cyl_radius,kDeg2Rad;
+    
+    Int_t ieta   = relid[2]; // offset along x axis
+    Int_t iphi = relid[3]; // offset along z axis
+    Int_t ipre = relid[1]; // indicates -1 preshower, or 0 full tower.
+    Int_t index;
+    
+
+    if(ipre==-1) ipre = 1;
+    index = TowerIndex(ieta,iphi,ipre);
+    EtaPhiFromIndex(index,eta,phi);
+    theta = 180.*(2.0*TMath::ATan(TMath::Exp(-eta)))/TMath::Pi();
+
+    
+    kDeg2Rad = TMath::Pi() / static_cast<Double_t>(180) ; 
+    cyl_radius = GetIPDistance()+ GetAirGap() ;
+    x =  cyl_radius * TMath::Cos(phi * kDeg2Rad ) ;
+    y =  cyl_radius * TMath::Cos(phi * kDeg2Rad ) ; 
+    z =  cyl_radius / TMath::Tan(theta * kDeg2Rad ) ; 
+ return;
+} 
+
 //______________________________________________________________________
 /*
 Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2) const {
index 56f2c3e046911ba36631793f665ca7e215735c9a..c1a91be1792a054131b1d71c67e2a530ffeaa86a 100644 (file)
@@ -67,6 +67,7 @@ class AliEMCALGeometry : public AliGeometry {
     const Int_t   GetNZ() const {return fNZ ;}
     const Int_t   GetNEta() const {return fNZ ;}
     const Int_t   GetNPhi() const {return fNPhi ;}
+    const Int_t   GetNTowers() const {return fNPhi * fNZ ;}
     const Float_t GetPbRadThick(){ // returns Pb radiator thickness in cm.
        return fPbRadThickness;
     }
@@ -91,6 +92,8 @@ class AliEMCALGeometry : public AliGeometry {
     void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi,Int_t &ipre) const;
     // for a given tower index it returns eta and phi of center of that tower.
     void EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const;
+    // returns x, y, and z (cm) on the inner surface of a given EMCAL Cell specified by relid.
+    void XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const;
     // for a given eta and phi in the EMCAL it returns the tower index.
     Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
     // for a given eta and phi in the EMCAL it returns the pretower index.