90 likes | 179 Vues
This study by Paul Balm examines the muon reconstruction process, including segment building and track fitting algorithms. Detailed recommendations for optimization are provided based on performance analysis, highlighting areas for potential speed enhancements. The conclusions summarize the processing times for various components, showcasing significant improvements in efficiency.
E N D
Profiling muon reco t139 Paul Balm April 12, 2001
Outline • Looked at • segmentreco, Combinatorial alg • muo_trackreco, Fit alg (max 6 iters) • Measurement details • t01.39.00-maxopt on d0mino • head version of muo_hit • single muons with 1.1 minbias (1000 evts) • jobs run in batch Paul Balm
Combi seg alg • CombinatorialSegmentBuilder::getSegments(PDTHitCollection, MDT..., MSC...) 15.4ms • 13.1 ms - MuoSegmentAlgCombi::findSegments(MuoHitCollection) • ~2.5 ms - conversion to MuoHitCollection • MuoSegmentAlgCombi::findSegments(MuoHitCollection) takes 13.1 ms and calls • 12.6 - createSegments(LocalWireHitVec) • 0.2 - createLocalHits • 0.2 - matchSegments • MuoSegmentAlgCombi::createSegments(LocalWireHitVec) takes 12.6 ms and calls • 10.1 - createSegments4Planes • 2.5 - cleanSegments • MuoSegmentAlgCombi::createSegments4Planes takes 10.1 ms and calls • 6.0 - MuoLocalSegment::addHit • 1.7 - MuoLocalSegment::fit • 0.6 - MuoLocalSegment::~MuoLocalSegment • 0.7 - MuoSegmentAlgCombi::createRoads Paul Balm
Combi seg alg (2) • MuoLocalSegment::addHit takes 6.0 ms and calls • 2.3 - LocalPoint(MuoLocalSegment, LocalWireHit) • 2.1 - new & delete • 0.4 - LocalPoint::onTrack • MuoSegmentAlgCombi::cleanSegments takes 2.5 ms and calls • 2.5 - LocalSegment::intersect(LocalSegment) • MuoLocalSegment::intersect takes 2.4 ms (it's not just called by cleanSegments) and calls • 1.7 - MuoIndex::operator== Paul Balm
RecommedationsCombinatorialSegBuilder • Recommendations for CombinatorialSegmentBuilder • the new&delete in MuoLocalSegment::addHit look like they could be removed • MuoLocalSegment::intersect does a lot of comparing MuoIndices. If that’s really necessary, speed up the comparison? • conversion SegmentCollection to MuoSegmentVector takes 2.5 ms Paul Balm
MuoTrackAlgFit • MuoTrackAlgFit::findTracks(SegmentCollection) takes 132.9 ms and calls • ~0 ms/event - conversion to MuoSegmentVector • 132.9 ms/event - findTracks(MuoSegmentVector) • MuoTrackAlgFit::findTracks(MuoSegmentVector) takes 132.9 ms and calls • 132.9 - MuoTrackAlgFit::findTracks( pair<MuoSegmentVector, MuoTrackVector> ) • ~0 - groupSegments • MuoTrackAlgFit::findTracks( pair<MuoSegmentVector, MuoTrackVector> ) takes 132.9 ms and calls • 132.7 - SegmentFit::fit(Estimation, TrackParameters, vector<double> ) • 0.2 - computeEstimation • SegmentFit::fit(Estimation, TrackParameters, vector<double> ) takes 132.7 ms and calls • 127.6 - NonLinearFitter::doFit(Estimation, Matrix) • 4.9 - BackTrack::ParPropagate(TrackParameters, doubles) Paul Balm
MuoTrackAlgFit (2) • NonLinearFitter::doFit(Estimation, Matrix) takes 127.6 ms and calls • 105.4 - NonLinearFitter::Derivative(Matrix, Matrix) • 21.1 - NonLinearFitter::ParPropagate(Matrix, double double double) • NonLinearFitter::Derivative(Matrix, Matrix) takes 105.8 ms and calls • 104.6 - NonLinearFitter::ParPropagate(Matrix, double double double) • NonLinearFitter::ParPropagate(Matrix, doubles…) takes 125.9 and calls • 125.6 - BackTrack::Propagate(TrackParameters, doubles...) • BackTrack::Propagate(TrackParameters, doubles...) takes 125.6 ms and calls • 85.8 - MagFieldPropagator::magFieldPropagator(TrackParameters, double) • 24.4 - Toroid::inToroidLoc • 3.7 - CartesianPoint constructors • M.F.Prop.::magFieldPropagator(TrackParameters, double) takes 85.8ms and calls • 22.1 - doStep(TrackParameters, SpaceVector) • 17.1 - SwapXYZ::apply with SpacePoint: 8.3, with SpaceVector: 4.7 • 3.9 - MagFieldTrack::fieldTrack • 8.5 - SpacePoint unit()= 7.5 and mag() = 1.0 Paul Balm
RecommendationsMuoTrackAlgFit • 13 ms/event used by SwapXYZ::apply is spent in SpacePoint/Vector c’tors/d’tors - 10 ms/event in total • caching the return values of unit() and mag() of SpacePoint (only if the methods are being called on the same SpacePoint more than once) • It’s all in the SpacePoints Paul Balm
Conclusions • L3 unpacking: 4 ms/event • CombinatorialSegmentBuilder: 15 ms/event • LinkedListSegmentBuilder: 32 ms/event • MuoTrackAlgFit (max 6 iters): 133 ms/event (first estimate “instantaneous”) • Overall: We’ve become pretty fast! Paul Balm