Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1Trigger_TrackerTFP_MiniHoughTransform_h
0002 #define L1Trigger_TrackerTFP_MiniHoughTransform_h
0003 
0004 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0005 #include "L1Trigger/TrackerTFP/interface/DataFormats.h"
0006 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0007 
0008 #include <vector>
0009 #include <set>
0010 #include <deque>
0011 
0012 namespace trackerTFP {
0013 
0014   // Class to refine HT track candidates in r-phi, by subdividing each HT cell into a finer granularity array
0015   class MiniHoughTransform {
0016   public:
0017     MiniHoughTransform(const edm::ParameterSet& iConfig,
0018                        const tt::Setup* setup,
0019                        const DataFormats* dataFormats,
0020                        int region);
0021     ~MiniHoughTransform() {}
0022 
0023     // read in and organize input product (fill vector input_)
0024     void consume(const tt::StreamsStub& streams);
0025     // fill output products
0026     void produce(tt::StreamsStub& accepted, tt::StreamsStub& lost);
0027 
0028   private:
0029     // remove and return first element of deque, returns nullptr if empty
0030     template <class T>
0031     T* pop_front(std::deque<T*>& ts) const;
0032     // perform finer pattern recognition per track
0033     void fill(int channel, const std::vector<StubHT*>& input, std::vector<std::deque<StubMHT*>>& output);
0034     // Static load balancing of inputs: mux 4 streams to 1 stream
0035     void slb(std::vector<std::deque<StubMHT*>>& inputs, std::vector<StubMHT*>& accepted, tt::StreamStub& lost) const;
0036     // Dynamic load balancing of inputs: swapping parts of streams to balance the amount of tracks per stream
0037     void dlb(std::vector<std::vector<StubMHT*>>& streams) const;
0038 
0039     // true if truncation is enbaled
0040     bool enableTruncation_;
0041     // provides run-time constants
0042     const tt::Setup* setup_;
0043     // provides dataformats
0044     const DataFormats* dataFormats_;
0045     // dataformat of inv2R
0046     DataFormat inv2R_;
0047     // dataformat of phiT
0048     DataFormat phiT_;
0049     // processing region (0 - 8)
0050     int region_;
0051     // number of inv2R bins used in HT
0052     int numBinsInv2R_;
0053     // number of cells used in MHT
0054     int numCells_;
0055     // number of dynamic load balancing nodes
0056     int numNodes_;
0057     // number of channel per dynamic load balancing node
0058     int numChannel_;
0059     // container of input stubs
0060     std::vector<StubHT> stubsHT_;
0061     // container of output stubs
0062     std::vector<StubMHT> stubsMHT_;
0063     // h/w liked organized pointer to input stubs
0064     std::vector<std::vector<StubHT*>> input_;
0065   };
0066 
0067 }  // namespace trackerTFP
0068 
0069 #endif