From 2d7bf073b3f66785ef8d344cb611ba1af133d7a1 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 25 Feb 2015 12:04:59 +0000
Subject: [PATCH] Fix Units in LCIOConversions

---
 DDG4/lcio/LCIOConversions.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/DDG4/lcio/LCIOConversions.cpp b/DDG4/lcio/LCIOConversions.cpp
index 77edb0876..be31bed96 100644
--- a/DDG4/lcio/LCIOConversions.cpp
+++ b/DDG4/lcio/LCIOConversions.cpp
@@ -30,6 +30,8 @@
 #include "UTIL/Operators.h"
 #include "UTIL/ILDConf.h"
 
+#include <G4SystemOfUnits.hh>
+
 using namespace std;
 
 //==================================================================================
@@ -119,16 +121,16 @@ namespace DD4hep {
         const Geant4Tracker::Hit::Contribution& t = hit->truth;
         int trackID = pm->particleID(t.trackID);
         EVENT::MCParticle* lc_mcp = (EVENT::MCParticle*)lc_part->getElementAt(trackID);
-        double pos[3] = {hit->position.x()/mm, hit->position.y()/mm, hit->position.z()/mm};
+        double pos[3] = {hit->position.x()/CLHEP::mm, hit->position.y()/CLHEP::mm, hit->position.z()/CLHEP::mm};
         lcio::SimTrackerHitImpl* lc_hit = new lcio::SimTrackerHitImpl;
         lc_hit->setCellID0((hit->cellID >>    0       ) & 0xFFFFFFFF);
         lc_hit->setCellID1((hit->cellID >> sizeof(int)) & 0xFFFFFFFF);
-        lc_hit->setEDep(hit->energyDeposit/GeV);
-        lc_hit->setPathLength(hit->length/mm);
-        lc_hit->setTime(hit->truth.time/ns);
+        lc_hit->setEDep(hit->energyDeposit/CLHEP::GeV);
+        lc_hit->setPathLength(hit->length/CLHEP::mm);
+        lc_hit->setTime(hit->truth.time/CLHEP::ns);
         lc_hit->setMCParticle(lc_mcp);
         lc_hit->setPosition(pos);
-        lc_hit->setMomentum(hit->momentum.x()/GeV,hit->momentum.y()/GeV,hit->momentum.z()/GeV);
+        lc_hit->setMomentum(hit->momentum.x()/CLHEP::GeV,hit->momentum.y()/CLHEP::GeV,hit->momentum.z()/CLHEP::GeV);
         lc_coll->addElement(lc_hit);
       }
       return lc_coll;
-- 
GitLab