Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootNuclearInteractionParametersWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootNuclearInteractionParametersWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020-2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
16 
17 #include <mutex>
18 #include <string>
19 #include <vector>
20 
21 namespace ActsExamples {
22 struct AlgorithmContext;
23 
31  : public WriterT<ExtractedSimulationProcessContainer> {
32  public:
33  struct Config {
37  std::string filePath = "parameters.root";
39  std::string fileMode = "RECREATE";
40 
42  unsigned int interactionProbabilityBins = 1e6;
44  unsigned int momentumBins = 1e6;
46  unsigned int invariantMassBins = 1e6;
48  unsigned int multiplicityMax = 10;
52  unsigned int nSimulatedEvents = 0;
53  };
54 
62 
64  ProcessCode finalize() override;
65 
67  const Config& config() const { return m_cfg; }
68 
69  protected:
74  ProcessCode writeT(const AlgorithmContext& /*ctx*/,
76 
77  private:
79  std::mutex m_writeMutex;
80  std::vector<detail::NuclearInteractionParametrisation::EventFraction>
82 };
83 } // namespace ActsExamples