CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VMStubsMEMemory.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_VMStubsMEMemory_h
2 #define L1Trigger_TrackFindingTracklet_interface_VMStubsMEMemory_h
3 
6 
7 #include <string>
8 #include <vector>
9 
10 namespace trklet {
11 
12  class Settings;
13  class Stub;
14  class L1TStub;
15 
16  class VMStubsMEMemory : public MemoryBase {
17  public:
18  VMStubsMEMemory(std::string name, Settings const& settings);
19 
20  ~VMStubsMEMemory() override = default;
21 
22  void addStub(VMStubME stub, unsigned int bin) {
23  if (binnedstubs_[bin].size() < settings_.maxStubsPerBin()) {
24  binnedstubs_[bin].push_back(stub);
25  }
26  }
27 
28  void resize(int nbins) { binnedstubs_.resize(nbins); }
29 
30  unsigned int nStubsBin(unsigned int bin) const {
31  assert(bin < binnedstubs_.size());
32  return binnedstubs_[bin].size();
33  }
34 
35  const VMStubME& getVMStubMEBin(unsigned int bin, unsigned int i) const {
36  assert(bin < binnedstubs_.size());
37  assert(i < binnedstubs_[bin].size());
38  return binnedstubs_[bin][i];
39  }
40 
41  const Stub* getStubBin(unsigned int bin, unsigned int i) const {
42  assert(bin < binnedstubs_.size());
43  assert(i < binnedstubs_[bin].size());
44  return binnedstubs_[bin][i].stub();
45  }
46 
47  void clean() override {
48  for (auto& binnedstub : binnedstubs_) {
49  binnedstub.clear();
50  }
51  }
52 
53  void writeStubs(bool first, unsigned int iSector);
54 
55  private:
56  std::vector<std::vector<VMStubME> > binnedstubs_;
57  };
58 
59 }; // namespace trklet
60 #endif
std::vector< std::vector< VMStubME > > binnedstubs_
void addStub(VMStubME stub, unsigned int bin)
assert(be >=bs)
void writeStubs(bool first, unsigned int iSector)
const Stub * getStubBin(unsigned int bin, unsigned int i) const
Settings const & settings_
Definition: MemoryBase.h:50
const VMStubME & getVMStubMEBin(unsigned int bin, unsigned int i) const
~VMStubsMEMemory() override=default
VMStubsMEMemory(std::string name, Settings const &settings)
void resize(int nbins)
tuple size
Write out results.
unsigned int maxStubsPerBin() const
Definition: Settings.h:224
unsigned int nStubsBin(unsigned int bin) const