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 
45  const std::vector<uint8_t>& amplitudes() const {return amplitudes_;}
46 
50  float barycenter() const;
51 
52 private:
53 
54  uint32_t detId_;
55  uint16_t firstStrip_;
56  std::vector<uint8_t> amplitudes_;
57 };
58 
59 // Comparison operators
60 inline bool operator<( const SiStripCluster& one, const SiStripCluster& other) {
61  if(one.geographicalId() == other.geographicalId()) {
62  return one.firstStrip() < other.firstStrip();
63  }
64  return one.geographicalId() < other.geographicalId();
65 }
66 
67 inline bool operator<(const SiStripCluster& cluster, const uint32_t& detid) {
68  return cluster.geographicalId() < detid;
69 }
70 
71 inline bool operator<(const uint32_t& detid,const SiStripCluster& cluster) {
72  return detid < cluster.geographicalId();
73 }
74 
75 inline bool operator<(const SiStripCluster& cluster, const uint16_t& firstStrip) {
76  return cluster.firstStrip() < firstStrip;
77 }
78 
79 inline bool operator<(const uint16_t& firstStrip,const SiStripCluster& cluster) {
80  return firstStrip < cluster.firstStrip();
81 }
82 #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