Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CKFPerformanceWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CKFPerformanceWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 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 
24 
25 #include <cstddef>
26 #include <functional>
27 #include <mutex>
28 #include <string>
29 #include <vector>
30 
31 class TFile;
32 class TTree;
33 namespace ActsFatras {
34 class Barcode;
35 } // namespace ActsFatras
36 
37 namespace ActsExamples {
38 struct AlgorithmContext;
39 
48 class CKFPerformanceWriter final : public WriterT<TrajectoriesContainer> {
49  public:
51 
52  struct Config {
60  std::string filePath = "performance_ckf.root";
62  std::string fileMode = "RECREATE";
68 
70  bool doubleMatching = false;
71 
73  double truthMatchProbMin = 0.5;
74 
76  std::function<bool(std::vector<float>&)> duplicatedPredictor = nullptr;
77  };
78 
81  ~CKFPerformanceWriter() override;
82 
84  ProcessCode finalize() override;
85 
87  const Config& config() const { return m_cfg; }
88 
89  private:
91  const TrajectoriesContainer& trajectories) override;
92 
95  std::mutex m_writeMutex;
96  TFile* m_outputFile{nullptr};
109 
110  // Adding numbers for efficiency, fake, duplicate calculations
111  size_t m_nTotalTracks = 0;
113  size_t m_nTotalFakeTracks = 0;
115  size_t m_nTotalParticles = 0;
119 
122  this, "InputMeasurementParticlesMap"};
123 };
124 
125 } // namespace ActsExamples