diff --git a/SDL/EndcapGeometry.cc b/SDL/EndcapGeometry.cc index b5cf8a3f..813ae229 100644 --- a/SDL/EndcapGeometry.cc +++ b/SDL/EndcapGeometry.cc @@ -22,7 +22,7 @@ SDL::EndcapGeometry::EndcapGeometry(std::string filename, unsigned int sizef) SDL::EndcapGeometry::~EndcapGeometry() {} void SDL::EndcapGeometry::load(std::string filename) { - sls_.clear(); + dxdy_slope_.clear(); centroid_phis_.clear(); std::ifstream ifile(filename); @@ -31,11 +31,13 @@ void SDL::EndcapGeometry::load(std::string filename) { while (std::getline(ifile, line)) { std::istringstream ss(line); unsigned int detid; - float sl, cp; + float dxdy_slope, centroid_phi; - if (ss >> detid >> sl >> cp) { - sls_[detid] = sl; - centroid_phis_[detid] = cp; + if (ss >> detid >> dxdy_slope >> centroid_phi) { + dxdy_slope_[detid] = dxdy_slope; + centroid_phis_[detid] = centroid_phi; + } else { + throw std::runtime_error("Failed to parse line: " + line); } } @@ -80,4 +82,4 @@ void SDL::EndcapGeometry::fillGeoMapArraysExplicit() { alpaka::wait(queue); } -float SDL::EndcapGeometry::getSlopeLower(unsigned int detid) { return sls_[detid]; } \ No newline at end of file +float SDL::EndcapGeometry::getdxdy_slope(unsigned int detid) { return dxdy_slope_[detid]; } \ No newline at end of file diff --git a/SDL/EndcapGeometry.h b/SDL/EndcapGeometry.h index f0d9957b..4c51a8ea 100644 --- a/SDL/EndcapGeometry.h +++ b/SDL/EndcapGeometry.h @@ -7,13 +7,14 @@ #include #include #include +#include #include "Constants.h" namespace SDL { class EndcapGeometry { private: - std::map sls_; // lower slope + std::map dxdy_slope_; // dx/dy slope std::map centroid_phis_; // centroid phi public: @@ -30,9 +31,7 @@ namespace SDL { void fillGeoMapArraysExplicit(); void CreateGeoMapArraysExplicit(); - float getAverageR2(unsigned int detid); - float getYInterceptLower(unsigned int detid); - float getSlopeLower(unsigned int detid); + float getdxdy_slope(unsigned int detid); }; void freeEndcap(); extern EndcapGeometry* endcapGeometry; diff --git a/SDL/ModuleMethods.h b/SDL/ModuleMethods.h index ffe27c82..70b58796 100644 --- a/SDL/ModuleMethods.h +++ b/SDL/ModuleMethods.h @@ -374,7 +374,7 @@ namespace SDL { host_isAnchor[index] = false; } - host_slopes[index] = (subdet == Endcap) ? endcapGeometry->getSlopeLower(detId) : tiltedGeometry.getSlope(detId); + host_slopes[index] = (subdet == Endcap) ? endcapGeometry->getdxdy_slope(detId) : tiltedGeometry.getSlope(detId); host_drdzs[index] = (subdet == Barrel) ? tiltedGeometry.getDrDz(detId) : 0; } diff --git a/SDL/TiltedGeometry.cc b/SDL/TiltedGeometry.cc index 658225cd..e9c564cc 100644 --- a/SDL/TiltedGeometry.cc +++ b/SDL/TiltedGeometry.cc @@ -23,10 +23,12 @@ void SDL::TiltedGeometry::load(std::string filename) { std::stringstream ss(line); - ss >> detid >> drdz >> slope; - - drdzs_[detid] = drdz; - slopes_[detid] = slope; + if (ss >> detid >> drdz >> slope) { + drdzs_[detid] = drdz; + slopes_[detid] = slope; + } else { + throw std::runtime_error("Failed to parse line: " + line); + } } }