CMS 3D CMS Logo

InputLinkMemory.cc
Go to the documentation of this file.
4 
5 #include <iomanip>
6 #include <cmath>
7 #include <sstream>
8 #include <cctype>
9 
11 
12 using namespace trklet;
13 using namespace std;
14 
15 InputLinkMemory::InputLinkMemory(string name, Settings const& settings, double, double) : MemoryBase(name, settings) {}
16 
17 void InputLinkMemory::addStub(Stub* stub) { stubs_.push_back(stub); }
18 
19 void InputLinkMemory::writeStubs(bool first, unsigned int iSector) {
20  iSector_ = iSector;
21  const string dirIS = settings_.memPath() + "InputStubs/";
22  openFile(first, dirIS, "InputStubs_");
23 
24  for (unsigned int j = 0; j < stubs_.size(); j++) {
25  string stub = stubs_[j]->str();
26  out_ << hexstr(j) << " " << stub << " " << trklet::hexFormat(stub) << endl;
27  }
28  out_.close();
29 }
30 
31 void InputLinkMemory::clean() { stubs_.clear(); }
void writeStubs(bool first, unsigned int iSector)
unsigned int iSector_
Definition: MemoryBase.h:47
void openFile(bool first, std::string dirName, std::string filebase)
Definition: MemoryBase.cc:75
std::string hexFormat(const std::string &binary)
Definition: Util.h:19
std::string memPath() const
Definition: Settings.h:202
Settings const & settings_
Definition: MemoryBase.h:53
std::ofstream out_
Definition: MemoryBase.h:49
void addStub(Stub *stub)
static std::string hexstr(unsigned int index)
Definition: MemoryBase.cc:111
std::vector< Stub * > stubs_
InputLinkMemory(std::string name, Settings const &settings, double, double)