File indexing completed on 2025-01-18 10:17:19
0001
0002
0003
0004
0005
0006 #include "PodioExampleProcessor.h"
0007 #include <PodioDatamodel/ExampleHitCollection.h>
0008 #include <PodioDatamodel/ExampleClusterCollection.h>
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 PodioExampleProcessor::PodioExampleProcessor() {
0046 SetTypeName(NAME_OF_THIS);
0047 SetCallbackStyle(CallbackStyle::ExpertMode);
0048 }
0049
0050 void PodioExampleProcessor::Process(const JEvent& event) {
0051
0052
0053 auto hits = event.GetCollection<ExampleHit>("hits");
0054 auto hits_filtered = event.GetCollection<ExampleHit>("hits_filtered");
0055 auto clusters = event.GetCollection<ExampleCluster>("clusters");
0056 auto clusters_filtered = event.GetCollection<ExampleCluster>("clusters_filtered");
0057 auto clusters_from_hits_filtered = event.GetCollection<ExampleCluster>("clusters_from_hits_filtered");
0058
0059 std::cout << "========================" << std::endl;
0060 std::cout << "Event nr: " << event.GetEventNumber() << ", Cluster count: " << clusters->size() << std::endl;
0061
0062 std::cout << "hits:" << std::endl;
0063 for (const ExampleHit& hit : *hits) {
0064 std::cout << " " << hit.id() << ": energy=" << hit.energy() << ", x=" << hit.x() << ", y=" << hit.y() << std::endl;
0065 }
0066 std::cout << "hits_filtered:" << std::endl;
0067 for (const ExampleHit& hit : *hits_filtered) {
0068 std::cout << " " << hit.id() << ": energy=" << hit.energy() << ", x=" << hit.x() << ", y=" << hit.y() << std::endl;
0069 }
0070
0071 std::cout << "clusters:" << std::endl;
0072 for (const ExampleCluster& cluster : *clusters) {
0073 std::cout << " " << cluster.id() << ": energy=" << cluster.energy() << ", hits=" << std::endl;
0074 for (const ExampleHit& hit : cluster.Hits()) {
0075 std::cout << " " << hit.id() << ": energy=" << hit.energy() << ", x=" << hit.x() << ", y=" << hit.y() << std::endl;
0076 }
0077 }
0078 std::cout << "clusters_filtered:" << std::endl;
0079 for (const ExampleCluster& cluster : *clusters_filtered) {
0080 std::cout << " " << cluster.id() << ": energy=" << cluster.energy() << ", hits=" << std::endl;
0081 for (const ExampleHit& hit : cluster.Hits()) {
0082 std::cout << " " << hit.id() << ": energy=" << hit.energy() << ", x=" << hit.x() << ", y=" << hit.y() << std::endl;
0083 }
0084 }
0085 std::cout << "clusters_from_hits_filtered:" << std::endl;
0086 for (const ExampleCluster& cluster : *clusters_from_hits_filtered) {
0087 std::cout << " " << cluster.id() << ": energy=" << cluster.energy() << ", hits=" << std::endl;
0088 for (const ExampleHit& hit : cluster.Hits()) {
0089 std::cout << " " << hit.id() << ": energy=" << hit.energy() << ", x=" << hit.x() << ", y=" << hit.y() << std::endl;
0090 }
0091 }
0092 }