39 edm::LogInfo(
"SiStripDetInfoFileReader") <<
"filePath " << filePath << std::endl;
44 inputFile_.open(filePath.c_str());
46 if (inputFile_.is_open()) {
50 unsigned short numberOfAPVs;
53 inputFile_ >> detid >> numberOfAPVs >> stripLength >>
thickness;
55 if (!(inputFile_.eof() || inputFile_.fail())) {
56 detIds_.push_back(detid);
63 std::map<uint32_t, DetInfo>::const_iterator it = detData_.find(detid);
65 if (it == detData_.end()) {
66 detData_[detid] =
DetInfo(numberOfAPVs, stripLength, thickness);
68 edm::LogError(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader")
69 <<
"DetId " << detid <<
" already found on file. Ignoring new data" << endl;
74 }
else if (inputFile_.eof()) {
75 edm::LogInfo(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader - END of file reached") << endl;
78 }
else if (inputFile_.fail()) {
79 edm::LogError(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader - ERROR while reading file") << endl;
87 edm::LogError(
"SiStripDetInfoFileReader::SiStripDetInfoFileReader - Unable to open file") << endl;
102 std::map<uint32_t, DetInfo>::const_iterator it = detData_.find(detId);
104 if (it != detData_.end()) {
105 return std::pair<unsigned short, double>(it->second.nApvs, it->second.stripLength);
108 std::pair<unsigned short, double> defaultValue(0, 0.);
110 "SiStripDetInfoFileReader::getNumberOfApvsAndStripLength - Unable to find requested detid. Returning invalid " 118 std::map<uint32_t, DetInfo>::const_iterator it = detData_.find(detId);
120 if (it != detData_.end()) {
121 return it->second.thickness;
124 static const float defaultValue = 0;
125 edm::LogWarning(
"SiStripDetInfoFileReader::getThickness - Unable to find requested detid. Returning invalid data ")
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 ©)
filePath
CUSTOMIZE FOR ML.
~SiStripDetInfoFileReader()
Namespace of DDCMS conversion namespace.
std::string fullPath() const
std::vector< uint32_t > detIds_
void reader(std::string filePath)
SiStripDetInfoFileReader()