corrected a typo in a if statement in Init (why did it compile before ! the granulari...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Dec 2002 18:10:54 +0000 (18:10 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Dec 2002 18:10:54 +0000 (18:10 +0000)
EMCAL/AliEMCALGeometry.cxx
EMCAL/AliEMCALGeometry.h

index 2a9a2ac421ed9c06b06472cd5b6371ea867c645c..6f796f29328b60c62bf616932dda55e15147346d 100644 (file)
@@ -69,11 +69,11 @@ void AliEMCALGeometry::Init(void){
     //
     if ( name == "EMCALArch1a"  ||
         name == "EMCALArch1b" ) {
-       fNZ         = 96;
-       fNPhi       = 144;
+      fNZ         = 96;
+      fNPhi       = 144;
     } // end if
     if ( name == "EMCALArch2a"  ||
-        name, "EMCALArch2b" ) {
+        name == "EMCALArch2b" ) {
        fNZ         = 112;
        fNPhi       = 168;
     } // end if
@@ -152,7 +152,7 @@ AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name,
 Int_t AliEMCALGeometry::TowerIndex(Int_t ieta,Int_t iphi,Int_t ipre) const {
     // Returns the tower index number from the based on the Z and Phi
     // index numbers. There are 2 times the number of towers to separate
-    // out the full towsers from the pre-towsers.
+    // out the full towers from the pre-showers.
     // Inputs:
     //   Int_t ieta    // index allong z axis [1-fNZ]
     //   Int_t iphi  // index allong phi axis [1-fNPhi]
@@ -378,7 +378,11 @@ void AliEMCALGeometry::XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Fl
     theta = 180.*(2.0*TMath::ATan(TMath::Exp(-eta)))/TMath::Pi();
     
     kDeg2Rad = TMath::Pi() / static_cast<Double_t>(180) ; 
-    cyl_radius = GetIPDistance()+ GetAirGap() ;
+    if ( ipre == -1 ) 
+      cyl_radius = GetIP2PreShower() ;
+    else 
+      cyl_radius = GetIP2Tower() ;
+
     x =  cyl_radius * TMath::Cos(phi * kDeg2Rad ) ;
     y =  cyl_radius * TMath::Sin(phi * kDeg2Rad ) ; 
     z =  cyl_radius / TMath::Tan(theta * kDeg2Rad ) ; 
index 3bfcd4ec7280735c0406bd673774897acccac392..d4277386a6fce6d374901d8d221dfa94938a184e 100644 (file)
@@ -25,126 +25,129 @@ class TParticle ;
 #include "AliGeometry.h"
 
 class AliEMCALGeometry : public AliGeometry {
- public:
-    AliEMCALGeometry() {
-       // default ctor,  must be kept public for root persistency purposes,
-       // but should never be called by the outside world
+public:
+  AliEMCALGeometry() {
+    // default ctor,  must be kept public for root persistency purposes,
+    // but should never be called by the outside world
+  };
+  AliEMCALGeometry(const AliEMCALGeometry & geom) {
+    // cpy ctor requested by Coding Convention but not yet needed
+    assert(0==1);
+  };
+  virtual ~AliEMCALGeometry(void) ; 
+  static AliEMCALGeometry * GetInstance(const Text_t* name,
+                                       const Text_t* title="") ; 
+  static AliEMCALGeometry * GetInstance() ;
+  AliEMCALGeometry & operator = (const AliEMCALGeometry  & rvalue) const {
+    // assignement operator requested by coding convention but not needed
+    assert(0==1) ;
+    return *(GetInstance()) ; 
+  };
+  virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrix &) const {}
+  virtual void GetGlobal(const AliRecPoint *, TVector3 &) const {}
+  virtual Bool_t Impact(const TParticle * particle) const {return kTRUE;}
+  // General
+  Bool_t  IsInitialized(void) const { return fgInit ; }
+  // Return EMCA geometrical parameters
+  // geometry
+  const Float_t GetAlFrontThickness() const { return fAlFrontThick;}
+  const Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
+  const Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
+  const Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
+  const Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
+  const Float_t GetIPDistance() const { return fIPDistance  ; } 
+  const Float_t GetIP2PreShower()  const { return (GetIPDistance() + GetAlFrontThickness() +  GetGap2Active() ) ;}
+  const Float_t GetIP2Tower() const { return ( GetIP2PreShower() + 2 * (  GetPreSintThick() +  GetPbRadThick() ) ) ; }  
+  const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }  
+  const Float_t GetShellThickness() const { return fShellThickness ; }
+  const Float_t GetZLength() const { return fZLength ; } 
+  const Float_t GetGap2Active() const {return  fGap2Active ; }
+  const Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/
+                                      ((Float_t)fNZ);}
+  const Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/
+                                      ((Float_t)fNPhi);}
+  const Int_t   GetNLayers() const {return fNLayers ;}
+  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()const { // returns Pb radiator thickness in cm.
+    return fPbRadThickness;
+  }
+  const Float_t GetFullSintThick() const { // returns Full tower sintilator
+    // thickness in cm.
+    return fFullShowerSintThick;
+  }
+  const Float_t GetPreSintThick() const { // returns PreShower tower sintilator
+    // thickness in cm.
+    return fPreShowerSintThick;
+  }
+  Float_t AngleFromEta(Float_t eta){ // returns angle in radians for a given
+    // pseudorapidity.
+    return 2.0*TMath::ATan(TMath::Exp(-eta));
+  }
+  Float_t ZFromEtaR(Float_t r,Float_t eta){ // returns z in for a given
+    // pseudorapidity and r=sqrt(x*x+y*y).
+    return r/TMath::Tan(AngleFromEta(eta));
+  }
+  Int_t TowerIndex(Int_t iz,Int_t iphi,Int_t ipre) const; // returns tower index
+  // returns tower indexs iz, iphi.
+  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.
+  Int_t PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
+  // Returns theta and phi (degree) for a given EMCAL cell indecated by relid
+  void PosInAlice(const Int_t *relid,Float_t &theta,Float_t &phi) const ;
+  // Returns an array indicating the Tower/preshower, iz, and iphi for a
+  // specific EMCAL indes.
+  Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const;
+  /*
+  // Returns kTRUE if the two indexs are neighboring towers or preshowers.
+  Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2) const;
+  */
+  
+  void SetNZ(Int_t nz) { fNZ= nz ; Info("SetNZ", "Number of modules in Z set to %d", fNZ) ; }
+  void SetNPhi(Int_t nphi) { fNPhi= nphi ; Info("SetNPhi", "Number of modules in Phi set to %d", fNPhi) ; }
+  
+protected:
+  AliEMCALGeometry(const Text_t* name, const Text_t* title="") :
+    AliGeometry(name, title) {// ctor only for internal usage (singleton)
+    Init();
+  };
+  void Init(void) ;            // initializes the parameters of EMCAL
+  
+private:
+  static AliEMCALGeometry * fgGeom ; // pointer to the unique instance
+  // of the singleton 
+  static Bool_t fgInit;// Tells if geometry has been succesfully set up.
+  Float_t fAlFrontThick; // Thickness of the front Al face of the support box
+  Float_t fPreShowerSintThick; // Thickness of the sintilator for the
+  // preshower part of the calorimeter
+  Float_t fFullShowerSintThick;// Thickness of the sintilaor for the full
+  // shower part of the calorimeter
+  Float_t fPbRadThickness; // Thickness of Pb radiators cm.
+  Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees)
+  Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees)
+  Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta
+  Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta
+  
+  // It is assumed that Arm1 and Arm2 have the same following parameters
+  Float_t fEnvelop[3];      // the GEANT TUB for the detector 
+  Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL
+  Float_t fShellThickness; // Total thickness in (x,y) direction
+  Float_t fZLength;        // Total length in z direction
+  Float_t fGap2Active;     // Gap between the envelop and the active material
+  Int_t   fNLayers;        // Number of layers of material in the R direction
+  Int_t   fNZ;             // Number of Towers in the Z direction
+  Int_t   fNPhi;           //Number of Towers in the Phi Direction
+  
+  ClassDef(AliEMCALGeometry,4) // EMCAL geometry class 
+    
     };
