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/DigitizationConfig.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 (const auto& bIndex : indices) {
0018     double var = 0.;
0019     if (varianceMap.contains(bIndex)) {
0020       // Try to find the variance for this cluster size
0021       std::size_t lsize =
0022           std::min(csizes[bIndex], varianceMap.at(bIndex).size());
0023       var = varianceMap.at(bIndex).at(lsize - 1);
0024     } else {
0025       // Pitch size ofer / sqrt(12) as error instead
0026       std::size_t ictr = cmins[bIndex] + csizes[bIndex] / 2;
0027       var = std::pow(segmentation.binningData()[bIndex].width(ictr), 2) / 12.0;
0028     }
0029     rVariances.push_back(var);
0030   }
0031   return rVariances;
0032 }
0033 
0034 }  // namespace ActsExamples