CMS 3D CMS Logo

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

#include <TrackletParametersMemory.h>

Inheritance diagram for trklet::TrackletParametersMemory:
trklet::MemoryBase

Public Member Functions

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

Constructor & Destructor Documentation

◆ TrackletParametersMemory()

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

Definition at line 11 of file TrackletParametersMemory.cc.

12  : MemoryBase(name, settings) {}

◆ ~TrackletParametersMemory()

trklet::TrackletParametersMemory::~TrackletParametersMemory ( )
overridedefault

Member Function Documentation

◆ addTracklet()

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

◆ clean()

void TrackletParametersMemory::clean ( )
overridevirtual

Implements trklet::MemoryBase.

Definition at line 14 of file TrackletParametersMemory.cc.

14  {
15  for (auto& tracklet : tracklets_) {
16  delete tracklet;
17  }
18  tracklets_.clear();
19 }

References tracklets_.

◆ getTracklet()

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

Definition at line 27 of file TrackletParametersMemory.h.

27 { return tracklets_[i]; }

References mps_fire::i, and tracklets_.

◆ nTracklets()

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

◆ writeTPAR()

void TrackletParametersMemory::writeTPAR ( bool  first,
unsigned int  iSector 
)

Definition at line 21 of file TrackletParametersMemory.cc.

21  {
22  iSector_ = iSector;
23  const string dirTP = settings_.memPath() + "TrackletParameters/";
24 
25  std::ostringstream oss;
26  oss << dirTP << "TrackletParameters_" << getName() << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1)
27  << ".dat";
28  auto const& fname = oss.str();
29 
30  openfile(out_, first, dirTP, fname, __FILE__, __LINE__);
31 
32  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
33 
34  for (unsigned int j = 0; j < tracklets_.size(); j++) {
35  string tpar = tracklets_[j]->trackletparstr();
36  out_ << "0x";
37  out_ << std::setfill('0') << std::setw(2);
38  out_ << hex << j << dec;
39  out_ << " " << tpar << " " << trklet::hexFormat(tpar) << endl;
40  }
41  out_.close();
42 
43  bx_++;
44  event_++;
45  if (bx_ > 7)
46  bx_ = 0;
47 }

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

Member Data Documentation

◆ tracklets_

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

Definition at line 34 of file TrackletParametersMemory.h.

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

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::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::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
trklet::hexFormat
std::string hexFormat(const std::string &binary)
Definition: Util.h:19
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
trklet::TrackletParametersMemory::tracklets_
std::vector< Tracklet * > tracklets_
Definition: TrackletParametersMemory.h:34
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44