CMS 3D CMS Logo

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