File indexing completed on 2024-04-06 12:22:01
0001 #include "L1Trigger/TrackFindingTracklet/interface/StubPairsMemory.h"
0002 #include "L1Trigger/TrackFindingTracklet/interface/VMStubTE.h"
0003 #include <iomanip>
0004 #include <filesystem>
0005
0006 using namespace std;
0007 using namespace trklet;
0008
0009 StubPairsMemory::StubPairsMemory(string name, Settings const& settings) : MemoryBase(name, settings) {}
0010
0011 void StubPairsMemory::writeSP(bool first, unsigned int iSector) {
0012 iSector_ = iSector;
0013 const string dirSP = settings_.memPath() + "StubPairs/";
0014
0015 std::ostringstream oss;
0016 oss << dirSP << "StubPairs_" << getName() << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
0017 auto const& fname = oss.str();
0018
0019 openfile(out_, first, dirSP, fname, __FILE__, __LINE__);
0020
0021 out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
0022
0023 for (unsigned int j = 0; j < stubs_.size(); j++) {
0024 string stub1index = stubs_[j].first.stub()->stubindex().str();
0025 string stub2index = stubs_[j].second.stub()->stubindex().str();
0026 out_ << hexstr(j) << " " << stub1index << "|" << stub2index << " " << trklet::hexFormat(stub1index + stub2index)
0027 << endl;
0028 }
0029 out_.close();
0030
0031 bx_++;
0032 event_++;
0033 if (bx_ > 7)
0034 bx_ = 0;
0035 }