Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-23 09:14:33

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 "ActsPlugins/FpeMonitoring/FpeMonitor.hpp"
0012 #include <Acts/Geometry/GeometryContext.hpp>
0013 #include <Acts/MagneticField/MagneticFieldContext.hpp>
0014 #include <Acts/Utilities/CalibrationContext.hpp>
0015 
0016 namespace ActsExamples {
0017 
0018 class WhiteBoard;
0019 
0020 /// Aggregated information to run one algorithm over one event.
0021 struct AlgorithmContext {
0022   /// @brief constructor with arguments
0023   ///
0024   /// @param alg is the algorithm/service/writer number
0025   /// @param event is the event number
0026   /// @param store is the event-wise event store
0027   /// @param thread is the thread number
0028   ///
0029   /// @note the event dependent contexts are to be added by the
0030   /// Sequencer::m_decorators list
0031   AlgorithmContext(std::size_t alg, std::size_t event, WhiteBoard& store,
0032                    std::size_t thread)
0033       : algorithmNumber(alg),
0034         eventNumber(event),
0035         eventStore(store),
0036         threadId{thread} {}
0037 
0038   /// @brief ++operator overload to increase the algorithm number
0039   AlgorithmContext& operator++() {
0040     algorithmNumber += 1;
0041     return (*this);
0042   }
0043 
0044   std::size_t algorithmNumber;       ///< Unique algorithm identifier
0045   std::size_t eventNumber;           ///< Unique event identifier
0046   WhiteBoard& eventStore;            ///< Per-event data store
0047   Acts::GeometryContext geoContext;  ///< Per-event geometry context
0048   Acts::MagneticFieldContext
0049       magFieldContext;                    ///< Per-event magnetic Field context
0050   Acts::CalibrationContext calibContext;  ///< Per-event calibration context
0051   std::size_t threadId;                   ///< Thread ID
0052 
0053   ActsPlugins::FpeMonitor* fpeMonitor = nullptr;
0054 };
0055 
0056 }  // namespace ActsExamples