// // File : FEReadoutTimeProfile.hh // // Purpose: Declaration & implementation of the class FEReadoutTimeProfile // // $Id: FEReadoutTimeProfile.hh 12523 2011-06-27 13:10:05Z mathes $ // /** @file FEReadoutTimeProfile.hh * Declaration of the class FEReadoutTimeProfile. * @author H.-J. Mathes, Fzk */ #ifndef _FEReadoutTimeProfile_hh_ #define _FEReadoutTimeProfile_hh_ #include #include #include /** Class which holds several TStopwatch objects (ROOT) to profile the * execution time of various readout steps. */ class FEReadoutTimeProfile : public FdUtil::Singleton { friend class FdUtil::Singleton; private: /** Constructor of the class FEReadoutTimeProfile. */ FEReadoutTimeProfile(); /** Destructor of the class FEReadoutTimeProfile. * * The final results of the profiling are printed to cout. */ ~FEReadoutTimeProfile(); public: /** Print the final results of the profiling to the specified stream. */ void PrintFinalResults(std::ostream& ostr=std::cout); /** TStopwatch for 'event delete' part. */ TStopwatch fDeleteEvent; /** TStopwatch for 'event header readout'. */ TStopwatch fEventHeader; /** TStopwatch for 'FADC readout'. */ TStopwatch fFADCReadout; /** TStopwatch for 'monitor data readout'. */ TStopwatch fMonitorReadout; /** TStopwatch for 'SLT data readout'. */ TStopwatch fPixelReadout; /** TStopwatch for 'Next Page polling'. */ TStopwatch fPollNextPage; /** TStopwatch for 'single DAC trace readout'. */ TStopwatch fTraceReadout; private: // these ones are not implemented FEReadoutTimeProfile(const FEReadoutTimeProfile&); FEReadoutTimeProfile& operator=(const FEReadoutTimeProfile&); TStopwatch fTotal; }; #ifdef MEASURE_TIME # define MEASURE_TIME_START(_timer_) \ FEReadoutTimeProfile::GetInstance()._timer_.Start(kFALSE) # define MEASURE_TIME_STOP(_timer_) \ FEReadoutTimeProfile::GetInstance()._timer_.Stop() #else # define MEASURE_TIME_START(_timer_) {} # define MEASURE_TIME_STOP(_timer_) {} #endif // MEASURE_TIME #endif // _FEReadoutTimeProfile_hh_