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, unsigned int iSector)
 
void writeST (bool first)
 
 ~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
 
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< 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)
 
- 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,
unsigned int  iSector 
)

Definition at line 9 of file StubTripletsMemory.cc.

10  : MemoryBase(name, settings, iSector) {}

◆ ~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.

20  {
21  stubs1_.push_back(stub1);
22  stubs2_.push_back(stub2);
23  stubs3_.push_back(stub3);
24  }

References stubs1_, stubs2_, and stubs3_.

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

◆ clean()

void trklet::StubTripletsMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 32 of file StubTripletsMemory.h.

32  {
33  stubs1_.clear();
34  stubs2_.clear();
35  stubs3_.clear();
36  }

References stubs1_, stubs2_, and stubs3_.

◆ getFPGAStub1()

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

Definition at line 28 of file StubTripletsMemory.h.

28 { return stubs1_[i]; }

References mps_fire::i, and stubs1_.

◆ getFPGAStub2()

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

Definition at line 29 of file StubTripletsMemory.h.

29 { return stubs2_[i]; }

References mps_fire::i, and stubs2_.

◆ getFPGAStub3()

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

Definition at line 30 of file StubTripletsMemory.h.

30 { return stubs3_[i]; }

References mps_fire::i, and stubs3_.

◆ nStubTriplets()

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

Definition at line 26 of file StubTripletsMemory.h.

26 { return stubs1_.size(); }

References stubs1_.

◆ writeST()

void StubTripletsMemory::writeST ( bool  first)

Definition at line 12 of file StubTripletsMemory.cc.

12  {
13  std::ostringstream oss;
14  oss << "../data/MemPrints/StubPairs/StubTriplets_" << getName() << "_" << std::setfill('0') << std::setw(2)
15  << (iSector_ + 1) << ".dat";
16  auto const& fname = oss.str();
17 
18  if (first) {
19  bx_ = 0;
20  event_ = 1;
21  out_.open(fname.c_str());
22  } else
23  out_.open(fname.c_str(), std::ofstream::app);
24 
25  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
26 
27  for (unsigned int j = 0; j < stubs1_.size(); j++) {
28  string stub1index = stubs1_[j]->stubindex().str();
29  string stub2index = stubs2_[j]->stubindex().str();
30  string stub3index = stubs3_[j]->stubindex().str();
31  out_ << std::setfill('0') << std::setw(2);
32  out_ << hex << j << dec;
33  out_ << " " << stub1index << "|" << stub2index << "|" << stub3index << endl;
34  }
35  out_.close();
36 
37  bx_++;
38  event_++;
39  if (bx_ > 7)
40  bx_ = 0;
41 }

References trklet::MemoryBase::bx_, TauDecayModes::dec, trklet::MemoryBase::event_, dqmdumpme::first, alignmentValidation::fname, trklet::MemoryBase::getName(), trklet::MemoryBase::iSector_, dqmiolumiharvest::j, trklet::MemoryBase::out_, stubs1_, stubs2_, and stubs3_.

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().

mps_fire.i
i
Definition: mps_fire.py:428
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
dqmdumpme.first
first
Definition: dqmdumpme.py:55
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::StubTripletsMemory::stubs1_
std::vector< const Stub * > stubs1_
Definition: StubTripletsMemory.h:41
trklet::MemoryBase::MemoryBase
MemoryBase(std::string name, Settings const &settings, unsigned int iSector)
Definition: MemoryBase.cc:11
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
trklet::StubTripletsMemory::stubs2_
std::vector< const Stub * > stubs2_
Definition: StubTripletsMemory.h:42
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44