Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:48

0001 #ifndef L1Trigger_TrackFindingTMTT_MuxHToutputs_h
0002 #define L1Trigger_TrackFindingTMTT_MuxHToutputs_h
0003 
0004 #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h"
0005 #include "L1Trigger/TrackFindingTMTT/interface/Array2D.h"
0006 
0007 #include <vector>
0008 #include <memory>
0009 
0010 //==================================================================================================
0011 /**
0012 * Multiplex the tracks found by several HT onto a single output optical link.
0013 * (where throughout this class, the word "link" corresponds to a pair of links in the hardware).
0014 * so that tracks that can't be sent down the link within the time-multiplexed period are killed.
0015 *
0016 * This class replaces the 2D track collection in the r-phi HTs with the subset of the tracks
0017 * that can be output within the TM period.
0018 *
0019 * If you wish to change the multiplexing algorithm, then edit this class ...
0020 */
0021 //==================================================================================================
0022 
0023 namespace tmtt {
0024 
0025   class Settings;
0026 
0027   class MuxHToutputs {
0028   public:
0029     enum class MuxAlgoName { None = 0, mBinPerLink = 1 };
0030 
0031     // Initialize constants from configuration parameters.
0032     MuxHToutputs(const Settings* settings);
0033 
0034     // Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing
0035     // of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement
0036     // to output all the tracks within the time-multiplexed period.
0037     // This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut.
0038     void exec(Array2D<std::unique_ptr<HTrphi>>& mHtRphis) const;
0039 
0040     // Determine number of optical links used to output tracks from each phi nonant
0041     // (where "link" refers to a pair of links in the hardware).
0042     unsigned int numLinksPerNonant() const {
0043       unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0;
0044       return numPhiSecPerNon_ * numEtaRegions_ * (busySectorMbinRanges_.size() - iCorr) / this->muxFactor();
0045     }
0046 
0047   private:
0048     // Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme).
0049     unsigned int muxFactor() const;
0050 
0051     // Define the MUX algorithm by which tracks from the specified m-bin range in the HT for a given (phi,eta)
0052     // sector within a phi nonant are multiplexed onto a single output optical link.
0053     unsigned int linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const;
0054 
0055     // Do sanity check of the MUX algorithm implemented in linkID().
0056     void sanityCheck();
0057 
0058   private:
0059     const Settings* settings_;  // Configuration parameters
0060 
0061     // Configuration parameters
0062     MuxAlgoName muxOutputsHT_;
0063     unsigned int numPhiNonants_;
0064     unsigned int numPhiSectors_;
0065     unsigned int numPhiSecPerNon_;
0066     unsigned int numEtaRegions_;
0067     bool busySectorKill_;
0068     unsigned int busySectorNumStubs_;
0069     std::vector<unsigned int> busySectorMbinRanges_;
0070     bool busySectorUseMbinRanges_;
0071   };
0072 
0073 }  // namespace tmtt
0074 
0075 #endif