Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:13:07

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 #pragma once
0010 
0011 #include "Acts/Seeding/IExperimentCuts.hpp"
0012 
0013 #include <algorithm>
0014 
0015 namespace Acts {
0016 template <typename SpacePoint>
0017 class ATLASCuts : public IExperimentCuts<SpacePoint> {
0018  public:
0019   /// Returns seed weight bonus/malus depending on detector considerations.
0020   /// @param bottom bottom space point of the current seed
0021   /// @param middle middle space point of the current seed
0022   /// @param top top space point of the current seed
0023   /// @return seed weight to be added to the seed's weight
0024   float seedWeight(const InternalSpacePoint<SpacePoint>& bottom,
0025                    const InternalSpacePoint<SpacePoint>& middle,
0026                    const InternalSpacePoint<SpacePoint>& top) const;
0027   /// @param weight the current seed weight
0028   /// @param bottom bottom space point of the current seed
0029   /// @param middle middle space point of the current seed
0030   /// @param top top space point of the current seed
0031   /// @return true if the seed should be kept, false if the seed should be
0032   /// discarded
0033   bool singleSeedCut(float weight, const InternalSpacePoint<SpacePoint>& bottom,
0034                      const InternalSpacePoint<SpacePoint>&,
0035                      const InternalSpacePoint<SpacePoint>&) const;
0036 
0037   /// @param seedCandidates contains collection of seed candidates created for one middle
0038   /// space point in a std::tuple format
0039   /// @return vector of seed candidates that pass the cut
0040   std::vector<typename CandidatesForMiddleSp<
0041       const InternalSpacePoint<SpacePoint>>::value_type>
0042   cutPerMiddleSP(std::vector<typename CandidatesForMiddleSp<
0043                      const InternalSpacePoint<SpacePoint>>::value_type>
0044                      seedCandidates) const override;
0045 };
0046 
0047 template <typename SpacePoint>
0048 float ATLASCuts<SpacePoint>::seedWeight(
0049     const InternalSpacePoint<SpacePoint>& bottom,
0050     const InternalSpacePoint<SpacePoint>&,
0051     const InternalSpacePoint<SpacePoint>& top) const {
0052   float weight = 0;
0053   if (bottom.radius() > 150) {
0054     weight = 400;
0055   }
0056   if (top.radius() < 150) {
0057     weight = 200;
0058   }
0059   return weight;
0060 }
0061 
0062 template <typename SpacePoint>
0063 bool ATLASCuts<SpacePoint>::singleSeedCut(
0064     float weight, const InternalSpacePoint<SpacePoint>& b,
0065     const InternalSpacePoint<SpacePoint>&,
0066     const InternalSpacePoint<SpacePoint>&) const {
0067   return !(b.radius() > 150. && weight < 380.);
0068 }
0069 
0070 template <typename SpacePoint>
0071 std::vector<typename CandidatesForMiddleSp<
0072     const InternalSpacePoint<SpacePoint>>::value_type>
0073 ATLASCuts<SpacePoint>::cutPerMiddleSP(
0074     std::vector<typename CandidatesForMiddleSp<
0075         const InternalSpacePoint<SpacePoint>>::value_type>
0076         seedCandidates) const {
0077   std::vector<typename CandidatesForMiddleSp<
0078       const InternalSpacePoint<SpacePoint>>::value_type>
0079       newSeedsVector;
0080   if (seedCandidates.size() <= 1) {
0081     return seedCandidates;
0082   }
0083 
0084   newSeedsVector.push_back(std::move(seedCandidates[0]));
0085   std::size_t itLength = std::min(seedCandidates.size(), std::size_t{5});
0086   // don't cut first element
0087   for (std::size_t i(1); i < itLength; i++) {
0088     float weight = seedCandidates[i].weight;
0089     const auto& bottom = seedCandidates[i].bottom;
0090     if (weight > 200. || bottom->radius() > 43.) {
0091       newSeedsVector.push_back(std::move(seedCandidates[i]));
0092     }
0093   }
0094   return newSeedsVector;
0095 }
0096 }  // namespace Acts