Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:33:30

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_ << "0x";
0033     out_ << std::setfill('0') << std::setw(2);
0034     out_ << hex << j << dec;
0035     out_ << " " << proj << "  " << trklet::hexFormat(proj) << endl;
0036   }
0037   out_.close();
0038 
0039   bx_++;
0040   event_++;
0041   if (bx_ > 7)
0042     bx_ = 0;
0043 }