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_ << std::setfill('0') << std::setw(2);
27  out_ << hex << j << dec;
28  out_ << " " << stub << " " << trklet::hexFormat(stub) << endl;
29  }
30  out_.close();
31 }
32 
33 void InputLinkMemory::clean() { stubs_.clear(); }
void writeStubs(bool first, unsigned int iSector)
unsigned int iSector_
Definition: MemoryBase.h:44
void openFile(bool first, std::string dirName, std::string filebase)
Definition: MemoryBase.cc:74
std::string hexFormat(const std::string &binary)
Definition: Util.h:19
std::string memPath() const
Definition: Settings.h:192
Settings const & settings_
Definition: MemoryBase.h:50
std::ofstream out_
Definition: MemoryBase.h:46
void addStub(Stub *stub)
std::vector< Stub * > stubs_
InputLinkMemory(std::string name, Settings const &settings, double, double)