CMS 3D CMS Logo

ClusterVariables.h
Go to the documentation of this file.
1 #ifndef CLUSTERSUMMARY_CLUSTERVARIABLES_H
2 #define CLUSTERSUMMARY_CLUSTERVARIABLES_H
3 
5 
10 #include <numeric>
11 
12 // never seen a more useless class...
14 public:
17 
19 
20  const SiStripCluster* cluster() const { return cluster_ptr; }
21 
22  /*
23  Returns the number of strips in the Cluster
24  */
25  const unsigned clusterSize() const { return cluster()->amplitudes().size(); }
26 
27  auto stripCharges() const -> decltype(cluster()->amplitudes()) { return cluster()->amplitudes(); }
28 
29  /*
30  Returns the total charge of all the strips in the Cluster
31  */
32  uint16_t charge() const { return std::accumulate(stripCharges().begin(), stripCharges().end(), uint16_t(0)); }
33 
34 private:
36 };
37 
38 #endif
ClusterVariables(const SiStripCluster &cluster)
const SiStripCluster * cluster_ptr
uint16_t charge() const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
#define end
Definition: vmac.h:39
const SiStripCluster * cluster() const
#define begin
Definition: vmac.h:32
const unsigned clusterSize() const
const std::vector< uint8_t > & amplitudes() const