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 }
Settings.h
trklet::MemoryBase::settings_
Settings const & settings_
Definition: MemoryBase.h:50
Util.h
trklet::AllProjectionsMemory::AllProjectionsMemory
AllProjectionsMemory(std::string name, Settings const &settings)
Definition: AllProjectionsMemory.cc:13
MessageLogger.h
trklet::AllProjectionsMemory::disk_
int disk_
Definition: AllProjectionsMemory.h:34
trklet::openfile
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)
Definition: Util.h:138
trklet::Settings
Definition: Settings.h:52
trklet::MemoryBase::event_
int event_
Definition: MemoryBase.h:48
trklet::MemoryBase::out_
std::ofstream out_
Definition: MemoryBase.h:46
trklet::AllProjectionsMemory::layer_
int layer_
Definition: AllProjectionsMemory.h:33
trklet::MemoryBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:19
trklet::MemoryBase::bx_
int bx_
Definition: MemoryBase.h:47
trklet::AllProjectionsMemory::tracklets_
std::vector< Tracklet * > tracklets_
Definition: AllProjectionsMemory.h:31
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
AllProjectionsMemory.h
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet::Settings::memPath
std::string memPath() const
Definition: Settings.h:192
trklet
Definition: AllInnerStubsMemory.h:10
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
std
Definition: JetResolutionObject.h:76
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
trklet::AllProjectionsMemory::writeAP
void writeAP(bool first, unsigned int iSector)
Definition: AllProjectionsMemory.cc:17
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
Tracklet.h
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44