Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:47:22

0001 /****************************************************************************
0002  *
0003  * 
0004  * Authors: 
0005  * F.Ferro ferro@ge.infn.it
0006  *
0007  ****************************************************************************/
0008 
0009 #include "FWCore/Utilities/interface/typelookup.h"
0010 
0011 #include "CondFormats/PPSObjects/interface/CTPPSPixelDAQMapping.h"
0012 
0013 using namespace std;
0014 
0015 //----------------------------------------------------------------------------------------------------
0016 
0017 std::set<unsigned int> CTPPSPixelDAQMapping::fedIds() const {
0018   std::set<unsigned int> fedSet;
0019   for (const auto &p : ROCMapping) {
0020     fedSet.insert(p.first.getFEDId());
0021   }
0022   return fedSet;
0023 }
0024 
0025 std::ostream &operator<<(std::ostream &s, const CTPPSPixelROCInfo &vi) {
0026   s << "ID=" << vi.iD << "  ROC=" << vi.roc;
0027 
0028   return s;
0029 }
0030 
0031 //----------------------------------------------------------------------------------------------------
0032 
0033 void CTPPSPixelDAQMapping::insert(const CTPPSPixelFramePosition &fp, const CTPPSPixelROCInfo &vi) {
0034   auto it = ROCMapping.find(fp);
0035   if (it != ROCMapping.end()) {
0036     edm::LogError("RPix") << "WARNING in DAQMapping::insert > Overwriting entry at " << fp << ". Previous: "
0037                           << "    " << ROCMapping[fp] << ","
0038                           << "  new: "
0039                           << "    " << vi << ". ";
0040   }
0041 
0042   ROCMapping[fp] = vi;
0043 }