CMS 3D CMS Logo

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

#include <StubTripletsMemory.h>

Inheritance diagram for trklet::StubTripletsMemory:
trklet::MemoryBase

Public Member Functions

void addStubs (const Stub *stub1, const Stub *stub2, const Stub *stub3)
 
void clean () override
 
const StubgetFPGAStub1 (unsigned int i) const
 
const StubgetFPGAStub2 (unsigned int i) const
 
const StubgetFPGAStub3 (unsigned int i) const
 
unsigned int nStubTriplets () const
 
 StubTripletsMemory (std::string name, Settings const &settings)
 
void writeST (bool first, unsigned int iSector)
 
 ~StubTripletsMemory () 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 * > stubs1_
 
std::vector< const Stub * > stubs2_
 
std::vector< const Stub * > stubs3_
 

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 14 of file StubTripletsMemory.h.

Constructor & Destructor Documentation

◆ StubTripletsMemory()

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

Definition at line 10 of file StubTripletsMemory.cc.

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

◆ ~StubTripletsMemory()

trklet::StubTripletsMemory::~StubTripletsMemory ( )
overridedefault

Member Function Documentation

◆ addStubs()

void trklet::StubTripletsMemory::addStubs ( const Stub stub1,
const Stub stub2,
const Stub stub3 
)
inline

Definition at line 20 of file StubTripletsMemory.h.

References stubs1_, stubs2_, and stubs3_.

Referenced by trklet::TripletEngine::execute().

20  {
21  stubs1_.push_back(stub1);
22  stubs2_.push_back(stub2);
23  stubs3_.push_back(stub3);
24  }
std::vector< const Stub * > stubs2_
std::vector< const Stub * > stubs1_
std::vector< const Stub * > stubs3_

◆ clean()

void trklet::StubTripletsMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 32 of file StubTripletsMemory.h.

References stubs1_, stubs2_, and stubs3_.

32  {
33  stubs1_.clear();
34  stubs2_.clear();
35  stubs3_.clear();
36  }
std::vector< const Stub * > stubs2_
std::vector< const Stub * > stubs1_
std::vector< const Stub * > stubs3_

◆ getFPGAStub1()

const Stub* trklet::StubTripletsMemory::getFPGAStub1 ( unsigned int  i) const
inline

Definition at line 28 of file StubTripletsMemory.h.

References mps_fire::i, and stubs1_.

28 { return stubs1_[i]; }
std::vector< const Stub * > stubs1_

◆ getFPGAStub2()

const Stub* trklet::StubTripletsMemory::getFPGAStub2 ( unsigned int  i) const
inline

Definition at line 29 of file StubTripletsMemory.h.

References mps_fire::i, and stubs2_.

29 { return stubs2_[i]; }
std::vector< const Stub * > stubs2_

◆ getFPGAStub3()

const Stub* trklet::StubTripletsMemory::getFPGAStub3 ( unsigned int  i) const
inline

Definition at line 30 of file StubTripletsMemory.h.

References mps_fire::i, and stubs3_.

30 { return stubs3_[i]; }
std::vector< const Stub * > stubs3_

◆ nStubTriplets()

unsigned int trklet::StubTripletsMemory::nStubTriplets ( ) const
inline

Definition at line 26 of file StubTripletsMemory.h.

References stubs1_.

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

◆ writeST()

void StubTripletsMemory::writeST ( bool  first,
unsigned int  iSector 
)

Definition at line 12 of file StubTripletsMemory.cc.

References trklet::MemoryBase::bx_, trklet::MemoryBase::event_, dqmdumpme::first, alignmentValidation::fname, trklet::MemoryBase::getName(), trklet::MemoryBase::hexstr(), trklet::MemoryBase::iSector_, dqmiolumiharvest::j, trklet::Settings::memPath(), trklet::openfile(), trklet::MemoryBase::out_, trklet::MemoryBase::settings_, stubs1_, stubs2_, and stubs3_.

12  {
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_ << hexstr(j) << " " << stub1index << "|" << stub2index << "|" << stub3index << endl;
29  }
30  out_.close();
31 
32  bx_++;
33  event_++;
34  if (bx_ > 7)
35  bx_ = 0;
36 }
unsigned int iSector_
Definition: MemoryBase.h:47
std::vector< const Stub * > stubs2_
std::string memPath() const
Definition: Settings.h:192
Settings const & settings_
Definition: MemoryBase.h:53
std::ofstream out_
Definition: MemoryBase.h:49
std::string const & getName() const
Definition: MemoryBase.h:19
static std::string hexstr(unsigned int index)
Definition: MemoryBase.cc:111
std::vector< const Stub * > stubs1_
string fname
main script
std::vector< const Stub * > stubs3_
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:137

Member Data Documentation

◆ stubs1_

std::vector<const Stub*> trklet::StubTripletsMemory::stubs1_
private

Definition at line 41 of file StubTripletsMemory.h.

Referenced by addStubs(), clean(), getFPGAStub1(), nStubTriplets(), and writeST().

◆ stubs2_

std::vector<const Stub*> trklet::StubTripletsMemory::stubs2_
private

Definition at line 42 of file StubTripletsMemory.h.

Referenced by addStubs(), clean(), getFPGAStub2(), and writeST().

◆ stubs3_

std::vector<const Stub*> trklet::StubTripletsMemory::stubs3_
private

Definition at line 43 of file StubTripletsMemory.h.

Referenced by addStubs(), clean(), getFPGAStub3(), and writeST().