Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:33:30

0001 // VMRouter: sorts input stubs into smaller units in phi (and possibly z), referred to as "Virtual Modules" (VMs)
0002 #ifndef L1Trigger_TrackFindingTracklet_interface_VMRouter_h
0003 #define L1Trigger_TrackFindingTracklet_interface_VMRouter_h
0004 
0005 #include "L1Trigger/TrackFindingTracklet/interface/ProcessBase.h"
0006 #include "L1Trigger/TrackFindingTracklet/interface/FPGAWord.h"
0007 #include "L1Trigger/TrackFindingTracklet/interface/TrackletLUT.h"
0008 
0009 #include <string>
0010 #include <vector>
0011 #include <utility>
0012 
0013 namespace trklet {
0014 
0015   class Settings;
0016   class Globals;
0017   class MemoryBase;
0018   class InputLinkMemory;
0019   class AllStubsMemory;
0020   class VMStubsMEMemory;
0021   class VMStubsTEMemory;
0022 
0023   struct VMStubsTEPHI {
0024     VMStubsTEPHI(unsigned int seednumber_,
0025                  unsigned int stubposition_,
0026                  std::vector<std::vector<VMStubsTEMemory*> > vmstubmem_)
0027         : seednumber(seednumber_), stubposition(stubposition_), vmstubmem(vmstubmem_){};
0028 
0029     unsigned int seednumber;    //seed number [0,11]
0030     unsigned int stubposition;  //stub position in the seed
0031     std::vector<std::vector<VMStubsTEMemory*> >
0032         vmstubmem;  // m_vmstubmem[iVM][n] is the VMStubsTEMemory for iVM and the nth copy
0033   };
0034 
0035   class VMRouter : public ProcessBase {
0036   public:
0037     VMRouter(std::string name, Settings const& settings, Globals* global);
0038 
0039     ~VMRouter() override = default;
0040 
0041     void addOutput(MemoryBase* memory, std::string output) override;
0042     void addInput(MemoryBase* memory, std::string input) override;
0043 
0044     void execute();
0045 
0046   private:
0047     //0-5 are the layers and 6-10 are the disks
0048     unsigned int layerdisk_;
0049 
0050     //overlapbits_ is the top bits of phicorr used to add or subtract one to see if stub should be added to
0051     //two VMs. nextrabits_ is the number of bits beyond the bits for the phivm that is used by overlapbits_
0052     unsigned int overlapbits_;
0053     unsigned int nextrabits_;
0054 
0055     int nbitszfinebintable_;
0056     int nbitsrfinebintable_;
0057 
0058     TrackletLUT meTable_;            //used for ME and outer TE barrel
0059     TrackletLUT diskTable_;          //outer disk used by D1, D2, and D4
0060     TrackletLUT innerTable_;         //projection to next layer/disk
0061     TrackletLUT innerOverlapTable_;  //projection to disk from layer
0062     TrackletLUT innerThirdTable_;    //projection to disk1 for extended - iseed=10
0063 
0064     //The input stub memories the two tmp inputs are used to build the order needed in HLS
0065     std::vector<InputLinkMemory*> stubinputs_, stubinputtmp_, stubinputdisk2stmp_;
0066 
0067     //The all stub memories
0068     std::vector<AllStubsMemory*> allstubs_;
0069 
0070     //The VM stubs memories used by the MEs
0071     std::vector<VMStubsMEMemory*> vmstubsMEPHI_;
0072 
0073     //The VM stubs memories used by the TEs (using structure defined above)
0074     std::vector<VMStubsTEPHI> vmstubsTEPHI_;
0075   };
0076 };  // namespace trklet
0077 #endif