EUDAQ
 All Classes Namespaces Files Functions Variables Pages
PluginManager.hh
1 #ifndef EUDAQ_INCLUDED_PluginManager
2 #define EUDAQ_INCLUDED_PluginManager
3 
4 #include "eudaq/DataConverterPlugin.hh"
5 #include "eudaq/DetectorEvent.hh"
6 
7 #include <string>
8 #include <map>
9 
10 namespace eudaq {
11 
20  class DLLEXPORT PluginManager {
21 
22  public:
23  typedef DataConverterPlugin::t_eventid t_eventid;
24 
27  void RegisterPlugin(DataConverterPlugin *plugin);
28 
34  static PluginManager &GetInstance();
35 
36  static unsigned GetTriggerID(const Event &);
37 
38  static int IsSyncWithTLU(eudaq::Event const &ev,
39  eudaq::TLUEvent const &tlu);
40  static t_eventid getEventId(eudaq::Event const &ev);
41 
42  static void setCurrentTLUEvent(eudaq::Event &ev,
43  eudaq::TLUEvent const &tlu);
44  static void Initialize(const DetectorEvent &);
45  static lcio::LCRunHeader *GetLCRunHeader(const DetectorEvent &);
46  static StandardEvent ConvertToStandard(const DetectorEvent &);
47  static lcio::LCEvent *ConvertToLCIO(const DetectorEvent &);
48 
49  static void ConvertStandardSubEvent(StandardEvent &, const Event &);
50  static void ConvertLCIOSubEvent(lcio::LCEvent &, const Event &);
51 
54  DataConverterPlugin &GetPlugin(t_eventid eventtype);
55  DataConverterPlugin &GetPlugin(const Event &event);
56 
57  private:
60  std::map<t_eventid, DataConverterPlugin *> m_pluginmap;
61 
62  PluginManager() {}
63  PluginManager(PluginManager const &) {}
64  class _dummy;
65  friend class _dummy; // Silence superfluous warnings in some gcc versions
66  };
67 
68 } // namespace eudaq
69 
70 #endif // EUDAQ_INCLUDED_PluginManager
Definition: TLUEvent.hh:10
Definition: StandardEvent.hh:128
Definition: DetectorEvent.hh:12
Definition: PluginManager.hh:20
Definition: DataConverterPlugin.hh:132
Definition: Event.hh:38