CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/SiStripCluster/interface/SiStripCluster.h

Go to the documentation of this file.
00001 #ifndef DATAFORMATS_SISTRIPCLUSTER_H
00002 #define DATAFORMATS_SISTRIPCLUSTER_H
00003 
00004 //#include "DataFormats/Common/interface/traits.h"
00005 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00006 #include <vector>
00007 
00008 class SiStripCluster  /*: public edm::DoNotSortUponInsertion*/ {
00009 public:
00010 
00011   typedef std::vector<SiStripDigi>::const_iterator   SiStripDigiIter;
00012   typedef std::pair<SiStripDigiIter,SiStripDigiIter>   SiStripDigiRange;
00013 
00018   SiStripCluster() : detId_(0) {}
00019 
00020   SiStripCluster( uint32_t detid, const SiStripDigiRange& range);
00021 
00022   SiStripCluster(const uint32_t& detid, 
00023                  const uint16_t& firstStrip, 
00024                  std::vector<uint16_t>::const_iterator begin, 
00025                  std::vector<uint16_t>::const_iterator end );
00026 
00029   uint16_t firstStrip() const {return firstStrip_;}
00030 
00035   uint32_t geographicalId() const {return detId_;}
00036 
00048   const std::vector<uint8_t>&  amplitudes() const {return amplitudes_;}
00049 
00053   float barycenter() const;
00054 
00055 private:
00056 
00057   uint32_t                detId_;
00058   uint16_t                firstStrip_;
00059   std::vector<uint8_t>   amplitudes_;
00060 };
00061 
00062 // Comparison operators
00063 inline bool operator<( const SiStripCluster& one, const SiStripCluster& other) {
00064   if(one.geographicalId() == other.geographicalId()) {
00065     return one.firstStrip() < other.firstStrip();
00066   }
00067   return one.geographicalId() < other.geographicalId();
00068 } 
00069 
00070 inline bool operator<(const SiStripCluster& cluster, const uint32_t& detid) {
00071   return cluster.geographicalId() < detid;
00072 } 
00073 
00074 inline bool operator<(const uint32_t& detid,const SiStripCluster& cluster) {
00075   return detid < cluster.geographicalId();
00076 } 
00077 
00078 inline bool operator<(const SiStripCluster& cluster, const uint16_t& firstStrip) {
00079   return cluster.firstStrip() < firstStrip;
00080 } 
00081 
00082 inline bool operator<(const uint16_t& firstStrip,const SiStripCluster& cluster) {
00083   return firstStrip < cluster.firstStrip();
00084 } 
00085 #endif // DATAFORMATS_SISTRIPCLUSTER_H