Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-15 23:40:44

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_,
0026                    unsigned int stubposition_,
0027                    const std::vector<std::vector<VMStubsTEMemory*> >& vmstubmem_)
0028         : seednumber(seednumber_), stubposition(stubposition_), vmstubmem(vmstubmem_) {};
0029 
0030     unsigned int seednumber;    //seed number [0,11]
0031     unsigned int stubposition;  //stub position in the seed (only used by triplet seeds)
0032 
0033     // The first index in the following 2D vector is only used in the case of
0034     // the triplet seeds.
0035     std::vector<std::vector<VMStubsTEMemory*> >
0036         vmstubmem;  // m_vmstubmem[iVM][n] is the VMStubsTEMemory for iVM and the nth copy
0037   };
0038 
0039   class VMRouterCM : public ProcessBase {
0040   public:
0041     VMRouterCM(std::string name, Settings const& settings, Globals* global);
0042 
0043     ~VMRouterCM() override = default;
0044 
0045     void addOutput(MemoryBase* memory, std::string output) override;
0046     void addInput(MemoryBase* memory, std::string input) override;
0047 
0048     void execute(unsigned int iSector);
0049 
0050   private:
0051     //0-5 are the layers and 6-10 are the disks
0052     unsigned int layerdisk_;
0053 
0054     //overlapbits_ is the top bits of phicorr used to add or subtract one to see if stub should be added to
0055     //two VMs. nextrabits_ is the number of bits beyond the bits for the phivm that is used by overlapbits_
0056     unsigned int overlapbits_;
0057     unsigned int nextrabits_;
0058 
0059     int nbitszfinebintable_;
0060     int nbitsrfinebintable_;
0061 
0062     unsigned int nvmmebins_;  //number of long z/r bins in VM
0063 
0064     TrackletLUT meTable_;    //used for ME and outer TE barrel
0065     TrackletLUT diskTable_;  //outer disk used by D1, D2, and D4
0066 
0067     // The following tables are only used to replicate the behavior of the old
0068     // VMRouter in the case of the triplet seeds.
0069     TrackletLUT meTableOld_;         //used for ME and outer TE barrel
0070     TrackletLUT diskTableOld_;       //outer disk used by D1, D2, and D4
0071     TrackletLUT innerTable_;         //projection to next layer/disk
0072     TrackletLUT innerOverlapTable_;  //projection to disk from layer
0073     TrackletLUT innerThirdTable_;    //projection to disk1 for extended - iseed=10
0074 
0075     //The input stub memories
0076     std::vector<InputLinkMemory*> stubinputs_;
0077 
0078     //The all stub memories
0079     std::vector<AllStubsMemory*> allstubs_;
0080     std::vector<std::pair<char, AllInnerStubsMemory*> > allinnerstubs_;
0081 
0082     //The VM stubs memories used by the MEs
0083     std::vector<VMStubsMEMemory*> vmstubsMEPHI_;
0084 
0085     //The VM stubs memories used by the TEs (using structure defined above)
0086     std::vector<VMStubsTEPHICM> vmstubsTEPHI_;
0087   };
0088 };  // namespace trklet
0089 #endif