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
 
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

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,
double  phimin,
double  phimax 
)

Definition at line 10 of file TrackFitMemory.cc.

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

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_.

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

◆ writeTF()

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

Definition at line 16 of file TrackFitMemory.cc.

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_ << "0x";
30  out_ << std::setfill('0') << std::setw(2);
31  out_ << hex << j << dec << " ";
32  out_ << tracks_[j]->trackfitstr() << " " << trklet::hexFormat(tracks_[j]->trackfitstr());
33  out_ << "\n";
34  }
35  out_.close();
36 
37  bx_++;
38  event_++;
39  if (bx_ > 7)
40  bx_ = 0;
41 }

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 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::MemoryBase::settings_
Settings const & settings_
Definition: MemoryBase.h:50
trklet::TrackFitMemory::phimax_
double phimax_
Definition: TrackFitMemory.h:43
mps_fire.i
i
Definition: mps_fire.py:428
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
trklet::openfile
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:138
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
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::TrackFitMemory::phimin_
double phimin_
Definition: TrackFitMemory.h:42
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
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:19
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44