Skip to content
Snippets Groups Projects

MuonMDT_CnvTools: Speed up handling of dead tubes.

Merged Scott Snyder requested to merge ssnyder/athena:deadTubes.MuonMDT_CnvTools-20190714 into master

The search for dead tubes was like this:

for(int layer = 1; layer <= mydetEl->getNLayers(); layer++){ for(int tube = 1; tube <= mydetEl->getNtubesperlayer(); tube++){ bool tubefound = false; for(unsigned int kk=0; kk < cv->getNChildVols(); kk++) { int tubegeo = cv->getIdOfChildVol(kk) % 100; int layergeo = ( cv->getIdOfChildVol(kk) - tubegeo ) / 100; if( tubegeo == tube && layergeo == layer ) { tubefound=true; break; }

However, getNChildVols() and getIdOfChildVol() are both O(N) operations, requiring a walk of the geo graph. Further, geomodel will maintain the transform while it does so, resulting in many calls to Eigen. And Eigen is much, much, much slower in debug builds than in optimized builds. The upshot is that in debug builds, this code was taking several minutes.

Rewrite using geoGetIds so that we only need to traverse the geo graph once (well, twice actually, since i left in the initial check on getNChildVols) and so we don't need to do matrix arithmetic during this traversal.

Merge request reports

Pipeline #976252 passed

Pipeline passed for faa93740 on ssnyder:deadTubes.MuonMDT_CnvTools-20190714

Approval is optional

Merged by Edward MoyseEdward Moyse 5 years ago (Jul 15, 2019 1:29pm UTC)

Merge details

  • Changes merged into master with 3d8cc7d6.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading