PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
podio::benchmark::BenchmarkRecorder Class Reference

#include <BenchmarkRecorder.h>

Public Member Functions

 BenchmarkRecorder ()=delete
 
 BenchmarkRecorder (const std::string &recFileName="podio_benchmark_file.root")
 
 BenchmarkRecorder (const BenchmarkRecorder &)=delete
 
BenchmarkRecorder operator= (const BenchmarkRecorder &)=delete
 
 ~BenchmarkRecorder ()
 
template<typename TimingResolution = std::chrono::nanoseconds>
void recordTime (const std::string &treeName, const std::string &stepName, const ClockT::duration time)
 
void Fill (const std::string &treeName)
 
BenchmarkRecorderTreeaddTree (const std::string &name, const std::vector< std::string > &steps)
 

Detailed Description

Definition at line 58 of file BenchmarkRecorder.h.

Constructor & Destructor Documentation

◆ BenchmarkRecorder() [1/3]

podio::benchmark::BenchmarkRecorder::BenchmarkRecorder ( )
delete

◆ BenchmarkRecorder() [2/3]

podio::benchmark::BenchmarkRecorder::BenchmarkRecorder ( const std::string &  recFileName = "podio_benchmark_file.root")
inline

Definition at line 61 of file BenchmarkRecorder.h.

61 {
62 m_recordFile = new TFile(recFileName.c_str(), "recreate");
63 }

◆ BenchmarkRecorder() [3/3]

podio::benchmark::BenchmarkRecorder::BenchmarkRecorder ( const BenchmarkRecorder )
delete

◆ ~BenchmarkRecorder()

podio::benchmark::BenchmarkRecorder::~BenchmarkRecorder ( )
inline

Definition at line 68 of file BenchmarkRecorder.h.

68 {
69 for (auto& tree : m_recordTrees) {
70 tree.second.Write();
71 }
72 m_recordFile->Write("", TObject::kWriteDelete);
73 m_recordFile->Close();
74 }

Member Function Documentation

◆ addTree()

BenchmarkRecorderTree & podio::benchmark::BenchmarkRecorder::addTree ( const std::string &  name,
const std::vector< std::string > &  steps 
)
inline

Definition at line 90 of file BenchmarkRecorder.h.

90 {
91 return m_recordTrees
92 .emplace_back(std::piecewise_construct, std::forward_as_tuple(name),
93 std::forward_as_tuple(m_recordFile, name, steps))
94 .second;
95 }

◆ Fill()

void podio::benchmark::BenchmarkRecorder::Fill ( const std::string &  treeName)
inline

Definition at line 84 of file BenchmarkRecorder.h.

84 {
85 auto it = std::find_if(m_recordTrees.begin(), m_recordTrees.end(),
86 [&treeName](const auto& recTree) { return recTree.first == treeName; });
87 it->second.Fill();
88 }

Referenced by podio::TimedReader< WrappedReader >::~TimedReader().

◆ operator=()

BenchmarkRecorder podio::benchmark::BenchmarkRecorder::operator= ( const BenchmarkRecorder )
delete

◆ recordTime()

template<typename TimingResolution = std::chrono::nanoseconds>
void podio::benchmark::BenchmarkRecorder::recordTime ( const std::string &  treeName,
const std::string &  stepName,
const ClockT::duration  time 
)
inline

Definition at line 77 of file BenchmarkRecorder.h.

77 {
78 auto it = std::find_if(m_recordTrees.begin(), m_recordTrees.end(),
79 [&treeName](const auto& recTree) { return recTree.first == treeName; });
80
81 it->second.template recordTime<TimingResolution>(stepName, time);
82 }

The documentation for this class was generated from the following file: