Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:38

0001 #ifndef CondFormats_SiStripObjects_NoiseAnalysis_H
0002 #define CondFormats_SiStripObjects_NoiseAnalysis_H
0003 
0004 #include "CondFormats/SiStripObjects/interface/CommissioningAnalysis.h"
0005 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0006 #include <sstream>
0007 #include <vector>
0008 #include <cstdint>
0009 
0010 /** 
0011     @class NoiseAnalysis
0012     @author M. Wingham, R.Bainbridge
0013     @brief Histogram-based analysis for pedestal run.
0014 */
0015 class NoiseAnalysis : public CommissioningAnalysis {
0016 public:
0017   // ---------- con(de)structors ----------
0018 
0019   NoiseAnalysis(const uint32_t& key);
0020 
0021   NoiseAnalysis();
0022 
0023   ~NoiseAnalysis() override { ; }
0024 
0025   friend class NoiseAlgorithm;
0026 
0027   // ---------- public interface ----------
0028 
0029   /** Identifies if analysis is valid or not. */
0030   bool isValid() const override;
0031 
0032   // Pedestal, noise and raw noise (128-strip vector per APV)
0033   inline const VVFloat& peds() const;
0034   inline const VVFloat& noise() const;
0035   inline const VVFloat& raw() const;
0036 
0037   // Dead and noisy strips (vector per APV)
0038   inline const VVInt& dead() const;
0039   inline const VVInt& noisy() const;
0040 
0041   // Mean and rms spread (value per APV)
0042   inline const VFloat& pedsMean() const;
0043   inline const VFloat& pedsSpread() const;
0044   inline const VFloat& noiseMean() const;
0045   inline const VFloat& noiseSpread() const;
0046   inline const VFloat& rawMean() const;
0047   inline const VFloat& rawSpread() const;
0048 
0049   // Max and min values (value per APV)
0050   inline const VFloat& pedsMax() const;
0051   inline const VFloat& pedsMin() const;
0052   inline const VFloat& noiseMax() const;
0053   inline const VFloat& noiseMin() const;
0054   inline const VFloat& rawMax() const;
0055   inline const VFloat& rawMin() const;
0056 
0057   // ---------- misc ----------
0058 
0059   /** Prints analysis results. */
0060   void print(std::stringstream&, uint32_t apv_number = 0) override;
0061 
0062   /** Overrides base method. */
0063   void summary(std::stringstream&) const override;
0064 
0065   /** Resets analysis member data. */
0066   void reset() override;
0067 
0068   // ---------- private member data ----------
0069 
0070 private:
0071   // VVFloats means: 1 vector per APV, 1 value per strip.
0072 
0073   /** Peds values. */
0074   VVFloat peds_;
0075 
0076   /** Noise values. */
0077   VVFloat noise_;
0078 
0079   /** Raw noise values. */
0080   VVFloat raw_;
0081 
0082   // VVInts means: 1 vector per APV, values are strip numbers.
0083 
0084   /** Dead strips. */
0085   VVInt dead_;
0086 
0087   /** Noisy strips. */
0088   VVInt noisy_;
0089 
0090   // VFloat: 1 value per APV
0091 
0092   /** Mean peds value. */
0093   VFloat pedsMean_;
0094 
0095   /** Rms spread in peds. */
0096   VFloat pedsSpread_;
0097 
0098   /** Mean noise value. */
0099   VFloat noiseMean_;
0100 
0101   /** Rms spread in noise. */
0102   VFloat noiseSpread_;
0103 
0104   /** Mean raw noise value. */
0105   VFloat rawMean_;
0106 
0107   /** Rms spread in raw noise. */
0108   VFloat rawSpread_;
0109 
0110   /** Max peds value. */
0111   VFloat pedsMax_;
0112 
0113   /** Min peds value. */
0114   VFloat pedsMin_;
0115 
0116   /** Max noise value. */
0117   VFloat noiseMax_;
0118 
0119   /** Min noise value. */
0120   VFloat noiseMin_;
0121 
0122   /** Max raw noise value. */
0123   VFloat rawMax_;
0124 
0125   /** Min raw noise value. */
0126   VFloat rawMin_;
0127 
0128   // true if legacy histogram naming is used
0129   bool legacy_;
0130 };
0131 
0132 // ---------- Inline methods ----------
0133 
0134 const NoiseAnalysis::VVFloat& NoiseAnalysis::peds() const { return peds_; }
0135 const NoiseAnalysis::VVFloat& NoiseAnalysis::noise() const { return noise_; }
0136 const NoiseAnalysis::VVFloat& NoiseAnalysis::raw() const { return raw_; }
0137 
0138 const NoiseAnalysis::VVInt& NoiseAnalysis::dead() const { return dead_; }
0139 const NoiseAnalysis::VVInt& NoiseAnalysis::noisy() const { return noisy_; }
0140 
0141 const NoiseAnalysis::VFloat& NoiseAnalysis::pedsMean() const { return pedsMean_; }
0142 const NoiseAnalysis::VFloat& NoiseAnalysis::pedsSpread() const { return pedsSpread_; }
0143 const NoiseAnalysis::VFloat& NoiseAnalysis::noiseMean() const { return noiseMean_; }
0144 const NoiseAnalysis::VFloat& NoiseAnalysis::noiseSpread() const { return noiseSpread_; }
0145 const NoiseAnalysis::VFloat& NoiseAnalysis::rawMean() const { return rawMean_; }
0146 const NoiseAnalysis::VFloat& NoiseAnalysis::rawSpread() const { return rawSpread_; }
0147 
0148 const NoiseAnalysis::VFloat& NoiseAnalysis::pedsMax() const { return pedsMax_; }
0149 const NoiseAnalysis::VFloat& NoiseAnalysis::pedsMin() const { return pedsMin_; }
0150 const NoiseAnalysis::VFloat& NoiseAnalysis::noiseMax() const { return noiseMax_; }
0151 const NoiseAnalysis::VFloat& NoiseAnalysis::noiseMin() const { return noiseMin_; }
0152 const NoiseAnalysis::VFloat& NoiseAnalysis::rawMax() const { return rawMax_; }
0153 const NoiseAnalysis::VFloat& NoiseAnalysis::rawMin() const { return rawMin_; }
0154 
0155 #endif  // CondFormats_SiStripObjects_NoiseAnalysis_H