File indexing completed on 2025-01-18 09:55:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDEVE_GENERICEVENTHANDLER_H
0014 #define DDEVE_GENERICEVENTHANDLER_H
0015
0016
0017 #include "DDEve/EventHandler.h"
0018
0019
0020
0021
0022 namespace dd4hep {
0023
0024
0025
0026
0027
0028
0029
0030 class GenericEventHandler : public EventHandler {
0031 protected:
0032
0033 typedef std::set<EventConsumer*> Subscriptions;
0034 std::map<std::string,EventHandler*> m_handlers;
0035 EventHandler* m_current;
0036
0037 Subscriptions m_subscriptions;
0038
0039 EventHandler* current() const;
0040 public:
0041
0042 GenericEventHandler();
0043
0044 virtual ~GenericEventHandler();
0045
0046 virtual const TypedEventCollections& data() const override { return current()->data(); }
0047
0048 virtual long numEvents() const override;
0049
0050 virtual std::string datasourceName() const override;
0051
0052 virtual CollectionType collectionType(const std::string& collection) const override;
0053
0054 virtual size_t collectionLoop(const std::string& collection, DDEveHitActor& actor) override;
0055
0056 virtual size_t collectionLoop(const std::string& collection, DDEveParticleActor& actor) override;
0057
0058 virtual bool Open(const std::string& type, const std::string& file_name) override;
0059
0060 virtual bool NextEvent() override;
0061
0062 virtual bool PreviousEvent() override;
0063
0064 virtual bool GotoEvent(long event_number) override;
0065
0066 virtual void Subscribe(EventConsumer* display);
0067
0068 virtual void Unsubscribe(EventConsumer* display);
0069
0070 #ifndef __CINT__
0071
0072 virtual void NotifySubscribers(void (EventConsumer::*pmf)(EventHandler&));
0073 #endif
0074
0075 ClassDefOverride(GenericEventHandler,0);
0076 };
0077 }
0078
0079 #endif
0080