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

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

Definition at line 9 of file VMProjectionsMemory.cc.

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

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

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

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 }

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

◆ clean()

void trklet::VMProjectionsMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 29 of file VMProjectionsMemory.h.

29 { tracklets_.clear(); }

References tracklets_.

◆ disk()

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

Definition at line 32 of file VMProjectionsMemory.h.

32 { return disk_; }

References disk_.

◆ getAllProjIndex()

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

Definition at line 25 of file VMProjectionsMemory.h.

25 { return tracklets_[i].second; }

References mps_fire::i, and tracklets_.

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

◆ getTracklet()

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

Definition at line 24 of file VMProjectionsMemory.h.

24 { return tracklets_[i].first; }

References mps_fire::i, and tracklets_.

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

◆ layer()

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

Definition at line 31 of file VMProjectionsMemory.h.

31 { return layer_; }

References layer_.

Referenced by geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

◆ nTracklets()

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

Definition at line 22 of file VMProjectionsMemory.h.

22 { return tracklets_.size(); }

References tracklets_.

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

◆ writeVMPROJ()

void VMProjectionsMemory::writeVMPROJ ( bool  first)

Definition at line 23 of file VMProjectionsMemory.cc.

23  {
24  std::ostringstream oss;
25  oss << "../data/MemPrints/VMProjections/VMProjections_" << getName();
26  //get rid of duplicates
27  auto const& tmp = oss.str();
28  int len = tmp.size();
29  if (tmp[len - 2] == 'n' && tmp[len - 1] > '1' && tmp[len - 1] <= '9')
30  return;
31  oss << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
32  auto const& fname = oss.str();
33 
34  if (first) {
35  bx_ = 0;
36  event_ = 1;
37  out_.open(fname.c_str());
38  } else
39  out_.open(fname.c_str(), std::ofstream::app);
40 
41  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
42 
43  for (unsigned int j = 0; j < tracklets_.size(); j++) {
44  string vmproj = (layer_ > 0) ? tracklets_[j].first->vmstrlayer(layer_, tracklets_[j].second)
45  : tracklets_[j].first->vmstrdisk(disk_, tracklets_[j].second);
46  out_ << "0x";
47  out_ << std::setfill('0') << std::setw(2);
48  out_ << hex << j << dec;
49  out_ << " " << vmproj << " " << trklet::hexFormat(vmproj) << endl;
50  }
51  out_.close();
52 
53  bx_++;
54  event_++;
55  if (bx_ > 7)
56  bx_ = 0;
57 }

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

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
trklet::VMProjectionsMemory::tracklets_
std::vector< std::pair< Tracklet *, unsigned int > > tracklets_
Definition: VMProjectionsMemory.h:37
mps_fire.i
i
Definition: mps_fire.py:428
trklet::VMProjectionsMemory::disk_
int disk_
Definition: VMProjectionsMemory.h:36
cms::cuda::assert
assert(be >=bs)
trklet::MemoryBase::event_
int event_
Definition: MemoryBase.h:48
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
trklet::MemoryBase::out_
std::ofstream out_
Definition: MemoryBase.h:46
trklet::MemoryBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:17
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
trklet::MemoryBase::bx_
int bx_
Definition: MemoryBase.h:47
dqmdumpme.first
first
Definition: dqmdumpme.py:55
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::Tracklet::TCID
int TCID() const
Definition: Tracklet.h:500
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
trklet::hexFormat
std::string hexFormat(const std::string &binary)
Definition: Util.h:14
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
trklet::VMProjectionsMemory::layer_
int layer_
Definition: VMProjectionsMemory.h:35
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44