00001 #ifndef _SERVICEMANAGER_H_ 00002 #define _SERVICEMANAGER_H_ 00003 00004 // $Id: ServiceManager.h,v 1.13 2008/10/13 13:05:36 hcheung Exp $ 00005 00006 #include "FWCore/ParameterSet/interface/ProcessDesc.h" 00007 00008 #include "IOPool/Streamer/interface/InitMessage.h" 00009 #include "IOPool/Streamer/interface/EventMessage.h" 00010 #include "IOPool/Streamer/interface/FRDEventMessage.h" 00011 00012 #include <EventFilter/StorageManager/interface/StreamService.h> 00013 #include <EventFilter/StorageManager/interface/InitMsgCollection.h> 00014 #include <EventFilter/StorageManager/interface/SMPerformanceMeter.h> 00015 00016 #include <boost/shared_ptr.hpp> 00017 #include <vector> 00018 #include <list> 00019 #include <string> 00020 #include <map> 00021 00022 namespace edm 00023 { 00024 00025 typedef std::vector<boost::shared_ptr<StreamService> > Streams; 00026 typedef std::vector<boost::shared_ptr<StreamService> >::iterator StreamsIterator; 00027 00028 00029 class ServiceManager { 00030 00031 public: 00032 00033 explicit ServiceManager(const std::string& config); 00034 ~ServiceManager(); 00035 00036 void start(); 00037 void stop(); 00038 00039 void manageInitMsg(std::string catalog, uint32 disks, std::string sourceId, 00040 InitMsgView& init_message, stor::InitMsgCollection& initMsgCollection); 00041 00042 void manageEventMsg(EventMsgView& msg); 00043 00044 void manageErrorEventMsg(std::string catalog, uint32 disks, std::string sourceId, FRDEventMsgView& msg); 00045 00046 void closeFilesIfNeeded(); 00047 00048 std::list<std::string>& get_filelist(); 00049 std::list<std::string>& get_currfiles(); 00050 std::vector<uint32>& get_storedEvents(); 00051 std::vector<std::string>& get_storedNames(); 00052 boost::shared_ptr<stor::SMOnlyStats> get_stats(); 00053 00054 std::map<std::string, Strings> getStreamSelectionTable(); 00055 00056 private: 00057 void collectStreamerPSets(const std::string& config); 00058 00059 std::vector<ParameterSet> outModPSets_; 00060 Streams managedOutputs_; 00061 std::list<std::string> filelist_; 00062 std::list<std::string> currfiles_; 00063 Strings psetHLTOutputLabels_; 00064 std::vector<uint32> outputModuleIds_; 00065 std::vector<uint32> storedEvents_; 00066 std::vector<std::string> storedNames_; 00067 int currentlumi_; 00068 double timeouttime_; 00069 double lasttimechecked_; 00070 int errorStreamPSetIndex_; 00071 bool errorStreamCreated_; 00072 unsigned long samples_; 00073 unsigned long period4samples_; 00074 stor::SMPerformanceMeter *pmeter_; 00075 }; 00076 00077 }//edm-namespace 00078 00079 #endif