From 711a946fb9a0fd1efa5c3e26b247cd96aa939e4f Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Thu, 1 Jul 2021 16:01:34 -0500
Subject: [PATCH] 	modified:   scripts/tutorial2_cell_size.cxx

---
 scripts/tutorial2_cell_size.cxx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/tutorial2_cell_size.cxx b/scripts/tutorial2_cell_size.cxx
index b1f7a8d..f8e0a1a 100644
--- a/scripts/tutorial2_cell_size.cxx
+++ b/scripts/tutorial2_cell_size.cxx
@@ -61,8 +61,8 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
       // **This is the most important part.** It provides a way of getting the
       // geometry information in a flexible way.
       // The segmentation hit postion:
-      auto pos1 = cellid_converter.position(h.cellID);
-      fmt::print("              Hit Position : {},{},{}\n", pos0.x / 10.0, pos0.y / 10.0, pos0.z / 10.0);
+      auto pos1 = cellid_converter.position(h.cellID)/dd4hep::mm;
+      fmt::print("              Hit Position : {},{},{}\n", pos0.x , pos0.y , pos0.z );
       fmt::print("Segmentation-Cell Position : {},{},{}\n", pos1.x(), pos1.y(), pos1.z());
 
       auto context = cellid_converter.findContext( h.cellID ) ;
@@ -71,11 +71,11 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
       auto cell_dim = seg.cellDimensions(h.cellID);
       std::cout << " dim ";
       for(const auto& dim : cell_dim) {
-        std::cout << dim << ", ";
+        std::cout << dim/dd4hep::mm << " mm, ";
       }
       std::cout << "\n";
 
-      result.push_back({pos0.x / 10.0 - pos1.x(), pos0.y / 10.0 - pos1.y()});
+      result.push_back({pos0.x  - pos1.x(), pos0.y  - pos1.y()});
     }
     return result;
   };
@@ -110,7 +110,7 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
                 .Define("x_pos", x_pos, {"xy_hit_pos"})
                 .Define("y_pos", y_pos, {"xy_hit_pos"});
 
-  auto h_local_pos = d1.Histo2D({"h_local_pos", " ;x [cm]; y [cm]", 100, -5.0, 5.0, 100, -5.0, 5.0}, "x_pos", "y_pos");
+  auto h_local_pos = d1.Histo2D({"h_local_pos", " ;x [mm]; y [mm]", 100, -50.0, 50.0, 100, -50.0, 50.0}, "x_pos", "y_pos");
 
   TCanvas* c = new TCanvas();
   h_local_pos->DrawCopy("colz");
-- 
GitLab