CMS 3D CMS Logo

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

#include <VMProjectionsMemory.h>

Inheritance diagram for trklet::VMProjectionsMemory:
trklet::MemoryBase

Public Member Functions

void addTracklet (Tracklet *tracklet, unsigned int allprojindex)
 
void clean () override
 
int disk () const
 
int getAllProjIndex (unsigned int i) const
 
TrackletgetTracklet (unsigned int i)
 
int layer () const
 
unsigned int nTracklets () const
 
 VMProjectionsMemory (std::string name, Settings const &settings)
 
void writeVMPROJ (bool first, unsigned int iSector)
 
 ~VMProjectionsMemory () 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

int disk_
 
int layer_
 
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_
 

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 VMProjectionsMemory.h.

Constructor & Destructor Documentation

◆ VMProjectionsMemory()

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

Definition at line 10 of file VMProjectionsMemory.cc.

References disk_, trklet::MemoryBase::initLayerDisk(), and layer_.

10  : MemoryBase(name, settings) {
12 }
MemoryBase(std::string name, Settings const &settings)
Definition: MemoryBase.cc:13
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:19

◆ ~VMProjectionsMemory()

trklet::VMProjectionsMemory::~VMProjectionsMemory ( )
overridedefault

Member Function Documentation

◆ addTracklet()

void VMProjectionsMemory::addTracklet ( Tracklet tracklet,
unsigned int  allprojindex 
)

Definition at line 14 of file VMProjectionsMemory.cc.

References cms::cuda::assert(), trklet::Tracklet::TCID(), createJobs::tmp, and tracklets_.

14  {
15  std::pair<Tracklet*, unsigned int> tmp(tracklet, allprojindex);
16  //Check that order of TCID is correct
17  if (!tracklets_.empty()) {
18  assert(tracklets_[tracklets_.size() - 1].first->TCID() <= tracklet->TCID());
19  }
20  tracklets_.push_back(tmp);
21 }
assert(be >=bs)
int TCID() const
Definition: Tracklet.h:212
tmp
align.sh
Definition: createJobs.py:716
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_

◆ clean()

void trklet::VMProjectionsMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 29 of file VMProjectionsMemory.h.

References tracklets_.

29 { tracklets_.clear(); }
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_

◆ disk()

int trklet::VMProjectionsMemory::disk ( ) const
inline

Definition at line 32 of file VMProjectionsMemory.h.

References disk_.

◆ getAllProjIndex()

int trklet::VMProjectionsMemory::getAllProjIndex ( unsigned int  i) const
inline

Definition at line 25 of file VMProjectionsMemory.h.

References mps_fire::i, and tracklets_.

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

25 { return tracklets_[i].second; }
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_

◆ getTracklet()

Tracklet* trklet::VMProjectionsMemory::getTracklet ( unsigned int  i)
inline

Definition at line 24 of file VMProjectionsMemory.h.

References mps_fire::i, and tracklets_.

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

24 { return tracklets_[i].first; }
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_

◆ layer()

int trklet::VMProjectionsMemory::layer ( ) const
inline

◆ nTracklets()

unsigned int trklet::VMProjectionsMemory::nTracklets ( ) const
inline

Definition at line 22 of file VMProjectionsMemory.h.

References tracklets_.

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

22 { return tracklets_.size(); }
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_

◆ writeVMPROJ()

void VMProjectionsMemory::writeVMPROJ ( bool  first,
unsigned int  iSector 
)

Definition at line 23 of file VMProjectionsMemory.cc.

References trklet::MemoryBase::bx_, TauDecayModes::dec, disk_, trklet::MemoryBase::event_, first, alignmentValidation::fname, trklet::MemoryBase::getName(), trklet::hexFormat(), trklet::MemoryBase::iSector_, dqmiolumiharvest::j, layer_, trklet::Settings::memPath(), trklet::openfile(), trklet::MemoryBase::out_, edm::second(), trklet::MemoryBase::settings_, createJobs::tmp, and tracklets_.

23  {
24  iSector_ = iSector;
25  const string dirVM = settings_.memPath() + "VMProjections/";
26 
27  std::ostringstream oss;
28  oss << dirVM + "VMProjections_" << getName();
29  //get rid of duplicates
30  auto const& tmp = oss.str();
31  int len = tmp.size();
32  if (tmp[len - 2] == 'n' && tmp[len - 1] > '1' && tmp[len - 1] <= '9')
33  return;
34  oss << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
35  auto const& fname = oss.str();
36 
37  openfile(out_, first, dirVM, fname, __FILE__, __LINE__);
38 
39  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
40 
41  for (unsigned int j = 0; j < tracklets_.size(); j++) {
42  string vmproj = (layer_ > 0) ? tracklets_[j].first->vmstrlayer(layer_, tracklets_[j].second)
43  : tracklets_[j].first->vmstrdisk(disk_, tracklets_[j].second);
44  out_ << "0x";
45  out_ << std::setfill('0') << std::setw(2);
46  out_ << hex << j << dec;
47  out_ << " " << vmproj << " " << trklet::hexFormat(vmproj) << endl;
48  }
49  out_.close();
50 
51  bx_++;
52  event_++;
53  if (bx_ > 7)
54  bx_ = 0;
55 }
unsigned int iSector_
Definition: MemoryBase.h:44
std::string hexFormat(const std::string &binary)
Definition: Util.h:19
std::string memPath() const
Definition: Settings.h:192
U second(std::pair< T, U > const &p)
Settings const & settings_
Definition: MemoryBase.h:50
std::ofstream out_
Definition: MemoryBase.h:46
std::string const & getName() const
Definition: MemoryBase.h:19
string fname
main script
tmp
align.sh
Definition: createJobs.py:716
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:139

Member Data Documentation

◆ disk_

int trklet::VMProjectionsMemory::disk_
private

Definition at line 36 of file VMProjectionsMemory.h.

Referenced by disk(), VMProjectionsMemory(), and writeVMPROJ().

◆ layer_

int trklet::VMProjectionsMemory::layer_
private

Definition at line 35 of file VMProjectionsMemory.h.

Referenced by layer(), VMProjectionsMemory(), and writeVMPROJ().

◆ tracklets_

std::vector<std::pair<Tracklet*, unsigned int> > trklet::VMProjectionsMemory::tracklets_
private