Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TimerStats.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TimerStats.cc
1 #include "TimerStats.h"
2 
3 #include <cdbobjects/CDBTTree.h>
4 
6 
9 #include <fun4all/SubsysReco.h> // for SubsysReco
10 
11 #include <phool/PHCompositeNode.h>
12 #include <phool/PHIODataNode.h> // for PHIODataNode
13 #include <phool/getClass.h>
14 
15 #include <map> // for _Rb_tree_iterator
16 
18  : SubsysReco(name)
19 {
20 }
21 
23 {
24  delete cdbttree; // make cppcheck happy, deleting a null ptr
27 }
28 
30 {
31  iev++;
33  EventHeader *evtheader = findNode::getClass<EventHeader>(topNode, "EventHeader");
34  if (evtheader)
35  {
36  iev = evtheader->get_EvtSequence();
37  }
38  else
39  {
40  iev++;
41  }
42  for (auto iter = se->timer_begin(); iter != se->timer_end(); ++iter)
43  {
44  cdbttree->SetFloatValue(iev, iter->first, iter->second.elapsed());
45  }
47 }
48 
49 int TimerStats::End(PHCompositeNode * /*topNode*/)
50 {
51  cdbttree->Commit();
53  delete cdbttree;
55 }