diff --git a/SDL/EndcapGeometry.cc b/SDL/EndcapGeometry.cc index 55f89ef1..2b5be62e 100644 --- a/SDL/EndcapGeometry.cc +++ b/SDL/EndcapGeometry.cc @@ -1,8 +1,8 @@ #include "EndcapGeometry.h" -SDL::EndcapGeometry::EndcapGeometry(SDL::Dev const& devAccIn, - SDL::QueueAcc& queue, - SDL::EndcapGeometry const& endcapGeometryIn) +SDL::EndcapGeometry::EndcapGeometry(SDL::Dev const& devAccIn, + SDL::QueueAcc& queue, + SDL::EndcapGeometryHost const& endcapGeometryIn) : geoMapDetId_buf(allocBufWrapper(devAccIn, endcapGeometryIn.centroid_phis_.size())), geoMapPhi_buf(allocBufWrapper(devAccIn, endcapGeometryIn.centroid_phis_.size())) { dxdy_slope_ = endcapGeometryIn.dxdy_slope_; @@ -10,7 +10,7 @@ SDL::EndcapGeometry::EndcapGeometry(SDL::Dev const& devAccIn, fillGeoMapArraysExplicit(queue); } -void SDL::EndcapGeometry::load(std::string filename) { +void SDL::EndcapGeometryHost::load(std::string filename) { dxdy_slope_.clear(); centroid_phis_.clear(); @@ -40,7 +40,7 @@ void SDL::EndcapGeometry::load(std::string filename) { } } -void SDL::EndcapGeometry::fillGeoMapArraysExplicit(SDL::QueueAcc& queue) { +void SDL::EndcapGeometry::fillGeoMapArraysExplicit(SDL::QueueAcc& queue) { unsigned int phi_size = centroid_phis_.size(); // Allocate buffers on host @@ -69,14 +69,14 @@ void SDL::EndcapGeometry::fillGeoMapArraysExplicit(SDL::QueueAcc alpaka::wait(queue); } -float SDL::EndcapGeometry::getdxdy_slope(unsigned int detid) const { +float SDL::EndcapGeometry::getdxdy_slope(unsigned int detid) const { if (dxdy_slope_.find(detid) != dxdy_slope_.end()) { return dxdy_slope_.at(detid); } else { return 0; } } -float SDL::EndcapGeometry::getdxdy_slope(unsigned int detid) const { +float SDL::EndcapGeometryHost::getdxdy_slope(unsigned int detid) const { if (dxdy_slope_.find(detid) != dxdy_slope_.end()) { return dxdy_slope_.at(detid); } else { diff --git a/SDL/EndcapGeometry.h b/SDL/EndcapGeometry.h index 970a558a..93da945c 100644 --- a/SDL/EndcapGeometry.h +++ b/SDL/EndcapGeometry.h @@ -19,36 +19,40 @@ namespace SDL { - // Only the full one contains alpaka buffers - template - class EndcapGeometry; + // FIXME: Need to separate this better into host and device classes + // This is only needed for host, but we template it to avoid symbol conflicts + template + class EndcapGeometryHost; template <> - class EndcapGeometry { + class EndcapGeometryHost { public: std::map dxdy_slope_; // dx/dy slope std::map centroid_phis_; // centroid phi - EndcapGeometry() = default; - ~EndcapGeometry() = default; + EndcapGeometryHost() = default; + ~EndcapGeometryHost() = default; void load(std::string); float getdxdy_slope(unsigned int detid) const; }; + template + class EndcapGeometry; + template <> - class EndcapGeometry { + class EndcapGeometry { private: std::map dxdy_slope_; // dx/dy slope std::map centroid_phis_; // centroid phi public: - Buf geoMapDetId_buf; - Buf geoMapPhi_buf; + Buf geoMapDetId_buf; + Buf geoMapPhi_buf; unsigned int nEndCapMap; - EndcapGeometry(Dev const& devAccIn, QueueAcc& queue, SDL::EndcapGeometry const& endcapGeometryIn); + EndcapGeometry(Dev const& devAccIn, QueueAcc& queue, SDL::EndcapGeometryHost const& endcapGeometryIn); ~EndcapGeometry() = default; void fillGeoMapArraysExplicit(QueueAcc& queue); diff --git a/SDL/Event.h b/SDL/Event.h index f7581a12..3d301c2c 100644 --- a/SDL/Event.h +++ b/SDL/Event.h @@ -92,7 +92,7 @@ namespace SDL { const unsigned int nPixels_; const std::shared_ptr> modulesBuffers_; const std::shared_ptr pixelMapping_; - const std::shared_ptr> endcapGeometry_; + const std::shared_ptr> endcapGeometry_; public: // Constructor used for CMSSW integration. Uses an external queue. diff --git a/SDL/LST.cc b/SDL/LST.cc index aa98fb3a..9f916d12 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -9,109 +9,6 @@ #include "Math/Vector3D.h" using XYZVector = ROOT::Math::XYZVector; -namespace { - std::string trackLooperDir() { - const char* path_lst_base = std::getenv("LST_BASE"); - const char* path_tracklooperdir = std::getenv("TRACKLOOPERDIR"); - std::string path_str; - if (path_lst_base != nullptr) { - path_str = path_lst_base; - } else if (path_tracklooperdir != nullptr) { - path_str = path_tracklooperdir; - } else { - // FIXME: temporary solution, will need to pass a value from FileInPath or CMSSW search path - // in the `LSTProducer` or a related ES producer - path_str = std::getenv("CMSSW_BASE"); - path_str += "/src/RecoTracker/LSTCore/TrackLooper"; - } - return path_str; - } - - std::string get_absolute_path_after_check_file_exists(const std::string name) { - std::filesystem::path fullpath = std::filesystem::absolute(name.c_str()); - if (not std::filesystem::exists(fullpath)) { - std::cout << "ERROR: Could not find the file = " << fullpath << std::endl; - exit(2); - } - return fullpath.string(); - } - - void loadMapsHost(SDL::MapPLStoLayer& pLStoLayer, - std::shared_ptr> endcapGeometry, - std::shared_ptr tiltedGeometry, - std::shared_ptr moduleConnectionMap) { - // Module orientation information (DrDz or phi angles) - auto endcap_geom = - get_absolute_path_after_check_file_exists(trackLooperDir() + "/data/OT800_IT615_pt0.8/endcap_orientation.bin"); - auto tilted_geom = get_absolute_path_after_check_file_exists( - trackLooperDir() + "/data/OT800_IT615_pt0.8/tilted_barrel_orientation.bin"); - // Module connection map (for line segment building) - auto mappath = get_absolute_path_after_check_file_exists( - trackLooperDir() + "/data/OT800_IT615_pt0.8/module_connection_tracing_merged.bin"); - - endcapGeometry->load(endcap_geom); - tiltedGeometry->load(tilted_geom); - moduleConnectionMap->load(mappath); - - auto pLSMapDir = trackLooperDir() + "/data/OT800_IT615_pt0.8/pixelmap/pLS_map"; - const std::array connects{ - {"_layer1_subdet5", "_layer2_subdet5", "_layer1_subdet4", "_layer2_subdet4"}}; - std::string path; - - static_assert(connects.size() == std::tuple_size>{}); - for (unsigned int i = 0; i < connects.size(); i++) { - auto connectData = connects[i].data(); - - path = pLSMapDir + connectData + ".bin"; - pLStoLayer[0][i] = SDL::ModuleConnectionMap(get_absolute_path_after_check_file_exists(path)); - - path = pLSMapDir + "_pos" + connectData + ".bin"; - pLStoLayer[1][i] = SDL::ModuleConnectionMap(get_absolute_path_after_check_file_exists(path)); - - path = pLSMapDir + "_neg" + connectData + ".bin"; - pLStoLayer[2][i] = SDL::ModuleConnectionMap(get_absolute_path_after_check_file_exists(path)); - } - } - -} // namespace - -std::unique_ptr SDL::loadAndFillESHost() { - auto pLStoLayer = std::make_shared(); - auto endcapGeometry = std::make_shared>(); - auto tiltedGeometry = std::make_shared(); - auto moduleConnectionMap = std::make_shared(); - ::loadMapsHost(*pLStoLayer, endcapGeometry, tiltedGeometry, moduleConnectionMap); - return std::make_unique(pLStoLayer, endcapGeometry, tiltedGeometry, moduleConnectionMap); -} - -std::unique_ptr> SDL::loadAndFillESDevice(SDL::QueueAcc& queue, - const LSTESHostData* hostData) { - SDL::Dev const& devAccIn = alpaka::getDev(queue); - uint16_t nModules; - uint16_t nLowerModules; - unsigned int nPixels; - std::shared_ptr> modulesBuffers = nullptr; - auto endcapGeometry = - std::make_shared>(devAccIn, queue, *hostData->endcapGeometry); - auto pixelMapping = std::make_shared(); - auto moduleConnectionMap = hostData->moduleConnectionMap; - - auto path = - get_absolute_path_after_check_file_exists(trackLooperDir() + "/data/OT800_IT615_pt0.8/sensor_centroids.bin"); - SDL::loadModulesFromFile(queue, - hostData->mapPLStoLayer.get(), - path.c_str(), - nModules, - nLowerModules, - nPixels, - modulesBuffers, - pixelMapping.get(), - endcapGeometry.get(), - hostData->tiltedGeometry.get(), - moduleConnectionMap.get()); - return std::make_unique>( - nModules, nLowerModules, nPixels, modulesBuffers, endcapGeometry, pixelMapping); -} void SDL::LST::run(SDL::QueueAcc& queue, bool verbose, diff --git a/SDL/LST.h b/SDL/LST.h index a35b0c03..7d9d1174 100644 --- a/SDL/LST.h +++ b/SDL/LST.h @@ -1,15 +1,14 @@ #ifndef LST_H #define LST_H -#include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h" - #ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/LSTESData.h" #else #include "Constants.h" +#include "LSTESData.h" #endif -#include #include #include #include @@ -19,65 +18,9 @@ namespace SDL { template class Event; - struct pixelMap; - class TiltedGeometry; - class ModuleConnectionMap; - using MapPLStoLayer = std::array, 3>; - - template - struct modulesBuffer; - - template - class EndcapGeometry; - - struct LSTESHostData { - const std::shared_ptr mapPLStoLayer; - const std::shared_ptr> endcapGeometry; - const std::shared_ptr tiltedGeometry; - const std::shared_ptr moduleConnectionMap; - - LSTESHostData(std::shared_ptr mapPLStoLayerIn, - std::shared_ptr> endcapGeometryIn, - std::shared_ptr tiltedGeometryIn, - std::shared_ptr moduleConnectionMapIn) - : mapPLStoLayer(std::const_pointer_cast(mapPLStoLayerIn)), - endcapGeometry(std::const_pointer_cast>(endcapGeometryIn)), - tiltedGeometry(std::const_pointer_cast(tiltedGeometryIn)), - moduleConnectionMap(std::const_pointer_cast(moduleConnectionMapIn)) {} - }; - - template - struct LSTESDeviceData { - const uint16_t nModules; - const uint16_t nLowerModules; - const unsigned int nPixels; - const std::shared_ptr> modulesBuffers; - const std::shared_ptr> endcapGeometry; - const std::shared_ptr pixelMapping; - - LSTESDeviceData(uint16_t nModulesIn, - uint16_t nLowerModulesIn, - unsigned int nPixelsIn, - std::shared_ptr> modulesBuffersIn, - std::shared_ptr> endcapGeometryIn, - std::shared_ptr pixelMappingIn) - : nModules(nModulesIn), - nLowerModules(nLowerModulesIn), - nPixels(nPixelsIn), - modulesBuffers(std::const_pointer_cast>(modulesBuffersIn)), - endcapGeometry(std::const_pointer_cast>(endcapGeometryIn)), - pixelMapping(std::const_pointer_cast(pixelMappingIn)) {} - }; - - std::unique_ptr loadAndFillESHost(); - std::unique_ptr> loadAndFillESDevice(SDL::QueueAcc& queue, const LSTESHostData* hostData); - template class LST; - template <> - class LST {}; - template <> class LST { public: @@ -169,14 +112,4 @@ namespace SDL { } // namespace SDL -namespace cms::alpakatools { - template <> - struct CopyToDevice { - template - static auto copyAsync(TQueue& queue, SDL::LSTESHostData const& hostData) { - return std::make_unique(hostData); - } - }; -} - #endif diff --git a/SDL/LSTESData.cc b/SDL/LSTESData.cc new file mode 100644 index 00000000..7586f95f --- /dev/null +++ b/SDL/LSTESData.cc @@ -0,0 +1,112 @@ +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/LSTESData.h" +#else +#include "LSTESData.h" +#endif + +#include "EndcapGeometry.h" +#include "ModuleConnectionMap.h" +#include "TiltedGeometry.h" +#include "PixelMap.h" +#include "ModuleMethods.h" + +std::string trackLooperDir() { + const char* path_lst_base = std::getenv("LST_BASE"); + const char* path_tracklooperdir = std::getenv("TRACKLOOPERDIR"); + std::string path_str; + if (path_lst_base != nullptr) { + path_str = path_lst_base; + } else if (path_tracklooperdir != nullptr) { + path_str = path_tracklooperdir; + } else { + // FIXME: temporary solution, will need to pass a value from FileInPath or CMSSW search path + // in the `LSTProducer` or a related ES producer + path_str = std::getenv("CMSSW_BASE"); + path_str += "/src/RecoTracker/LSTCore/TrackLooper"; + } + return path_str; +} + +std::string get_absolute_path_after_check_file_exists(const std::string name) { + std::filesystem::path fullpath = std::filesystem::absolute(name.c_str()); + if (not std::filesystem::exists(fullpath)) { + std::cout << "ERROR: Could not find the file = " << fullpath << std::endl; + exit(2); + } + return fullpath.string(); +} + +void loadMapsHost(SDL::MapPLStoLayer& pLStoLayer, + std::shared_ptr> endcapGeometry, + std::shared_ptr> tiltedGeometry, + std::shared_ptr> moduleConnectionMap) { + // Module orientation information (DrDz or phi angles) + auto endcap_geom = + get_absolute_path_after_check_file_exists(trackLooperDir() + "/data/OT800_IT615_pt0.8/endcap_orientation.bin"); + auto tilted_geom = get_absolute_path_after_check_file_exists( + trackLooperDir() + "/data/OT800_IT615_pt0.8/tilted_barrel_orientation.bin"); + // Module connection map (for line segment building) + auto mappath = get_absolute_path_after_check_file_exists( + trackLooperDir() + "/data/OT800_IT615_pt0.8/module_connection_tracing_merged.bin"); + + endcapGeometry->load(endcap_geom); + tiltedGeometry->load(tilted_geom); + moduleConnectionMap->load(mappath); + + auto pLSMapDir = trackLooperDir() + "/data/OT800_IT615_pt0.8/pixelmap/pLS_map"; + const std::array connects{ + {"_layer1_subdet5", "_layer2_subdet5", "_layer1_subdet4", "_layer2_subdet4"}}; + std::string path; + + static_assert(connects.size() == std::tuple_size>{}); + for (unsigned int i = 0; i < connects.size(); i++) { + auto connectData = connects[i].data(); + + path = pLSMapDir + connectData + ".bin"; + pLStoLayer[0][i] = SDL::ModuleConnectionMap(get_absolute_path_after_check_file_exists(path)); + + path = pLSMapDir + "_pos" + connectData + ".bin"; + pLStoLayer[1][i] = SDL::ModuleConnectionMap(get_absolute_path_after_check_file_exists(path)); + + path = pLSMapDir + "_neg" + connectData + ".bin"; + pLStoLayer[2][i] = SDL::ModuleConnectionMap(get_absolute_path_after_check_file_exists(path)); + } +} + +std::unique_ptr> SDL::loadAndFillESHost() { + auto pLStoLayer = std::make_shared(); + auto endcapGeometry = std::make_shared>(); + auto tiltedGeometry = std::make_shared>(); + auto moduleConnectionMap = std::make_shared>(); + loadMapsHost(*pLStoLayer, endcapGeometry, tiltedGeometry, moduleConnectionMap); + return std::make_unique>(pLStoLayer, endcapGeometry, tiltedGeometry, moduleConnectionMap); +} + +std::unique_ptr> SDL::loadAndFillESDevice(SDL::QueueAcc& queue, + const LSTESHostData* hostData) { + SDL::Dev const& devAccIn = alpaka::getDev(queue); + uint16_t nModules; + uint16_t nLowerModules; + unsigned int nPixels; + std::shared_ptr> modulesBuffers = nullptr; + auto endcapGeometry = + std::make_shared>(devAccIn, queue, *hostData->endcapGeometry); + auto pixelMapping = std::make_shared(); + auto moduleConnectionMap = hostData->moduleConnectionMap; + + auto path = + get_absolute_path_after_check_file_exists(trackLooperDir() + "/data/OT800_IT615_pt0.8/sensor_centroids.bin"); + SDL::loadModulesFromFile(queue, + hostData->mapPLStoLayer.get(), + path.c_str(), + nModules, + nLowerModules, + nPixels, + modulesBuffers, + pixelMapping.get(), + endcapGeometry.get(), + hostData->tiltedGeometry.get(), + moduleConnectionMap.get()); + return std::make_unique>( + nModules, nLowerModules, nPixels, modulesBuffers, endcapGeometry, pixelMapping); +} \ No newline at end of file diff --git a/SDL/LSTESData.h b/SDL/LSTESData.h new file mode 100644 index 00000000..6a47cdd9 --- /dev/null +++ b/SDL/LSTESData.h @@ -0,0 +1,90 @@ +#ifndef LSTESData_H +#define LSTESData_H + +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else +#include "Constants.h" +#endif + +#include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h" + +#include +#include + +namespace SDL { + + struct pixelMap; + + template + class TiltedGeometry; + + template + class ModuleConnectionMap; + using MapPLStoLayer = std::array, 4>, 3>; + + template + struct modulesBuffer; + + template + class EndcapGeometryHost; + + template + class EndcapGeometry; + + template + struct LSTESHostData { + const std::shared_ptr mapPLStoLayer; + const std::shared_ptr> endcapGeometry; + const std::shared_ptr> tiltedGeometry; + const std::shared_ptr> moduleConnectionMap; + + LSTESHostData(std::shared_ptr mapPLStoLayerIn, + std::shared_ptr> endcapGeometryIn, + std::shared_ptr> tiltedGeometryIn, + std::shared_ptr> moduleConnectionMapIn) + : mapPLStoLayer(std::const_pointer_cast(mapPLStoLayerIn)), + endcapGeometry(std::const_pointer_cast>(endcapGeometryIn)), + tiltedGeometry(std::const_pointer_cast>(tiltedGeometryIn)), + moduleConnectionMap(std::const_pointer_cast>(moduleConnectionMapIn)) {} + }; + + template + struct LSTESDeviceData { + const uint16_t nModules; + const uint16_t nLowerModules; + const unsigned int nPixels; + const std::shared_ptr> modulesBuffers; + const std::shared_ptr> endcapGeometry; + const std::shared_ptr pixelMapping; + + LSTESDeviceData(uint16_t nModulesIn, + uint16_t nLowerModulesIn, + unsigned int nPixelsIn, + std::shared_ptr> modulesBuffersIn, + std::shared_ptr> endcapGeometryIn, + std::shared_ptr pixelMappingIn) + : nModules(nModulesIn), + nLowerModules(nLowerModulesIn), + nPixels(nPixelsIn), + modulesBuffers(std::const_pointer_cast>(modulesBuffersIn)), + endcapGeometry(std::const_pointer_cast>(endcapGeometryIn)), + pixelMapping(std::const_pointer_cast(pixelMappingIn)) {} + }; + + std::unique_ptr> loadAndFillESHost(); + std::unique_ptr> loadAndFillESDevice(SDL::QueueAcc& queue, const LSTESHostData* hostData); + +} // namespace SDL + +namespace cms::alpakatools { + template <> + struct CopyToDevice> { + template + static auto copyAsync(TQueue& queue, SDL::LSTESHostData const& hostData) { + return std::make_unique>(hostData); + } + }; +} // namespace cms::alpakatools + +#endif diff --git a/SDL/ModuleConnectionMap.cc b/SDL/ModuleConnectionMap.cc index e866aa5e..9a1ee2de 100644 --- a/SDL/ModuleConnectionMap.cc +++ b/SDL/ModuleConnectionMap.cc @@ -1,12 +1,12 @@ #include "ModuleConnectionMap.h" -SDL::ModuleConnectionMap::ModuleConnectionMap() {} +SDL::ModuleConnectionMap::ModuleConnectionMap() {} -SDL::ModuleConnectionMap::ModuleConnectionMap(std::string filename) { load(filename); } +SDL::ModuleConnectionMap::ModuleConnectionMap(std::string filename) { load(filename); } -SDL::ModuleConnectionMap::~ModuleConnectionMap() {} +SDL::ModuleConnectionMap::~ModuleConnectionMap() {} -void SDL::ModuleConnectionMap::load(std::string filename) { +void SDL::ModuleConnectionMap::load(std::string filename) { moduleConnections_.clear(); std::ifstream ifile(filename, std::ios::binary); @@ -49,7 +49,7 @@ void SDL::ModuleConnectionMap::load(std::string filename) { } } -void SDL::ModuleConnectionMap::add(std::string filename) { +void SDL::ModuleConnectionMap::add(std::string filename) { std::ifstream ifile; ifile.open(filename.c_str()); std::string line; @@ -81,7 +81,7 @@ void SDL::ModuleConnectionMap::add(std::string filename) { } } -void SDL::ModuleConnectionMap::print() { +void SDL::ModuleConnectionMap::print() { std::cout << "Printing ModuleConnectionMap" << std::endl; for (auto& pair : moduleConnections_) { unsigned int detid = pair.first; @@ -93,9 +93,9 @@ void SDL::ModuleConnectionMap::print() { } } -const std::vector& SDL::ModuleConnectionMap::getConnectedModuleDetIds(unsigned int detid) const { +const std::vector& SDL::ModuleConnectionMap::getConnectedModuleDetIds(unsigned int detid) const { static const std::vector dummy; auto const mList = moduleConnections_.find(detid); return mList != moduleConnections_.end() ? mList->second : dummy; } -int SDL::ModuleConnectionMap::size() const { return moduleConnections_.size(); } +int SDL::ModuleConnectionMap::size() const { return moduleConnections_.size(); } diff --git a/SDL/ModuleConnectionMap.h b/SDL/ModuleConnectionMap.h index 57e1a871..45d629a7 100644 --- a/SDL/ModuleConnectionMap.h +++ b/SDL/ModuleConnectionMap.h @@ -15,7 +15,11 @@ #endif namespace SDL { - class ModuleConnectionMap { + //FIXME: move to non-alpaka single arch build + template + class ModuleConnectionMap; + template <> + class ModuleConnectionMap { private: std::map> moduleConnections_; @@ -32,7 +36,7 @@ namespace SDL { int size() const; }; - using MapPLStoLayer = std::array, 3>; + using MapPLStoLayer = std::array, 4>, 3>; } // namespace SDL #endif diff --git a/SDL/ModuleMethods.h b/SDL/ModuleMethods.h index fc8625b6..dc0eb0fc 100644 --- a/SDL/ModuleMethods.h +++ b/SDL/ModuleMethods.h @@ -116,7 +116,7 @@ namespace SDL { unsigned int nMod, TQueue queue, struct ModuleMetaData& mmd, - const ModuleConnectionMap* moduleConnectionMap) { + const ModuleConnectionMap* moduleConnectionMap) { DevHost const& devHost = cms::alpakatools::host(); auto moduleMap_buf = allocBufWrapper(devHost, nMod * MAX_CONNECTED_MODULES); uint16_t* moduleMap = alpaka::getPtrNative(moduleMap_buf); @@ -234,9 +234,9 @@ namespace SDL { unsigned int& nPixels, std::shared_ptr>& modulesBuf, pixelMap* pixelMapping, - const EndcapGeometry* endcapGeometry, - const TiltedGeometry* tiltedGeometry, - const ModuleConnectionMap* moduleConnectionMap) { + const EndcapGeometry* endcapGeometry, + const TiltedGeometry* tiltedGeometry, + const ModuleConnectionMap* moduleConnectionMap) { ModuleMetaData mmd; loadCentroidsFromFile(moduleMetaDataFilePath, mmd, nModules); diff --git a/SDL/TiltedGeometry.cc b/SDL/TiltedGeometry.cc index 598c73cd..862155ab 100644 --- a/SDL/TiltedGeometry.cc +++ b/SDL/TiltedGeometry.cc @@ -1,8 +1,8 @@ #include "TiltedGeometry.h" -SDL::TiltedGeometry::TiltedGeometry(std::string filename) { load(filename); } +SDL::TiltedGeometry::TiltedGeometry(std::string filename) { load(filename); } -void SDL::TiltedGeometry::load(std::string filename) { +void SDL::TiltedGeometry::load(std::string filename) { drdzs_.clear(); dxdys_.clear(); @@ -32,7 +32,7 @@ void SDL::TiltedGeometry::load(std::string filename) { } } -float SDL::TiltedGeometry::getDrDz(unsigned int detid) const { +float SDL::TiltedGeometry::getDrDz(unsigned int detid) const { if (drdzs_.find(detid) != drdzs_.end()) { return drdzs_.at(detid); } else { @@ -40,7 +40,7 @@ float SDL::TiltedGeometry::getDrDz(unsigned int detid) const { } } -float SDL::TiltedGeometry::getDxDy(unsigned int detid) const { +float SDL::TiltedGeometry::getDxDy(unsigned int detid) const { if (dxdys_.find(detid) != dxdys_.end()) { return dxdys_.at(detid); } else { diff --git a/SDL/TiltedGeometry.h b/SDL/TiltedGeometry.h index 15204391..51481762 100644 --- a/SDL/TiltedGeometry.h +++ b/SDL/TiltedGeometry.h @@ -16,7 +16,10 @@ #endif namespace SDL { - class TiltedGeometry { + template + class TiltedGeometry; + template <> + class TiltedGeometry { private: std::map drdzs_; // dr/dz slope std::map dxdys_; // dx/dy slope diff --git a/code/core/AnalysisConfig.h b/code/core/AnalysisConfig.h index a6e719dc..34242659 100644 --- a/code/core/AnalysisConfig.h +++ b/code/core/AnalysisConfig.h @@ -103,7 +103,7 @@ class AnalysisConfig std::map>> moduleSimHits; std::map modulePopulation; - SDL::ModuleConnectionMap moduleConnectiongMapLoose; + SDL::ModuleConnectionMap moduleConnectiongMapLoose; // Boolean to trigger whether to run cut_value_ntupling bool do_cut_value_ntuple;