Skip to content
Snippets Groups Projects
Commit 711a946f authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: scripts/tutorial2_cell_size.cxx

parent bef6067a
No related branches found
No related tags found
No related merge requests found
Pipeline #12613 failed
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment