Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to SiStripCluster DataFormat: use auto for return types #36852

Merged
merged 1 commit into from Feb 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 11 additions & 12 deletions DataFormats/SiStripCluster/interface/SiStripCluster.h
Expand Up @@ -40,13 +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
* the amplitude is set to zero.
Expand All @@ -58,15 +51,21 @@ 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