diff --git a/LArCalorimeter/LArG4/LArG4HEC/LArG4HEC/HECGeometry.h b/LArCalorimeter/LArG4/LArG4HEC/LArG4HEC/HECGeometry.h
index 623648b8ffde8c91229351f56b7f9a9d23824605..dc8420a00e7e334846de57f85353ec8a1ab2291d 100755
--- a/LArCalorimeter/LArG4/LArG4HEC/LArG4HEC/HECGeometry.h
+++ b/LArCalorimeter/LArG4/LArG4HEC/LArG4HEC/HECGeometry.h
@@ -43,27 +43,27 @@ namespace LArG4 {
     private:
       static HECGeometry *m_instance;
       
-      const HECDetectorManager *hecManager;
+      const HECDetectorManager *m_hecManager;
 
       static bool m_depthHist;
       static bool m_withMother;
       static bool m_inMother;
 
       static int  m_g4historyDepth;
-      static double depthSize[7];
-      static double depthSum[7];
-      static double minval[7][2][10];
-      static double maxval[7][2][10];
-
-      static double firstAbsThickness[2];
-      static double wheel1;
-      static double wheel2;
-      static double betweenWheels;
-      static double hecLength;
-      static double startHec2;
-      static double rOuter;
-      static double rInner1;
-      static double rInner2;
+      static double s_depthSize[7];
+      static double s_depthSum[7];
+      static double s_minval[7][2][10];
+      static double s_maxval[7][2][10];
+
+      static double s_firstAbsThickness[2];
+      static double s_wheel1;
+      static double s_wheel2;
+      static double s_betweenWheels;
+      static double s_hecLength;
+      static double s_startHec2;
+      static double s_rOuter;
+      static double s_rInner1;
+      static double s_rInner2;
 
     };
 
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc b/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc
index a58e714431285e42099cd3f4645a4bb2680d79c1..b9f6749828255cc691f21b685bd6a49282f9217c 100755
--- a/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc
@@ -26,12 +26,17 @@
 #include "StoreGate/StoreGateSvc.h"
 #include "StoreGate/StoreGate.h"
 #include "AthenaKernel/getMessageSvc.h"
+#include "AthenaKernel/Units.h"
 
 #include "globals.hh"
 #include <string>
 #include <cmath>
 #include <stdexcept>
 
+
+namespace Units = Athena::Units;
+
+
 #undef DEBUG_HEC
 
 #undef DEBUG_HEC_OLD_DIAGNOSTIC
@@ -52,19 +57,19 @@ bool   HECGeometry::m_depthHist = false;
 bool   HECGeometry::m_withMother = false;
 bool   HECGeometry::m_inMother = false;
 int    HECGeometry::m_g4historyDepth = 0;
-double HECGeometry::depthSize[7];
-double HECGeometry::depthSum[7];
-double HECGeometry::minval[7][2][10];
-double HECGeometry::maxval[7][2][10];
-double HECGeometry::firstAbsThickness[2];
-double HECGeometry::wheel1;
-double HECGeometry::wheel2;
-double HECGeometry::betweenWheels;
-double HECGeometry::hecLength;
-double HECGeometry::startHec2;
-double HECGeometry::rOuter;
-double HECGeometry::rInner1;
-double HECGeometry::rInner2;
+double HECGeometry::s_depthSize[7];
+double HECGeometry::s_depthSum[7];
+double HECGeometry::s_minval[7][2][10];
+double HECGeometry::s_maxval[7][2][10];
+double HECGeometry::s_firstAbsThickness[2];
+double HECGeometry::s_wheel1;
+double HECGeometry::s_wheel2;
+double HECGeometry::s_betweenWheels;
+double HECGeometry::s_hecLength;
+double HECGeometry::s_startHec2;
+double HECGeometry::s_rOuter;
+double HECGeometry::s_rInner1;
+double HECGeometry::s_rInner2;
 
 
 HECGeometry* HECGeometry::m_instance = 0;
@@ -81,13 +86,13 @@ HECGeometry* HECGeometry::GetInstance()
   
   
   MsgStream log(Athena::getMessageSvc(),"LArG4HEC::HECGeometry" );
-  log << MSG::DEBUG << "HECGeometry - Constructor" << endreq;
+  log << MSG::DEBUG << "HECGeometry - Constructor" << endmsg;
     
-  hecManager=NULL;
+  m_hecManager=NULL;
   
