testdockerwcsim / XTriggerApplication

Other
2 stars 3 forks source link

Smarter looping over triggered hits #65

Open tdealtry opened 4 years ago

tdealtry commented 4 years ago

SubSamples are time ordered in most use cases, so instead of having

  /// Stores the trigger readout windows each hit is associated with
  std::vector<std::vector<int> > m_trigger_readout_windows;
  /// Is each hit masked from future trigger decisions?
  std::vector<bool> m_masked;

And having to loop over the entire SubSample to find hits to use in reconstruction, hits to write out, hits that are masked from triggers etc, we could instead have

/// Stores the first and last hit number associated with a trigger readout window
std::vector<std::pair<int, int> > m_trigger_readout_window_ids;
/// Something similar for masking

So we can focus our loops on the interesting hits.

m_first_unique made me think of this improvement. So that is a starting point. But it's not as simple as for that case because in DataOut we need to make sure hits are not associated with more than 1 trigger

tdealtry commented 4 years ago

Having a "which SubSample(s) are included in this trigger" variable in TriggerInfo will also help increase the efficiency of the loops