Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:17:19

0001 // Copyright 2024, Jefferson Science Associates, LLC.
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 
0004 #pragma once
0005 
0006 #include <JANA/Components/JOmniFactory.h>
0007 #include <PodioDatamodel/ExampleHitCollection.h>
0008 #include <PodioDatamodel/ExampleClusterCollection.h>
0009 
0010 
0011 struct PodioProtoclusteringFactory : public JOmniFactory<PodioProtoclusteringFactory> {
0012 
0013     PodioInput<ExampleHit> hits_in {this};
0014     PodioOutput<ExampleCluster> clusters_out {this};
0015 
0016     void Configure() {
0017     }
0018 
0019     void ChangeRun(int32_t /*run_nr*/) {
0020     }
0021 
0022     void Execute(int32_t /*run_nr*/, uint64_t /*evt_nr*/) {
0023 
0024         auto cs = std::make_unique<ExampleClusterCollection>();
0025         for (auto hit : *hits_in()) {
0026             auto cluster = cs->create();
0027             cluster.energy(hit.energy());
0028             cluster.addHits(hit);
0029         }
0030         clusters_out() = std::move(cs);
0031     }
0032 };
0033 
0034