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_ << hexstr(j) << " " << proj << " " << trklet::hexFormat(proj) << endl;
33  }
34  out_.close();
35 
36  bx_++;
37  event_++;
38  if (bx_ > 7)
39  bx_ = 0;
40 }
unsigned int iSector_
Definition: MemoryBase.h:47
std::string hexFormat(const std::string &binary)
Definition: Util.h:19
std::string memPath() const
Definition: Settings.h:204
Settings const & settings_
Definition: MemoryBase.h:53
std::ofstream out_
Definition: MemoryBase.h:49
std::vector< Tracklet * > tracklets_
void writeAP(bool first, unsigned int iSector)
std::string const & getName() const
Definition: MemoryBase.h:19
static std::string hexstr(unsigned int index)
Definition: MemoryBase.cc:111
string fname
main script
AllProjectionsMemory(std::string name, Settings const &settings)
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:20
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:154