42 edm::LogInfo(
"SiStripDetInfoFileReader") <<
"filePath " << filePath << std::endl;
48 inputFile_.open(filePath.c_str());
50 if (inputFile_.is_open()){
56 unsigned short numberOfAPVs;
59 inputFile_ >> detid >> numberOfAPVs >> stripLength >> thickness;
61 if (!(inputFile_.eof() || inputFile_.fail())){
63 detIds_.push_back(detid);
70 std::map<uint32_t, DetInfo >::const_iterator it = detData_.find(detid);
72 if(it==detData_.end()){
73 detData_[
detid]=
DetInfo(numberOfAPVs, stripLength,thickness);
77 edm::LogError(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader") <<
"DetId " << detid <<
" already found on file. Ignoring new data"<<endl;
83 else if (inputFile_.eof()){
85 edm::LogInfo(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader - END of file reached")<<endl;
89 else if (inputFile_.fail()) {
91 edm::LogError(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader - ERROR while reading file")<<endl;
101 edm::LogError(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader - Unable to open file")<<endl;
123 std::map<uint32_t, DetInfo >::const_iterator it = detData_.find(detId);
125 if(it!=detData_.end()){
127 return std::pair<unsigned short, double>(it->second.nApvs,it->second.stripLength);
132 static std::pair<unsigned short, double> defaultValue(0,0);
133 edm::LogWarning(
"SiStripDetInfoFileReader::getNumberOfApvsAndStripLength - Unable to find requested detid. Returning invalid data ")<<endl;
142 std::map<uint32_t, DetInfo >::const_iterator it = detData_.find(detId);
144 if(it!=detData_.end()){
146 return it->second.thickness;
151 static float defaultValue=0;
152 edm::LogWarning(
"SiStripDetInfoFileReader::getThickness - Unable to find requested detid. Returning invalid data ")<<endl;
T getUntrackedParameter(std::string const &, T const &) const
const float & getThickness(uint32_t detId) const
std::map< uint32_t, DetInfo > detData_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
SiStripDetInfoFileReader & operator=(const SiStripDetInfoFileReader ©)
~SiStripDetInfoFileReader()
std::vector< uint32_t > detIds_
std::string fullPath() const
void reader(std::string filePath)
SiStripDetInfoFileReader()