CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripCluster.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_SISTRIPCLUSTER_H
2 #define DATAFORMATS_SISTRIPCLUSTER_H
3 
4 //#include "DataFormats/Common/interface/traits.h"
6 #include <vector>
7 
8 class SiStripCluster /*: public edm::DoNotSortUponInsertion*/ {
9 public:
10 
11  typedef std::vector<SiStripDigi>::const_iterator SiStripDigiIter;
12  typedef std::pair<SiStripDigiIter,SiStripDigiIter> SiStripDigiRange;
13 
19 
20  SiStripCluster( uint32_t detid, const SiStripDigiRange& range);
21 
22  SiStripCluster(const uint32_t& detid,
23  const uint16_t& firstStrip,
24  std::vector<uint16_t>::const_iterator begin,
25  std::vector<uint16_t>::const_iterator end );
26 
29  uint16_t firstStrip() const {return firstStrip_;}
30 
35  uint32_t geographicalId() const {return detId_;}
36 
48  const std::vector<uint8_t>& amplitudes() const {return amplitudes_;}
49 
53  float barycenter() const;
54 
55 private:
56 
57  uint32_t detId_;
58  uint16_t firstStrip_;
59  std::vector<uint8_t> amplitudes_;
60 };
61 
62 // Comparison operators
63 inline bool operator<( const SiStripCluster& one, const SiStripCluster& other) {
64  if(one.geographicalId() == other.geographicalId()) {
65  return one.firstStrip() < other.firstStrip();
66  }
67  return one.geographicalId() < other.geographicalId();
68 }
69 
70 inline bool operator<(const SiStripCluster& cluster, const uint32_t& detid) {
71  return cluster.geographicalId() < detid;
72 }
73 
74 inline bool operator<(const uint32_t& detid,const SiStripCluster& cluster) {
75  return detid < cluster.geographicalId();
76 }
77 
78 inline bool operator<(const SiStripCluster& cluster, const uint16_t& firstStrip) {
79  return cluster.firstStrip() < firstStrip;
80 }
81 
82 inline bool operator<(const uint16_t& firstStrip,const SiStripCluster& cluster) {
83  return firstStrip < cluster.firstStrip();
84 }
85 #endif // DATAFORMATS_SISTRIPCLUSTER_H
std::pair< SiStripDigiIter, SiStripDigiIter > SiStripDigiRange
uint16_t firstStrip() const
uint32_t geographicalId() const
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
float barycenter() const
#define end
Definition: vmac.h:38
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
#define begin
Definition: vmac.h:31
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
const std::vector< uint8_t > & amplitudes() const