Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/****************************************************************************
 *
 * 
 * Authors: 
 * F.Ferro ferro@ge.infn.it
 *
 ****************************************************************************/

#include "FWCore/Utilities/interface/typelookup.h"

#include "CondFormats/PPSObjects/interface/CTPPSPixelDAQMapping.h"

using namespace std;

//----------------------------------------------------------------------------------------------------

std::set<unsigned int> CTPPSPixelDAQMapping::fedIds() const {
  std::set<unsigned int> fedSet;
  for (const auto &p : ROCMapping) {
    fedSet.insert(p.first.getFEDId());
  }
  return fedSet;
}

std::ostream &operator<<(std::ostream &s, const CTPPSPixelROCInfo &vi) {
  s << "ID=" << vi.iD << "  ROC=" << vi.roc;

  return s;
}

//----------------------------------------------------------------------------------------------------

void CTPPSPixelDAQMapping::insert(const CTPPSPixelFramePosition &fp, const CTPPSPixelROCInfo &vi) {
  auto it = ROCMapping.find(fp);
  if (it != ROCMapping.end()) {
    edm::LogError("RPix") << "WARNING in DAQMapping::insert > Overwriting entry at " << fp << ". Previous: "
                          << "    " << ROCMapping[fp] << ","
                          << "  new: "
                          << "    " << vi << ". ";
  }

  ROCMapping[fp] = vi;
}