test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
13  CSCIndexer indexer;
14  NoiseMatrixMap::const_iterator mapItr = matrix.find( indexer.dbIndex(cscId, strip) );
15  if(mapItr == matrix.end())
16  {
17  throw cms::Exception("CSCNoiseMatrix")
18  << "Cannot find CSC conditions for chamber " << CSCDetId(cscId);
19  }
20  return mapItr->second.at(strip-1);
21 }
22 
23 
25 {
26  std::ostringstream os;
27  os << elem33 << " " << elem34 << " " << elem35 << " " << elem44 << " "
28  << elem45 << " " << elem46 << " " << elem55 << " " << elem56 << " "
29  << elem57 << " " << elem66 << " " << elem67 << " " << elem77 << "\n";
30  return os.str();
31 }
32 
34 {
35  std::ostringstream os;
36  for(NoiseMatrixMap::const_iterator mapItr = matrix.begin(); mapItr != matrix.end(); ++mapItr)
37  {
38  os << mapItr->first<< " ";
39  for(std::vector<Item>::const_iterator itemItr = mapItr->second.begin();
40  itemItr != mapItr->second.end(); ++itemItr)
41  {
42  os << itemItr->print();
43  }
44  }
45  return os.str();
46 }
47 
const Item & item(const CSCDetId &cscId, int strip) const
std::string print() const
int dbIndex(const CSCDetId &id, int &channel)
Definition: CSCIndexer.cc:240
NoiseMatrixMap matrix
std::string print() const