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 }
CSCNoiseMatrix::Item::elem34
float elem34
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::Item::elem67
float elem67
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::Item::print
std::string print() const
Definition: CSCNoiseMatrix.cc:20
CSCNoiseMatrix.h
CSCNoiseMatrix::print
std::string print() const
Definition: CSCNoiseMatrix.cc:27
CSCNoiseMatrix::Item::elem55
float elem55
Definition: CSCNoiseMatrix.h:16
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCNoiseMatrix::Item::elem33
float elem33
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::Item
Definition: CSCNoiseMatrix.h:15
CSCNoiseMatrix::Item::elem56
float elem56
Definition: CSCNoiseMatrix.h:16
CSCIndexer
Definition: CSCIndexer.h:44
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCNoiseMatrix::matrix
NoiseMatrixMap matrix
Definition: CSCNoiseMatrix.h:26
CSCNoiseMatrix::CSCNoiseMatrix
CSCNoiseMatrix()
Definition: CSCNoiseMatrix.cc:8
CSCNoiseMatrix::item
const Item & item(const CSCDetId &cscId, int strip) const
Definition: CSCNoiseMatrix.cc:11
CSCIndexer.h
CSCDetId
Definition: CSCDetId.h:26
CSCNoiseMatrix::Item::elem46
float elem46
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::Item::elem44
float elem44
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::Item::elem77
float elem77
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::~CSCNoiseMatrix
~CSCNoiseMatrix()
Definition: CSCNoiseMatrix.cc:9
CSCNoiseMatrix::Item::elem57
float elem57
Definition: CSCNoiseMatrix.h:16
CSCIndexer::dbIndex
int dbIndex(const CSCDetId &id, int &channel)
Definition: CSCIndexer.cc:231
Exception
Definition: hltDiff.cc:246
Exception.h
CSCNoiseMatrix::Item::elem35
float elem35
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::Item::elem66
float elem66
Definition: CSCNoiseMatrix.h:16
CSCNoiseMatrix::Item::elem45
float elem45
Definition: CSCNoiseMatrix.h:16