Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef __L1Trigger_L1THGCal_HGCalStage1TruncationConfig_SA_h__
0002 #define __L1Trigger_L1THGCal_HGCalStage1TruncationConfig_SA_h__
0003 
0004 #include <vector>
0005 #include <cstdint>  // uint32_t
0006 
0007 namespace l1thgcfirmware {
0008 
0009   class Stage1TruncationConfig {
0010   public:
0011     Stage1TruncationConfig(const bool do_truncate,
0012                            const double roz_min,
0013                            const double roz_max,
0014                            const unsigned roz_bins,
0015                            const std::vector<unsigned>& max_tcs_per_bins,
0016                            const std::vector<double>& phi_edges)
0017         : do_truncate_(do_truncate),
0018           roz_min_(roz_min),
0019           roz_max_(roz_max),
0020           roz_bins_(roz_bins),
0021           max_tcs_per_bins_(max_tcs_per_bins),
0022           phi_edges_(phi_edges) {}
0023 
0024     void setParameters(const bool do_truncate,
0025                        const double roz_min,
0026                        const double roz_max,
0027                        const unsigned roz_bins,
0028                        const std::vector<unsigned>& max_tcs_per_bins,
0029                        const std::vector<double>& phi_edges) {
0030       do_truncate_ = do_truncate;
0031       roz_min_ = roz_min;
0032       roz_max_ = roz_max;
0033       roz_bins_ = roz_bins;
0034       max_tcs_per_bins_ = max_tcs_per_bins;
0035       phi_edges_ = phi_edges;
0036     }
0037 
0038     void setParameters(const Stage1TruncationConfig& newConfig) {
0039       setParameters(newConfig.doTruncate(),
0040                     newConfig.rozMin(),
0041                     newConfig.rozMax(),
0042                     newConfig.rozBins(),
0043                     newConfig.maxTcsPerBin(),
0044                     newConfig.phiEdges());
0045     }
0046 
0047     void setSector120(const unsigned sector) { sector120_ = sector; }
0048     void setFPGAID(const uint32_t fpga_id) { fpga_id_ = fpga_id; }
0049 
0050     bool doTruncate() const { return do_truncate_; }
0051     double rozMin() const { return roz_min_; }
0052     double rozMax() const { return roz_max_; }
0053     unsigned rozBins() const { return roz_bins_; }
0054     const std::vector<unsigned>& maxTcsPerBin() const { return max_tcs_per_bins_; }
0055     const std::vector<double>& phiEdges() const { return phi_edges_; }
0056     unsigned phiSector() const { return sector120_; }
0057     uint32_t fpgaID() const { return fpga_id_; }
0058 
0059   private:
0060     bool do_truncate_;
0061     double roz_min_;
0062     double roz_max_;
0063     unsigned roz_bins_;
0064     std::vector<unsigned> max_tcs_per_bins_;
0065     std::vector<double> phi_edges_;
0066     unsigned sector120_;
0067     uint32_t fpga_id_;
0068   };
0069 
0070 }  // namespace l1thgcfirmware
0071 
0072 #endif