CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StubTripletsMemory.cc
Go to the documentation of this file.
4 #include <iomanip>
5 #include <filesystem>
6 
7 using namespace std;
8 using namespace trklet;
9 
10 StubTripletsMemory::StubTripletsMemory(string name, Settings const& settings) : MemoryBase(name, settings) {}
11 
12 void StubTripletsMemory::writeST(bool first, unsigned int iSector) {
13  iSector_ = iSector;
14  const string dirSP = settings_.memPath() + "StubPairs/";
15 
16  std::ostringstream oss;
17  oss << dirSP << "StubTriplets_" << getName() << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
18  auto const& fname = oss.str();
19 
20  openfile(out_, first, dirSP, fname, __FILE__, __LINE__);
21 
22  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
23 
24  for (unsigned int j = 0; j < stubs1_.size(); j++) {
25  string stub1index = stubs1_[j]->stubindex().str();
26  string stub2index = stubs2_[j]->stubindex().str();
27  string stub3index = stubs3_[j]->stubindex().str();
28  out_ << std::setfill('0') << std::setw(2);
29  out_ << hex << j << dec;
30  out_ << " " << stub1index << "|" << stub2index << "|" << stub3index << endl;
31  }
32  out_.close();
33 
34  bx_++;
35  event_++;
36  if (bx_ > 7)
37  bx_ = 0;
38 }
std::string memPath() const
Definition: Settings.h:192
unsigned int iSector_
Definition: MemoryBase.h:44
std::vector< const Stub * > stubs2_
std::string const & getName() const
Definition: MemoryBase.h:19
Settings const & settings_
Definition: MemoryBase.h:50
std::ofstream out_
Definition: MemoryBase.h:46
std::vector< const Stub * > stubs1_
void writeST(bool first, unsigned int iSector)
string fname
main script
std::vector< const Stub * > stubs3_
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:139