CMS 3D CMS Logo

AllProjectionsMemory.cc
Go to the documentation of this file.
6 
7 #include <iomanip>
8 #include <filesystem>
9 
10 using namespace trklet;
11 using namespace std;
12 
15 }
16 
17 void AllProjectionsMemory::writeAP(bool first, unsigned int iSector) {
18  iSector_ = iSector;
19  const string dirTP = settings_.memPath() + "TrackletProjections/";
20 
21  std::ostringstream oss;
22  oss << dirTP << "AllProj_" << getName() << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
23  auto const& fname = oss.str();
24 
25  openfile(out_, first, dirTP, fname, __FILE__, __LINE__);
26 
27  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
28 
29  for (unsigned int j = 0; j < tracklets_.size(); j++) {
30  string proj =
31  (layer_ > 0) ? tracklets_[j]->trackletprojstrlayer(layer_) : tracklets_[j]->trackletprojstrdisk(disk_);
32  out_ << "0x";
33  out_ << std::setfill('0') << std::setw(2);
34  out_ << hex << j << dec;
35  out_ << " " << proj << " " << trklet::hexFormat(proj) << endl;
36  }
37  out_.close();
38 
39  bx_++;
40  event_++;
41  if (bx_ > 7)
42  bx_ = 0;
43 }
unsigned int iSector_
Definition: MemoryBase.h:44
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::vector< Tracklet * > tracklets_
void writeAP(bool first, unsigned int iSector)
std::string const & getName() const
Definition: MemoryBase.h:19
string fname
main script
AllProjectionsMemory(std::string name, Settings const &settings)
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:19
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:139