CMS 3D CMS Logo

TrackFitMemory.cc
Go to the documentation of this file.
4 #include <iomanip>
5 #include <filesystem>
6 
7 using namespace std;
8 using namespace trklet;
9 
10 TrackFitMemory::TrackFitMemory(string name, Settings const& settings, double phimin, double phimax)
11  : MemoryBase(name, settings) {
12  phimin_ = phimin;
13  phimax_ = phimax;
14 }
15 
16 void TrackFitMemory::writeTF(bool first, unsigned int iSector) {
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 }
void writeTF(bool first, unsigned int iSector)
unsigned int iSector_
Definition: MemoryBase.h:44
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:50
std::ofstream out_
Definition: MemoryBase.h:46
std::string const & getName() const
Definition: MemoryBase.h:19
string fname
main script
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:139