Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:48

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 SpacePoint& bottom, const SpacePoint& middle,
0025                    const SpacePoint& top) const override;
0026   /// @param weight the current seed weight
0027   /// @param bottom bottom space point of the current seed
0028   /// @param middle middle space point of the current seed
0029   /// @param top top space point of the current seed
0030   /// @return true if the seed should be kept, false if the seed should be
0031   /// discarded
0032   bool singleSeedCut(float weight, const SpacePoint& bottom,
0033                      const SpacePoint& /*middle*/,
0034                      const SpacePoint& /*top*/) const override;
0035 
0036   /// @param seedCandidates contains collection of seed candidates created for one middle
0037   /// space point in a std::tuple format
0038   /// @return vector of seeds that pass the cut
0039   std::vector<typename CandidatesForMiddleSp<const SpacePoint>::value_type>
0040   cutPerMiddleSP(
0041       std::vector<typename CandidatesForMiddleSp<const SpacePoint>::value_type>
0042           seedCandidates) const override;
0043 };
0044 
0045 template <typename SpacePoint>
0046 float ATLASCuts<SpacePoint>::seedWeight(const SpacePoint& bottom,
0047                                         const SpacePoint& /*middle*/,
0048                                         const SpacePoint& top) const {
0049   float weight = 0;
0050   if (bottom.radius() > 150) {
0051     weight = 400;
0052   }
0053   if (top.radius() < 150) {
0054     weight = 200;
0055   }
0056   return weight;
0057 }
0058 
0059 template <typename SpacePoint>
0060 bool ATLASCuts<SpacePoint>::singleSeedCut(float weight, const SpacePoint& b,
0061                                           const SpacePoint& /*m*/,
0062                                           const SpacePoint& /*t*/) const {
0063   return !(b.radius() > 150. && weight < 380.);
0064 }
0065 
0066 template <typename SpacePoint>
0067 std::vector<typename CandidatesForMiddleSp<const SpacePoint>::value_type>
0068 ATLASCuts<SpacePoint>::cutPerMiddleSP(
0069     std::vector<typename CandidatesForMiddleSp<const SpacePoint>::value_type>
0070         seedCandidates) const {
0071   std::vector<typename CandidatesForMiddleSp<const SpacePoint>::value_type>
0072       newSeedsVector;
0073   if (seedCandidates.size() <= 1) {
0074     return seedCandidates;
0075   }
0076 
0077   newSeedsVector.push_back(std::move(seedCandidates[0]));
0078   std::size_t itLength = std::min(seedCandidates.size(), std::size_t{5});
0079   // don't cut first element
0080   for (std::size_t i(1); i < itLength; i++) {
0081     float weight = seedCandidates[i].weight;
0082     const auto& bottom = seedCandidates[i].bottom;
0083     if (weight > 200. || bottom->radius() > 43.) {
0084       newSeedsVector.push_back(std::move(seedCandidates[i]));
0085     }
0086   }
0087   return newSeedsVector;
0088 }
0089 }  // namespace Acts