Skip to content

Commit

Permalink
Change to SiStripCluster DataFormat: use auto for return types
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Feb 1, 2022
1 parent 9c97405 commit 527187e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions DataFormats/SiStripCluster/interface/SiStripCluster.h
Expand Up @@ -40,12 +40,6 @@ class SiStripCluster {
amplitudes_.insert(amplitudes_.end(), begin, end);
}

/** The number of the first strip in the cluster.
* The high bit of firstStrip_ indicates whether the cluster is a candidate for being merged.
*/
uint16_t firstStrip() const { return firstStrip_ & stripIndexMask; }

uint16_t endStrip() const { return firstStrip() + size(); }

/** The amplitudes of the strips forming the cluster.
* The amplitudes are on consecutive strips; if a strip is missing
Expand All @@ -58,15 +52,22 @@ class SiStripCluster {
* You can find the special meanings of values { 0, 254, 255} in section 3.4.1 of
* http://www.te.rl.ac.uk/esdg/cms-fed/firmware/Documents/FE_FPGA_Technical_Description.pdf
*/
uint8_t const* begin() const { return amplitudes_.data(); }
uint8_t const* end() const { return begin() + size(); }
uint8_t size() const { return amplitudes_.size(); }
uint8_t operator[](int i) const { return *(begin() + i); }
bool empty() const { return 0 == size(); }
auto size() const { return amplitudes_.size(); }
auto const* begin() const { return amplitudes_.data(); }
auto const* end() const { return begin() + size(); }
auto operator[](int i) const { return *(begin() + i); }
bool empty() const { return amplitudes_.empty(); }
bool full() const { return false; }

SiStripCluster const& amplitudes() const { return *this; }

/** The number of the first strip in the cluster.
* The high bit of firstStrip_ indicates whether the cluster is a candidate for being merged.
*/
uint16_t firstStrip() const { return firstStrip_ & stripIndexMask; }
uint16_t endStrip() const { return firstStrip() + size(); }


/** The barycenter of the cluster, not corrected for Lorentz shift;
* should not be used as position estimate for tracking.
*/
Expand Down

0 comments on commit 527187e

Please sign in to comment.