Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "L1Trigger/TrackFindingTracklet/interface/StubTripletsMemory.h"
0002 #include "L1Trigger/TrackFindingTracklet/interface/L1TStub.h"
0003 #include "L1Trigger/TrackFindingTracklet/interface/Stub.h"
0004 #include <iomanip>
0005 #include <filesystem>
0006 
0007 using namespace std;
0008 using namespace trklet;
0009 
0010 StubTripletsMemory::StubTripletsMemory(string name, Settings const& settings) : MemoryBase(name, settings) {}
0011 
0012 void StubTripletsMemory::writeST(bool first, unsigned int iSector) {
0013   iSector_ = iSector;
0014   const string dirSP = settings_.memPath() + "StubPairs/";
0015 
0016   std::ostringstream oss;
0017   oss << dirSP << "StubTriplets_" << getName() << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
0018   auto const& fname = oss.str();
0019 
0020   openfile(out_, first, dirSP, fname, __FILE__, __LINE__);
0021 
0022   out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
0023 
0024   for (unsigned int j = 0; j < stubs1_.size(); j++) {
0025     string stub1index = stubs1_[j]->stubindex().str();
0026     string stub2index = stubs2_[j]->stubindex().str();
0027     string stub3index = stubs3_[j]->stubindex().str();
0028     out_ << std::setfill('0') << std::setw(2);
0029     out_ << hex << j << dec;
0030     out_ << " " << stub1index << "|" << stub2index << "|" << stub3index << endl;
0031   }
0032   out_.close();
0033 
0034   bx_++;
0035   event_++;
0036   if (bx_ > 7)
0037     bx_ = 0;
0038 }