#include <CalibTracker/SiStripCommon/src/SiStripDetInfoFileReader.cc>
Classes | |
struct | DetInfo |
Public Member Functions | |
const std::map< uint32_t, DetInfo > & | getAllData () const |
const std::vector< uint32_t > & | getAllDetIds () const |
const std::pair< unsigned short, double > | getNumberOfApvsAndStripLength (uint32_t detId) const |
const float & | getThickness (uint32_t detId) const |
SiStripDetInfoFileReader & | operator= (const SiStripDetInfoFileReader ©) |
SiStripDetInfoFileReader (std::string filePath) | |
SiStripDetInfoFileReader (const SiStripDetInfoFileReader &) | |
SiStripDetInfoFileReader (const edm::ParameterSet &, const edm::ActivityRegistry &) | |
SiStripDetInfoFileReader () | |
~SiStripDetInfoFileReader () | |
Private Member Functions | |
void | reader (std::string filePath) |
Private Attributes | |
std::map< uint32_t, DetInfo > | detData_ |
std::vector< uint32_t > | detIds_ |
std::ifstream | inputFile_ |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 31 of file SiStripDetInfoFileReader.h.
SiStripDetInfoFileReader::SiStripDetInfoFileReader | ( | ) | [inline, explicit] |
Definition at line 46 of file SiStripDetInfoFileReader.h.
{};
SiStripDetInfoFileReader::SiStripDetInfoFileReader | ( | const edm::ParameterSet & | pset, |
const edm::ActivityRegistry & | ar | ||
) | [explicit] |
Definition at line 22 of file SiStripDetInfoFileReader.cc.
References edm::FileInPath::fullPath(), edm::ParameterSet::getUntrackedParameter(), and matplotRender::reader.
{ edm::FileInPath fp(pset.getUntrackedParameter<std::string>("filePath","CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")); reader(fp.fullPath()); }
SiStripDetInfoFileReader::SiStripDetInfoFileReader | ( | std::string | filePath | ) | [explicit] |
Definition at line 32 of file SiStripDetInfoFileReader.cc.
References matplotRender::reader.
SiStripDetInfoFileReader::SiStripDetInfoFileReader | ( | const SiStripDetInfoFileReader & | copy | ) | [explicit] |
SiStripDetInfoFileReader::~SiStripDetInfoFileReader | ( | ) |
Definition at line 117 of file SiStripDetInfoFileReader.cc.
{ }
const std::map<uint32_t, DetInfo >& SiStripDetInfoFileReader::getAllData | ( | ) | const [inline] |
Definition at line 63 of file SiStripDetInfoFileReader.h.
References detData_.
Referenced by SiStripQuality::addNotConnectedConnectionFromCabling(), and SiStripQualityHotStripIdentifier::bookHistos().
{return detData_;}
const std::vector<uint32_t>& SiStripDetInfoFileReader::getAllDetIds | ( | ) | const [inline] |
Definition at line 57 of file SiStripDetInfoFileReader.h.
References detIds_.
Referenced by SiStripBaseCondObjDQM::analysis(), SiStripQualityStatistics::analyze(), SiStripQualityDQM::fillGrandSummaryMEs(), SiStripFedCablingFakeESSource::make(), and TkLayerMap::TkLayerMap().
{return detIds_;}
const std::pair< unsigned short, double > SiStripDetInfoFileReader::getNumberOfApvsAndStripLength | ( | uint32_t | detId | ) | const |
Definition at line 121 of file SiStripDetInfoFileReader.cc.
Referenced by SiStripQuality::add(), SiStripHitEffFromCalibTree::algoAnalyze(), SiStripQualityStatistics::analyze(), SiStripBaseCondObjDQM::bookProfileMEs(), SiStripBaseCondObjDQM::bookSummaryProfileMEs(), SiStripQuality::compact(), SiStripQuality::fillBadComponents(), SiStripThresholdDQM::fillMEsForDet(), SiStripQualityDQM::fillMEsForDet(), SiStripPedestalsDQM::fillMEsForDet(), SiStripNoisesDQM::fillMEsForDet(), SiStripApvGainsDQM::fillMEsForDet(), SiStripQualityDQM::fillMEsForLayer(), SiStripApvGainsDQM::fillMEsForLayer(), SiStripThresholdDQM::fillMEsForLayer(), SiStripPedestalsDQM::fillMEsForLayer(), SiStripNoisesDQM::fillMEsForLayer(), SiStripBadModuleByHandBuilder::getNewObject(), SiStripCorrelateBadStripAndNoise::iterateOnBadStrips(), SiStripHitEffFromCalibTree::makeSQLite(), SiStripQuality::operator-=(), SiStripCondObjBuilderFromDb::retrieveNumberAPVPairs(), SiStripQualityStatistics::SetBadComponents(), SiStripHitEffFromCalibTree::SetBadComponents(), SiStripQualityDQM::SetBadComponents(), and SiStripCondObjBuilderFromDb::setValuesApvLatency().
{ std::map<uint32_t, DetInfo >::const_iterator it = detData_.find(detId); if(it!=detData_.end()){ return std::pair<unsigned short, double>(it->second.nApvs,it->second.stripLength); } else{ static std::pair<unsigned short, double> defaultValue(0,0); edm::LogWarning("SiStripDetInfoFileReader::getNumberOfApvsAndStripLength - Unable to find requested detid. Returning invalid data ")<<endl; return defaultValue; } }
const float & SiStripDetInfoFileReader::getThickness | ( | uint32_t | detId | ) | const |
Definition at line 140 of file SiStripDetInfoFileReader.cc.
{ std::map<uint32_t, DetInfo >::const_iterator it = detData_.find(detId); if(it!=detData_.end()){ return it->second.thickness; } else{ static float defaultValue=0; edm::LogWarning("SiStripDetInfoFileReader::getThickness - Unable to find requested detid. Returning invalid data ")<<endl; return defaultValue; } }
SiStripDetInfoFileReader & SiStripDetInfoFileReader::operator= | ( | const SiStripDetInfoFileReader & | copy | ) |
void SiStripDetInfoFileReader::reader | ( | std::string | filePath | ) | [private] |
Definition at line 36 of file SiStripDetInfoFileReader.cc.
References cond::rpcobgas::detid.
{ // if(filePath==std::string("")){ // filePath = edm::FileInPath(std::string("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat") ).fullPath(); // } edm::LogInfo("SiStripDetInfoFileReader") << "filePath " << filePath << std::endl; detData_.clear(); detIds_.clear(); inputFile_.open(filePath.c_str()); if (inputFile_.is_open()){ for(;;) { uint32_t detid; double stripLength; unsigned short numberOfAPVs; float thickness; inputFile_ >> detid >> numberOfAPVs >> stripLength >> thickness; if (!(inputFile_.eof() || inputFile_.fail())){ detIds_.push_back(detid); // inputFile_ >> numberOfAPVs; // inputFile_ >> stripLength; // edm::LogInfo("SiStripDetInfoFileReader::SiStripDetInfoFileReader") << detid <<" " <<numberOfAPVs <<" " <<stripLength << " "<< thickness<< endl; std::map<uint32_t, DetInfo >::const_iterator it = detData_.find(detid); if(it==detData_.end()){ detData_[detid]=DetInfo(numberOfAPVs, stripLength,thickness); } else{ edm::LogError("SiStripDetInfoFileReader::SiStripDetInfoFileReader") <<"DetId " << detid << " already found on file. Ignoring new data"<<endl; detIds_.pop_back(); continue; } } else if (inputFile_.eof()){ edm::LogInfo("SiStripDetInfoFileReader::SiStripDetInfoFileReader - END of file reached")<<endl; break; } else if (inputFile_.fail()) { edm::LogError("SiStripDetInfoFileReader::SiStripDetInfoFileReader - ERROR while reading file")<<endl; break; } } inputFile_.close(); } else { edm::LogError("SiStripDetInfoFileReader::SiStripDetInfoFileReader - Unable to open file")<<endl; return; } // int i=0; // for(std::map<uint32_t, std::pair<unsigned short, double> >::iterator it =detData_.begin(); it!=detData_.end(); it++ ) { // std::cout<< it->first << " " << (it->second).first << " " << (it->second).second<<endl; // i++; // } // std::cout<<i; }
std::map<uint32_t, DetInfo> SiStripDetInfoFileReader::detData_ [private] |
Definition at line 73 of file SiStripDetInfoFileReader.h.
Referenced by getAllData(), operator=(), and SiStripDetInfoFileReader().
std::vector<uint32_t> SiStripDetInfoFileReader::detIds_ [private] |
Definition at line 76 of file SiStripDetInfoFileReader.h.
Referenced by getAllDetIds(), operator=(), and SiStripDetInfoFileReader().
std::ifstream SiStripDetInfoFileReader::inputFile_ [private] |
Definition at line 70 of file SiStripDetInfoFileReader.h.