Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-18 08:23:36

0001 #ifndef __L1Trigger_L1THGCal_HGCalStage1TruncationImpl_h__
0002 #define __L1Trigger_L1THGCal_HGCalStage1TruncationImpl_h__
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "DataFormats/L1THGCal/interface/HGCalTriggerCell.h"
0006 #include "L1Trigger/L1THGCal/interface/HGCalTriggerTools.h"
0007 
0008 #include <vector>
0009 
0010 class HGCalStage1TruncationImpl {
0011 public:
0012   HGCalStage1TruncationImpl(const edm::ParameterSet& conf);
0013 
0014   void setGeometry(const HGCalTriggerGeometryBase* const geom) { triggerTools_.setGeometry(geom); }
0015 
0016   void run(uint32_t fpga_id,
0017            const std::vector<edm::Ptr<l1t::HGCalTriggerCell>>& tcs_in,
0018            std::vector<edm::Ptr<l1t::HGCalTriggerCell>>& tcs_out);
0019 
0020 private:
0021   HGCalTriggerTools triggerTools_;
0022 
0023   static constexpr unsigned offset_roz_ = 1;
0024   static constexpr unsigned mask_roz_ = 0x3f;  // 6 bits, max 64 bins
0025   static constexpr unsigned mask_phi_ = 1;
0026 
0027   bool do_truncate_;
0028   double roz_min_ = 0.;
0029   double roz_max_ = 0.;
0030   unsigned roz_bins_ = 42;
0031   std::vector<unsigned> max_tcs_per_bin_;
0032   std::vector<double> phi_edges_;
0033   double roz_bin_size_ = 0.;
0034 
0035   uint32_t packBin(unsigned roverzbin, unsigned phibin) const;
0036   void unpackBin(unsigned packedbin, unsigned& roverzbin, unsigned& phibin) const;
0037   unsigned phiBin(unsigned roverzbin, double phi) const;
0038   double rotatedphi(double x, double y, double z, int sector) const;
0039 };
0040 
0041 #endif