Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-28 08:20:50

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/GeometricConfig.hpp"
0010 
0011 namespace ActsExamples {
0012 
0013 std::vector<double> GeometricConfig::variances(
0014     const std::array<std::size_t, 2u>& csizes,
0015     const std::array<std::size_t, 2u>& cmins) const {
0016   std::vector<double> rVariances;
0017   for (std::size_t i = 0; i < indices.size(); ++i) {
0018     const auto& bIndex = indices[i];
0019     double var = 0.;
0020     if (varianceMap.contains(bIndex)) {
0021       // Try to find the variance for this cluster size
0022       const std::size_t lsize =
0023           std::min(csizes[bIndex], varianceMap.at(bIndex).size());
0024       var = varianceMap.at(bIndex).at(lsize - 1);
0025     } else {
0026       // Pitch size ofer / sqrt(12) as error instead
0027       const std::size_t ictr = cmins[i] + csizes[i] / 2;
0028       var = std::pow(segmentation->getAxis(bIndex).getBinWidth(ictr + 1), 2) /
0029             12.0;
0030     }
0031     rVariances.push_back(var);
0032   }
0033   return rVariances;
0034 }
0035 
0036 }  // namespace ActsExamples