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, double phimin, double phimax)
 
void writeTF (bool first, unsigned int iSector)
 
 ~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
 
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

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)
 
static std::string hexstr (unsigned int index)
 
- 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,
double  phimin,
double  phimax 
)

Definition at line 10 of file TrackFitMemory.cc.

References phimax, phimax_, phimin, and phimin_.

11  : MemoryBase(name, settings) {
12  phimin_ = phimin;
13  phimax_ = phimax;
14 }
MemoryBase(std::string name, Settings const &settings)
Definition: MemoryBase.cc:14

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

References stubidslists_.

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

23 { stubidslists_.push_back(stubidslist); }
std::vector< std::vector< std::pair< int, int > > > stubidslists_

◆ addStubList()

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

Definition at line 22 of file TrackFitMemory.h.

References stublists_.

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

22 { stublists_.push_back(stublist); }
std::vector< std::vector< const Stub * > > stublists_

◆ addTrack()

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

Definition at line 21 of file TrackFitMemory.h.

References tracks_.

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

21 { tracks_.push_back(tracklet); }
std::vector< Tracklet * > tracks_

◆ clean()

void trklet::TrackFitMemory::clean ( )
inlineoverridevirtual

Implements trklet::MemoryBase.

Definition at line 33 of file TrackFitMemory.h.

References stubidslists_, stublists_, and tracks_.

33  {
34  tracks_.clear();
35  stublists_.clear();
36  stubidslists_.clear();
37  }
std::vector< std::vector< std::pair< int, int > > > stubidslists_
std::vector< Tracklet * > tracks_
std::vector< std::vector< const Stub * > > stublists_

◆ getStubidslist()

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

Definition at line 31 of file TrackFitMemory.h.

References mps_fire::i, and stubidslists_.

31 { return stubidslists_[i]; }
std::vector< std::vector< std::pair< int, int > > > stubidslists_

◆ getStublist()

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

Definition at line 30 of file TrackFitMemory.h.

References mps_fire::i, and stublists_.

30 { return stublists_[i]; }
std::vector< std::vector< const Stub * > > stublists_

◆ getTrack()

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

Definition at line 29 of file TrackFitMemory.h.

References mps_fire::i, and tracks_.

29 { return tracks_[i]; }
std::vector< Tracklet * > tracks_

◆ nStubidslists()

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

Definition at line 27 of file TrackFitMemory.h.

References stubidslists_.

27 { return stubidslists_.size(); }
std::vector< std::vector< std::pair< int, int > > > stubidslists_

◆ nStublists()

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

Definition at line 26 of file TrackFitMemory.h.

References stublists_.

26 { return stublists_.size(); }
std::vector< std::vector< const Stub * > > stublists_

◆ nTracks()

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

Definition at line 25 of file TrackFitMemory.h.

References tracks_.

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

25 { return tracks_.size(); }
std::vector< Tracklet * > tracks_

◆ writeTF()

void TrackFitMemory::writeTF ( bool  first,
unsigned int  iSector 
)

Definition at line 16 of file TrackFitMemory.cc.

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

16  {
17  iSector_ = iSector;
18  const string dirFT = settings_.memPath() + "FitTrack/";
19 
20  std::ostringstream oss;
21  oss << dirFT << "TrackFit_" << getName() << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
22  auto const& fname = oss.str();
23 
24  openfile(out_, first, dirFT, fname, __FILE__, __LINE__);
25 
26  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
27 
28  for (unsigned int j = 0; j < tracks_.size(); j++) {
29  out_ << hexstr(j) << " " << tracks_[j]->trackfitstr() << " " << trklet::hexFormat(tracks_[j]->trackfitstr());
30  out_ << "\n";
31  }
32  out_.close();
33 
34  bx_++;
35  event_++;
36  if (bx_ > 7)
37  bx_ = 0;
38 }
unsigned int iSector_
Definition: MemoryBase.h:47
std::vector< Tracklet * > tracks_
std::string hexFormat(const std::string &binary)
Definition: Util.h:19
std::string memPath() const
Definition: Settings.h:192
Settings const & settings_
Definition: MemoryBase.h:53
std::ofstream out_
Definition: MemoryBase.h:49
std::string const & getName() const
Definition: MemoryBase.h:19
static std::string hexstr(unsigned int index)
Definition: MemoryBase.cc:111
string fname
main script
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:137

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().