Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to make standalone run also from within a CMSSW area #36

27 changes: 13 additions & 14 deletions RecoTracker/LSTCore/src/alpaka/LSTESData.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@

namespace {
std::string trackLooperDir() {
const char* path_lst_base = std::getenv("LST_BASE");
std::string path_str, path;
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) {
std::stringstream search_path(std::getenv("CMSSW_SEARCH_PATH"));

while (std::getline(search_path, path, ':')) {
if (std::filesystem::exists(path + "/RecoTracker/LSTCore/data")) {
path_str = path;
break;
}
}

if (path_str.empty()) {
path_str = path_tracklooperdir;
path_str += "/../";
path_str += "/..";
} else {
std::stringstream search_path(std::getenv("CMSSW_SEARCH_PATH"));
std::string path;
while (std::getline(search_path, path, ':')) {
if (std::filesystem::exists(path + "/RecoTracker/LSTCore/data")) {
path_str = path;
break;
}
}
path_str += "/RecoTracker/LSTCore";
}

return path_str;
}

Expand Down
Loading