00001 #ifndef Services_PATHTIMERSERVICE_h
00002 #define Services_PATHTIMERSERVICE_h
00003
00004
00005
00006
00007
00008
00009
00010
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
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_;
00046 double curr_event_time_;
00047 double curr_module_time_;
00048
00049
00050
00051
00052 double max_event_time_;
00053 double min_event_time_;
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