00001 #ifndef CLUSTERSUMMARY_CLUSTERVARIABLES_H 00002 #define CLUSTERSUMMARY_CLUSTERVARIABLES_H 00003 00004 00005 #include "FWCore/Framework/interface/Frameworkfwd.h" 00006 00007 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h" 00008 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h" 00009 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h" 00010 #include "DataFormats/Common/interface/DetSetVectorNew.h" 00011 #include <numeric> 00012 00013 class ClusterVariables { 00014 00015 public: 00016 00017 ClusterVariables(){}; 00018 ~ClusterVariables(){}; 00019 00020 ClusterVariables(const SiStripCluster& cluster): cluster_ptr(&cluster){} 00021 00022 00023 const SiStripCluster * cluster() const {return cluster_ptr;} 00024 00025 /* 00026 Returns the number of strips in the Cluster 00027 */ 00028 const unsigned clusterSize() const {return cluster()->amplitudes().size();} 00029 00030 00031 const std::vector<uint8_t>& stripCharges() const {return cluster()->amplitudes();} 00032 00033 /* 00034 Returns the total charge of all the strips in the Cluster 00035 */ 00036 uint16_t charge() const {return accumulate( stripCharges().begin(), stripCharges().end(), uint16_t(0));} 00037 00038 00039 private: 00040 00041 const SiStripCluster* cluster_ptr; 00042 00043 }; 00044 00045 #endif