-  if (!hecManager){
+  if (!m_hecManager){
     StoreGateSvc* detStore = StoreGate::pointer("DetectorStore");
-    if (detStore->retrieve(hecManager)!=StatusCode::SUCCESS){
+    if (detStore->retrieve(m_hecManager)!=StatusCode::SUCCESS){
       throw std::runtime_error("HEC::HECGeometry Can't find HECDetectorManager!");
     }
   }
@@ -98,12 +103,12 @@ HECGeometry* HECGeometry::GetInstance()
   // eta identifier ready for any given depth. 
 
   for (int iblock=0; iblock<7; iblock++)  {
-    depthSum[iblock] = 0.;
-    depthSize[iblock] = 0.;
+    s_depthSum[iblock] = 0.;
+    s_depthSize[iblock] = 0.;
     for (int ireg=0; ireg<2; ireg++)     {
       for (int etaseg=0; etaseg<10; etaseg++)  {
-	minval[iblock][ireg][etaseg] = 0.; 
-	maxval[iblock][ireg][etaseg] = 0.;
+	s_minval[iblock][ireg][etaseg] = 0.; 
+	s_maxval[iblock][ireg][etaseg] = 0.;
       }
     }
   }
@@ -111,12 +116,12 @@ HECGeometry* HECGeometry::GetInstance()
   double depthsum_tally = 0.;
   for (int depthIndex=0; depthIndex<7; depthIndex++)
     {
-      depthSize[depthIndex] = hecManager->getBlock(depthIndex)->getDepth();
-      depthsum_tally += depthSize[depthIndex];
+      s_depthSize[depthIndex] = m_hecManager->getBlock(depthIndex)->getDepth();
+      depthsum_tally += s_depthSize[depthIndex];
       if (depthIndex==3) depthsum_tally += 40.5; // YIKES! hard-coded number...!
-      depthSum[depthIndex] = depthsum_tally  ;
+      s_depthSum[depthIndex] = depthsum_tally  ;
 
-      const HECLongBlock *block = hecManager->getBlock(depthIndex);
+      const HECLongBlock *block = m_hecManager->getBlock(depthIndex);
       
       int isegInner = 0;
       int isegOuter = block->getNumRadialSegments();
@@ -137,29 +142,29 @@ HECGeometry* HECGeometry::GetInstance()
 	  if (ieta < 0) { iregion=0; ieta=9; } 
 	  
 	  const HECRadialSegment *hecRad = block->getRadialSegment(iseg);
-	  minval[depthIndex][iregion][ieta]= hecRad->getMinVal();
-	  maxval[depthIndex][iregion][ieta]= hecRad->getMaxVal();
+	  s_minval[depthIndex][iregion][ieta]= hecRad->getMinVal();
+	  s_maxval[depthIndex][iregion][ieta]= hecRad->getMaxVal();
 	  // This is a most terrible hack to correct numbers in the database...:
-	  double rInner = hecManager->getBlock(depthIndex)->getInnerRadius();
-	  double rOuter = hecManager->getBlock(depthIndex)->getOuterRadius();
-	  if (hecRad->getMaxVal()==2027.)                    maxval[depthIndex][iregion][ieta]=rOuter;
-	  if (hecRad->getMinVal()==375. && depthIndex==0)    minval[depthIndex][iregion][ieta]=rInner;
-	  else if (hecRad->getMinVal()==478 && depthIndex>0) minval[depthIndex][iregion][ieta]=rInner;
+	  double rInner = m_hecManager->getBlock(depthIndex)->getInnerRadius();
+	  double s_rOuter = m_hecManager->getBlock(depthIndex)->getOuterRadius();
+	  if (hecRad->getMaxVal()==2027.)                    s_maxval[depthIndex][iregion][ieta]=s_rOuter;
+	  if (hecRad->getMinVal()==375. && depthIndex==0)    s_minval[depthIndex][iregion][ieta]=rInner;
+	  else if (hecRad->getMinVal()==478 && depthIndex>0) s_minval[depthIndex][iregion][ieta]=rInner;
 	}
     }
 
 
   // And some essential numbers we'll need over and over again:
-  firstAbsThickness[0] = hecManager->getBlock(0)->getFrontPlateThickness() ; 
-  firstAbsThickness[1] = hecManager->getBlock(3)->getFrontPlateThickness() ; 
-  wheel1 = depthSize[0]+depthSize[1]+depthSize[2];              // 816.5;
-  wheel2 = depthSize[3]+depthSize[4]+depthSize[5]+depthSize[6]; // 961.0;
-  betweenWheels = 40.5; // HACK!! -- can't find this through LArReadoutGeometry...
-  startHec2 = wheel1 + betweenWheels + firstAbsThickness[1];
-  hecLength = wheel1 + betweenWheels + wheel2;  
-  rOuter  = hecManager->getBlock(0)->getOuterRadius();
-  rInner1 = hecManager->getBlock(0)->getInnerRadius();
-  rInner2 = hecManager->getBlock(1)->getInnerRadius();
+  s_firstAbsThickness[0] = m_hecManager->getBlock(0)->getFrontPlateThickness() ; 
+  s_firstAbsThickness[1] = m_hecManager->getBlock(3)->getFrontPlateThickness() ; 
+  s_wheel1 = s_depthSize[0]+s_depthSize[1]+s_depthSize[2];              // 816.5;
+  s_wheel2 = s_depthSize[3]+s_depthSize[4]+s_depthSize[5]+s_depthSize[6]; // 961.0;
+  s_betweenWheels = 40.5; // HACK!! -- can't find this through LArReadoutGeometry...
+  s_startHec2 = s_wheel1 + s_betweenWheels + s_firstAbsThickness[1];
+  s_hecLength = s_wheel1 + s_betweenWheels + s_wheel2;  
+  s_rOuter  = m_hecManager->getBlock(0)->getOuterRadius();
+  s_rInner1 = m_hecManager->getBlock(0)->getInnerRadius();
+  s_rInner2 = m_hecManager->getBlock(1)->getInnerRadius();
 
 }
 
