Skip to content

Commit ad0bd48

Browse files
authored
Merge branch 'main' into feat-root-spacepoint2-reader-writer
2 parents ee1191f + 1d80ea6 commit ad0bd48

File tree

13 files changed

+682
-372
lines changed

13 files changed

+682
-372
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Devcontainer CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
- 'release/**'
9+
- 'develop/**'
10+
11+
jobs:
12+
devcontainer-build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Install devcontainer CLI
22+
run: |
23+
npm install -g @devcontainers/cli
24+
25+
- name: Build devcontainer
26+
run: |
27+
devcontainer up --workspace-folder .
28+
29+
- name: Run configure_acts
30+
run: |
31+
devcontainer exec --workspace-folder . bash -c "configure_acts"
32+
33+
- name: Run build_acts with ActsCore target
34+
run: |
35+
devcontainer exec --workspace-folder . bash -c "build_acts --target ActsCore"

Examples/Algorithms/Geant4/src/SensitiveSurfaceMapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ bool SensitiveSurfaceMapper::checkMapping(
303303
std::ranges::sort(allSurfaces);
304304

305305
std::vector<const Acts::Surface*> found;
306-
for (const auto [_, surfacePtr] : state.g4VolumeToSurfaces) {
306+
for (const auto& [_, surfacePtr] : state.g4VolumeToSurfaces) {
307307
found.push_back(surfacePtr);
308308
}
309309
std::ranges::sort(found);

Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/SpacePointMaker.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class SpacePointMaker final : public IAlgorithm {
7575
/// @return a process code indication success or failure
7676
ProcessCode execute(const AlgorithmContext& ctx) const override;
7777

78+
ProcessCode initialize() override;
79+
7880
/// Const access to the config
7981
const Config& config() const { return m_cfg; }
8082

Examples/Algorithms/TrackFinding/src/SpacePointMaker.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "ActsExamples/EventData/Measurement.hpp"
2121
#include "ActsExamples/EventData/SimSpacePoint.hpp"
2222
#include "ActsExamples/Framework/AlgorithmContext.hpp"
23+
#include "ActsExamples/Framework/ProcessCode.hpp"
2324
#include "ActsExamples/Utilities/GroupBy.hpp"
2425

2526
#include <algorithm>
@@ -91,10 +92,6 @@ ActsExamples::SpacePointMaker::SpacePointMaker(Config cfg,
9192
<< " geometry selection duplicates");
9293
m_cfg.geometrySelection.erase(geoSelLastUnique, geoSelEnd);
9394
}
94-
ACTS_INFO("Space point geometry selection:");
95-
for (const auto& geoId : m_cfg.geometrySelection) {
96-
ACTS_INFO(" " << geoId);
97-
}
9895
auto spBuilderConfig = Acts::SpacePointBuilderConfig();
9996
spBuilderConfig.trackingGeometry = m_cfg.trackingGeometry;
10097

@@ -121,6 +118,15 @@ ActsExamples::SpacePointMaker::SpacePointMaker(Config cfg,
121118
}
122119
}
123120

121+
ActsExamples::ProcessCode ActsExamples::SpacePointMaker::initialize() {
122+
ACTS_INFO("Space point geometry selection:");
123+
for (const auto& geoId : m_cfg.geometrySelection) {
124+
ACTS_INFO(" " << geoId);
125+
}
126+
127+
return ProcessCode::SUCCESS;
128+
}
129+
124130
void ActsExamples::SpacePointMaker::initializeStripPartners() {
125131
ACTS_INFO("Strip space point geometry selection:");
126132
for (const auto& geoId : m_cfg.stripGeometrySelection) {

Examples/Io/EDM4hep/include/ActsExamples/Io/EDM4hep/EDM4hepSimInputConverter.hpp

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,19 @@
2121

2222
namespace edm4hep {
2323
class MCParticle;
24-
}
24+
class SimTrackerHit;
25+
} // namespace edm4hep
2526

2627
namespace podio {
2728
class Frame;
2829
}
2930

3031
namespace ActsExamples {
3132

33+
namespace detail {
34+
struct ParticleInfo;
35+
}
36+
3237
class DD4hepDetector;
3338

3439
/// Read particles from EDM4hep.
@@ -54,10 +59,6 @@ class EDM4hepSimInputConverter final : public EDM4hepInputConverter {
5459
/// Output simulated vertices collection.
5560
std::string outputSimVertices;
5661

57-
/// Directory into which to write graphviz files for particles
58-
/// Empty string means no output
59-
std::string graphvizOutput = "";
60-
6162
/// DD4hep detector for cellID resolution.
6263
std::shared_ptr<DD4hepDetector> dd4hepDetector;
6364

@@ -66,6 +67,15 @@ class EDM4hepSimInputConverter final : public EDM4hepInputConverter {
6667

6768
/// Whether to sort sim hits in time to produce index sequence
6869
bool sortSimHitsInTime = false;
70+
71+
std::optional<double> particleRMin = std::nullopt;
72+
std::optional<double> particleRMax = std::nullopt;
73+
74+
std::optional<double> particleZMin = std::nullopt;
75+
std::optional<double> particleZMax = std::nullopt;
76+
77+
std::optional<double> particlePtMin = std::nullopt;
78+
std::optional<double> particlePtMax = std::nullopt;
6979
};
7080

7181
using ParentRelationship = std::unordered_map<std::size_t, std::size_t>;
@@ -83,14 +93,16 @@ class EDM4hepSimInputConverter final : public EDM4hepInputConverter {
8393
ProcessCode convert(const AlgorithmContext& ctx,
8494
const podio::Frame& frame) const override;
8595

86-
void processChildren(const edm4hep::MCParticle& particle, SimBarcode parentId,
87-
std::vector<SimParticle>& particles,
88-
ParentRelationship& parentRelationship,
89-
std::unordered_map<int, std::size_t>& particleMap,
90-
std::size_t& nSecondaryVertices,
91-
std::size_t& maxGen) const;
96+
void processChildren(
97+
const edm4hep::MCParticle& particle, SimBarcode parentId,
98+
std::vector<SimBarcode>& particles,
99+
ParentRelationship& parentRelationship,
100+
std::unordered_map<int, detail::ParticleInfo>& particleMap,
101+
std::size_t& nSecondaryVertices, std::size_t& maxGen) const;
92102

93-
static void setSubParticleIds(std::span<SimParticle> particles);
103+
static void setSubParticleIds(std::span<SimBarcode> particles);
104+
105+
bool acceptParticle(const edm4hep::MCParticle& particle) const;
94106

95107
Config m_cfg;
96108

@@ -105,9 +117,6 @@ class EDM4hepSimInputConverter final : public EDM4hepInputConverter {
105117

106118
WriteDataHandle<SimVertexContainer> m_outputSimVertices{this,
107119
"OutputSimVertices"};
108-
109-
void graphviz(std::ostream& os, const std::vector<SimParticle>& particles,
110-
const ParentRelationship& parents) const;
111120
};
112121

113122
} // namespace ActsExamples

0 commit comments

Comments
 (0)