CMS 3D CMS Logo

AllProjectionsMemory.cc
Go to the documentation of this file.
4 #include <iomanip>
6 
7 using namespace trklet;
8 using namespace std;
9 
10 AllProjectionsMemory::AllProjectionsMemory(string name, Settings const& settings, unsigned int iSector)
11  : MemoryBase(name, settings, iSector) {
13 }
14 
16  std::ostringstream oss;
17  oss << "../data/MemPrints/TrackletProjections/AllProj_" << getName() << "_" << std::setfill('0') << std::setw(2)
18  << (iSector_ + 1) << ".dat";
19  auto const& fname = oss.str();
20 
21  if (first) {
22  bx_ = 0;
23  event_ = 1;
24  out_.open(fname.c_str());
25  } else
26  out_.open(fname.c_str(), std::ofstream::app);
27 
28  out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
29 
30  for (unsigned int j = 0; j < tracklets_.size(); j++) {
31  string proj =
32  (layer_ > 0) ? tracklets_[j]->trackletprojstrlayer(layer_) : tracklets_[j]->trackletprojstrdisk(disk_);
33  out_ << "0x";
34  out_ << std::setfill('0') << std::setw(2);
35  out_ << hex << j << dec;
36  out_ << " " << proj << " " << trklet::hexFormat(proj) << endl;
37  }
38  out_.close();
39 
40  bx_++;
41  event_++;
42  if (bx_ > 7)
43  bx_ = 0;
44 }
Settings.h
MessageLogger.h
trklet::AllProjectionsMemory::writeAP
void writeAP(bool first)
Definition: AllProjectionsMemory.cc:15
trklet::AllProjectionsMemory::disk_
int disk_
Definition: AllProjectionsMemory.h:34
trklet::Settings
Definition: Settings.h:26
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:17
trklet::MemoryBase::bx_
int bx_
Definition: MemoryBase.h:47
dqmdumpme.first
first
Definition: dqmdumpme.py:55
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
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet
Definition: AllProjectionsMemory.h:9
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
std
Definition: JetResolutionObject.h:76
trklet::AllProjectionsMemory::AllProjectionsMemory
AllProjectionsMemory(std::string name, Settings const &settings, unsigned int iSector)
Definition: AllProjectionsMemory.cc:10
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
trklet::hexFormat
std::string hexFormat(const std::string &binary)
Definition: Util.h:14
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
Tracklet.h
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44