CMS 3D CMS Logo

StubPairsMemory.cc
Go to the documentation of this file.
3 #include <iomanip>
4 
5 using namespace std;
6 using namespace trklet;
7 
8 StubPairsMemory::StubPairsMemory(string name, Settings const& settings, unsigned int iSector)
9  : MemoryBase(name, settings, iSector) {}
10 
12  std::ostringstream oss;
13  oss << "../data/MemPrints/StubPairs/StubPairs_" << getName() << "_" << std::setfill('0') << std::setw(2)
14  << (iSector_ + 1) << ".dat";
15  auto const& fname = oss.str();
16 
17  if (first) {
18  bx_ = 0;
19  event_ = 1;
20  out_.open(fname.c_str());
21  } else
22  out_.open(fname.c_str(), std::ofstream::app);
23 
24  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
25 
26  for (unsigned int j = 0; j < stubs_.size(); j++) {
27  string stub1index = stubs_[j].first.stub()->stubindex().str();
28  string stub2index = stubs_[j].second.stub()->stubindex().str();
29  out_ << "0x";
30  out_ << std::setfill('0') << std::setw(2);
31  out_ << hex << j << dec;
32  out_ << " " << stub1index << "|" << stub2index << " " << trklet::hexFormat(stub1index + stub2index) << endl;
33  }
34  out_.close();
35 
36  bx_++;
37  event_++;
38  if (bx_ > 7)
39  bx_ = 0;
40 }
trklet::StubPairsMemory::writeSP
void writeSP(bool first)
Definition: StubPairsMemory.cc:11
trklet::Settings
Definition: Settings.h:26
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
dqmdumpme.first
first
Definition: dqmdumpme.py:55
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet::StubPairsMemory::stubs_
std::vector< std::pair< const VMStubTE, const VMStubTE > > stubs_
Definition: StubPairsMemory.h:45
StubPairsMemory.h
trklet
Definition: AllProjectionsMemory.h:9
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
std
Definition: JetResolutionObject.h:76
VMStubTE.h
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
trklet::hexFormat
std::string hexFormat(const std::string &binary)
Definition: Util.h:14
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44