Skip to content

Commit

Permalink
test: Refactor GX2F test (#2545)
Browse files Browse the repository at this point in the history
While debugging #2534 I encountered a few problems with the GX2F test which I try to fix here.
- make volume big enough to fit all the surfaces
- introduce envelope
- remove volume material
- lower case variable name
  • Loading branch information
andiwand committed Oct 16, 2023
1 parent b1ef696 commit ecc68bc
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,31 +136,24 @@ std::shared_ptr<const TrackingGeometry> makeToyDetector(
for (auto& sCfg : surfaceConfig) {
CuboidVolumeBuilder::LayerConfig cfg;
cfg.surfaceCfg = {sCfg};
cfg.active = true;
cfg.envelopeX = {-0.1_mm, 0.1_mm};
cfg.envelopeY = {-0.1_mm, 0.1_mm};
cfg.envelopeZ = {-0.1_mm, 0.1_mm};
layerConfig.push_back(cfg);
}

for (auto& cfg : layerConfig) {
cfg.surfaces = {};
}

// Inner Volume - Build volume configuration
CuboidVolumeBuilder::VolumeConfig volumeConfig;
volumeConfig.position = {nSurfaces / 2. * 1_m, 0., 0.};
volumeConfig.length = {nSurfaces * 1_m, 1_m, 1_m};
volumeConfig.length = {(nSurfaces + 1) * 1_m, 1_m, 1_m};
volumeConfig.position = {volumeConfig.length.x() / 2, 0., 0.};
volumeConfig.layerCfg = layerConfig;
volumeConfig.name = "Test volume";
volumeConfig.volumeMaterial =
std::make_shared<HomogeneousVolumeMaterial>(makeBeryllium());

volumeConfig.layers.clear();
for (auto& lay : volumeConfig.layerCfg) {
lay.active = true;
}

// Outer volume - Build TrackingGeometry configuration
CuboidVolumeBuilder::Config config;
config.position = {nSurfaces / 2. * 1_m, 0., 0.};
config.length = {nSurfaces * 1_m, 1_m, 1_m};
config.length = {(nSurfaces + 1) * 1_m, 1_m, 1_m};
config.position = {volumeConfig.length.x() / 2, 0., 0.};
config.volumeCfg = {volumeConfig};

cvb.setConfig(config);
Expand Down Expand Up @@ -425,7 +418,7 @@ BOOST_AUTO_TEST_CASE(MixedDetector) {

using Gx2Fitter =
Experimental::Gx2Fitter<RecoPropagator, VectorMultiTrajectory>;
Gx2Fitter Fitter(rPropagator, gx2fLogger->clone());
Gx2Fitter fitter(rPropagator, gx2fLogger->clone());

Experimental::Gx2FitterExtensions<VectorMultiTrajectory> extensions;
extensions.calibrator
Expand All @@ -445,7 +438,7 @@ BOOST_AUTO_TEST_CASE(MixedDetector) {
Acts::VectorMultiTrajectory{}};

// Fit the track
auto res = Fitter.fit(sourceLinks.begin(), sourceLinks.end(),
auto res = fitter.fit(sourceLinks.begin(), sourceLinks.end(),
startParametersFit, gx2fOptions, tracks);

BOOST_REQUIRE(res.ok());
Expand Down

0 comments on commit ecc68bc

Please sign in to comment.