7 #include "GaudiKernel/RndmGenerators.h"
8 #include "GaudiKernel/IRndmGenSvc.h"
9 #include "GaudiUtils/Aida2ROOT.h"
31 declareInterface<ISequencerTimerTool>(
this);
33 declareProperty(
"shots" , m_shots );
34 declareProperty(
"Normalised" , m_normalised =
false );
35 declareProperty(
"GlobalTiming" , m_globalTiming =
false );
36 declareProperty(
"NameSize" , m_headerSize = 30,
37 "Number of characters to be used in algorithm name column" );
51 IRndmGenSvc* rsvc = svc<IRndmGenSvc>(
"RndmGenSvc", true );
56 while( 0 < --shots ) { sum +=
gauss() *
sum ; }
61 info() <<
"This machine has a speed about "
63 <<
" times the speed of a 2.8 GHz Xeon." <<
endmsg ;
76 <<
"This machine has a speed about "
78 <<
" times the speed of a 2.8 GHz Xeon.";
86 if ( lastName == timr.name() )
continue;
87 lastName = timr.name();
100 auto beg = name.find_first_not_of(
" \t");
101 auto end = name.find_last_not_of(
" \t");
102 auto temp = name.substr( beg,
end-beg+1 );
105 beg = timer.
name().find_first_not_of(
" \t");
106 end = timer.
name().find_last_not_of(
" \t");
107 return timer.
name().compare(beg,
end-beg+1,temp) == 0;
119 info() <<
"Saving Timing histograms" <<
endmsg;
121 AIDA::IHistogram1D* histoTime =
book(
"ElapsedTime", 0, bins, bins);
122 AIDA::IHistogram1D* histoCPU =
book(
"CPUTime", 0, bins, bins);
123 AIDA::IHistogram1D* histoCount =
book(
"Count", 0, bins, bins);
128 tHtime->Fill(tfsq.name().c_str(), tfsq.elapsedTotal());
129 tHCPU->Fill(tfsq.name().c_str(), tfsq.cpuTotal());
130 tHCount->Fill(tfsq.name().c_str(), tfsq.count());
140 std::string myName( 2*
m_indent,
' ' );
143 myName += std::string(
m_headerSize - myName.size(),
' ' );
static std::string header(std::string::size_type size)
header matching the previous format
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
double sum(double x, double y, double z)
uint64_t stop()
Stop time measurement and return the last elapsed time.
auto begin(reverse_wrapper< T > &w)
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.
Random number accessor This small class encapsulates the use of the random number generator...
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Random Generator service interface definition Definition of a interface for a service to access rando...
auto end(reverse_wrapper< T > &w)
This class is used for returning status codes from appropriate routines.
#define DECLARE_COMPONENT(type)
Definition of the basic interface.
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
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
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 & info() const
shortcut for the method msgStream(MSG::INFO)