Go to the documentation of this file.00001 #ifndef DATAFORMATS_SISTRIPCLUSTER_H
00002 #define DATAFORMATS_SISTRIPCLUSTER_H
00003
00004
00005 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00006 #include <vector>
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008
00009 class SiStripCluster {
00010 public:
00011
00012 typedef std::vector<SiStripDigi>::const_iterator SiStripDigiIter;
00013 typedef std::pair<SiStripDigiIter,SiStripDigiIter> SiStripDigiRange;
00014
00019 SiStripCluster() : detId_(0), error_x( -99999.9 ) {}
00020
00021 SiStripCluster( uint32_t detid, const SiStripDigiRange& range);
00022
00023 SiStripCluster(const uint32_t& detid,
00024 const uint16_t& firstStrip,
00025 std::vector<uint16_t>::const_iterator begin,
00026 std::vector<uint16_t>::const_iterator end );
00027
00030 uint16_t firstStrip() const {return firstStrip_;}
00031
00036 uint32_t geographicalId() const {
00037 if (detId_==0) edm::LogError("Deprecation")<<"this method will give zero offline";
00038 return detId_;
00039 }
00040 void setId(uint32_t id) { detId_=id; }
00041
00053 const std::vector<uint8_t>& amplitudes() const {return amplitudes_;}
00054
00058 float barycenter() const;
00059
00060 float getSplitClusterError () const { return error_x; }
00061 void setSplitClusterError ( float errx ) { error_x = errx; }
00062
00063
00064 private:
00065
00066 uint32_t detId_;
00067 uint16_t firstStrip_;
00068
00069 std::vector<uint8_t> amplitudes_;
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 float error_x;
00080
00081 };
00082
00083
00084 inline bool operator<( const SiStripCluster& one, const SiStripCluster& other) {
00085 if(one.geographicalId() == other.geographicalId()) {
00086 return one.firstStrip() < other.firstStrip();
00087 }
00088 return one.geographicalId() < other.geographicalId();
00089 }
00090
00091 inline bool operator<(const SiStripCluster& cluster, const uint32_t& detid) {
00092 return cluster.geographicalId() < detid;
00093 }
00094
00095 inline bool operator<(const uint32_t& detid,const SiStripCluster& cluster) {
00096 return detid < cluster.geographicalId();
00097 }
00098
00099 inline bool operator<(const SiStripCluster& cluster, const uint16_t& firstStrip) {
00100 return cluster.firstStrip() < firstStrip;
00101 }
00102
00103 inline bool operator<(const uint16_t& firstStrip,const SiStripCluster& cluster) {
00104 return firstStrip < cluster.firstStrip();
00105 }
00106 #endif // DATAFORMATS_SISTRIPCLUSTER_H