CMS 3D CMS Logo

StubPairsMemory.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_StubPairsMemory_h
2 #define L1Trigger_TrackFindingTracklet_interface_StubPairsMemory_h
3 
6 
7 #include <vector>
8 
9 namespace trklet {
10 
11  class Settings;
12 
13  class StubPairsMemory : public MemoryBase {
14  public:
15  StubPairsMemory(std::string name, Settings const& settings);
16 
17  ~StubPairsMemory() override = default;
18 
19  void addStubPair(const VMStubTE& stub1,
20  const VMStubTE& stub2,
21  const unsigned index = 0,
22  const std::string& tedName = "") {
23  stubs_.emplace_back(stub1, stub2);
24  indices_.push_back(index);
25  tedNames_.push_back(tedName);
26  }
27 
28  unsigned int nStubPairs() const { return stubs_.size(); }
29 
30  const VMStubTE& getVMStub1(unsigned int i) const { return stubs_[i].first; }
31  const VMStubTE& getVMStub2(unsigned int i) const { return stubs_[i].second; }
32 
33  unsigned getIndex(const unsigned i) const { return indices_.at(i); }
34  const std::string& getTEDName(const unsigned i) const { return tedNames_.at(i); }
35 
36  void clean() override {
37  stubs_.clear();
38  indices_.clear();
39  tedNames_.clear();
40  }
41 
42  void writeSP(bool first, unsigned int iSector);
43 
44  private:
45  std::vector<std::pair<const VMStubTE, const VMStubTE> > stubs_;
46 
47  std::vector<unsigned> indices_;
48  std::vector<std::string> tedNames_;
49  };
50 
51 }; // namespace trklet
52 #endif
StubPairsMemory(std::string name, Settings const &settings)
const std::string & getTEDName(const unsigned i) const
unsigned getIndex(const unsigned i) const
void addStubPair(const VMStubTE &stub1, const VMStubTE &stub2, const unsigned index=0, const std::string &tedName="")
~StubPairsMemory() override=default
std::vector< std::pair< const VMStubTE, const VMStubTE > > stubs_
const VMStubTE & getVMStub2(unsigned int i) const
unsigned int nStubPairs() const
std::vector< unsigned > indices_
const VMStubTE & getVMStub1(unsigned int i) const
std::vector< std::string > tedNames_
void writeSP(bool first, unsigned int iSector)