CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
12 public:
13 
15  Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size) : firstDigi_(row, col), data_((size & 0x7fff)) { }
16  Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold) : firstDigi_(row, col), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) { }
17  Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size) : firstDigi_(firstDigi), data_((size & 0x7fff)) { }
18  Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size, unsigned int threshold) : firstDigi_(firstDigi), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) { }
19 
20  const Phase2TrackerDigi& firstDigi() const { return firstDigi_; }
21  unsigned int firstStrip() const { return firstDigi_.strip(); }
22  unsigned int firstRow() const { return firstDigi_.row(); }
23  unsigned int edge() const { return firstDigi_.edge(); }
24  unsigned int column() const { return firstDigi_.column(); }
25  uint16_t size() const { return (data_ & 0x7fff); }
26  uint16_t threshold() const { return ((data_ >> 15) & 0x1); }
27  float center() const { return firstStrip() + (data_ & 0x7fff) / 2.; }
28  std::pair< float, float > barycenter() const { return std::make_pair(column(), center()); }
29 
30 private:
31 
33  uint16_t data_;
34 
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
edmNew::DetSetVector< Phase2TrackerCluster1D > Phase2TrackerCluster1DCollectionNew
std::pair< float, float > barycenter() const
unsigned int firstStrip() const
unsigned int firstRow() const
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
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
Phase2TrackerCluster1D(const Phase2TrackerDigi &firstDigi, unsigned int size, unsigned int threshold)
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size)
int col
Definition: cuy.py:1008
unsigned int strip() const
const Phase2TrackerDigi & firstDigi() const