CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/DataFormats/FP420Cluster/interface/ClusterFP420.h

Go to the documentation of this file.
00001 #ifndef ClusterFP420_h
00002 #define ClusterFP420_h
00003 
00004 #include <vector>
00005 class HDigiFP420;
00006 
00007 class ClusterFP420 {
00008 public:
00009 
00010   typedef std::vector<HDigiFP420>::const_iterator   HDigiFP420Iter;
00011   typedef std::pair<HDigiFP420Iter,HDigiFP420Iter>   HDigiFP420Range;
00012 
00013   //ClusterFP420() : detId_(0) , xytype_(0) {}
00014   ClusterFP420() : detId_(0)  {}
00015 
00016   //The range is assumed to be non-empty.
00017   ClusterFP420( unsigned int, unsigned int, const HDigiFP420Range&, float&, float&);
00018   //  ClusterFP420( unsigned int detid, const HDigiFP420Range& range, float& cog, float& err);// work also
00019 
00020   // number of the first strip in the cluster
00021   short firstStrip() const {return firstStrip_;}
00022 
00023   //global ID of the corresponding DetUnit --> iu index
00024   unsigned int globalId() const {return detId_;}
00025 
00026   // since xytype=2 all the time, no sense to record it into collection, so do comment the next line:
00027   //unsigned int globalType() const {return xytype_;}
00028 
00029   const std::vector<short>&  amplitudes() const {return amplitudes_;}
00030 
00031   float barycenter() const {return barycenter_;}
00032   float barycerror() const {return barycerror_;}
00033 
00034   float barycenterW() const {return barycenterW_;}
00035   float barycerrorW() const {return barycerrorW_;}
00036 
00037 private:
00038 
00039   unsigned int           detId_;
00040   //  unsigned int           xytype_;
00041   short                firstStrip_;
00042   std::vector<short>   amplitudes_;
00043   float                barycenter_;
00044   float                barycerror_;
00045   float                barycenterW_;
00046   float                barycerrorW_;
00047 
00048 
00049 };
00050 
00051 // Comparison operators
00052 inline bool operator<( const ClusterFP420& one, const ClusterFP420& other) {
00053   if(one.globalId() == other.globalId()) {
00054     return one.firstStrip() < other.firstStrip();
00055   }
00056   return one.globalId() < other.globalId();
00057 } 
00058 #endif