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 141 of file L1Timer.h.

Constructor & Destructor Documentation

◆ L1CATFTimerInfo() [1/2]

L1CATFTimerInfo::L1CATFTimerInfo ( )
inline

Definition at line 143 of file L1Timer.h.

143 {};

◆ L1CATFTimerInfo() [2/2]

L1CATFTimerInfo::L1CATFTimerInfo ( int  n)
inline

Definition at line 144 of file L1Timer.h.

144 { fTIIs.resize(n); };

Member Function Documentation

◆ Add()

void L1CATFTimerInfo::Add ( string  name)
inline

Definition at line 154 of file L1Timer.h.

References i.

155  {
156  for (unsigned int i = 0; i < fTIIs.size(); ++i)
157  fTIIs[i].Add(name);
158  fTIAll.Add(name);
159  }; // use after setniter
unsigned int i
Definition: P4_F32vec4.h:33
void Add(string name)
Definition: L1Timer.h:91
void Add(string name)
Definition: L1Timer.h:154

◆ Calc()

void L1CATFTimerInfo::Calc ( )
inline

Definition at line 179 of file L1Timer.h.

References i.

180  {
181  fTIAll = fTIIs[0];
182  for (unsigned int i = 1; i < fTIIs.size(); ++i)
183  fTIAll += fTIIs[i];
184  }
unsigned int i
Definition: P4_F32vec4.h:33

◆ Clear()

void L1CATFTimerInfo::Clear ( void  )
inline

Definition at line 147 of file L1Timer.h.

References TimerInfo::Clear(), and i.

148  {
149  for (unsigned int i = 0; i < fTIIs.size(); i++)
150  fTIIs[i].Clear();
151  fTIAll.Clear();
152  };
void Clear()
Definition: L1Timer.h:147
unsigned int i
Definition: P4_F32vec4.h:33

◆ GetAllInfo()

L1CATFIterTimerInfo& L1CATFTimerInfo::GetAllInfo ( )
inline

Definition at line 186 of file L1Timer.h.

Referenced by operator+=().

186 { return fTIAll; };

◆ GetTimerAll()

L1CATFIterTimerInfo& L1CATFTimerInfo::GetTimerAll ( )
inline

Definition at line 160 of file L1Timer.h.

160 { return fTIAll; };

◆ operator+=()

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

Definition at line 162 of file L1Timer.h.

References GetAllInfo(), and i.

163  {
164  for (unsigned int i = 0; i < fTIIs.size(); ++i)
165  fTIIs[i] += t[i];
166  fTIAll += t.GetAllInfo();
167  }
L1CATFIterTimerInfo & GetAllInfo()
Definition: L1Timer.h:186
unsigned int i
Definition: P4_F32vec4.h:33

◆ operator/()

L1CATFTimerInfo L1CATFTimerInfo::operator/ ( float  f)
inline

Definition at line 168 of file L1Timer.h.

References f, i, and SetNIter().

169  {
170  L1CATFTimerInfo r;
171  r.fTIAll = fTIAll / f;
172  r.SetNIter(fTIIs.size());
173  for (unsigned int i = 0; i < fTIIs.size(); ++i) {
174  r.fTIIs[i] = fTIIs[i] / f;
175  }
176  return r;
177  }
void SetNIter(int n)
Definition: L1Timer.h:145
unsigned int i
Definition: P4_F32vec4.h:33
float f
Definition: P4_F32vec4.h:32

◆ operator[]()

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

Definition at line 161 of file L1Timer.h.

References i.

161 { return fTIIs[i]; };
unsigned int i
Definition: P4_F32vec4.h:33

◆ PrintReal()

void L1CATFTimerInfo::PrintReal ( )
inline

Definition at line 187 of file L1Timer.h.

References i.

188  {
189  // save original cout flags
190  std::ios_base::fmtflags coutFlags = cout.flags();
191 
192  int old_precision = cout.precision(1);
193  cout.setf(ios::fixed);
194  cout << " stage "
195  << " : ";
196  fTIAll.PrintNames();
197  cout << endl;
198  for (unsigned int i = 0; i < fTIIs.size(); ++i) {
199  cout << " iter " << i << " : ";
200  fTIIs[i].PrintReal();
201  cout << endl;
202  }
203  cout << " all "
204  << " : ";
205  fTIAll.PrintReal();
206  cout << endl;
207 
208  // restore original cout flags
209  cout.flags(coutFlags);
210  cout.precision(old_precision);
211  };
unsigned int i
Definition: P4_F32vec4.h:33
void PrintReal(int f=0)
Definition: L1Timer.h:114

◆ SetNIter()

void L1CATFTimerInfo::SetNIter ( int  n)
inline

Definition at line 145 of file L1Timer.h.

Referenced by operator/().

145 { fTIIs.resize(n); };

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