CMS 3D CMS Logo

CSCNoiseMatrix.cc
Go to the documentation of this file.
4 
5 #include <iostream>
6 #include <sstream>
7 
10 
11 const CSCNoiseMatrix::Item& CSCNoiseMatrix::item(const CSCDetId& cscId, int strip) const {
12  CSCIndexer indexer;
13  NoiseMatrixMap::const_iterator mapItr = matrix.find(indexer.dbIndex(cscId, strip));
14  if (mapItr == matrix.end()) {
15  throw cms::Exception("CSCNoiseMatrix") << "Cannot find CSC conditions for chamber " << CSCDetId(cscId);
16  }
17  return mapItr->second.at(strip - 1);
18 }
19 
21  std::ostringstream os;
22  os << elem33 << " " << elem34 << " " << elem35 << " " << elem44 << " " << elem45 << " " << elem46 << " " << elem55
23  << " " << elem56 << " " << elem57 << " " << elem66 << " " << elem67 << " " << elem77 << "\n";
24  return os.str();
25 }
26 
28  std::ostringstream os;
29  for (NoiseMatrixMap::const_iterator mapItr = matrix.begin(); mapItr != matrix.end(); ++mapItr) {
30  os << mapItr->first << " ";
31  for (std::vector<Item>::const_iterator itemItr = mapItr->second.begin(); itemItr != mapItr->second.end();
32  ++itemItr) {
33  os << itemItr->print();
34  }
35  }
36  return os.str();
37 }
std::string print() const
std::string print() const
const Item & item(const CSCDetId &cscId, int strip) const
int dbIndex(const CSCDetId &id, int &channel)
Definition: CSCIndexer.cc:235
NoiseMatrixMap matrix