Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-10-14 01:44:01

0001 // VMRouter: sorts input stubs into smaller units in phi (and possibly z), referred to as "Virtual Modules" (VMs) - implementation for combined modules
0002 #ifndef L1Trigger_TrackFindingTracklet_interface_VMRouterCM_h
0003 #define L1Trigger_TrackFindingTracklet_interface_VMRouterCM_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 AllInnerStubsMemory;
0021   class VMStubsMEMemory;
0022   class VMStubsTEMemory;
0023 
0024   struct VMStubsTEPHICM {
0025     VMStubsTEPHICM(unsigned int seednumber_, std::vector<VMStubsTEMemory*> vmstubmem_)
0026         : seednumber(seednumber_), vmstubmem(vmstubmem_){};
0027 
0028     unsigned int seednumber;                  //seed number [0,11]
0029     std::vector<VMStubsTEMemory*> vmstubmem;  // m_vmstubmem[n] is the VMStubsTEMemory for the nth copy
0030   };
0031 
0032   class VMRouterCM : public ProcessBase {
0033   public:
0034     VMRouterCM(std::string name, Settings const& settings, Globals* global);
0035 
0036     ~VMRouterCM() override = default;
0037 
0038     void addOutput(MemoryBase* memory, std::string output) override;
0039     void addInput(MemoryBase* memory, std::string input) override;
0040 
0041     void execute(unsigned int iSector);
0042 
0043   private:
0044     //0-5 are the layers and 6-10 are the disks
0045     unsigned int layerdisk_;
0046 
0047     //overlapbits_ is the top bits of phicorr used to add or subtract one to see if stub should be added to
0048     //two VMs. nextrabits_ is the number of bits beyond the bits for the phivm that is used by overlapbits_
0049     unsigned int overlapbits_;
0050     unsigned int nextrabits_;
0051 
0052     int nbitszfinebintable_;
0053     int nbitsrfinebintable_;
0054 
0055     unsigned int nvmmebins_;  //number of long z/r bins in VM
0056 
0057     TrackletLUT meTable_;    //used for ME and outer TE barrel
0058     TrackletLUT diskTable_;  //outer disk used by D1, D2, and D4
0059 
0060     //The input stub memories
0061     std::vector<InputLinkMemory*> stubinputs_;
0062 
0063     //The all stub memories
0064     std::vector<AllStubsMemory*> allstubs_;
0065     std::vector<std::pair<char, AllInnerStubsMemory*> > allinnerstubs_;
0066 
0067     //The VM stubs memories used by the MEs
0068     std::vector<VMStubsMEMemory*> vmstubsMEPHI_;
0069 
0070     //The VM stubs memories used by the TEs (using structure defined above)
0071     std::vector<VMStubsTEPHICM> vmstubsTEPHI_;
0072   };
0073 };  // namespace trklet
0074 #endif