ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
Utilities
BasicDataCollector.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
BasicDataCollector.h
"
6
7
#include <algorithm>
8
#include <sstream>
9
10
namespace
GlobalSim
{
11
12
using namespace
std::chrono;
13
14
BasicDataCollector::BasicDataCollector
():
15
m_t0
{high_resolution_clock::now()}{
16
}
17
18
void
BasicDataCollector::collect
(
const
IAlgTool& tool,
19
const
std::string&
msg
){
20
const
auto
&
label
= tool.name();
21
auto
iter =
22
std::find_if(
m_msgs
.begin(),
23
m_msgs
.end(),
24
[&
label
](
const
std::pair<std::string,
25
std::vector<std::string>>& p){
26
return label == p.first;
27
});
28
auto
d = high_resolution_clock::now() -
m_t0
;
29
30
auto
ss
= std::stringstream();
31
ss << duration_cast<microseconds>
(d).count() <<
" (us): "
<<
msg
;
32
33
if
(iter ==
m_msgs
.cend()){
34
m_msgs
.push_back(std::pair(
label
, std::vector<std::string>{
ss
.str()}));
35
}
else
{
36
(iter->second).push_back(
ss
.str());
37
}
38
}
39
40
41
std::string
BasicDataCollector::to_string
()
const
{
42
auto
result = std::string();
43
for
(
const
auto
& p :
m_msgs
){
44
result += p.first +
'\n'
;;
45
for
(
const
auto
& m : p.second){
46
result +=
" "
+ m +
'\n'
;
47
}
48
}
49
return
result;
50
}
51
52
std::ostream&
operator <<
(std::ostream& os,
const
BasicDataCollector
& bdc){
53
os << bdc.
to_string
();
54
return
os;
55
}
56
}
BasicDataCollector.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
GlobalSim::BasicDataCollector
Definition
BasicDataCollector.h:15
GlobalSim::BasicDataCollector::collect
virtual void collect(const IAlgTool &, const std::string &msg)
Definition
BasicDataCollector.cxx:18
GlobalSim::BasicDataCollector::m_msgs
std::vector< std::pair< std::string, std::vector< std::string > > > m_msgs
Definition
BasicDataCollector.h:23
GlobalSim::BasicDataCollector::m_t0
std::chrono::high_resolution_clock::time_point m_t0
Definition
BasicDataCollector.h:24
GlobalSim::BasicDataCollector::BasicDataCollector
BasicDataCollector()
Definition
BasicDataCollector.cxx:14
GlobalSim::BasicDataCollector::to_string
virtual std::string to_string() const
Definition
BasicDataCollector.cxx:41
label
std::string label(const std::string &format, int i)
Definition
label.h:19
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
Trigger/TrigT1/Global/GlobalSimulation/src/Egamma1BDT/Egamma1BDT/BDT.h:11
GlobalSim::operator<<
std::ostream & operator<<(std::ostream &os, const BasicDataCollector &bdc)
Definition
BasicDataCollector.cxx:52
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0