CMS 3D CMS Logo

ModuleTiming.h
Go to the documentation of this file.
1 #ifndef Edm_Module_Timing_h
2 #define Edm_Module_Timing_h
3 
4 #include <vector>
5 #include <string>
6 
7 /* Original version: July 2006, Christos Leonidopoulos */
8 
9 namespace edm {
10 
11  // structure holding the processing time (per event) and name of a module
12  class ModuleTime {
13  public:
14  ModuleTime() : name_(""), time_(-1) {}
17 
18  std::string name() const { return name_; } // module name ("label")
19  double time() const { return time_; } // processing time for event (secs)
20  private:
22  double time_;
23  };
24 
25  // structure holding processing info for all modules in event (+total time)
26  class EventTime {
27  private:
28  std::vector<ModuleTime> moduleSet;
29  double tot_time_; // total time in event for all modules (in secs)
30 
31  public:
32  EventTime() { reset(); }
34 
35  // # of modules contained in event
36  unsigned size() const { return moduleSet.size(); }
37  // get hold of ModuleTime structure for module #i, where 0 <= i < size()
38  const ModuleTime& moduleTime(unsigned i) { return moduleSet.at(i); }
39  // get total processing time for event (secs)
40  double tot_time() const { return tot_time_; }
41  // get name for module #i, where 0 <= i < size()
42  std::string name(unsigned i) const { return moduleSet.at(i).name(); }
43  // get processing time for module #i (secs), where 0 <= i < size()
44  double time(unsigned i) const { return moduleSet.at(i).time(); }
45  // add module structure to event
46  void addModuleTime(const ModuleTime& m) {
47  moduleSet.push_back(m);
48  tot_time_ += m.time();
49  }
50 
51  // reset all info (ie. from previous event)
52  void reset() {
53  moduleSet.clear();
54  tot_time_ = 0;
55  }
56  };
57 
58 } // namespace edm
59 
60 #endif // #define Edm_Module_Timing_h
edm::EventTime::size
unsigned size() const
Definition: ModuleTiming.h:36
mps_fire.i
i
Definition: mps_fire.py:355
edm::EventTime::tot_time_
double tot_time_
Definition: ModuleTiming.h:29
SiStripClientConfig_Tier0_cff.Name
Name
Definition: SiStripClientConfig_Tier0_cff.py:13
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ModuleTime::time
double time() const
Definition: ModuleTiming.h:19
edm::ModuleTime::name
std::string name() const
Definition: ModuleTiming.h:18
edm::EventTime::moduleSet
std::vector< ModuleTime > moduleSet
Definition: ModuleTiming.h:28
edm::EventTime::~EventTime
~EventTime()
Definition: ModuleTiming.h:33
edm::EventTime::reset
void reset()
Definition: ModuleTiming.h:52
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
edm::EventTime::time
double time(unsigned i) const
Definition: ModuleTiming.h:44
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventTime::tot_time
double tot_time() const
Definition: ModuleTiming.h:40
edm::ModuleTime::~ModuleTime
~ModuleTime()
Definition: ModuleTiming.h:16
edm::EventTime::moduleTime
const ModuleTime & moduleTime(unsigned i)
Definition: ModuleTiming.h:38
edm::EventTime
Definition: ModuleTiming.h:26
edm::ModuleTime::time_
double time_
Definition: ModuleTiming.h:22
edm::EventTime::EventTime
EventTime()
Definition: ModuleTiming.h:32
edm::EventTime::addModuleTime
void addModuleTime(const ModuleTime &m)
Definition: ModuleTiming.h:46
edm::ModuleTime::ModuleTime
ModuleTime(std::string Name, double Time)
Definition: ModuleTiming.h:15
edm::ModuleTime
Definition: ModuleTiming.h:12
RecoSummaryTask_cfi.Time
Time
Definition: RecoSummaryTask_cfi.py:34
edm::EventTime::name
std::string name(unsigned i) const
Definition: ModuleTiming.h:42
edm::ModuleTime::ModuleTime
ModuleTime()
Definition: ModuleTiming.h:14
edm::ModuleTime::name_
std::string name_
Definition: ModuleTiming.h:21