CMS 3D CMS Logo

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