PandaRoot
L1CATFTimerInfo Class Reference

#include <L1Timer.h>

Public Member Functions

 L1CATFTimerInfo ()
 
 L1CATFTimerInfo (int n)
 
void SetNIter (int n)
 
void Clear ()
 
void Add (string name)
 
L1CATFIterTimerInfoGetTimerAll ()
 
L1CATFIterTimerInfooperator[] (int i)
 
void operator+= (L1CATFTimerInfo &t)
 
L1CATFTimerInfo operator/ (float f)
 
void Calc ()
 
L1CATFIterTimerInfoGetAllInfo ()
 
void PrintReal ()
 

Detailed Description

Definition at line 129 of file L1Timer.h.

Constructor & Destructor Documentation

◆ L1CATFTimerInfo() [1/2]

L1CATFTimerInfo::L1CATFTimerInfo ( )
inline

Definition at line 131 of file L1Timer.h.

131 {};

◆ L1CATFTimerInfo() [2/2]

L1CATFTimerInfo::L1CATFTimerInfo ( int  n)
inline

Definition at line 132 of file L1Timer.h.

132 { fTIIs.resize(n); };

Member Function Documentation

◆ Add()

void L1CATFTimerInfo::Add ( string  name)
inline

Definition at line 142 of file L1Timer.h.

References i.

143  {
144  for (unsigned int i = 0; i < fTIIs.size(); ++i)
145  fTIIs[i].Add(name);
146  fTIAll.Add(name);
147  }; // use after setniter
unsigned int i
Definition: P4_F32vec4.h:21
void Add(string name)
Definition: L1Timer.h:79
void Add(string name)
Definition: L1Timer.h:142

◆ Calc()

void L1CATFTimerInfo::Calc ( )
inline

Definition at line 167 of file L1Timer.h.

References i.

168  {
169  fTIAll = fTIIs[0];
170  for (unsigned int i = 1; i < fTIIs.size(); ++i)
171  fTIAll += fTIIs[i];
172  }
unsigned int i
Definition: P4_F32vec4.h:21

◆ Clear()

void L1CATFTimerInfo::Clear ( void  )
inline

Definition at line 135 of file L1Timer.h.

References TimerInfo::Clear(), and i.

136  {
137  for (unsigned int i = 0; i < fTIIs.size(); i++)
138  fTIIs[i].Clear();
139  fTIAll.Clear();
140  };
void Clear()
Definition: L1Timer.h:135
unsigned int i
Definition: P4_F32vec4.h:21

◆ GetAllInfo()

L1CATFIterTimerInfo& L1CATFTimerInfo::GetAllInfo ( )
inline

Definition at line 174 of file L1Timer.h.

Referenced by operator+=().

174 { return fTIAll; };

◆ GetTimerAll()

L1CATFIterTimerInfo& L1CATFTimerInfo::GetTimerAll ( )
inline

Definition at line 148 of file L1Timer.h.

148 { return fTIAll; };

◆ operator+=()

void L1CATFTimerInfo::operator+= ( L1CATFTimerInfo t)
inline

Definition at line 150 of file L1Timer.h.

References GetAllInfo(), and i.

151  {
152  for (unsigned int i = 0; i < fTIIs.size(); ++i)
153  fTIIs[i] += t[i];
154  fTIAll += t.GetAllInfo();
155  }
L1CATFIterTimerInfo & GetAllInfo()
Definition: L1Timer.h:174
unsigned int i
Definition: P4_F32vec4.h:21

◆ operator/()

L1CATFTimerInfo L1CATFTimerInfo::operator/ ( float  f)
inline

Definition at line 156 of file L1Timer.h.

References f, i, and SetNIter().

157  {
158  L1CATFTimerInfo r;
159  r.fTIAll = fTIAll / f;
160  r.SetNIter(fTIIs.size());
161  for (unsigned int i = 0; i < fTIIs.size(); ++i) {
162  r.fTIIs[i] = fTIIs[i] / f;
163  }
164  return r;
165  }
void SetNIter(int n)
Definition: L1Timer.h:133
unsigned int i
Definition: P4_F32vec4.h:21
float f
Definition: P4_F32vec4.h:20

◆ operator[]()

L1CATFIterTimerInfo& L1CATFTimerInfo::operator[] ( int  i)
inline

Definition at line 149 of file L1Timer.h.

References i.

149 { return fTIIs[i]; };
unsigned int i
Definition: P4_F32vec4.h:21

◆ PrintReal()

void L1CATFTimerInfo::PrintReal ( )
inline

Definition at line 175 of file L1Timer.h.

References i.

176  {
177  // save original cout flags
178  std::ios_base::fmtflags coutFlags = cout.flags();
179 
180  int old_precision = cout.precision(1);
181  cout.setf(ios::fixed);
182  cout << " stage "
183  << " : ";
184  fTIAll.PrintNames();
185  cout << endl;
186  for (unsigned int i = 0; i < fTIIs.size(); ++i) {
187  cout << " iter " << i << " : ";
188  fTIIs[i].PrintReal();
189  cout << endl;
190  }
191  cout << " all "
192  << " : ";
193  fTIAll.PrintReal();
194  cout << endl;
195 
196  // restore original cout flags
197  cout.flags(coutFlags);
198  cout.precision(old_precision);
199  };
unsigned int i
Definition: P4_F32vec4.h:21
void PrintReal(int f=0)
Definition: L1Timer.h:102

◆ SetNIter()

void L1CATFTimerInfo::SetNIter ( int  n)
inline

Definition at line 133 of file L1Timer.h.

Referenced by operator/().

133 { fTIIs.resize(n); };

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