Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:42

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/Utilities/Logger.hpp"
0012 #include "ActsExamples/EventData/Track.hpp"
0013 #include "ActsExamples/Framework/DataHandle.hpp"
0014 #include "ActsExamples/Framework/IAlgorithm.hpp"
0015 #include "ActsExamples/Framework/ProcessCode.hpp"
0016 
0017 #include <limits>
0018 #include <string>
0019 
0020 namespace ActsExamples {
0021 struct AlgorithmContext;
0022 
0023 /// Select tracks by applying some selection cuts.
0024 class TrackParameterSelector final : public IAlgorithm {
0025  public:
0026   struct Config {
0027     /// Input track parameters collection
0028     std::string inputTrackParameters;
0029     /// Output track parameters collection.
0030     std::string outputTrackParameters;
0031 
0032     // Minimum/maximum local positions.
0033     double loc0Min = -std::numeric_limits<double>::infinity();
0034     double loc0Max = std::numeric_limits<double>::infinity();
0035     double loc1Min = -std::numeric_limits<double>::infinity();
0036     double loc1Max = std::numeric_limits<double>::infinity();
0037     // Minimum/maximum track time.
0038     double timeMin = -std::numeric_limits<double>::infinity();
0039     double timeMax = std::numeric_limits<double>::infinity();
0040     // Direction cuts.
0041     double phiMin = -std::numeric_limits<double>::infinity();
0042     double phiMax = std::numeric_limits<double>::infinity();
0043     double etaMin = -std::numeric_limits<double>::infinity();
0044     double etaMax = std::numeric_limits<double>::infinity();
0045     double absEtaMin = 0.0;
0046     double absEtaMax = std::numeric_limits<double>::infinity();
0047     // Momentum cuts.
0048     double ptMin = 0.0;
0049     double ptMax = std::numeric_limits<double>::infinity();
0050   };
0051 
0052   TrackParameterSelector(const Config& config, Acts::Logging::Level level);
0053 
0054   ProcessCode execute(const AlgorithmContext& ctx) const final;
0055 
0056   /// Get readonly access to the config parameters
0057   const Config& config() const { return m_cfg; }
0058 
0059  private:
0060   Config m_cfg;
0061 
0062   ReadDataHandle<TrackParametersContainer> m_inputTrackParameters{
0063       this, "InputTrackParameters"};
0064   WriteDataHandle<TrackParametersContainer> m_outputTrackParameters{
0065       this, "OutputTrackParameters"};
0066 };
0067 
0068 }  // namespace ActsExamples