Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1Trigger_TrackFindingTracklet_interface_StubPairsMemory_h
0002 #define L1Trigger_TrackFindingTracklet_interface_StubPairsMemory_h
0003 
0004 #include "L1Trigger/TrackFindingTracklet/interface/MemoryBase.h"
0005 #include "L1Trigger/TrackFindingTracklet/interface/VMStubTE.h"
0006 
0007 #include <vector>
0008 
0009 namespace trklet {
0010 
0011   class Settings;
0012 
0013   class StubPairsMemory : public MemoryBase {
0014   public:
0015     StubPairsMemory(std::string name, Settings const& settings);
0016 
0017     ~StubPairsMemory() override = default;
0018 
0019     void addStubPair(const VMStubTE& stub1,
0020                      const VMStubTE& stub2,
0021                      const unsigned index = 0,
0022                      const std::string& tedName = "") {
0023       stubs_.emplace_back(stub1, stub2);
0024       indices_.push_back(index);
0025       tedNames_.push_back(tedName);
0026     }
0027 
0028     unsigned int nStubPairs() const { return stubs_.size(); }
0029 
0030     const VMStubTE& getVMStub1(unsigned int i) const { return stubs_[i].first; }
0031     const VMStubTE& getVMStub2(unsigned int i) const { return stubs_[i].second; }
0032 
0033     unsigned getIndex(const unsigned i) const { return indices_.at(i); }
0034     const std::string& getTEDName(const unsigned i) const { return tedNames_.at(i); }
0035 
0036     void clean() override {
0037       stubs_.clear();
0038       indices_.clear();
0039       tedNames_.clear();
0040     }
0041 
0042     void writeSP(bool first, unsigned int iSector);
0043 
0044   private:
0045     std::vector<std::pair<const VMStubTE, const VMStubTE> > stubs_;
0046 
0047     std::vector<unsigned> indices_;
0048     std::vector<std::string> tedNames_;
0049   };
0050 
0051 };  // namespace trklet
0052 #endif