27 const
std::
string& name,
31 , m_normFactor( 0.001 )
37 declareProperty(
"shots" , m_shots );
38 declareProperty(
"Normalised" , m_normalised =
false );
39 declareProperty(
"GlobalTiming" , m_globalTiming =
false );
40 declareProperty(
"NameSize" , m_headerSize = 30,
41 "Number of characters to be used in algorithm name column" );
61 IRndmGenSvc* rsvc = svc<IRndmGenSvc>(
"RndmGenSvc", true );
66 while( 0 < --shots ) { sum += gauss() *
sum ; }
71 info() <<
"This machine has a speed about "
73 <<
" times the speed of a 2.8 GHz Xeon." <<
endmsg ;
88 <<
"This machine has a speed about "
90 <<
" times the speed of a 2.8 GHz Xeon.";
95 std::string lastName =
"";
96 for (
unsigned int kk=0 ;
m_timerList.size() > kk ; kk++ )
112 std::string::size_type beg = name.find_first_not_of(
" \t");
113 std::string::size_type
end = name.find_last_not_of(
" \t");
114 std::string temp = name.substr( beg, end-beg+1 );
115 for (
unsigned int kk=0 ;
m_timerList.size() > kk ; kk++ ) {
116 beg =
m_timerList[kk].name().find_first_not_of(
" \t");
117 end =
m_timerList[kk].name().find_last_not_of(
" \t");
130 info() <<
"Saving Timing histograms" <<
endmsg;
132 AIDA::IHistogram1D* histoTime =
book(
"ElapsedTime", 0, bins, bins);
133 AIDA::IHistogram1D* histoCPU =
book(
"CPUTime", 0, bins, bins);
134 AIDA::IHistogram1D* histoCount =
book(
"Count", 0, bins, bins);
138 for (
size_t kk = 0 ; bins > kk ; kk++ )
143 tHCount->Fill(tfsq.
name().c_str(), tfsq.
count());
156 const std::string prefix(
m_indent,
' ' );
162 const std::string space(
m_headerSize - myName.size(),
' ' );
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
MsgStream & info() const
shortcut for the method msgStream ( MSG::INFO )
static std::string header(std::string::size_type size)
header matching the previous format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
double sum(double x, double y, double z)
double count() const
Returns the number run count.
double lastCpu() const
returns the last measured time
Parameters for the Gauss random number generation.
void start()
Start a time measurement.
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
virtual const std::string & name() const =0
Retrieve the name of the instance.
double stop()
Stop time measurement and return the last elapsed time.
Random number accessor This small class encapsulates the use of the random number generator...
Random Generator service interface definition Definition of a interface for a service to access rando...
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
AIDA::IHistogram1D * book(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
double elapsedTotal() const
returns the total elapsed time
double cpuTotal() const
returns the total cpu time
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
const std::string & name() const
returns the name
virtual StatusCode initialize(const SmartIF< IRndmGenSvc > &svc, const IRndmGen::Param &par)
Initialization.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.