-    AliEMCALGeometry(const AliEMCALGeometry & geom) {
-       // cpy ctor requested by Coding Convention but not yet needed
-       assert(0==1);
-    };
-    virtual ~AliEMCALGeometry(void) ; 
-    static AliEMCALGeometry * GetInstance(const Text_t* name,
-                                         const Text_t* title="") ; 
-    static AliEMCALGeometry * GetInstance() ;
-    AliEMCALGeometry & operator = (const AliEMCALGeometry  & rvalue) const {
-       // assignement operator requested by coding convention but not needed
-       assert(0==1) ;
-       return *(GetInstance()) ; 
-    };
-    virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrix &) const {}
-    virtual void GetGlobal(const AliRecPoint *, TVector3 &) const {}
-    virtual Bool_t Impact(const TParticle * particle) const {return kTRUE;}
-    // General
-    Bool_t  IsInitialized(void) const { return fgInit ; }
-    // Return EMCA geometrical parameters
-    // geometry
-    const Float_t GetAirGap() const { return fAirGap ; }
-    const Float_t GetAlFrontThickness() const { return fAlFrontThick;}
-    const Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
-    const Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
-    const Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
-    const Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
-    const Float_t GetIPDistance()   const { return  fIPDistance  ; } 
-    const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }  
-    const Float_t GetShellThickness() const { return fShellThickness ; }
-    const Float_t GetZLength() const { return fZLength ; } 
-    const Float_t GetGap2Active() const {return  fGap2Active ; }
-    const Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/
-                                          ((Float_t)fNZ);}
-    const Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/
-                                          ((Float_t)fNPhi);}
-    const Int_t   GetNLayers() const {return fNLayers ;}
-    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;
-    }
-    const Float_t GetFullSintThick(){ // returns Full tower sintilator
-                                     // thickness in cm.
-       return fFullShowerSintThick;
-    }
-    const Float_t GetPreSintThick(){ // returns PreShower tower sintilator
-                                     // thickness in cm.
-       return fPreShowerSintThick;
-    }
-    Float_t AngleFromEta(Float_t eta){ // returns angle in radians for a given
-       // pseudorapidity.
-       return 2.0*TMath::ATan(TMath::Exp(-eta));
-       }
-    Float_t ZFromEtaR(Float_t r,Float_t eta){ // returns z in for a given
-       // pseudorapidity and r=sqrt(x*x+y*y).
-       return r/TMath::Tan(AngleFromEta(eta));
-       }
-    Int_t TowerIndex(Int_t iz,Int_t iphi,Int_t ipre) const; // returns tower index
-    // returns tower indexs iz, iphi.
-    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.
-    Int_t PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
-    // Returns theta and phi (degree) for a given EMCAL cell indecated by relid
-    void PosInAlice(const Int_t *relid,Float_t &theta,Float_t &phi) const ;
-    // Returns an array indicating the Tower/preshower, iz, and iphi for a
-    // specific EMCAL indes.
-    Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const;
-    /*
-    // Returns kTRUE if the two indexs are neighboring towers or preshowers.
-    Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2) const;
- */
-
- protected:
-    AliEMCALGeometry(const Text_t* name, const Text_t* title="") :
-       AliGeometry(name, title) {// ctor only for internal usage (singleton)
-       Init();
-    };
-    void Init(void) ;            // initializes the parameters of EMCAL
-
- private:
-    static AliEMCALGeometry * fgGeom ; // pointer to the unique instance
-                                       // of the singleton 
-    static Bool_t fgInit;// Tells if geometry has been succesfully set up.
-    Float_t fAirGap;     // Distance between envelop and active material
-    Float_t fAlFrontThick; // Thickness of the front Al face of the support box
-    Float_t fPreShowerSintThick; // Thickness of the sintilator for the
-                                 // preshower part of the calorimeter
-    Float_t fFullShowerSintThick;// Thickness of the sintilaor for the full
-                                 // shower part of the calorimeter
-    Float_t fPbRadThickness; // Thickness of Pb radiators cm.
-    Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees)
-    Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees)
-    Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta
-    Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta
-
-    // It is assumed that Arm1 and Arm2 have the same following parameters
-    Float_t fEnvelop[3];      // the GEANT TUB for the detector 
-    Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL
-    Float_t fShellThickness; // Total thickness in (x,y) direction
-    Float_t fZLength;        // Total length in z direction
-    Float_t fGap2Active;     // Gap between the envelop and the active material
-    Int_t   fNLayers;        // Number of layers of material in the R direction
-    Int_t   fNZ;             // Number of Towers in the Z direction
-    Int_t   fNPhi;           //Number of Towers in the Phi Direction
-    ClassDef(AliEMCALGeometry,3) // EMCAL geometry class 
-
-};
 
 #endif // AliEMCALGEOMETRY_H