Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:33:34

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_ << "0x";
0027     out_ << std::setfill('0') << std::setw(2);
0028     out_ << hex << j << dec;
0029     out_ << " " << stub1index << "|" << stub2index << " " << trklet::hexFormat(stub1index + stub2index) << endl;
0030   }
0031   out_.close();
0032 
0033   bx_++;
0034   event_++;
0035   if (bx_ > 7)
0036     bx_ = 0;
0037 }