Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:33

0001 #ifndef SiPixelDetSummary_h
0002 #define SiPixelDetSummary_h
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 
0006 #include <sstream>
0007 #include <map>
0008 #include <cmath>
0009 #include <iomanip>
0010 #include <iostream>
0011 
0012 /**
0013  * @class SiPixelDetSummary
0014  * @author Urs Langenegger, using SiStripDetSummary
0015  * @date 2010/05/04
0016  * Class to compute and print pixel detector summary information
0017  *
0018  * If values are passed together with DetIds (method add( detId, value)), it computes the mean value and
0019  * rms of a given quantity and is able to print a summary divided by layer/disk for each subdetector. <br>
0020  * If instead only DetIds are passed (method add( detId )), it prints the count divided by layer/disk for
0021  * each subdetector. <br>
0022  * <br>
0023  */
0024 
0025 class SiPixelDetSummary {
0026 public:
0027   SiPixelDetSummary(int verbose = 0);
0028 
0029   void add(const DetId &detid, const float &value);
0030   void add(const DetId &detid);
0031 
0032   void print(std::stringstream &ss, const bool mean = true) const;
0033 
0034   std::map<int, int> getCounts() { return fCountMap; }
0035 
0036 protected:
0037   std::map<int, double> fMeanMap;
0038   std::map<int, double> fRmsMap;
0039   std::map<int, int> fCountMap;
0040   bool fComputeMean;
0041   int fVerbose;
0042 };
0043 
0044 #endif