CMS 3D CMS Logo

SiStripDetSummary.h
Go to the documentation of this file.
1 #ifndef SiStripDetSummary_h
2 #define SiStripDetSummary_h
3 
5 class TrackerTopology;
6 
7 #include <sstream>
8 #include <map>
9 #include <cmath>
10 #include <iomanip>
11 #include <iostream>
12 
29 {
30 public:
32  {
33  // Initialize valueMap_ with zeros
34  // WARNING: this initialization is strongly connected with how the map is filled in the add method
35  // TIB: layers = 4, stereo = the first 2
36  // TOB: layers = 6, stereo = the first 2
37  // TEC: wheels = 9, stereo = 9
38  // TID: wheels = 3, stereo = 3
39  unsigned int layers[] = {4, 6, 9, 3};
40  unsigned int stereo[] = {2, 2, 9, 3};
41  Values initValues;
42  for( unsigned int subDet = 0; subDet < 4; ++subDet ) {
43  // Layers start from 1
44  for( unsigned int layer = 1; layer <= layers[subDet]; ++layer ) {
45  valueMap_[1000*(subDet+1)+layer*10] = initValues;
46  if( layer <= stereo[subDet] ) valueMap_[1000*(subDet+1)+layer*10+1] = initValues;
47  }
48  }
49  }
50 
52  void add(DetId detid, float value);
54  inline void add(DetId detid)
55  {
56  computeMean_ = false;
57  add( detid, 0 );
58  }
59 
64  void print(std::stringstream& ss, const bool mean = true) const;
65 
66  struct Values
67  {
68  Values() : mean(0.), rms(0.), count(0) {}
69  double mean;
70  double rms;
71  unsigned int count;
72  };
73  std::map<unsigned int, Values> getCounts()
74  {
75  return valueMap_;
76  }
77 protected:
78  // Maps to store the value and the counts
79  std::map<unsigned int, Values> valueMap_;
81 private:
83 };
84 
85 #endif
std::map< unsigned int, Values > getCounts()
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::map< unsigned int, Values > valueMap_
const TrackerTopology * trackerTopo_
SiStripDetSummary(const TrackerTopology *tTopo)
void add(DetId detid, float value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
Definition: value.py:1
void add(DetId detid)
Used to compute the number of entries divided by subdetector, layer and mono/stereo.
void print(std::stringstream &ss, const bool mean=true) const
Definition: DetId.h:18