Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Monitor.cxx

Go to the documentation of this file.
00001 // ================================================
00002 // Monitor class Implementation
00003 // ================================================
00004 //
00005 // THIS TEXT TO BE REPLACED BY ATLAS STANDARD FORMAT
00006 //
00007 // Namespace Atlfast
00008 //
00009 
00010 #include "AtlfastAlgs/Monitor.h"
00011 #include <cmath> 
00012 
00013 // Generic algorithms
00014 #include <algorithm>
00015 
00016 // Gaudi includes
00017 #include "GaudiKernel/DataSvc.h"
00018 
00019 namespace Atlfast {
00020 
00021   
00022   //--------------------------------
00023   // Constructor 
00024   //--------------------------------
00025   
00026   Monitor::Monitor ( 
00027                     const std::string& name, 
00028                     ISvcLocator* pSvcLocator 
00029                     )
00030     : Algorithm( name, pSvcLocator )
00031   {
00032     
00033     // Set the parameter defaults.
00034     
00035     // Declare the paramemters to Gaudi so that
00036     // they can be over-written via the job options file
00037     m_frequency         = 50;
00038     m_comment           ="no comment";
00039     declareProperty( "Frequency",m_frequency );
00040     declareProperty( "Comment",  m_comment );
00041     
00042   }
00043   
00044   //--------------------
00045   // Destructor
00046   //--------------------
00047   
00048   Monitor::~Monitor() {
00049     MsgStream log( messageService(), name() ) ;
00050     log << MSG::INFO << "destructor, deleting smearer" << endreq;
00051   }
00052   //---------------------------------
00053   // initialise() 
00054   //---------------------------------
00055   
00056   StatusCode Monitor::initialize()
00057   {
00058 
00059     m_nEvents=0;    
00060     return StatusCode::SUCCESS ;
00061   }
00062   
00063   //---------------------------------
00064   // finalise() 
00065   //---------------------------------
00066   
00067   StatusCode Monitor::finalize()
00068   {
00069     
00070     MsgStream log( messageService(), name() ) ;
00071     
00072     log << MSG::INFO << "Finalizing" << endreq;  
00073     
00074     return StatusCode::SUCCESS ;
00075   }
00076   
00077   StatusCode Monitor::execute( )
00078   {
00079     
00080     MsgStream log( messageService(), name() ) ;
00081     
00082     ++m_nEvents;
00083     // Counter of events processed
00084     if( m_nEvents % m_frequency == 0) {
00085       log << MSG::INFO << "    processing event number " 
00086           << m_nEvents <<" "<<m_comment<<endreq;
00087     }     
00088     
00089     return StatusCode::SUCCESS;
00090   }
00091   
00092 } // end namespace bracket
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 

Generated on Tue Mar 18 11:18:24 2003 for AtlfastAlgs by doxygen1.3-rc1