@@ -172,14 +177,14 @@ HECGeometry* HECGeometry::GetInstance()
 
     {
    
-      if (!hecManager){
+      if (!m_hecManager){
 	StoreGateSvc* detStore = StoreGate::pointer("DetectorStore");
-	if (detStore->retrieve(hecManager)!=StatusCode::SUCCESS){
+	if (detStore->retrieve(m_hecManager)!=StatusCode::SUCCESS){
 	  throw std::runtime_error("HEC::HECGeometry Can't find HECDetectorManager!");
 	}
       }
 
-      if (!hecManager){
+      if (!m_hecManager){
 	throw std::runtime_error("HEC::HECGeometry Can't find HECDetectorManager!");
       }
          
@@ -205,17 +210,17 @@ HECGeometry* HECGeometry::GetInstance()
 	      if ((theTouchable->GetHistory()->GetVolume(myVol)->GetName())== "LArMgr::LAr::HEC::LiquidArgon")
 		{ m_g4historyDepth=myVol; 
 		  m_depthHist=true;  
-		  log << MSG::INFO << " G4Depth of HEC::LiquidArgon " << m_g4historyDepth << endreq;
+		  log << MSG::INFO << " G4Depth of HEC::LiquidArgon " << m_g4historyDepth << endmsg;
 		  if ((theTouchable->GetHistory()->GetVolume(m_g4historyDepth-1)->GetName())== "LArMgr::LAr::HEC::Mother")
-		    {m_withMother=true;    log << MSG::INFO << "The HEC Wheel is embedded in a HEC Mother" << endreq; }
-		  else {m_withMother=false;    log << MSG::INFO << "The HEC Wheel is independent (no Mother)" << endreq; }
+		    {m_withMother=true;    log << MSG::INFO << "The HEC Wheel is embedded in a HEC Mother" << endmsg; }
+		  else {m_withMother=false;    log << MSG::INFO << "The HEC Wheel is independent (no Mother)" << endmsg; }
 		  break;}	
 	      else if ((theTouchable->GetHistory()->GetVolume(myVol)->GetName())== "LArMgr::LAr::HEC::Mother")
 		{ m_g4historyDepth=myVol+1;  
 		  m_depthHist=true;  
 		  m_withMother=true;
 		  log << MSG::INFO << " G4Depth of HEC::LiquidArgon " << m_g4historyDepth  
-		      << "  The HEC Wheel is embedded in a HEC Mother" << endreq; 
+		      << "  The HEC Wheel is embedded in a HEC Mother" << endmsg; 
 		  break;}	
 	    }
 	}
@@ -269,7 +274,7 @@ HECGeometry* HECGeometry::GetInstance()
 	  const G4AffineTransform moduleTransform= theTouchable->GetHistory()->GetTransform(modVol);
 	  
 	  G4ThreeVector modulePosition = moduleTransform.TransformPoint(pre_step_point->GetPosition());	  
-          double moduleY               = (sqrt)(modulePosition.y()/CLHEP::mm*modulePosition.y()/CLHEP::mm) ;
+          double moduleY               = (sqrt)(modulePosition.y()/Units::mm*modulePosition.y()/Units::mm) ;
 
 	  if (subgap) {
 
@@ -279,11 +284,11 @@ HECGeometry* HECGeometry::GetInstance()
 	    const G4AffineTransform sliceTransform=theTouchable->GetHistory()->GetTransform(sliceVol);
 	    G4ThreeVector slicePosition = sliceTransform.TransformPoint(pre_step_point->GetPosition());	  
 	    G4VSolid      *sliceSolid   = theTouchable->GetHistory()->GetVolume(sliceVol)->GetLogicalVolume()->GetSolid();
-	    double sliceZ               = slicePosition.z()/CLHEP::mm ;
+	    double sliceZ               = slicePosition.z()/Units::mm ;
 	    
 	    G4Tubs *tubs = dynamic_cast<G4Tubs *> (sliceSolid);
 	    if (tubs) {
-	      double dz = tubs->GetDz()/CLHEP::mm;
+	      double dz = tubs->GetDz()/Units::mm;
 	      if (sliceZ > 0) {
 		if (fabs(sliceZ)>dz/2.0) {
 		  (*subgap) = 0;
@@ -317,10 +322,10 @@ HECGeometry* HECGeometry::GetInstance()
 
 	  //---REGION, ETA ---
 	  int ieta = -1;
-	  int iregion = ( moduleY>= maxval[depthIndex][1][0] ) ? 0 : 1 ;
+	  int iregion = ( moduleY>= s_maxval[depthIndex][1][0] ) ? 0 : 1 ;
 	  for (int ie=0; ie<10; ie++)	{
-	    if ( moduleY > minval[depthIndex][iregion][ie] &&
-		 moduleY<= maxval[depthIndex][iregion][ie] )
+	    if ( moduleY > s_minval[depthIndex][iregion][ie] &&
+		 moduleY<= s_maxval[depthIndex][iregion][ie] )
 	      {
 		ieta = ie;  
 		break; 
@@ -333,9 +338,9 @@ HECGeometry* HECGeometry::GetInstance()
 	  if (ieta<0){ 
 	    int ietaMin[7] = {3,2,2,2,2,3,3};
 	    int ietaMax[7] = {0,0,1,1,2,2,3};
-	    if      (moduleY>=rOuter)                        ieta = ietaMax[depthIndex]; 
-	    else if ((depthIndex==0 && moduleY<rInner1 ) ||
-		     (depthIndex>0  && moduleY<rInner2 ))    ieta = ietaMin[depthIndex];
+	    if      (moduleY>=s_rOuter)                        ieta = ietaMax[depthIndex]; 
+	    else if ((depthIndex==0 && moduleY<s_rInner1 ) ||
+		     (depthIndex>0  && moduleY<s_rInner2 ))    ieta = ietaMin[depthIndex];
 	  }
 
 
@@ -423,7 +428,7 @@ HECGeometry* HECGeometry::GetInstance()
 	  // For z, r and PHI , use either mother or wheel coordinates:
 	  // For ETA:
 	  // Get the ideal HEC eta for the inter-moduel crack:
-	  // hecManager->getFocalToRef() = 4270 ...that's the start of the ideal HEC envelope
+	  // m_hecManager->getFocalToRef() = 4270 ...that's the start of the ideal HEC envelope
 	  // (no database access to this:  4277 ...is the start of the actual ideal HEC
 	  // in any case; this number is only used to get some ideal eta assignment.
 	  // it is NOT geometry- or alignmnet-dependent!
@@ -451,7 +456,7 @@ HECGeometry* HECGeometry::GetInstance()
 			((wheelPosition.getPhi() > 0.0) ? (M_PI-wheelPosition.getPhi()) : (-M_PI-wheelPosition.getPhi()))
 			: wheelPosition.getPhi());
 	    // See whether we are in Front or Rear wheel:
-	    zed      = (hecCopy<1) ? (zed    ) : (zed+wheel1+betweenWheels); 
+	    zed      = (hecCopy<1) ? (zed    ) : (zed+s_wheel1+s_betweenWheels); 
 	    idealZ   = zed + 4277.; 
 	    idealEta = -log ( tan( atan(radius/idealZ) / 2.));
 
@@ -460,7 +465,7 @@ HECGeometry* HECGeometry::GetInstance()
 	  // --- PHI ---
 	  // For phi need to consider opposite sense for the negative z-side (that's the same for mother/wheel):
 	  phi           = (phi<0) ? (phi+2.*M_PI) : phi;          
-          int iphi      = int(32*phi/(M_PI));
+          int iphi      = int(phi*(32/M_PI));
 
 #ifdef DEBUG_DEAD
 	  std::cout<<"Dead global phi: "<<globalPosition.getPhi()
@@ -484,7 +489,7 @@ HECGeometry* HECGeometry::GetInstance()
 
 	  
           //--- outside or behind HEC:
-	  if ( radius >= rOuter ) {
+	  if ( radius >= s_rOuter ) {
             if(idealEta < 1.7) { 
 	      ieta = int((idealEta - 1.0)/0.1);
 	      type=1  ; sampling=2;  region=5; 
@@ -495,17 +500,17 @@ HECGeometry* HECGeometry::GetInstance()
 	    }
           }
 	  //--- behind HEC:
-	  else if ( zed >= hecLength ) {  
+	  else if ( zed >= s_hecLength ) {  
 	    ieta = int((idealEta - 1.7)/0.1); 
 	    type=1  ; sampling=3; region=0;   
 	  }
           //--- in front of HEC:
-	  else if ( zed <= firstAbsThickness[0] && radius >rInner1  ) {
+	  else if ( zed <= s_firstAbsThickness[0] && radius >s_rInner1  ) {
 	    ieta = int((idealEta - 1.5)/0.1);
 	    type=1  ; sampling=2;  region=3;    
 	  }
           //--- in bewteen the two HECs:
-	  else if ( zed >= wheel1 &&  zed <=startHec2 && radius<rOuter && radius >rInner2 ) {
+	  else if ( zed >= s_wheel1 &&  zed <=s_startHec2 && radius<s_rOuter && radius >s_rInner2 ) {
 	    ieta = int((idealEta - 1.5)/0.1); 
 	    type=1  ; sampling=2;  region=4; 
 	  }
@@ -516,7 +521,7 @@ HECGeometry* HECGeometry::GetInstance()
 	      
 	      int iDepth =-1;
 	      for (int depthIndex=0; depthIndex<7; depthIndex++) {
-		if (zed <= depthSum[depthIndex]) { iDepth = depthIndex; break; } 
+		if (zed <= s_depthSum[depthIndex]) { iDepth = depthIndex; break; } 
 	      }
               if(iDepth < 0) { // this should not happen (previous tests on zed should guarantee, but to make Coverity happy
                  iDepth = 6;
@@ -525,11 +530,11 @@ HECGeometry* HECGeometry::GetInstance()
 	      // for inner HEC region or HEC/FCAL region:
 	      sampling = (iDepth==0 ? 0 : (iDepth<3 ? 1 : (iDepth<5 ? 2 : 3))); 
 	      iphi = int(32*phi/(2.*M_PI));  
-	      region = (( radius>= maxval[iDepth][1][0] ) ? 2 : 3 );
+	      region = (( radius>= s_maxval[iDepth][1][0] ) ? 2 : 3 );
 	      if      (region==3) ieta = int((idealEta-2.5)/0.2) ; 
 	      else                ieta = int((idealEta-1.5)/0.2) ; 
-	      if      (iDepth>0  && radius <= rInner2 ) { region = 4 ; ieta=0; iphi = int(32*phi/(M_PI));} // between HEC and FCAL
-	      else if (iDepth==0 && radius <= rInner1 ) { region = 4 ; ieta=0; iphi = int(32*phi/(M_PI));} // between HEC and FCAL
+	      if      (iDepth>0  && radius <= s_rInner2 ) { region = 4 ; ieta=0; iphi = int(phi*(32/M_PI));} // between HEC and FCAL
+	      else if (iDepth==0 && radius <= s_rInner1 ) { region = 4 ; ieta=0; iphi = int(phi*(32/M_PI));} // between HEC and FCAL
 
 	    }
 
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalculator.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalculator.cc
index cc399d571c091f45c69900a80a6acd545d2776a3..54df916b2bcab2cfb02ae6cba5ce18ac33834cf3 100755
--- a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalculator.cc
@@ -27,8 +27,11 @@
 #include "GaudiKernel/ISvcLocator.h"
 #include "GaudiKernel/Bootstrap.h"
 #include "StoreGate/StoreGateSvc.h"
+#include "AthenaKernel/Units.h"
 // Standard implementation of a singleton pattern.
 
+namespace Units = Athena::Units;
+
 LArHECCalculator* LArHECCalculator::m_instance = 0;
 
 LArHECCalculator* LArHECCalculator::GetCalculator()
@@ -122,7 +125,7 @@ G4bool LArHECCalculator::Process(const G4Step* a_step, std::vector<LArHitData>&
   G4ThreeVector endPoint   = post_step_point->GetPosition();
   G4ThreeVector p = (startPoint + endPoint) * 0.5;
 					 
-  hdata[0].time = timeOfFlight/CLHEP::ns - p.mag()/CLHEP::c_light/CLHEP::ns;
+  hdata[0].time = timeOfFlight/Units::ns - p.mag()/Units::c_light/Units::ns;
   if (hdata[0].time > m_OOTcut)
     m_isInTime = false;
   else
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalibrationWheelCalculator.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalibrationWheelCalculator.cc
index 7fb593aa14d78d87767bb17171ba802f79bbf9aa..b89e8a711d823015047dd3b15868d6c86f2ad968 100755
--- a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalibrationWheelCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECCalibrationWheelCalculator.cc
@@ -27,10 +27,10 @@ namespace LArG4 {
       StatusCode status = svcLocator->service("DetectorStore", detStore);
       MsgStream log(Athena::getMessageSvc(),"LArHECWheelCalculator" );
       if(status != StatusCode::SUCCESS ) {
-         log << MSG::ERROR << "No DetStore available !!" << endreq;
+         log << MSG::ERROR << "No DetStore available !!" << endmsg;
       }
 
-      log << MSG::INFO << "Use the LArHECCalibrationWheelCalculator for the HEC" << endreq;
+      log << MSG::INFO << "Use the LArHECCalibrationWheelCalculator for the HEC" << endmsg;
 
       // Initialize the geometry calculator.
       m_geometryCalculator = HECGeometry::GetInstance();
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECLocalCalculator.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECLocalCalculator.cc
index 79c40269f19088012cf8d390f077c842b19e78a2..8959917666ca4fcdabd648d99fa7d717b3e05efc 100755
--- a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECLocalCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECLocalCalculator.cc
@@ -21,10 +21,13 @@
 #include "GaudiKernel/ISvcLocator.h"
 #include "GaudiKernel/Bootstrap.h"
 #include "StoreGate/StoreGateSvc.h"
+#include "AthenaKernel/Units.h"
 
 #include "globals.hh"
 #include <cmath>
 
+namespace Units = Athena::Units;
+
 #undef DEBUG_HITS
 
 // Standard implementation of a singleton pattern.
@@ -69,7 +72,7 @@ LArHECLocalCalculator::LArHECLocalCalculator()
    if(status.isFailure()) m_msgSvc = 0;
    if(m_msgSvc) {
      MsgStream log(m_msgSvc,"LArHECLocalCalculator");
-     log << MSG::INFO << "Constructing Calculator " << endreq;
+     log << MSG::INFO << "Constructing Calculator " << endmsg;
    }
 
    m_OOTcut = globalOptions->OutOfTimeCut();
@@ -107,7 +110,7 @@ G4bool LArHECLocalCalculator::Process(const G4Step* a_step, int depthadd, double
   hdata[0].energy = a_step->GetTotalEnergyDeposit();
 
   // apply BirksLaw if we want to:
-  G4double stepLengthCm = a_step->GetStepLength() / CLHEP::cm;
+  G4double stepLengthCm = a_step->GetStepLength() / Units::cm;
   if(hdata[0].energy <= 0. || stepLengthCm <= 0.)  return false;
   if(m_birksLaw)  hdata[0].energy = (*m_birksLaw)(hdata[0].energy, stepLengthCm, 10.0 /*KeV/cm*/);
 
@@ -121,7 +124,7 @@ G4bool LArHECLocalCalculator::Process(const G4Step* a_step, int depthadd, double
   G4ThreeVector endPoint   = post_step_point->GetPosition();
   G4ThreeVector p = (startPoint + endPoint) * 0.5;
 					 
-  hdata[0].time = timeOfFlight/CLHEP::ns - p.mag()/CLHEP::c_light/CLHEP::ns;
+  hdata[0].time = timeOfFlight/Units::ns - p.mag()/Units::c_light/Units::ns;
   if (hdata[0].time > m_OOTcut)
     m_isInTime = false;
   else
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECWheelCalculator.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECWheelCalculator.cc
index ac58b6137bc2abd03dddb67e139eb98ba37e9a0a..63efb0f4cc55d8c41b6da832fdcde62a96c0ef05 100755
--- a/LArCalorimeter/LArG4/LArG4HEC/src/LArHECWheelCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/LArHECWheelCalculator.cc
@@ -29,10 +29,13 @@
 #include "GaudiKernel/Bootstrap.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "AthenaKernel/getMessageSvc.h"
+#include "AthenaKernel/Units.h"
 
 #include "globals.hh"
 #include <cmath>
 
+namespace Units = Athena::Units;
+
 #undef DEBUG_HITS
 
 // Standard implementation of a singleton pattern.
@@ -79,7 +82,7 @@ LArHECWheelCalculator::LArHECWheelCalculator()
    }
 
    MsgStream log(Athena::getMessageSvc(),"LArHECWheelCalculator" );
-   log << MSG::INFO << "Use the LArHECWheelCalculator for the HEC" << endreq;
+   log << MSG::INFO << "Use the LArHECWheelCalculator for the HEC" << endmsg;
 
    m_OOTcut = globalOptions->OutOfTimeCut();
 
@@ -116,7 +119,7 @@ G4bool LArHECWheelCalculator::Process(const G4Step* a_step, std::vector<LArHitDa
   
 
   // apply BirksLaw if we want to:
-  G4double stepLengthCm = a_step->GetStepLength() / CLHEP::cm;
+  G4double stepLengthCm = a_step->GetStepLength() / Units::cm;
   if(hdata[0].energy <= 0. || stepLengthCm <= 0.)  return false;
   if(m_birksLaw)  hdata[0].energy = (*m_birksLaw)(hdata[0].energy, stepLengthCm, 10.0 /*KeV/cm*/);
 
@@ -126,7 +129,7 @@ G4bool LArHECWheelCalculator::Process(const G4Step* a_step, std::vector<LArHitDa
   G4ThreeVector point          = 0.5* (  a_step->GetPreStepPoint()->GetPosition()
 				       + a_step->GetPostStepPoint()->GetPosition() );
 
-  hdata[0].time = timeOfFlight/CLHEP::ns - point.mag()/CLHEP::c_light/CLHEP::ns;
+  hdata[0].time = timeOfFlight/Units::ns - point.mag()/Units::c_light/Units::ns;
 
   if (hdata[0].time > m_OOTcut)
     m_isInTime = false;
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc
index c9f4df8fe3215f10d330d901aa683204c6111756..3b071269fea8f463e6edb7adc32a3fd9e058565d 100755
--- a/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc
@@ -23,10 +23,15 @@
 #include "GaudiKernel/ISvcLocator.h"
 #include "GaudiKernel/Bootstrap.h"
 #include "StoreGate/StoreGateSvc.h"
+#include "AthenaKernel/Units.h"
 #include "globals.hh"
 #include <cmath>
 #include <stdexcept>
 
+
+namespace Units = Athena::Units;
+
+
 #undef DEBUG_HEC
 #undef DEBUG_HEC_OLD_DIAGNOSTIC
 
@@ -162,7 +167,7 @@ double deadZone(double locx, double locy, double /*rot*/=0)
       }
 
       if(m_log) {
-         *m_log << MSG::INFO << "Constructing local HEC geometry helper " << endreq;
+         *m_log << MSG::INFO << "Constructing local HEC geometry helper " << endmsg;
          *m_log << MSG::DEBUG<< " detectorKey: "<<detectorKey<<" detectorNode: "<<detectorNode<<std::endl;
       }
 
@@ -309,11 +314,11 @@ double deadZone(double locx, double locy, double /*rot*/=0)
   
          double locy, locx;
          if(m_isX) {
-	    locy = fabs(pinLocal.x()/CLHEP::mm);
-	    locx = pinLocal.y()/CLHEP::mm;
+	    locy = fabs(pinLocal.x()/Units::mm);
+	    locx = pinLocal.y()/Units::mm;
 	 } else {
-	    locy = fabs(pinLocal.y()/CLHEP::mm);
-	    locx = pinLocal.x()/CLHEP::mm;
+	    locy = fabs(pinLocal.y()/Units::mm);
+	    locx = pinLocal.x()/Units::mm;
 	 }
          // Add shift is needed (absorber)
          locy += locyadd;
@@ -390,7 +395,7 @@ double deadZone(double locx, double locy, double /*rot*/=0)
 
       } else {  // Calculate dead ID
 
-//        if(m_log) *m_log << MSG::DEBUG << "Local geometry DM Id " << endreq;
+//        if(m_log) *m_log << MSG::DEBUG << "Local geometry DM Id " << endmsg;
 
          LArG4Identifier result = LArG4Identifier();
 
@@ -401,26 +406,26 @@ double deadZone(double locx, double locy, double /*rot*/=0)
         // Copy number
         G4int copyN = theTouchable->GetVolume(0)->GetCopyNo();
         double locy, locx, locz, abslocz;
-	locz = pinLocal.z()/CLHEP::mm;
+	locz = pinLocal.z()/Units::mm;
 	abslocz = fabs(locz);
         if(m_isX) {
-	    locy = fabs(pinLocal.x()/CLHEP::mm);
-	    locx = pinLocal.y()/CLHEP::mm;
+	    locy = fabs(pinLocal.x()/Units::mm);
+	    locx = pinLocal.y()/Units::mm;
 	} else {
-	    locy = fabs(pinLocal.y()/CLHEP::mm);
-	    locx = pinLocal.x()/CLHEP::mm;
+	    locy = fabs(pinLocal.y()/Units::mm);
+	    locx = pinLocal.x()/Units::mm;
 	}
 
 	if(copyN == 16969) { // Mother volume (should not be)
-	   if(m_log) *m_log << MSG::WARNING << "Wrong Local geometry DM volume: HEC mother, default ID used" <<endreq;
+	   if(m_log) *m_log << MSG::WARNING << "Wrong Local geometry DM volume: HEC mother, default ID used" <<endmsg;
 	   G4double phi = p.phi();
 	   if (phi < 0) phi += 2*M_PI;
-	   phiBin = int(32*phi/(2*M_PI));
+	   phiBin = int(phi*(32/(2*M_PI)));
 	   G4double eta = fabs( p.pseudoRapidity() );
 	   etaBin =  int(eta/0.1);
 	} else if (copyN <= 32) { // HEC::Module
-//	   double locz = fabs(pinLocal.z()/CLHEP::mm);
-//	   double locy = fabs(pinLocal.y()/CLHEP::mm);
+//	   double locz = fabs(pinLocal.z()/Units::mm);
+//	   double locy = fabs(pinLocal.y()/Units::mm);
 	   if(zSide<0) {
 	      if(copyN-1<16) copyModule = abs(copyN - 1 - 15); else copyModule = 47 - (copyN - 1);
 	   } else {
@@ -458,8 +463,8 @@ double deadZone(double locx, double locy, double /*rot*/=0)
 //	      etaBin = 13 - binSearchAll(locy, 0);
 	      etaBin = 16 - binSearchAll(locy, 3, true);
 	   } else {
-//	   sampling = localSampling(pinLocal.z()/CLHEP::mm);
-  	      double distance = deadZone(fabs(pinLocal.x()/CLHEP::mm),locy);
+//	   sampling = localSampling(pinLocal.z()/Units::mm);
+  	      double distance = deadZone(fabs(pinLocal.x()/Units::mm),locy);
 	      if(distance > deadzone) { // We should return the inactive Id !!!!
 #ifdef DEBUG_HEC_OLD_DIAGNOSTIC
 	         std::cout<<"inactive Id"<<std::endl;
@@ -561,8 +566,8 @@ double deadZone(double locx, double locy, double /*rot*/=0)
 	   type = 1;
            sampling = 2;
            region = 3;
-//	   etaBin = 13 - binSearchAll(fabs(pinLocal.y()/CLHEP::mm), 0);
-//	   etaBin = 16 - binSearchAll(fabs(pinLocal.y()/CLHEP::mm), 0, true);
+//	   etaBin = 13 - binSearchAll(fabs(pinLocal.y()/Units::mm), 0);
+//	   etaBin = 16 - binSearchAll(fabs(pinLocal.y()/Units::mm), 0, true);
 	   etaBin = 16 - binSearchAll(locy, 0, true);
 	   if( etaBin < 0 ) etaBin = 0;
 	} else if (copyN==51 ) { // First Absorber  - interwheel gap
@@ -582,8 +587,8 @@ double deadZone(double locx, double locy, double /*rot*/=0)
 	   type = 1;
            sampling = 2;
            region = 4;
-//	   etaBin = 13 - binSearchAll(fabs(pinLocal.y()/CLHEP::mm), 0);
-//	   etaBin = 16 - binSearchAll(fabs(pinLocal.y()/CLHEP::mm), 3, true);
+//	   etaBin = 13 - binSearchAll(fabs(pinLocal.y()/Units::mm), 0);
+//	   etaBin = 16 - binSearchAll(fabs(pinLocal.y()/Units::mm), 3, true);
 	   etaBin = 16 - binSearchAll(locy, 3, true);
 	} else if (copyN>=100  && copyN<= 106 ) { //Depth
 	   copyModule = theTouchable->GetVolume(1)->GetCopyNo() - 1;
@@ -598,7 +603,7 @@ double deadZone(double locx, double locy, double /*rot*/=0)
            } else {
                    if(zSide * pinLocal.x() > 0) ++phiBin;
            }
-	   double locy = fabs(pinLocal.y()/CLHEP::mm);
+	   double locy = fabs(pinLocal.y()/Units::mm);
 	   */
 	   if(copyN==100 && locz < -depthSize[0]/2. + firstAbsorber[0]) { // in front of HEC
 	      type = 1;