CMS 3D CMS Logo

PathTimerService.h

Go to the documentation of this file.
00001 #ifndef Services_PATHTIMERSERVICE_h
00002 #define Services_PATHTIMERSERVICE_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Services
00006 // Class  :     Timing
00007 // 
00008 //
00009 // Original Author:  David Lange
00010 // $Id: PathTimerService.h,v 1.6 2007/09/14 17:33:32 bdahmes Exp $
00011 //
00012 #include "sigc++/signal.h"
00013 
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00016 #include "DataFormats/Provenance/interface/EventID.h"
00017 #include "DataFormats/HLTReco/interface/HLTPerformanceInfo.h"
00018 // Keep track of CPU time
00019 #include "FWCore/Utilities/interface/CPUTimer.h"
00020 
00021 
00022 namespace edm {
00023     namespace service {
00024         class PathTimerService
00025         {
00026         public:
00027             PathTimerService(const ParameterSet&,ActivityRegistry&);
00028             ~PathTimerService();
00029 
00030             sigc::signal<void, const edm::ModuleDescription&, double> newMeasurementSignal;
00031             
00032             std::auto_ptr<HLTPerformanceInfo> getInfo() { return std::auto_ptr<HLTPerformanceInfo>(new HLTPerformanceInfo(*_perfInfo));}
00033 
00034         private:
00035             void postBeginJob();
00036             void postEndJob();
00037       
00038             void preEventProcessing(const edm::EventID&, const edm::Timestamp&);
00039             void postEventProcessing(const Event&, const EventSetup&);
00040             void postPathProcessing(const std::string&, const HLTPathStatus&);
00041             void preModule(const ModuleDescription&);
00042             void postModule(const ModuleDescription&);
00043 
00044             edm::EventID curr_event_;
00045             double curr_job_;         // seconds
00046             double curr_event_time_;  // seconds
00047             double curr_module_time_; // seconds
00048       
00049             //
00050             // Min Max and average event times for summary
00051             //  at end of job
00052             double max_event_time_;    // seconds
00053             double min_event_time_;    // seconds
00054             int total_event_count_; 
00055 
00056             ParameterSet _myPS;
00057             std::map<std::string, std::string> _moduleList;
00058             std::map<std::string, double> _moduleTime;
00059             std::map<std::string, double> _moduleCPUTime;
00060             std::map<int, std::string> _pathMapping;
00061             std::map<std::string, unsigned int> _lastModuleToRun;
00062             std::auto_ptr<HLTPerformanceInfo> _perfInfo;
00063             std::vector< std::vector<unsigned int> > _newPathIndex ;
00064             static edm::CPUTimer* _CPUtimer ;
00065         
00066         };
00067     }
00068 }
00069 
00070 #endif

Generated on Tue Jun 9 17:33:04 2009 for CMSSW by  doxygen 1.5.4