Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CondFormats_SiStripObjects_FastFedCablingAnalysis_H
0002 #define CondFormats_SiStripObjects_FastFedCablingAnalysis_H
0003 
0004 #include "CondFormats/SiStripObjects/interface/CommissioningAnalysis.h"
0005 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0006 #include <sstream>
0007 #include <vector>
0008 #include <map>
0009 #include <cstdint>
0010 
0011 /** 
0012    @class FastFedCablingAnalysis
0013    @author R.Bainbridge
0014    @brief Histogram-based analysis for connection loop.
0015 */
0016 class FastFedCablingAnalysis : public CommissioningAnalysis {
0017 public:
0018   // ---------- con(de)structors and typedefs ----------
0019 
0020   FastFedCablingAnalysis(const uint32_t& key);
0021 
0022   FastFedCablingAnalysis();
0023 
0024   ~FastFedCablingAnalysis() override { ; }
0025 
0026   typedef std::map<uint32_t, uint16_t> Candidates;
0027 
0028   friend class FastFedCablingAlgorithm;
0029 
0030   // ---------- public interface ----------
0031 
0032   /** Identifies if analysis is valid or not. */
0033   bool isValid() const override;
0034 
0035   /** Identifies if fibre is dirty or not. */
0036   bool isDirty() const;
0037 
0038   /** Identifies if TrimDAQ setting is valid or not. */
0039   bool badTrimDac() const;
0040 
0041   /** DCU hardware id (32-bits). */
0042   inline const uint32_t& dcuHardId() const;
0043 
0044   /** Linear Laser Driver channel. */
0045   inline const uint16_t& lldCh() const;
0046 
0047   /** "High" light level [ADC]. */
0048   inline const float& highLevel() const;
0049 
0050   /** Spread in "high" ligh level [ADC]. */
0051   inline const float& highRms() const;
0052 
0053   /** "Low" light level [ADC]. */
0054   inline const float& lowLevel() const;
0055 
0056   /** Spread in "low" ligh level [ADC]. */
0057   inline const float& lowRms() const;
0058 
0059   /** Maximum light level in data [ADC]. */
0060   inline const float& max() const;
0061 
0062   /** Minimum light level in data [ADC]. */
0063   inline const float& min() const;
0064 
0065   // ---------- misc ----------
0066 
0067   /** Prints analysis results. */
0068   void print(std::stringstream&, uint32_t not_used = 0) override;
0069 
0070   /** Header information for analysis print(). */
0071   void header(std::stringstream&) const override;
0072 
0073   /** Overrides base method. */
0074   void summary(std::stringstream&) const override;
0075 
0076   /** Resets analysis member data. */
0077   void reset() override;
0078 
0079   // ---------- public static data ----------
0080 
0081 public:
0082   /** Threshold to identify digital high from digital low. */
0083   static const float threshold_;
0084 
0085   /** Level [ADC] below which fibre is defined as "dirty". */
0086   static const float dirtyThreshold_;
0087 
0088   /** Level [ADC] below which TrimDAC setting is defined as "bad". */
0089   static const float trimDacThreshold_;
0090 
0091   /** */
0092   static const uint16_t nBitsForDcuId_;
0093 
0094   /** */
0095   static const uint16_t nBitsForLldCh_;
0096 
0097   // ---------- private member data ----------
0098 
0099 private:
0100   /** Extracted DCU id. */
0101   uint32_t dcuHardId_;
0102 
0103   /** Extracted LLD channel. */
0104   uint16_t lldCh_;
0105 
0106   /** */
0107   float highMedian_;
0108 
0109   /** */
0110   float highMean_;
0111 
0112   /** */
0113   float highRms_;
0114 
0115   /** */
0116   float lowMedian_;
0117 
0118   /** */
0119   float lowMean_;
0120 
0121   /** */
0122   float lowRms_;
0123 
0124   /** */
0125   float range_;
0126 
0127   /** */
0128   float midRange_;
0129 
0130   /** */
0131   float max_;
0132 
0133   /** */
0134   float min_;
0135 };
0136 
0137 // ---------- Inline methods ----------
0138 
0139 const uint32_t& FastFedCablingAnalysis::dcuHardId() const { return dcuHardId_; }
0140 const uint16_t& FastFedCablingAnalysis::lldCh() const { return lldCh_; }
0141 const float& FastFedCablingAnalysis::highLevel() const { return highMean_; }
0142 const float& FastFedCablingAnalysis::highRms() const { return highRms_; }
0143 const float& FastFedCablingAnalysis::lowLevel() const { return lowMean_; }
0144 const float& FastFedCablingAnalysis::lowRms() const { return lowRms_; }
0145 const float& FastFedCablingAnalysis::max() const { return max_; }
0146 const float& FastFedCablingAnalysis::min() const { return min_; }
0147 
0148 #endif  // CondFormats_SiStripObjects_FastFedCablingAnalysis_H