File indexing completed on 2025-01-18 10:17:18
0001
0002
0003
0004
0005
0006 #include "DstExampleProcessor.h"
0007 #include "DataObjects.h"
0008 #include <JANA/JLogger.h>
0009
0010 DstExampleProcessor::DstExampleProcessor() {
0011 SetTypeName(NAME_OF_THIS);
0012 SetCallbackStyle(CallbackStyle::ExpertMode);
0013 }
0014
0015 void DstExampleProcessor::Init() {
0016 LOG << "DstExampleProcessor::Init" << LOG_END;
0017
0018 }
0019
0020 void DstExampleProcessor::Process(const JEvent& event) {
0021 LOG << "DstExampleProcessor::Process, Event #" << event.GetEventNumber() << LOG_END;
0022
0023
0024
0025
0026
0027
0028 event.Get<MyRenderableJObject>("from_factory");
0029
0030
0031
0032 auto renderable_map = event.GetAllChildren<Renderable>();
0033 auto jobject_map = event.GetAllChildren<JObject>();
0034
0035
0036
0037
0038 std::lock_guard<std::mutex>lock(m_mutex);
0039 for (const auto& item : renderable_map) {
0040
0041 std::string factory_name = item.first.first;
0042 std::string factory_tag = item.first.second;
0043 const std::vector<Renderable*>& renderables = item.second;
0044
0045 LOG << "----------------------------------" << LOG_END;
0046 LOG << "Found factory producing Renderables: " << factory_name << ", " << factory_tag << LOG_END;
0047 for (auto renderable : renderables) {
0048 renderable->Render();
0049 }
0050 }
0051
0052 for (const auto& item : jobject_map) {
0053
0054 std::string factory_name = item.first.first;
0055 std::string factory_tag = item.first.second;
0056 const std::vector<JObject*>& jobjects = item.second;
0057
0058 LOG << "----------------------------------" << LOG_END;
0059 LOG << "Found factory producing JObjects: " << factory_name << ", " << factory_tag << LOG_END;
0060
0061 for (auto jobject : jobjects) {
0062 LOG << "Found JObject with classname " << jobject->className() << LOG_END;
0063 }
0064 }
0065 LOG << "----------------------------------" << LOG_END;
0066 }
0067
0068 void DstExampleProcessor::Finish() {
0069
0070 LOG << "DstExampleProcessor::Finish" << LOG_END;
0071 }
0072