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

#include <BenchmarkRecorder.h>

Public Member Functions

 BenchmarkRecorderTree ()=delete
 
 BenchmarkRecorderTree (const BenchmarkRecorderTree &)=delete
 
BenchmarkRecorderTreeoperator= (const BenchmarkRecorderTree &)=delete
 
 BenchmarkRecorderTree (TFile *recFile, const std::string &name, const std::vector< std::string > &steps)
 
template<typename TimingResolution = std::chrono::nanoseconds>
void recordTime (const std::string &stepName, const ClockT::duration time)
 
void Fill ()
 
void Write ()
 

Detailed Description

Definition at line 18 of file BenchmarkRecorder.h.

Constructor & Destructor Documentation

◆ BenchmarkRecorderTree() [1/3]

podio::benchmark::BenchmarkRecorderTree::BenchmarkRecorderTree ( )
delete

◆ BenchmarkRecorderTree() [2/3]

podio::benchmark::BenchmarkRecorderTree::BenchmarkRecorderTree ( const BenchmarkRecorderTree )
delete

◆ BenchmarkRecorderTree() [3/3]

podio::benchmark::BenchmarkRecorderTree::BenchmarkRecorderTree ( TFile *  recFile,
const std::string &  name,
const std::vector< std::string > &  steps 
)
inline

Definition at line 26 of file BenchmarkRecorder.h.

26 :
27 m_stepNames(steps), m_stepTimes(steps.size()) {
28 recFile->cd();
29 m_recordTree = new TTree(name.c_str(), "time recording tree");
30 m_recordTree->SetDirectory(recFile);
31
32 for (size_t i = 0; i < m_stepNames.size(); ++i) {
33 m_recordTree->Branch(m_stepNames[i].c_str(), &m_stepTimes[i]);
34 }
35 }

Member Function Documentation

◆ Fill()

void podio::benchmark::BenchmarkRecorderTree::Fill ( )
inline

Definition at line 44 of file BenchmarkRecorder.h.

44 {
45 m_recordTree->Fill();
46 }

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

◆ operator=()

BenchmarkRecorderTree & podio::benchmark::BenchmarkRecorderTree::operator= ( const BenchmarkRecorderTree )
delete

◆ recordTime()

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

Definition at line 38 of file BenchmarkRecorder.h.

38 {
39 const auto it = std::find(m_stepNames.cbegin(), m_stepNames.cend(), stepName);
40 const auto index = std::distance(m_stepNames.cbegin(), it);
41 m_stepTimes[index] = std::chrono::duration_cast<TimingResolution>(time).count();
42 }

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

◆ Write()

void podio::benchmark::BenchmarkRecorderTree::Write ( )
inline

Definition at line 48 of file BenchmarkRecorder.h.

48 {
49 m_recordTree->Write();
50 }

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