Skip to content

Commit

Permalink
others
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger committed Sep 30, 2024
1 parent 7058dd2 commit 6d039ab
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Examples/Io/Csv/src/CsvSeedWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ ActsExamples::ProcessCode ActsExamples::CsvSeedWriter::writeT(
truthDistance = sqrt(dPhi * dPhi + dEta * dEta);
// If the seed is truth matched, check if it is the closest one for the
// contributing particle
if (goodSeed.find(majorityParticleId) != goodSeed.end()) {
if (goodSeed.contains(majorityParticleId)) {
if (goodSeed[majorityParticleId].second > truthDistance) {
goodSeed[majorityParticleId] = std::make_pair(iparams, truthDistance);
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/Io/Csv/src/CsvTrackWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ ProcessCode CsvTrackWriter::writeT(const AlgorithmContext& context,

// good/duplicate/fake = 0/1/2
for (auto& [id, trajState] : infoMap) {
if (listGoodTracks.find(id) != listGoodTracks.end()) {
if (listGoodTracks.contains(id)) {
trajState.trackType = "good";
} else if (trajState.trackType != "fake") {
trajState.trackType = "duplicate";
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/src/Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void addLogging(Acts::Python::Context& ctx) {
logging.def(
"getLogger",
[](const std::string& name) {
if (pythonLoggers.find(name) == pythonLoggers.end()) {
if (!pythonLoggers.contains(name)) {
pythonLoggers[name] =
std::make_shared<PythonLogger>(name, Acts::Logging::INFO);
}
Expand Down
3 changes: 1 addition & 2 deletions Examples/Python/src/Svg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ actsvg::svg::object drawDetectorVolume(const Svg::ProtoVolume& pVolume,

// Helper lambda for material selection
auto materialSel = [&](const Svg::ProtoSurface& s) -> bool {
return (materials &&
s._decorations.find("material") != s._decorations.end());
return (materials && s._decorations.contains("material"));
};

// Helper lambda for view range selection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int boundParamResolution(const std::string& inFile, const std::string& treeName,
for (int volID = 1; volID <= volBins; ++volID) {
for (int layID = 1; layID <= layBins; ++layID) {
if (h2_volID_layID->GetBinContent(volID, layID) != 0.) {
if (volLayIds.find(volID) == volLayIds.end()) {
if (!volLayIds.contains(volID)) {
// First occurrence of this layer, add -1 for volume plots
volLayIds[volID] = {-1, layID};
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static inline actsvg::svg::object xy(const ProtoIndexedSurfaceGrid& pIndexGrid,
for (const auto [is, sis] : enumerate(pIndices[ig])) {
const auto& ps = pSurfaces[sis];
std::string oInfo = std::string("- object: ") + std::to_string(sis);
if (ps._aux_info.find("center") != ps._aux_info.end()) {
if (ps._aux_info.contains("center")) {
for (const auto& ci : ps._aux_info.at("center")) {
oInfo += ci;
}
Expand Down
2 changes: 1 addition & 1 deletion Plugins/DD4hep/src/DD4hepLayerStructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Acts::Experimental::DD4hepLayerStructure::builder(
DD4hepDetectorElement::Store& dd4hepStore, const GeometryContext& gctx,
const dd4hep::DetElement& dd4hepElement, const Options& options) const {
// Check for misconfiguration with double naming
if (dd4hepStore.find(options.name) != dd4hepStore.end()) {
if (dd4hepStore.contains(options.name)) {
std::string reMessage = "DD4hepLayerStructure: structure with name '";
reMessage += options.name;
reMessage += "' already registered in DetectorElementStore";
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Json/src/MaterialJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ nlohmann::json Acts::MaterialJsonConverter::toJsonDetray(
nlohmann::json jGridLink;
jGridLink["type"] = gridIndexType;
std::size_t gridIndex = 0;
if (gridLink.find(gridIndexType) != gridLink.end()) {
if (gridLink.contains(gridIndexType)) {
std::size_t& fGridIndex = gridLink[gridIndex];
gridIndex = fGridIndex;
fGridIndex++;
Expand Down

0 comments on commit 6d039ab

Please sign in to comment.