From b67740fdc3e18fd300dc7caa81f68b00786830ff Mon Sep 17 00:00:00 2001 From: Whitney Armstrong Date: Tue, 19 Jan 2021 18:09:50 -0600 Subject: [PATCH] Debugging acts geometry Something that runs... modified: src/SiTrackerEndcap_geo.cpp modified: topside/silicon_tracker.xml modified: topside/silicon_tracker.xml --- src/SiTrackerBarrel2_geo.cpp | 2 +- src/SiTrackerBarrel_geo.cpp | 11 ++++++----- src/SiTrackerEndcap_geo.cpp | 12 ++++++------ src/SiVertexBarrel.cpp | 2 +- topside/display.xml | 15 +++++++++++++-- topside/silicon_tracker.xml | 31 ++++++++++++------------------- 6 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/SiTrackerBarrel2_geo.cpp b/src/SiTrackerBarrel2_geo.cpp index f678a61..4150c96 100644 --- a/src/SiTrackerBarrel2_geo.cpp +++ b/src/SiTrackerBarrel2_geo.cpp @@ -26,7 +26,7 @@ #include "Acts/Surfaces/PlanarBounds.hpp" #include "Acts/Surfaces/RectangleBounds.hpp" #include "Acts/Surfaces/TrapezoidBounds.hpp" -#include "Acts/Utilities/Units.hpp" +#include "Acts/Definitions/Units.hpp" using namespace std; diff --git a/src/SiTrackerBarrel_geo.cpp b/src/SiTrackerBarrel_geo.cpp index 12ea19e..71348b8 100644 --- a/src/SiTrackerBarrel_geo.cpp +++ b/src/SiTrackerBarrel_geo.cpp @@ -35,7 +35,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s xml_comp_t x_mod = mi; xml_comp_t m_env = x_mod.child(_U(module_envelope)); string m_nam = x_mod.nameStr(); - Volume m_vol(m_nam, Box(m_env.width() / 2, m_env.length() / 2, m_env.thickness() / 2), air); + Volume m_vol(m_nam, Box(m_env.thickness() / 2,m_env.width() / 2, m_env.length() / 2 ), air); int ncomponents = 0, sensor_number = 1; if (volumes.find(m_nam) != volumes.end()) { @@ -49,7 +49,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s xml_comp_t x_pos = x_comp.position(false); xml_comp_t x_rot = x_comp.rotation(false); string c_nam = _toString(ncomponents, "component%d"); - Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); + Box c_box(x_comp.thickness() / 2, x_comp.width() / 2 ,x_comp.length() / 2 ); Volume c_vol(c_nam, c_box, description.material(x_comp.materialStr())); if (x_pos && x_rot) { @@ -99,6 +99,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s Acts::ActsExtension* layerExtension = new Acts::ActsExtension(); layerExtension->addType("sensitive cylinder", "layer"); + //layerExtension->addValue(10. * Acts::UnitConstants::mm, "r", "envelope"); lay_elt.addExtension(layerExtension); Placements& sensVols = sensitives[m_nam]; @@ -127,7 +128,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // tr(RotationZYX(0,-((M_PI/2)-phic-phi_tilt),M_PI/2),Position(x,y,module_z)); // NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the // outside - Transform3D tr(RotationZYX(0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), Position(x, y, module_z)); + Transform3D tr(RotationZYX(phic - phi_tilt,0, 0), Position(x, y, module_z)); pv = lay_vol.placeVolume(m_env, tr); pv.addPhysVolID("module", module); @@ -136,7 +137,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s PlacedVolume sens_pv = sensVols[ic]; DetElement comp_elt(mod_elt, sens_pv.volume().name(), module); comp_elt.setPlacement(sens_pv); - Acts::ActsExtension* moduleExtension = new Acts::ActsExtension(); + Acts::ActsExtension* moduleExtension = new Acts::ActsExtension("YZX"); comp_elt.addExtension(moduleExtension); } @@ -166,7 +167,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s assembly.setVisAttributes(description.invisible()); pv = description.pickMotherVolume(sdet).placeVolume(assembly); pv.addPhysVolID("system", det_id); // Set the subdetector system ID. - pv.addPhysVolID("barrel", 0); // Flag this as a barrel subdetector. + pv.addPhysVolID("barrel", 1); // Flag this as a barrel subdetector. sdet.setPlacement(pv); return sdet; } diff --git a/src/SiTrackerEndcap_geo.cpp b/src/SiTrackerEndcap_geo.cpp index 602f994..41bc90f 100644 --- a/src/SiTrackerEndcap_geo.cpp +++ b/src/SiTrackerEndcap_geo.cpp @@ -18,11 +18,10 @@ #include #include "Acts/Plugins/DD4hep/ActsExtension.hpp" -//#include "Acts/Definitions/Units.hpp" -#include "Acts/Surfaces/PlanarBounds.hpp" -#include "Acts/Surfaces/RectangleBounds.hpp" -#include "Acts/Surfaces/TrapezoidBounds.hpp" -#include "Acts/Utilities/Units.hpp" +//#include "Acts/Surfaces/PlanarBounds.hpp" +//#include "Acts/Surfaces/RectangleBounds.hpp" +//#include "Acts/Surfaces/TrapezoidBounds.hpp" +#include "Acts/Definitions/Units.hpp" using namespace std; using namespace dd4hep; @@ -107,7 +106,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s double layer_rmax = l_env.attr(_Unicode(rmax)); double layer_length = l_env.attr(_Unicode(length)); double layer_zstart = l_env.attr(_Unicode(zstart)); - std::cout << "SiTracker Endcap layer " << l_id << " zstart = " << layer_zstart/dd4hep::mm << "mm ( " << layer_length/dd4hep::mm << " mm thick )\n"; + //printout(INFO,"ROOTGDMLParse","+++ Read geometry from GDML file file:%s",input.c_str()); + //std::cout << "SiTracker Endcap layer " << l_id << " zstart = " << layer_zstart/dd4hep::mm << "mm ( " << layer_length/dd4hep::mm << " mm thick )\n"; //Assembly layer_assembly(layer_name); //assembly.placeVolume(layer_assembly); diff --git a/src/SiVertexBarrel.cpp b/src/SiVertexBarrel.cpp index c03c602..7fbfdea 100644 --- a/src/SiVertexBarrel.cpp +++ b/src/SiVertexBarrel.cpp @@ -22,7 +22,7 @@ #include "Acts/Surfaces/PlanarBounds.hpp" #include "Acts/Surfaces/RectangleBounds.hpp" #include "Acts/Surfaces/TrapezoidBounds.hpp" -#include "Acts/Utilities/Units.hpp" +#include "Acts/Definitions/Units.hpp" using namespace std; diff --git a/topside/display.xml b/topside/display.xml index 193ab4c..4c5b677 100644 --- a/topside/display.xml +++ b/topside/display.xml @@ -1,17 +1,28 @@ - - + + + + + + + + + + + + + diff --git a/topside/silicon_tracker.xml b/topside/silicon_tracker.xml index 92aac09..c439ddf 100644 --- a/topside/silicon_tracker.xml +++ b/topside/silicon_tracker.xml @@ -123,12 +123,6 @@ - - - - - - @@ -216,7 +210,7 @@ - - - system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16 + + system:8,barrel:2,layer:4,module:12,sensor:2,y:32:-16,z:-16 -- GitLab