CMS 3D CMS Logo

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

#include <TrackFitMemory.h>

Inheritance diagram for trklet::TrackFitMemory:
trklet::MemoryBase

Public Member Functions

void addStubidsList (std::vector< std::pair< int, int >> stubidslist)
 
void addStubList (std::vector< const Stub * > stublist)
 
void addTrack (Tracklet *tracklet)
 
void clean () override
 
std::vector< std::pair< int, int > > getStubidslist (unsigned int i) const
 
std::vector< const Stub * > getStublist (unsigned int i) const
 
TrackletgetTrack (unsigned int i)
 
unsigned int nStubidslists () const
 
unsigned int nStublists () const
 
unsigned int nTracks () const
 
 TrackFitMemory (std::string name, Settings const &settings, unsigned int iSector, double phimin, double phimax)
 
void writeTF (bool first)
 
 ~TrackFitMemory () 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

double phimax_
 
double phimin_
 
std::vector< std::vector< std::pair< int, int > > > stubidslists_
 
std::vector< std::vector< const Stub * > > stublists_
 
std::vector< Tracklet * > tracks_
 

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 15 of file TrackFitMemory.h.

Constructor & Destructor Documentation

◆ TrackFitMemory()

TrackFitMemory::TrackFitMemory ( std::string  name,
Settings const &  settings,
unsigned int  iSector,
double  phimin,
double  phimax 
)

Definition at line 9 of file TrackFitMemory.cc.

10  : MemoryBase(name, settings, iSector) {
11  phimin_ = phimin;
12  phimax_ = phimax;
13 }

References phimax, phimax_, phimin, and phimin_.

◆ ~TrackFitMemory()

trklet::TrackFitMemory::~TrackFitMemory ( )
overridedefault

Member Function Documentation

◆ addStubidsList()

void trklet::TrackFitMemory::addStubidsList ( std::vector< std::pair< int, int >>  stubidslist)
inline

Definition at line 23 of file TrackFitMemory.h.

23 { stubidslists_.push_back(stubidslist); }

References stubidslists_.

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

◆ addStubList()

void trklet::TrackFitMemory::addStubList ( std::vector< const Stub * >  stublist)
inline

Definition at line 22 of file TrackFitMemory.h.

22 { stublists_.push_back(stublist); }

References stublists_.

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

◆ addTrack()

void trklet::TrackFitMemory::addTrack ( Tracklet tracklet)
inline

Definition at line 21 of file TrackFitMemory.h.

21 { tracks_.push_back(tracklet); }

References tracks_.

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

◆ clean()

void trklet::TrackFitMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 33 of file TrackFitMemory.h.

33  {
34  tracks_.clear();
35  stublists_.clear();
36  stubidslists_.clear();
37  }

References stubidslists_, stublists_, and tracks_.

◆ getStubidslist()

std::vector<std::pair<int, int> > trklet::TrackFitMemory::getStubidslist ( unsigned int  i) const
inline

Definition at line 31 of file TrackFitMemory.h.

31 { return stubidslists_[i]; }

References mps_fire::i, and stubidslists_.

◆ getStublist()

std::vector<const Stub*> trklet::TrackFitMemory::getStublist ( unsigned int  i) const
inline

Definition at line 30 of file TrackFitMemory.h.

30 { return stublists_[i]; }

References mps_fire::i, and stublists_.

◆ getTrack()

Tracklet* trklet::TrackFitMemory::getTrack ( unsigned int  i)
inline

Definition at line 29 of file TrackFitMemory.h.

29 { return tracks_[i]; }

References mps_fire::i, and tracks_.

◆ nStubidslists()

unsigned int trklet::TrackFitMemory::nStubidslists ( ) const
inline

Definition at line 27 of file TrackFitMemory.h.

27 { return stubidslists_.size(); }

References stubidslists_.

◆ nStublists()

unsigned int trklet::TrackFitMemory::nStublists ( ) const
inline

Definition at line 26 of file TrackFitMemory.h.

26 { return stublists_.size(); }

References stublists_.

◆ nTracks()

unsigned int trklet::TrackFitMemory::nTracks ( ) const
inline

Definition at line 25 of file TrackFitMemory.h.

25 { return tracks_.size(); }

References tracks_.

◆ writeTF()

void TrackFitMemory::writeTF ( bool  first)

Definition at line 15 of file TrackFitMemory.cc.

15  {
16  std::ostringstream oss;
17  oss << "../data/MemPrints/FitTrack/TrackFit_" << 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 < tracks_.size(); j++) {
31  out_ << "0x";
32  out_ << std::setfill('0') << std::setw(2);
33  out_ << hex << j << dec << " ";
34  out_ << tracks_[j]->trackfitstr() << " " << trklet::hexFormat(tracks_[j]->trackfitstr());
35  out_ << "\n";
36  }
37  out_.close();
38 
39  bx_++;
40  event_++;
41  if (bx_ > 7)
42  bx_ = 0;
43 }

References trklet::MemoryBase::bx_, TauDecayModes::dec, trklet::MemoryBase::event_, dqmdumpme::first, alignmentValidation::fname, trklet::MemoryBase::getName(), trklet::hexFormat(), trklet::MemoryBase::iSector_, dqmiolumiharvest::j, trklet::MemoryBase::out_, and tracks_.

Member Data Documentation

◆ phimax_

double trklet::TrackFitMemory::phimax_
private

Definition at line 43 of file TrackFitMemory.h.

Referenced by TrackFitMemory().

◆ phimin_

double trklet::TrackFitMemory::phimin_
private

Definition at line 42 of file TrackFitMemory.h.

Referenced by TrackFitMemory().

◆ stubidslists_

std::vector<std::vector<std::pair<int, int> > > trklet::TrackFitMemory::stubidslists_
private

Definition at line 46 of file TrackFitMemory.h.

Referenced by addStubidsList(), clean(), getStubidslist(), and nStubidslists().

◆ stublists_

std::vector<std::vector<const Stub*> > trklet::TrackFitMemory::stublists_
private

Definition at line 45 of file TrackFitMemory.h.

Referenced by addStubList(), clean(), getStublist(), and nStublists().

◆ tracks_

std::vector<Tracklet*> trklet::TrackFitMemory::tracks_
private

Definition at line 44 of file TrackFitMemory.h.

Referenced by addTrack(), clean(), getTrack(), nTracks(), and writeTF().

trklet::TrackFitMemory::phimax_
double phimax_
Definition: TrackFitMemory.h:43
mps_fire.i
i
Definition: mps_fire.py:355
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
trklet::TrackFitMemory::stublists_
std::vector< std::vector< const Stub * > > stublists_
Definition: TrackFitMemory.h:45
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
dqmdumpme.first
first
Definition: dqmdumpme.py:55
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::TrackFitMemory::phimin_
double phimin_
Definition: TrackFitMemory.h:42
trklet::MemoryBase::MemoryBase
MemoryBase(std::string name, Settings const &settings, unsigned int iSector)
Definition: MemoryBase.cc:11
phimax
float phimax
Definition: ReggeGribovPartonMCHadronizer.h:106
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
trklet::TrackFitMemory::tracks_
std::vector< Tracklet * > tracks_
Definition: TrackFitMemory.h:44
trklet::TrackFitMemory::stubidslists_
std::vector< std::vector< std::pair< int, int > > > stubidslists_
Definition: TrackFitMemory.h:46
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