Back to home page

EIC code displayed by LXR

 
 

    


Warning, /eic-smear/src/erhic/ForesterStatus.cxx.betterbutdifferent is written in an unsupported language. File is not indexed.

0001 /**
0002  \file
0003  Implementation of class erhic::Forester.
0004  
0005  \author    Thomas Burton
0006  \date      2011-06-23
0007  \copyright 2011 Brookhaven National Lab
0008  */
0009 
0010 #include "eicsmear/erhic/ForesterStatus.h"
0011 
0012 namespace erhic {
0013   
0014   ForesterStatus::ForesterStatus()
0015     : mNEvents(0)
0016     , mNParticles(0) {
0017     // Initialise the start and end time to the creation time and reset
0018     // the timer to ensure it is at zero.
0019     std::time(&mStartTime);
0020     mEndTime = mStartTime;
0021     mTimer.Reset();
0022   }
0023   
0024   ForesterStatus::~ForesterStatus() { /* noop */ }
0025   
0026   std::ostream& ForesterStatus::Print(std::ostream& os) const {
0027     // Put start and end times in different os <<... otherwise I get
0028     // the same time for each...
0029     os << "Began on " << std::ctime(&mStartTime);
0030     os << "Ended on " << std::ctime(&mEndTime);
0031     os << "Processed " << mNEvents << " events containing "
0032        << mNParticles << " particles in "
0033        << mTimer.RealTime() << " seconds "
0034        << '(' << mTimer.RealTime()/mNEvents <<" sec/event)" << std::endl;
0035     return os;
0036   }
0037   
0038   void ForesterStatus::StartTimer() {
0039     std::time(&mStartTime);
0040     mTimer.Start();
0041   }
0042   
0043   void ForesterStatus::StopTimer() {
0044     std::time(&mEndTime);
0045     mTimer.Stop();
0046   }
0047   
0048   void ForesterStatus::ModifyEventCount(Long64_t count) {
0049     mNEvents += count;
0050   }
0051   
0052   void ForesterStatus::ModifyParticleCount(Long64_t count) {
0053     mNParticles += count;
0054   }
0055   
0056   // ClassImp( ForesterStatus ); // throws error for some reason
0057   
0058 
0059 }  // namespace erhic