File indexing completed on 2025-01-18 09:11:01
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Units.hpp"
0013 #include "Acts/Seeding/SeedConfirmationRangeConfig.hpp"
0014 #include "Acts/Utilities/Delegate.hpp"
0015
0016 #include <limits>
0017 #include <memory>
0018 #include <numbers>
0019 #include <vector>
0020
0021 namespace Acts {
0022
0023
0024 template <typename T>
0025 class SeedFilter;
0026
0027
0028 template <typename SpacePoint>
0029 struct SeedFinderConfig {
0030 std::shared_ptr<Acts::SeedFilter<SpacePoint>> seedFilter;
0031
0032
0033
0034
0035
0036
0037 float phiMin = -std::numbers::pi_v<float>;
0038 float phiMax = std::numbers::pi_v<float>;
0039 float zMin = -2800 * Acts::UnitConstants::mm;
0040 float zMax = 2800 * Acts::UnitConstants::mm;
0041 float rMax = 600 * Acts::UnitConstants::mm;
0042
0043
0044 float rMin = 33 * Acts::UnitConstants::mm;
0045
0046
0047 std::vector<float> zBinEdges;
0048
0049
0050 std::vector<std::size_t> zBinsCustomLooping = {};
0051
0052
0053 float binSizeR = 1. * Acts::UnitConstants::mm;
0054
0055
0056
0057
0058
0059
0060
0061
0062 float rMinMiddle = 60.f * Acts::UnitConstants::mm;
0063 float rMaxMiddle = 120.f * Acts::UnitConstants::mm;
0064
0065
0066 bool useVariableMiddleSPRange = false;
0067
0068 std::vector<std::vector<float>> rRangeMiddleSP;
0069
0070
0071
0072 float deltaRMiddleMinSPRange = 10. * Acts::UnitConstants::mm;
0073 float deltaRMiddleMaxSPRange = 10. * Acts::UnitConstants::mm;
0074
0075
0076
0077
0078
0079
0080 float deltaRMin = 5 * Acts::UnitConstants::mm;
0081
0082
0083
0084 float deltaRMax = 270 * Acts::UnitConstants::mm;
0085
0086 float deltaRMinTopSP = std::numeric_limits<float>::quiet_NaN();
0087
0088 float deltaRMaxTopSP = std::numeric_limits<float>::quiet_NaN();
0089
0090 float deltaRMinBottomSP = std::numeric_limits<float>::quiet_NaN();
0091
0092 float deltaRMaxBottomSP = std::numeric_limits<float>::quiet_NaN();
0093
0094
0095 float deltaZMax =
0096 std::numeric_limits<float>::infinity() * Acts::UnitConstants::mm;
0097
0098
0099
0100 float cotThetaMax = 10.01788;
0101
0102
0103
0104 float collisionRegionMin = -150 * Acts::UnitConstants::mm;
0105 float collisionRegionMax = +150 * Acts::UnitConstants::mm;
0106
0107
0108
0109 bool interactionPointCut = false;
0110
0111
0112
0113
0114
0115
0116
0117
0118 float minPt = 400. * Acts::UnitConstants::MeV;
0119
0120
0121 float sigmaScattering = 5;
0122
0123
0124
0125
0126 float radLengthPerSeed = 0.05;
0127
0128 float maxPtScattering = 10 * Acts::UnitConstants::GeV;
0129
0130 float impactMax = 20. * Acts::UnitConstants::mm;
0131
0132
0133 float helixCutTolerance = 1.;
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143 bool seedConfirmation = false;
0144
0145 SeedConfirmationRangeConfig centralSeedConfirmationRange;
0146
0147 SeedConfirmationRangeConfig forwardSeedConfirmationRange;
0148
0149 unsigned int maxSeedsPerSpM = 5;
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159 float zAlign = 0 * Acts::UnitConstants::mm;
0160 float rAlign = 0 * Acts::UnitConstants::mm;
0161
0162
0163 float sigmaError = 5;
0164
0165
0166 float highland = 0;
0167 float maxScatteringAngle2 = 0;
0168
0169
0170 int maxBlockSize = 1024;
0171 int nTrplPerSpBLimit = 100;
0172 int nAvgTrplPerSpBLimit = 2;
0173
0174
0175
0176
0177
0178
0179 bool useDetailedDoubleMeasurementInfo = false;
0180
0181 Delegate<bool(const SpacePoint&)> spacePointSelector{
0182 DelegateFuncTag<voidSpacePointSelector>{}};
0183
0184 static bool voidSpacePointSelector(const SpacePoint& ) { return true; }
0185
0186
0187
0188
0189 float toleranceParam = 1.1 * Acts::UnitConstants::mm;
0190
0191
0192 Delegate<bool(float , float )> experimentCuts{
0193 DelegateFuncTag<&noopExperimentCuts>{}};
0194
0195 bool isInInternalUnits = false;
0196
0197 SeedFinderConfig toInternalUnits() const {
0198 if (isInInternalUnits) {
0199 throw std::runtime_error(
0200 "Repeated conversion to internal units for SeedFinderConfig");
0201 }
0202
0203
0204 if (!seedFilter) {
0205 throw std::runtime_error(
0206 "Invalid values for the seed filter inside the seed filter config: "
0207 "nullptr");
0208 }
0209 if (!seedFilter->getSeedFilterConfig().isInInternalUnits) {
0210 throw std::runtime_error(
0211 "The internal Seed Filter configuration, contained in the seed "
0212 "finder config, is not in internal units.");
0213 }
0214
0215 using namespace Acts::UnitLiterals;
0216 SeedFinderConfig config = *this;
0217 config.isInInternalUnits = true;
0218 config.minPt /= 1_MeV;
0219 config.deltaRMin /= 1_mm;
0220 config.deltaRMax /= 1_mm;
0221 config.binSizeR /= 1_mm;
0222 config.deltaRMinTopSP /= 1_mm;
0223 config.deltaRMaxTopSP /= 1_mm;
0224 config.deltaRMinBottomSP /= 1_mm;
0225 config.deltaRMaxBottomSP /= 1_mm;
0226 config.deltaRMiddleMinSPRange /= 1_mm;
0227 config.deltaRMiddleMaxSPRange /= 1_mm;
0228 config.impactMax /= 1_mm;
0229 config.maxPtScattering /= 1_MeV;
0230 config.collisionRegionMin /= 1_mm;
0231 config.collisionRegionMax /= 1_mm;
0232 config.zMin /= 1_mm;
0233 config.zMax /= 1_mm;
0234 config.rMax /= 1_mm;
0235 config.rMin /= 1_mm;
0236 config.deltaZMax /= 1_mm;
0237
0238 config.zAlign /= 1_mm;
0239 config.rAlign /= 1_mm;
0240
0241 config.toleranceParam /= 1_mm;
0242
0243 return config;
0244 }
0245 SeedFinderConfig calculateDerivedQuantities() const {
0246 SeedFinderConfig config = *this;
0247
0248
0249 config.highland = 13.6 * std::sqrt(radLengthPerSeed) *
0250 (1 + 0.038 * std::log(radLengthPerSeed));
0251 const float maxScatteringAngle = config.highland / minPt;
0252 config.maxScatteringAngle2 = maxScatteringAngle * maxScatteringAngle;
0253 return config;
0254 }
0255 };
0256
0257 struct SeedFinderOptions {
0258
0259
0260 Acts::Vector2 beamPos{0 * Acts::UnitConstants::mm,
0261 0 * Acts::UnitConstants::mm};
0262
0263 float bFieldInZ = 2.08 * Acts::UnitConstants::T;
0264
0265
0266 float pTPerHelixRadius = std::numeric_limits<float>::quiet_NaN();
0267 float minHelixDiameter2 = std::numeric_limits<float>::quiet_NaN();
0268 float pT2perRadius = std::numeric_limits<float>::quiet_NaN();
0269 float sigmapT2perRadius = std::numeric_limits<float>::quiet_NaN();
0270 float multipleScattering2 = std::numeric_limits<float>::quiet_NaN();
0271
0272 bool isInInternalUnits = false;
0273
0274 SeedFinderOptions toInternalUnits() const {
0275 if (isInInternalUnits) {
0276 throw std::runtime_error(
0277 "Repeated conversion to internal units for SeedFinderOptions");
0278 }
0279 using namespace Acts::UnitLiterals;
0280 SeedFinderOptions options = *this;
0281 options.isInInternalUnits = true;
0282 options.beamPos[0] /= 1_mm;
0283 options.beamPos[1] /= 1_mm;
0284
0285 options.bFieldInZ /= 1000. * 1_T;
0286 return options;
0287 }
0288
0289 template <typename Config>
0290 SeedFinderOptions calculateDerivedQuantities(const Config& config) const {
0291 using namespace Acts::UnitLiterals;
0292
0293 if (!isInInternalUnits) {
0294 throw std::runtime_error(
0295 "Derived quantities in SeedFinderOptions can only be calculated from "
0296 "Acts internal units");
0297 }
0298 SeedFinderOptions options = *this;
0299
0300
0301
0302 options.pTPerHelixRadius = 1_T * 1e6 * options.bFieldInZ;
0303 options.minHelixDiameter2 =
0304 std::pow(config.minPt * 2 / options.pTPerHelixRadius, 2) *
0305 config.helixCutTolerance;
0306 options.pT2perRadius =
0307 std::pow(config.highland / options.pTPerHelixRadius, 2);
0308 options.sigmapT2perRadius =
0309 options.pT2perRadius * std::pow(2 * config.sigmaScattering, 2);
0310 options.multipleScattering2 =
0311 config.maxScatteringAngle2 * std::pow(config.sigmaScattering, 2);
0312 return options;
0313 }
0314 };
0315
0316 }