File indexing completed on 2025-01-18 10:17:19
0001
0002 #include <JANA/JApplication.h>
0003 #include <JANA/Components/JOmniFactory.h>
0004 #include <JANA/Components/JOmniFactoryGeneratorT.h>
0005 #include <PodioDatamodel/ExampleClusterCollection.h>
0006
0007
0008 struct PodioClusteringFactory : public JOmniFactory<PodioClusteringFactory> {
0009
0010 PodioInput<ExampleCluster> m_protoclusters_in {this};
0011 PodioOutput<ExampleCluster> m_clusters_out {this};
0012
0013 Parameter<double> m_scale {this, "scale", 1.0, "Scaling factor"};
0014 Parameter<double> m_offset {this, "offset", 0.0, "Amount to offset [mm]"};
0015
0016 void Configure() {
0017 }
0018
0019 void ChangeRun(int32_t ) {
0020 }
0021
0022 void Execute(int32_t , uint64_t ) {
0023
0024 auto cs = std::make_unique<ExampleClusterCollection>();
0025
0026 for (auto protocluster : *m_protoclusters_in()) {
0027 auto cluster = cs->create();
0028 cluster.energy((m_scale() * protocluster.energy()) + m_offset());
0029 }
0030
0031 m_clusters_out() = std::move(cs);
0032 }
0033 };
0034
0035