00001
00002
00003 #include "EventFilter/Utilities/interface/MicroStateService.h"
00004
00005
00006 namespace evf{
00007
00008 MicroStateService::MicroStateService(const edm::ParameterSet& iPS,
00009 edm::ActivityRegistry& reg)
00010 {
00011
00012 reg.watchPostBeginJob(this,&MicroStateService::postBeginJob);
00013 reg.watchPostEndJob(this,&MicroStateService::postEndJob);
00014
00015 reg.watchPreProcessEvent(this,&MicroStateService::preEventProcessing);
00016 reg.watchPostProcessEvent(this,&MicroStateService::postEventProcessing);
00017 reg.watchPreSource(this,&MicroStateService::preSource);
00018 reg.watchPostSource(this,&MicroStateService::postSource);
00019
00020 reg.watchPreModule(this,&MicroStateService::preModule);
00021 reg.watchPostModule(this,&MicroStateService::postModule);
00022 microstate1_ = "BJ";
00023 microstate2_ = "INIT";
00024
00025 }
00026
00027
00028 MicroStateService::~MicroStateService()
00029 {
00030 }
00031
00032 void MicroStateService::postBeginJob()
00033 {
00034 boost::mutex::scoped_lock sl(lock_);
00035 microstate1_ = "BJD";
00036 }
00037
00038 void MicroStateService::postEndJob()
00039 {
00040 boost::mutex::scoped_lock sl(lock_);
00041 microstate1_ = "EJ";
00042 microstate2_ = "done";
00043 }
00044
00045 void MicroStateService::preEventProcessing(const edm::EventID& iID,
00046 const edm::Timestamp& iTime)
00047 {
00048 boost::mutex::scoped_lock sl(lock_);
00049 microstate1_ = "PRO";
00050 }
00051
00052 void MicroStateService::postEventProcessing(const edm::Event& e, const edm::EventSetup&)
00053 {
00054 boost::mutex::scoped_lock sl(lock_);
00055 microstate2_ = "IN";
00056 }
00057 void MicroStateService::preSource()
00058 {
00059 boost::mutex::scoped_lock sl(lock_);
00060 microstate2_ = "IN";
00061 }
00062
00063 void MicroStateService::postSource()
00064 {
00065 boost::mutex::scoped_lock sl(lock_);
00066 microstate2_ = "IND";
00067 }
00068
00069 void MicroStateService::preModule(const edm::ModuleDescription& desc)
00070 {
00071 boost::mutex::scoped_lock sl(lock_);
00072 microstate2_ = desc.moduleLabel_;
00073 }
00074
00075 void MicroStateService::postModule(const edm::ModuleDescription& desc)
00076 {
00077 }
00078
00079 std::string MicroStateService::getMicroState1()
00080 {
00081 boost::mutex::scoped_lock sl(lock_);
00082 return microstate1_;
00083 }
00084
00085 std::string MicroStateService::getMicroState2()
00086 {
00087 boost::mutex::scoped_lock sl(lock_);
00088 return microstate2_;
00089 }
00090
00091 }
00092