Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:35

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "ActsExamples/Digitization/MeasurementCreation.hpp"
0010 
0011 #include "Acts/EventData/MeasurementHelpers.hpp"
0012 #include "Acts/Geometry/GeometryIdentifier.hpp"
0013 #include "ActsExamples/EventData/Measurement.hpp"
0014 
0015 #include <stdexcept>
0016 #include <string>
0017 
0018 ActsExamples::VariableBoundMeasurementProxy ActsExamples::createMeasurement(
0019     MeasurementContainer& container, Acts::GeometryIdentifier geometryId,
0020     const DigitizedParameters& dParams) {
0021   if (dParams.indices.size() > 4u) {
0022     std::string errorMsg = "Invalid/mismatching measurement dimension: " +
0023                            std::to_string(dParams.indices.size());
0024     throw std::runtime_error(errorMsg.c_str());
0025   }
0026 
0027   return Acts::visit_measurement(
0028       dParams.indices.size(), [&](auto dim) -> VariableBoundMeasurementProxy {
0029         auto [indices, par, cov] = measurementConstituents<dim>(dParams);
0030         return VariableBoundMeasurementProxy{
0031             container.emplaceMeasurement<dim>(geometryId, indices, par, cov)};
0032       });
0033 }