]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSGeometry.h
initialize pointer data member to zero in the default ctor to avoid problems with...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeometry.h
index e3c8447ce5b9dd63974da3434bae93c71d6e59fa..88fbffc7800c42aac5c24d6f6a025f4b7fc53bbd 100644 (file)
@@ -34,6 +34,8 @@ public:
   AliPHOSGeometry() {
     // default ctor 
     // must be kept public for root persistency purposes, but should never be called by the outside world
+    fPHOSAngle = 0 ; 
+
   } ;  
   AliPHOSGeometry(const AliPHOSGeometry & geom) {
     // cpy ctor requested by Coding Convention 
@@ -42,7 +44,7 @@ public:
   } 
   
   virtual ~AliPHOSGeometry(void) ; 
-  static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title) ; 
+  static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ; 
   static AliPHOSGeometry * GetInstance() ; 
   virtual void  GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat)  ;
   virtual void  GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos)  ; 
@@ -53,20 +55,30 @@ public:
     assert(0==1) ;
     return *(GetInstance()) ; 
   }
-  static TString fgDegre ;   // a global for degree (deg)
-  static TString fgRadian ;  // a global for radian (rad)
-
   // General
 
+  static TString Degre(void) {
+    // a global for degree (deg)
+    return TString("deg") ; 
+  }
+
+  static TString Radian(void) { 
+    // a global for radian (rad)
+    return TString("rad") ; 
+  } 
+   
   Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) ; // converts the absolute PHOS numbering to a relative 
-  void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt = fgRadian);    
+  void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt = Radian() );    
                                                          // calculates the angular coverage in theta and phi of a EMC module
-  void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = fgRadian) ; 
+  void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = Radian() ) ; 
                                                                          // calculates the angular coverage in theta and phi of a 
                                                                          // single crystal in a EMC module
+
   void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, Double_t & x, Double_t & z) ; 
-                                                                         // calculates the impact coordinates of a neutral particle  
-                                                                         // emitted in direction theta and phi in ALICE
+                                                                          // calculates the impact coordinates of a neutral particle  
+                                                                          // emitted in direction theta and phi in ALICE
   void   RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) ; // gets the position of element (pad or Xtal) relative to 
                                                                          // center of PHOS module  
   void   RelPosInAlice(const Int_t AbsId, TVector3 &  pos) ;             // gets the position of element (pad or Xtal) relative to 
@@ -78,7 +90,7 @@ public:
 
   Bool_t     IsInitialized(void)                  const { 
     // 
-    return fInit ; }  
+    return fgInit ; }  
   Float_t    GetAirFilledBoxSize(Int_t index)     const { 
     // Getter
     return fAirFilledBoxSize[index] ;}
@@ -233,7 +245,7 @@ public:
 
 protected:
 
-  AliPHOSGeometry(const Text_t* name, const Text_t* title) : AliGeometry(name, title) { 
+  AliPHOSGeometry(const Text_t* name, const Text_t* title="") : AliGeometry(name, title) { 
     // ctor only for internal usage (singleton)
     Init() ; 
   }  
@@ -253,7 +265,6 @@ private:
   Float_t fCrystalWrapThickness ;         // Thickness of Tyvek wrapping the crystal
   Float_t fCrystalHolderThickness ;       // Titanium holder of the crystal
   Float_t fGapBetweenCrystals ;           // Total Gap between two adjacent crystals 
-  Bool_t  fInit ;                         // Tells if geometry has been succesfully set up 
   Float_t fIPtoOuterCoverDistance ;       // Distances from interaction point to outer cover 
   Float_t fIPtoCrystalSurface ;           // Distances from interaction point to Xtal surface
   Float_t fModuleBoxThickness ;           // Thickness of the thermo insulating box containing one crystals module 
@@ -302,6 +313,7 @@ private:
   Float_t fZDisplacement ;                // Z displacement of micromegas1 with respect to micromegas2  
 
   static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton 
+  static Bool_t  fgInit ;            // Tells if geometry has been succesfully set up 
 
   ClassDef(AliPHOSGeometry,1)  // PHOS geometry class