Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CondFormats_SiStripObjects_DaqScopeModeAnalysis_H
0002 #define CondFormats_SiStripObjects_DaqScopeModeAnalysis_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 DaqScopeModeAnalysis
0012    @author R.Bainbridge
0013    @brief Analysis for scope mode data.
0014 */
0015 
0016 class DaqScopeModeAnalysis : public CommissioningAnalysis {
0017 public:
0018   DaqScopeModeAnalysis(const uint32_t& key);
0019 
0020   DaqScopeModeAnalysis();
0021 
0022   ~DaqScopeModeAnalysis() override { ; }
0023 
0024   friend class DaqScopeModeAlgorithm;
0025 
0026   /** Identifies if analysis is valid or not. */
0027   bool isValid() const override;
0028   /** Identifies if tick mark is found or not. */
0029   bool foundTickMark() const;
0030   /** FED frame-finding threshold [ADC] (returns 65535 if invalid). */
0031   uint16_t frameFindingThreshold() const;
0032 
0033   // Pedestal, noise and raw noise (128-strip vector per APV)
0034   inline const VVFloat& peds() const;
0035   inline const VVFloat& noise() const;
0036   inline const VVFloat& raw() const;
0037 
0038   // Dead and noisy strips (vector per APV)
0039   inline const VVInt& dead() const;
0040   inline const VVInt& noisy() const;
0041 
0042   // Mean and rms spread (value per APV)
0043   inline const VFloat& pedsMean() const;
0044   inline const VFloat& pedsSpread() const;
0045   inline const VFloat& noiseMean() const;
0046   inline const VFloat& noiseSpread() const;
0047   inline const VFloat& rawMean() const;
0048   inline const VFloat& rawSpread() const;
0049 
0050   // Max and min values (value per APV)
0051   inline const VFloat& pedsMax() const;
0052   inline const VFloat& pedsMin() const;
0053   inline const VFloat& noiseMax() const;
0054   inline const VFloat& noiseMin() const;
0055   inline const VFloat& rawMax() const;
0056   inline const VFloat& rawMin() const;
0057 
0058   /** Height of tick mark [ADC]. */
0059   inline const float& height() const;
0060   /** Baseline level of tick mark [ADC]. */
0061   inline const float& base() const;
0062   /** Level of tick mark top [ADC]. */
0063   inline const float& peak() const;
0064 
0065   /** Prints analysis results. */
0066   void print(std::stringstream&, uint32_t apv_number = 0) override;
0067 
0068   /** Adds error codes for analysis (overrides private base). */
0069   inline void addErrorCode(const std::string& error) override;
0070 
0071   /** Overrides base method. */
0072   void summary(std::stringstream&) const override;
0073 
0074   /** Resets analysis member data. */
0075   void reset() override;
0076 
0077   /** Threshold defining minimum tick mark height [ADC]. */
0078   static const float tickMarkHeightThreshold_;
0079 
0080   /** Threshold for FED frame finding (fraction of tick height). */
0081   static const float frameFindingThreshold_;
0082 
0083 private:
0084   /** Height of tick mark [ADC]. */
0085   float height_;
0086   /** Baseline level of tick mark [ADC]. */
0087   float base_;
0088   /** Level of tick mark top [ADC]. */
0089   float peak_;
0090 
0091   /** Peds values. */
0092   VVFloat peds_;
0093   /** Noise values. */
0094   VVFloat noise_;
0095   /** Raw noise values. */
0096   VVFloat raw_;
0097 
0098   /** Dead strips. */
0099   VVInt dead_;
0100   /** Noisy strips. */
0101   VVInt noisy_;
0102 
0103   /** Mean peds value. */
0104   VFloat pedsMean_;
0105   /** Rms spread in peds. */
0106   VFloat pedsSpread_;
0107   /** Mean noise value. */
0108   VFloat noiseMean_;
0109   /** Rms spread in noise. */
0110   VFloat noiseSpread_;
0111   /** Mean raw noise value. */
0112   VFloat rawMean_;
0113   /** Rms spread in raw noise. */
0114   VFloat rawSpread_;
0115 
0116   /** Max peds value. */
0117   VFloat pedsMax_;
0118   /** Min peds value. */
0119   VFloat pedsMin_;
0120 
0121   /** Max noise value. */
0122   VFloat noiseMax_;
0123   /** Min noise value. */
0124   VFloat noiseMin_;
0125   /** Max raw noise value. */
0126   VFloat rawMax_;
0127   /** Min raw noise value. */
0128   VFloat rawMin_;
0129   // true if legacy histogram naming is used
0130   bool legacy_;
0131 };
0132 
0133 const DaqScopeModeAnalysis::VVFloat& DaqScopeModeAnalysis::peds() const { return peds_; }
0134 const DaqScopeModeAnalysis::VVFloat& DaqScopeModeAnalysis::noise() const { return noise_; }
0135 const DaqScopeModeAnalysis::VVFloat& DaqScopeModeAnalysis::raw() const { return raw_; }
0136 
0137 const DaqScopeModeAnalysis::VVInt& DaqScopeModeAnalysis::dead() const { return dead_; }
0138 const DaqScopeModeAnalysis::VVInt& DaqScopeModeAnalysis::noisy() const { return noisy_; }
0139 
0140 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::pedsMean() const { return pedsMean_; }
0141 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::pedsSpread() const { return pedsSpread_; }
0142 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::noiseMean() const { return noiseMean_; }
0143 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::noiseSpread() const { return noiseSpread_; }
0144 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::rawMean() const { return rawMean_; }
0145 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::rawSpread() const { return rawSpread_; }
0146 
0147 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::pedsMax() const { return pedsMax_; }
0148 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::pedsMin() const { return pedsMin_; }
0149 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::noiseMax() const { return noiseMax_; }
0150 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::noiseMin() const { return noiseMin_; }
0151 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::rawMax() const { return rawMax_; }
0152 const DaqScopeModeAnalysis::VFloat& DaqScopeModeAnalysis::rawMin() const { return rawMin_; }
0153 
0154 const float& DaqScopeModeAnalysis::height() const { return height_; }
0155 const float& DaqScopeModeAnalysis::base() const { return base_; }
0156 const float& DaqScopeModeAnalysis::peak() const { return peak_; }
0157 void DaqScopeModeAnalysis::addErrorCode(const std::string& error) { CommissioningAnalysis::addErrorCode(error); }
0158 
0159 #endif  // CondFormats_SiStripObjects_DaqScopeModeAnalysis_H