Moved PrPixelTracking to functional
This involved actually a lot of code refactoring. In particular :
- PrPixelStoreClusters algo has been merged into PrPixelTracking (was always used just after it anyway)
- PrPixelMonitor algo has been merged into PrPixelTracking It is not activated by default, and the Property Monitor allows to activate it
- PrPixelHitManager tool was heavily changed in order to drop any state of it. This involved redoing completely the memory allocation, which was heavily optimized. So tests have to be performed to check the efficiency of the new code With this modification, PrPixelTracking is functional but not yet completely thread safe. 2 things are missing :
- thread safe histograms in the monitoring
- usage of derived conditions for the remaining state in the HitManager. These will change only when geometry changes, so almost never. But it still should be properly done
Merge request reports
Activity
Yes, my understanding is that PrPixelTracking decodes clusters internally. PrPixelStoreClusters is needed to create clusters in a format used by the track fit. If you do not fit the tracks, this is not needed. And it would artificially increase the run time of PrPixelTracking. @tnikodem @adudziak Can you confirm?
Validation started with lhcb-future#186
Added 1 commit:
- 3d9d2c7d - Moved PrPixelTracking to functional
Validation started with lhcb-future#187
580 583 // all pointers and iterators would be rendered invalid. We HAVE to do this 581 584 // here! 582 585 for (unsigned int i = 0; i < pool.size(); ++i) { 583 PrPixelHit *hit = &(pool[i]); 584 modulehits[hit->module()].addHit(hit); 586 auto& hit = pool[i]; 587 modulehits[hit.module()].addHit(&hit); 585 588 } 12 12 class PrPixelModuleHits { I suggest to add
final
, i.e.class PrPixelModuleHits final {
Edited by Gerhard Raven
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() {} Why merge the monitoring into the reconstruction algorithm ? This seems a move in the wrong direction to me, we should be aiming to keep the reconstruction algorithms as streamlined as possible and (optionally) run the monitoring in a seperate sequence.
Also note, if you do keep it like this (which i think would be a mistake) you should use GaudiHistoAlg as your base class. GaudiTupleAlg has additional baggage associated to it, for tuples, you aren't using I believe.
Edited by Christopher Rob JonesValidation started with lhcb-future#188
Validation started with lhcb-future#189
Validation started with lhcb-future#190
@jonrob : the merging of the monitoring is exactly trying to stay streamlined ! First you do not need to run the monitoring, you can disable it (actually, it's even disabled by default) via a property called "Monitor". Now when you want to run it, you need some internal state of the tracking that is not stored in the TES. So if you run it as a separate algo, you either have a stateful algorithm (or tool, as it was the case), or you need to store more than before. And you will have to store, as you do not know from inside whether the monitoring algo will be run later or not. With this implementation, only the minimal is stored and you are optimized in all cases. Concerning the base class, I'm not yet completely at easy with all of them, so you are most probably right. I'll fix that next week when I come back.
OK, I am still not completely convinced that this isn't setting a precedence of moving the monitoring into the reconstruction algorithms, which as a general principle I do not like. I will let it drop for now, but I think if we start to see a mass migration of the monitoring from what we currently run in the Moni or Check sequences in brunel, into the algorithms themselves, its something that will need discussing.
A few other small suggestions.
- You don't need to add your m_monitor flag, as the GaudiHistoAlg base class already has a property for this, which you should just reuse via the produceHisto() method.
By default this is on for algorithms using this base clasx, but you change this by running
setProperty( "HistoProduce", false );
in your constructor.
- Also, at the point where you switch in the monitoring, you could use the compiler hint UNLIKELY (Defined in Gaudi somewhere) such that the optimiser knows to optimise the if statement for not being run.
if ( UNLIKELY( produceHisto() ) ) { // do stuff }
Chris