CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::VMStubsMEMemory Class Reference

#include <VMStubsMEMemory.h>

Inheritance diagram for trklet::VMStubsMEMemory:
trklet::MemoryBase

Public Member Functions

void addStub (VMStubME stub, unsigned int bin)
 
void clean () override
 
const StubgetStubBin (unsigned int bin, unsigned int i) const
 
const VMStubMEgetVMStubMEBin (unsigned int bin, unsigned int i) const
 
unsigned int nStubsBin (unsigned int bin) const
 
 VMStubsMEMemory (std::string name, Settings const &settings, unsigned int iSector)
 
void writeStubs (bool first)
 
 ~VMStubsMEMemory () override=default
 
- Public Member Functions inherited from trklet::MemoryBase
void findAndReplaceAll (std::string &data, std::string toSearch, std::string replaceStr)
 
std::string getLastPartOfName () const
 
std::string const & getName () const
 
unsigned int initLayerDisk (unsigned int pos)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk)
 
void initSpecialSeeding (unsigned int pos, bool &overlap, bool &extra, bool &extended)
 
 MemoryBase (std::string name, Settings const &settings, unsigned int iSector)
 
void openFile (bool first, std::string filebase)
 
virtual ~MemoryBase ()=default
 

Private Attributes

std::vector< std::vector< VMStubME > > binnedstubs_
 

Additional Inherited Members

- Static Public Member Functions inherited from trklet::MemoryBase
static size_t find_nth (const std::string &haystack, size_t pos, const std::string &needle, size_t nth)
 
- Protected Attributes inherited from trklet::MemoryBase
int bx_
 
int event_
 
unsigned int iSector_
 
std::string name_
 
std::ofstream out_
 
Settings const & settings_
 

Detailed Description

Definition at line 16 of file VMStubsMEMemory.h.

Constructor & Destructor Documentation

◆ VMStubsMEMemory()

VMStubsMEMemory::VMStubsMEMemory ( std::string  name,
Settings const &  settings,
unsigned int  iSector 
)

Definition at line 8 of file VMStubsMEMemory.cc.

9  : MemoryBase(name, settings, iSector) {
10  unsigned int layerdisk = initLayerDisk(6);
11  if (layerdisk < N_LAYER) {
13  } else {
14  //For disks we have NLONGVMBITS on each disk
15  binnedstubs_.resize(2 * settings_.NLONGVMBINS());
16  }
17 }

References binnedstubs_, trklet::MemoryBase::initLayerDisk(), trklet::N_LAYER, trklet::Settings::NLONGVMBINS(), and trklet::MemoryBase::settings_.

◆ ~VMStubsMEMemory()

trklet::VMStubsMEMemory::~VMStubsMEMemory ( )
overridedefault

Member Function Documentation

◆ addStub()

void trklet::VMStubsMEMemory::addStub ( VMStubME  stub,
unsigned int  bin 
)
inline

◆ clean()

void trklet::VMStubsMEMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 45 of file VMStubsMEMemory.h.

45  {
46  for (auto& binnedstub : binnedstubs_) {
47  binnedstub.clear();
48  }
49  }

References binnedstubs_.

◆ getStubBin()

const Stub* trklet::VMStubsMEMemory::getStubBin ( unsigned int  bin,
unsigned int  i 
) const
inline

Definition at line 39 of file VMStubsMEMemory.h.

39  {
40  assert(bin < binnedstubs_.size());
42  return binnedstubs_[bin][i].stub();
43  }

References cms::cuda::assert(), newFWLiteAna::bin, binnedstubs_, mps_fire::i, and findQualityFiles::size.

◆ getVMStubMEBin()

const VMStubME& trklet::VMStubsMEMemory::getVMStubMEBin ( unsigned int  bin,
unsigned int  i 
) const
inline

◆ nStubsBin()

unsigned int trklet::VMStubsMEMemory::nStubsBin ( unsigned int  bin) const
inline

Definition at line 28 of file VMStubsMEMemory.h.

28  {
29  assert(bin < binnedstubs_.size());
30  return binnedstubs_[bin].size();
31  }

References cms::cuda::assert(), newFWLiteAna::bin, and binnedstubs_.

Referenced by trklet::MatchEngine::execute(), trklet::MatchProcessor::execute(), and trklet::MatchEngineUnit::step().

◆ writeStubs()

void VMStubsMEMemory::writeStubs ( bool  first)

Definition at line 19 of file VMStubsMEMemory.cc.

19  {
20  std::ostringstream oss;
21  oss << "../data/MemPrints/VMStubsME/VMStubs_" << getName();
22  //get rid of duplicates
23  auto const& tmp = oss.str();
24  int len = tmp.size();
25  if (tmp[len - 2] == 'n' && tmp[len - 1] > '1' && tmp[len - 1] <= '9')
26  return;
27  oss << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
28  auto const& fname = oss.str();
29 
30  if (first) {
31  bx_ = 0;
32  event_ = 1;
33  out_.open(fname.c_str());
34  } else
35  out_.open(fname.c_str(), std::ofstream::app);
36 
37  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
38 
39  for (unsigned int i = 0; i < binnedstubs_.size(); i++) {
40  for (unsigned int j = 0; j < binnedstubs_[i].size(); j++) {
41  string stub = binnedstubs_[i][j].stubindex().str();
42  stub += "|" + binnedstubs_[i][j].bend().str();
43 
44  FPGAWord finepos = binnedstubs_[i][j].finerz();
45  stub += "|" + finepos.str();
46  out_ << hex << i << " " << j << dec << " " << stub << " " << trklet::hexFormat(stub) << endl;
47  }
48  }
49  out_.close();
50 
51  bx_++;
52  event_++;
53  if (bx_ > 7)
54  bx_ = 0;
55 }

References binnedstubs_, trklet::MemoryBase::bx_, TauDecayModes::dec, trklet::MemoryBase::event_, dqmdumpme::first, alignmentValidation::fname, trklet::MemoryBase::getName(), trklet::hexFormat(), mps_fire::i, trklet::MemoryBase::iSector_, dqmiolumiharvest::j, trklet::MemoryBase::out_, trklet::FPGAWord::str(), and createJobs::tmp.

Member Data Documentation

◆ binnedstubs_

std::vector<std::vector<VMStubME> > trklet::VMStubsMEMemory::binnedstubs_
private
trklet::MemoryBase::settings_
Settings const & settings_
Definition: MemoryBase.h:50
mps_fire.i
i
Definition: mps_fire.py:428
trklet::FPGAWord::str
std::string str() const
Definition: FPGAWord.cc:54
cms::cuda::assert
assert(be >=bs)
trklet::MemoryBase::event_
int event_
Definition: MemoryBase.h:48
trklet::MemoryBase::out_
std::ofstream out_
Definition: MemoryBase.h:46
trklet::VMStubsMEMemory::binnedstubs_
std::vector< std::vector< VMStubME > > binnedstubs_
Definition: VMStubsMEMemory.h:54
trklet::MemoryBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:17
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
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::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:19
trklet::FPGAWord
Definition: FPGAWord.h:9
trklet::Settings::NLONGVMBINS
unsigned int NLONGVMBINS() const
Definition: Settings.h:272
trklet::Settings::maxStubsPerBin
unsigned int maxStubsPerBin() const
Definition: Settings.h:183
trklet::MemoryBase::MemoryBase
MemoryBase(std::string name, Settings const &settings, unsigned int iSector)
Definition: MemoryBase.cc:11
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
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
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443