CMS 3D CMS Logo

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 }
trklet::MemoryBase::settings_
Settings const & settings_
Definition: MemoryBase.h:50
L1TStub.h
trklet::openfile
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:138
trklet::Settings
Definition: Settings.h:52
trklet::MemoryBase::event_
int event_
Definition: MemoryBase.h:48
trklet::MemoryBase::out_
std::ofstream out_
Definition: MemoryBase.h:46
trklet::MemoryBase::bx_
int bx_
Definition: MemoryBase.h:47
trklet::StubTripletsMemory::stubs3_
std::vector< const Stub * > stubs3_
Definition: StubTripletsMemory.h:43
StubTripletsMemory.h
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::StubTripletsMemory::writeST
void writeST(bool first, unsigned int iSector)
Definition: StubTripletsMemory.cc:12
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet::Settings::memPath
std::string memPath() const
Definition: Settings.h:192
trklet::StubTripletsMemory::stubs1_
std::vector< const Stub * > stubs1_
Definition: StubTripletsMemory.h:41
trklet
Definition: AllInnerStubsMemory.h:10
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
std
Definition: JetResolutionObject.h:76
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
Stub.h
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
trklet::StubTripletsMemory::stubs2_
std::vector< const Stub * > stubs2_
Definition: StubTripletsMemory.h:42
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44