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