CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Phase2TrackerCluster1D.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_PHASE2TRACKERCLUSTER_PHASE2TRACKERCLUSTER1D_H
2 #define DATAFORMATS_PHASE2TRACKERCLUSTER_PHASE2TRACKERCLUSTER1D_H
3 
4 #include <cstdint>
5 
7 
9 
11 public:
13  Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size)
14  : firstDigi_(row, col), data_((size & 0x7fff)) {}
15  Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold)
16  : firstDigi_(row, col), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {}
18  : firstDigi_(firstDigi), data_((size & 0x7fff)) {}
19  Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size, unsigned int threshold)
20  : firstDigi_(firstDigi), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {}
21 
22  const Phase2TrackerDigi& firstDigi() const { return firstDigi_; }
23  unsigned int firstStrip() const { return firstDigi_.strip(); }
24  unsigned int firstRow() const { return firstDigi_.row(); }
25  unsigned int edge() const { return firstDigi_.edge(); }
26  unsigned int column() const { return firstDigi_.column(); }
27  uint16_t size() const { return (data_ & 0x7fff); }
28  uint16_t threshold() const { return ((data_ >> 15) & 0x1); }
29  float center() const { return float(firstStrip()) + 0.5f * size(); }
30  std::pair<float, float> barycenter() const { return std::make_pair(column(), center()); }
31 
32 private:
34  uint16_t data_;
35 };
36 
37 inline bool operator<(const Phase2TrackerCluster1D& one, const Phase2TrackerCluster1D& other) {
38  return one.firstStrip() < other.firstStrip();
39 }
40 
42 
43 #endif
unsigned int column() const
unsigned int row() const
unsigned int edge() const
unsigned int firstStrip() const
edmNew::DetSetVector< Phase2TrackerCluster1D > Phase2TrackerCluster1DCollectionNew
unsigned int firstRow() const
Phase2TrackerCluster1D(const Phase2TrackerDigi &firstDigi, unsigned int size)
unsigned int column() const
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold)
unsigned int edge() const
bool operator<(DTCELinkId const &lhs, DTCELinkId const &rhs)
Definition: DTCELinkId.h:70
Phase2TrackerCluster1D(const Phase2TrackerDigi &firstDigi, unsigned int size, unsigned int threshold)
std::pair< float, float > barycenter() const
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size)
int col
Definition: cuy.py:1009
unsigned int strip() const
const Phase2TrackerDigi & firstDigi() const