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
 
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)
 
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)
 
- 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) {}

◆ ~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,
unsigned int  iSector 
)

Definition at line 12 of file StubTripletsMemory.cc.

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_ << std::setfill('0') << std::setw(2);
29  out_ << hex << j << dec;
30  out_ << " " << stub1index << "|" << stub2index << "|" << stub3index << endl;
31  }
32  out_.close();
33 
34  bx_++;
35  event_++;
36  if (bx_ > 7)
37  bx_ = 0;
38 }

References trklet::MemoryBase::bx_, TauDecayModes::dec, trklet::MemoryBase::event_, first, alignmentValidation::fname, trklet::MemoryBase::getName(), trklet::MemoryBase::iSector_, dqmiolumiharvest::j, trklet::Settings::memPath(), trklet::openfile(), trklet::MemoryBase::out_, trklet::MemoryBase::settings_, 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().

trklet::MemoryBase::settings_
Settings const & settings_
Definition: MemoryBase.h:50
mps_fire.i
i
Definition: mps_fire.py:428
trklet::openfile
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:138
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
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
trklet::Settings::memPath
std::string memPath() const
Definition: Settings.h:192
trklet::StubTripletsMemory::stubs1_
std::vector< const Stub * > stubs1_
Definition: StubTripletsMemory.h:41
trklet::MemoryBase::MemoryBase
MemoryBase(std::string name, Settings const &settings)
Definition: MemoryBase.cc:13
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:142
trklet::StubTripletsMemory::stubs2_
std::vector< const Stub * > stubs2_
Definition: StubTripletsMemory.h:42
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44