ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
MuonValidation
MuonVisualizationHelpersR4
Root
FileHelpers.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
MuonVisualizationHelpersR4/FileHelpers.h
"
5
6
#include "GeoModelKernel/throwExcept.h"
7
#include <filesystem>
8
#include <algorithm>
9
namespace
MuonValR4
{
10
std::string
removeNonAlphaNum
(std::string
str
) {
11
str
.erase(
std::remove_if
(
str
.begin(),
str
.end(),
12
[](
const
unsigned
char
c){
13
return !std::isalnum(c);
14
}),
str
.end());
15
return
str
;
16
}
17
void
ensureDirectory
(
const
std::string& path) {
18
const
std::string dir = path.substr(0, path.rfind(
"/"
));
19
if
(dir.rfind(
"/"
) != std::string::npos){
20
ensureDirectory
(dir);
21
}
else
if
(dir.empty()) {
22
return
;
23
}
24
if
(!std::filesystem::is_directory(dir) && !std::filesystem::create_directory(dir)) {
25
THROW_EXCEPTION
(
"Failed to create "
<<dir);
26
}
27
}
28
}
FileHelpers.h
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition
SpacePointWriter.cxx:32
MuonValR4::ensureDirectory
void ensureDirectory(const std::string &path)
Ensures that the subdirectory in the path is created.
Definition
FileHelpers.cxx:17
MuonValR4::removeNonAlphaNum
std::string removeNonAlphaNum(std::string str)
Removes all non-alpha numerical characters from a string.
Definition
FileHelpers.cxx:10
std::remove_if
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.
Definition
DVL_algorithms.h:70
str
Definition
BTagTrackIpAccessor.cxx:11
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0