Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CsvMultiTrajectoryWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CsvMultiTrajectoryWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 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 
21 
22 #include <cstddef>
23 #include <cstdint>
24 #include <fstream>
25 #include <string>
26 #include <vector>
27 
28 namespace ActsExamples {
29 struct AlgorithmContext;
30 } // namespace ActsExamples
31 
32 using namespace Acts::UnitLiterals;
33 
34 namespace ActsExamples {
35 
49 class CsvMultiTrajectoryWriter : public WriterT<TrajectoriesContainer> {
50  public:
52 
53  struct Config {
56  std::string fileName = "CKFtracks.csv";
59  size_t outputPrecision = 6;
60  size_t nMeasurementsMin = 7;
61  bool onlyTruthMatched = false;
62  double truthMatchProbMin = 0.5;
63  double ptMin = 1_GeV;
64  };
65 
71 
73  const Config& config() const { return m_cfg; }
74 
75  protected:
79  ProcessCode writeT(const AlgorithmContext& context,
80  const TrajectoriesContainer& trajectories) override;
81 
82  private:
84 
85  ReadDataHandle<HitParticlesMap> m_inputMeasurementParticlesMap{
86  this, "InputMeasurementParticlesMap"};
87 
91  size_t trackId = 0;
93  size_t nMajorityHits = 0;
95  double truthMatchProb = 0;
96  const TrackParameters* fittedParameters = nullptr;
97  std::vector<uint64_t> measurementsID;
98  }; // trackInfo struct
99 };
100 
101 } // namespace ActsExamples