CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CondFormats/CSCObjects/src/CSCDBGains.cc

Go to the documentation of this file.
00001 #include "CondFormats/CSCObjects/interface/CSCDBGains.h"
00002 #include "DataFormats/MuonDetId/interface/CSCIndexer.h"
00003 
00004 CSCDBGains::CSCDBGains(){}
00005 CSCDBGains::~CSCDBGains(){}
00006 
00007 const CSCDBGains::Item & CSCDBGains::item(const CSCDetId & cscId, int strip) const
00008 {
00009   CSCIndexer indexer;
00010   //  return gains.at( indexer.stripChannelIndex(cscId, strip)-1 ); // if we worry about range
00011   return gains[ indexer.stripChannelIndex(cscId, strip)-1 ]; // no worries about range!
00012 }
00013 
00014 std::ostream & operator<<(std::ostream & os, const CSCDBGains & cscDbGains)
00015 {
00016   CSCIndexer indexer;
00017   for(size_t i = 0; i < cscDbGains.gains.size(); ++i)
00018   {
00019     std::pair<CSCDetId, CSCIndexer::IndexType> indexPair = indexer.detIdFromStripChannelIndex(i);
00020     os << indexPair.first << " strip:" << indexPair.second 
00021        << " slope:" << cscDbGains.gains[i].gain_slope << "\n";
00022   }
00023   return os;
00024 }