Update to the conversion of PrPixelTracking to functional
PrPixelTracking has been converted to a functional algorithm, which required some changes to the way hits were allocated and passed around. This supersedes !269 (closed)
Merge request reports
Activity
24 m_module(0), 25 m_id(0), 26 m_isUsed(false) {} 18 PrPixelHit(const LHCb::LHCbID &id, 19 const float x, const float y, const float z, 20 const float wxerr, const float wyerr, 21 const unsigned int module) : 22 m_x(x), 23 m_y(y), 24 m_z(z), 25 m_wxerr(wxerr), 26 m_wyerr(wyerr), 27 m_module(module), 28 m_id(id) {} 27 29 /// Destructor 28 30 virtual ~PrPixelHit() {} 13 10 class PrPixelModule { 14 11 15 12 public: 16 13 /// Constructor 17 14 PrPixelModule(const unsigned int number, const bool right) 18 : m_lastHitX(-1), 19 m_number(number), 20 m_previous(-1), 21 m_empty(true), 22 m_isRight(right) { 23 reset(); 24 } 15 : m_number(number), 16 m_isRight(right) {} 25 17 /// Destructor 26 18 virtual ~PrPixelModule() {} 579 592 } // loop over all banks 580 593 581 // DO NOT MOVE THIS IN THE ABOVE LOOP IN A FUTILE OPTIMIZATION ATTEMPT! The 582 // pool container could have been resized during clustering in which case 583 // all pointers and iterators would be rendered invalid. We HAVE to do this 584 // here! 585 for (unsigned int i = 0; i < pool.size(); ++i) { 586 auto& hit = pool[i]; 587 modulehits[hit.module()].addHit(&hit); 594 for (size_t module = 0; module < hitsPerModule.size(); ++module) { 595 modulehits[module].hits().reserve(hitsPerModule[module]); 596 } 597 598 if (m_trigger) { 599 // Add hits without channel IDs in trigger mode 600 for (const auto& t : view::zip(pool, xFractions, yFractions)) { @raaij Do you care about making sure all the contianers you pass to the range v3 zip have the same size ? If the vectors have different sizes the zip utility iterates over the lowest common denominator, with no warnings. If the containers absolutely should always have the same sizes, then take a look at the utility methods I added to FunctionalDetails.h in GaudiAlg. This adds a runtime check on the sizes to enforce they are the same.
Also when iterating over the zipped contianer i think you are better of using
const auto&& t
as the type, as the returned tuple is a temporary.Edited by Christopher Rob Jones
mentioned in merge request !269 (closed)
Validation started with lhcb-future#199
Validation started with lhcb-future#200
Validation started with lhcb-future#201
Validation started with lhcb-future#201
Added 1 commit:
- 78c43bf7 - Fixes of base algo class and monitoring enabling after code review by Chris
Added 1 commit:
- c61d55a8 - Fixes of base algo class and monitoring enabling after code review by Chris
Validation started with lhcb-future#202
mentioned in commit 9ff10fee
Mentioned in commit 9ff10fee