MuonReadoutGeometryR4: Speed up handling of tube transforms.
MuonReadoutGeometryR4: Speed up handling of tube transforms. Calling toTubeFrame is expensive, since it needs to walk over all children until it gets to the desired value. Hence, calling toTubeFrame from within a loop over tubes is an N^2 operation. Further, MdtReadoutElement::initElement() was calling toTubeFrame multiple times for each tube. This is especially painful in a debug build, where Eigen matrix operations are very slow. Speed up by using GeoVolumeCursor to change from the nested O(N^2) iteration to a single O(N) iteration, and only evaluate the transform once per tube. Also fix a logic error the prevented the layer-to-layer pitch test from executing.
Showing
- MuonSpectrometer/MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtTubeLayer.h 4 additions, 1 deletion...uonReadoutGeometryR4/MuonReadoutGeometryR4/MdtTubeLayer.h
- MuonSpectrometer/MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx 11 additions, 4 deletions...nDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx
- MuonSpectrometer/MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtTubeLayer.cxx 3 additions, 0 deletions...I/MuonDetDescr/MuonReadoutGeometryR4/src/MdtTubeLayer.cxx
Please register or sign in to comment