CMS 3D CMS Logo

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

#include <AllProjectionsMemory.h>

Inheritance diagram for trklet::AllProjectionsMemory:
trklet::MemoryBase

Public Member Functions

void addTracklet (Tracklet *tracklet)
 
 AllProjectionsMemory (std::string name, Settings const &settings, unsigned int iSector)
 
void clean () override
 
const TrackletgetTracklet (unsigned int i) const
 
unsigned int nTracklets () const
 
void writeAP (bool first)
 
 ~AllProjectionsMemory () 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< Tracklet * > 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 AllProjectionsMemory.h.

Constructor & Destructor Documentation

◆ AllProjectionsMemory()

AllProjectionsMemory::AllProjectionsMemory ( std::string  name,
Settings const &  settings,
unsigned int  iSector 
)

Definition at line 10 of file AllProjectionsMemory.cc.

11  : MemoryBase(name, settings, iSector) {
13 }

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

◆ ~AllProjectionsMemory()

trklet::AllProjectionsMemory::~AllProjectionsMemory ( )
overridedefault

Member Function Documentation

◆ addTracklet()

void trklet::AllProjectionsMemory::addTracklet ( Tracklet tracklet)
inline

Definition at line 20 of file AllProjectionsMemory.h.

20 { tracklets_.push_back(tracklet); }

References tracklets_.

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

◆ clean()

void trklet::AllProjectionsMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 26 of file AllProjectionsMemory.h.

26 { tracklets_.clear(); }

References tracklets_.

◆ getTracklet()

const Tracklet* trklet::AllProjectionsMemory::getTracklet ( unsigned int  i) const
inline

Definition at line 24 of file AllProjectionsMemory.h.

24 { return tracklets_[i]; }

References mps_fire::i, and tracklets_.

◆ nTracklets()

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

Definition at line 22 of file AllProjectionsMemory.h.

22 { return tracklets_.size(); }

References tracklets_.

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

◆ writeAP()

void AllProjectionsMemory::writeAP ( bool  first)

Definition at line 15 of file AllProjectionsMemory.cc.

15  {
16  std::ostringstream oss;
17  oss << "../data/MemPrints/TrackletProjections/AllProj_" << getName() << "_" << std::setfill('0') << std::setw(2)
18  << (iSector_ + 1) << ".dat";
19  auto const& fname = oss.str();
20 
21  if (first) {
22  bx_ = 0;
23  event_ = 1;
24  out_.open(fname.c_str());
25  } else
26  out_.open(fname.c_str(), std::ofstream::app);
27 
28  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
29 
30  for (unsigned int j = 0; j < tracklets_.size(); j++) {
31  string proj =
32  (layer_ > 0) ? tracklets_[j]->trackletprojstrlayer(layer_) : tracklets_[j]->trackletprojstrdisk(disk_);
33  out_ << "0x";
34  out_ << std::setfill('0') << std::setw(2);
35  out_ << hex << j << dec;
36  out_ << " " << proj << " " << trklet::hexFormat(proj) << endl;
37  }
38  out_.close();
39 
40  bx_++;
41  event_++;
42  if (bx_ > 7)
43  bx_ = 0;
44 }

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_, amptDefault_cfi::proj, and tracklets_.

Member Data Documentation

◆ disk_

int trklet::AllProjectionsMemory::disk_
private

Definition at line 34 of file AllProjectionsMemory.h.

Referenced by AllProjectionsMemory(), and writeAP().

◆ layer_

int trklet::AllProjectionsMemory::layer_
private

Definition at line 33 of file AllProjectionsMemory.h.

Referenced by AllProjectionsMemory(), and writeAP().

◆ tracklets_

std::vector<Tracklet*> trklet::AllProjectionsMemory::tracklets_
private

Definition at line 31 of file AllProjectionsMemory.h.

Referenced by addTracklet(), clean(), getTracklet(), nTracklets(), and writeAP().

mps_fire.i
i
Definition: mps_fire.py:355
trklet::AllProjectionsMemory::disk_
int disk_
Definition: AllProjectionsMemory.h:34
trklet::MemoryBase::event_
int event_
Definition: MemoryBase.h:48
trklet::MemoryBase::out_
std::ofstream out_
Definition: MemoryBase.h:46
trklet::AllProjectionsMemory::layer_
int layer_
Definition: AllProjectionsMemory.h:33
trklet::MemoryBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:17
trklet::MemoryBase::bx_
int bx_
Definition: MemoryBase.h:47
dqmdumpme.first
first
Definition: dqmdumpme.py:55
trklet::AllProjectionsMemory::tracklets_
std::vector< Tracklet * > tracklets_
Definition: AllProjectionsMemory.h:31
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
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
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44