Go to the documentation of this file.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_ = "INPUT";
00056 }
00057 void MicroStateService::preSource()
00058 {
00059 boost::mutex::scoped_lock sl(lock_);
00060 microstate2_ = "INPUT";
00061 }
00062
00063 void MicroStateService::postSource()
00064 {
00065 boost::mutex::scoped_lock sl(lock_);
00066 microstate2_ = "FWKOVH";
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 boost::mutex::scoped_lock sl(lock_);
00078 microstate2_ = "FWKOVH";
00079 }
00080
00081 std::string MicroStateService::getMicroState1()
00082 {
00083 boost::mutex::scoped_lock sl(lock_);
00084 return microstate1_;
00085 }
00086
00087 std::string MicroStateService::getMicroState2()
00088 {
00089 boost::mutex::scoped_lock sl(lock_);
00090 return microstate2_;
00091 }
00092
00093 void MicroStateService::setMicroState(std::string &in)
00094 {
00095 boost::mutex::scoped_lock sl(lock_);
00096 microstate2_ = in;
00097 }
00098
00099 }
00100