CMS 3D CMS Logo

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

#include <AllStubsMemory.h>

Inheritance diagram for trklet::AllStubsMemory:
trklet::MemoryBase

Public Member Functions

void addStub (const Stub *stub)
 
 AllStubsMemory (std::string name, Settings const &settings)
 
void clean () override
 
const StubgetStub (unsigned int i) const
 
unsigned int nStubs () const
 
void writeStubs (bool first, unsigned int iSector)
 
 ~AllStubsMemory () 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
 
void initLayerDisk (unsigned int pos, int &layer, int &disk)
 
unsigned int initLayerDisk (unsigned int pos)
 
void initSpecialSeeding (unsigned int pos, bool &overlap, bool &extra, bool &extended)
 
 MemoryBase (std::string name, Settings const &settings)
 
void openFile (bool first, std::string dirName, std::string filebase)
 
virtual ~MemoryBase ()=default
 

Private Attributes

std::vector< const Stub * > stubs_
 

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)
 
static std::string hexstr (unsigned int index)
 
- 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 AllStubsMemory.h.

Constructor & Destructor Documentation

◆ AllStubsMemory()

AllStubsMemory::AllStubsMemory ( std::string  name,
Settings const &  settings 
)

Definition at line 9 of file AllStubsMemory.cc.

9 : MemoryBase(name, settings) {}
MemoryBase(std::string name, Settings const &settings)
Definition: MemoryBase.cc:14

◆ ~AllStubsMemory()

trklet::AllStubsMemory::~AllStubsMemory ( )
overridedefault

Member Function Documentation

◆ addStub()

void trklet::AllStubsMemory::addStub ( const Stub stub)
inline

Definition at line 22 of file AllStubsMemory.h.

References stubs_.

22 { stubs_.push_back(stub); }
std::vector< const Stub * > stubs_

◆ clean()

void trklet::AllStubsMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 28 of file AllStubsMemory.h.

References stubs_.

28 { stubs_.clear(); }
std::vector< const Stub * > stubs_

◆ getStub()

const Stub* trklet::AllStubsMemory::getStub ( unsigned int  i) const
inline

Definition at line 26 of file AllStubsMemory.h.

References mps_fire::i, and stubs_.

26 { return stubs_[i]; }
std::vector< const Stub * > stubs_

◆ nStubs()

unsigned int trklet::AllStubsMemory::nStubs ( ) const
inline

Definition at line 24 of file AllStubsMemory.h.

References stubs_.

24 { return stubs_.size(); }
std::vector< const Stub * > stubs_

◆ writeStubs()

void AllStubsMemory::writeStubs ( bool  first,
unsigned int  iSector 
)

Definition at line 11 of file AllStubsMemory.cc.

References dqmdumpme::first, trklet::hexFormat(), trklet::MemoryBase::hexstr(), trklet::MemoryBase::iSector_, dqmiolumiharvest::j, trklet::Settings::memPath(), trklet::MemoryBase::openFile(), trklet::MemoryBase::out_, trklet::MemoryBase::settings_, and stubs_.

11  {
12  iSector_ = iSector;
13  const string dirS = settings_.memPath() + "Stubs/";
14  openFile(first, dirS, "AllStubs_");
15 
16  for (unsigned int j = 0; j < stubs_.size(); j++) {
17  string stub = stubs_[j]->str();
18  out_ << hexstr(j) << " " << stub << " " << hexFormat(stub) << endl;
19  }
20  out_.close();
21 }
unsigned int iSector_
Definition: MemoryBase.h:47
void openFile(bool first, std::string dirName, std::string filebase)
Definition: MemoryBase.cc:75
std::string hexFormat(const std::string &binary)
Definition: Util.h:19
std::string memPath() const
Definition: Settings.h:192
Settings const & settings_
Definition: MemoryBase.h:53
std::ofstream out_
Definition: MemoryBase.h:49
std::vector< const Stub * > stubs_
static std::string hexstr(unsigned int index)
Definition: MemoryBase.cc:111

Member Data Documentation

◆ stubs_

std::vector<const Stub*> trklet::AllStubsMemory::stubs_
private

Definition at line 33 of file AllStubsMemory.h.

Referenced by addStub(), clean(), getStub(), nStubs(), and writeStubs().