File indexing completed on 2024-04-06 12:21:57
0001 #include "L1Trigger/TrackFindingTracklet/interface/AllProjectionsMemory.h"
0002 #include "L1Trigger/TrackFindingTracklet/interface/Tracklet.h"
0003 #include "L1Trigger/TrackFindingTracklet/interface/Settings.h"
0004 #include "L1Trigger/TrackFindingTracklet/interface/Util.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006
0007 #include <iomanip>
0008 #include <filesystem>
0009
0010 using namespace trklet;
0011 using namespace std;
0012
0013 AllProjectionsMemory::AllProjectionsMemory(string name, Settings const& settings) : MemoryBase(name, settings) {
0014 initLayerDisk(3, layer_, disk_);
0015 }
0016
0017 void AllProjectionsMemory::writeAP(bool first, unsigned int iSector) {
0018 iSector_ = iSector;
0019 const string dirTP = settings_.memPath() + "TrackletProjections/";
0020
0021 std::ostringstream oss;
0022 oss << dirTP << "AllProj_" << getName() << "_" << std::setfill('0') << std::setw(2) << (iSector_ + 1) << ".dat";
0023 auto const& fname = oss.str();
0024
0025 openfile(out_, first, dirTP, fname, __FILE__, __LINE__);
0026
0027 out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;
0028
0029 for (unsigned int j = 0; j < tracklets_.size(); j++) {
0030 string proj =
0031 (layer_ > 0) ? tracklets_[j]->trackletprojstrlayer(layer_) : tracklets_[j]->trackletprojstrdisk(disk_);
0032 out_ << hexstr(j) << " " << proj << " " << trklet::hexFormat(proj) << endl;
0033 }
0034 out_.close();
0035
0036 bx_++;
0037 event_++;
0038 if (bx_ > 7)
0039 bx_ = 0;
0040 }