EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
PulseGeneration_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2024-2025 Simon Gardner, Chun Yuen Tsang, Prithwish Tribedy
3// Minho Kim, Sylvester Joosten, Wouter Deconinck, Dmitry Kalinkin
4//
5
6#pragma once
7
8#include <edm4eic/EDM4eicVersion.h>
12
13namespace eicrecon {
14
15template <typename HitT>
17 : public JOmniFactory<PulseGeneration_factory<HitT>, PulseGenerationConfig> {
18public:
21
22private:
23 std::unique_ptr<AlgoT> m_algo;
24
25 typename FactoryT::template PodioInput<HitT> m_in_sim_hits{this};
26#if EDM4EIC_VERSION_MAJOR > 8 || (EDM4EIC_VERSION_MAJOR == 8 && EDM4EIC_VERSION_MINOR >= 1)
27 typename FactoryT::template PodioOutput<edm4eic::SimPulse> m_out_pulses{this};
28#else
29 typename FactoryT::template PodioOutput<edm4hep::TimeSeries> m_out_pulses{this};
30#endif
31
32 typename FactoryT::template ParameterRef<std::string> m_pulse_shape_function{
33 this, "pulseShapeFunction", this->config().pulse_shape_function};
34 typename FactoryT::template ParameterRef<std::vector<double>> m_pulse_shape_params{
35 this, "pulseShapeParams", this->config().pulse_shape_params};
36 typename FactoryT::template ParameterRef<double> m_timestep{this, "timestep",
37 this->config().timestep};
38 typename FactoryT::template ParameterRef<double> m_ignore_thres{this, "ignoreThreshold",
39 this->config().ignore_thres};
40 typename FactoryT::template ParameterRef<double> m_min_sampling_time{
41 this, "minSamplingTime", this->config().min_sampling_time};
42 typename FactoryT::template ParameterRef<uint32_t> m_max_time_bins{this, "maxTimeBins",
43 this->config().max_time_bins};
44
45 typename FactoryT::template Service<AlgorithmsInit_service> m_algorithmsInit{this};
46
47public:
48 void Configure() {
49 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
50 m_algo->level(static_cast<algorithms::LogLevel>(this->logger()->level()));
51 m_algo->applyConfig(this->config());
52 m_algo->init();
53 }
54
55 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
56 m_algo->process({m_in_sim_hits()}, {m_out_pulses().get()});
57 }
58};
59
60} // namespace eicrecon
Definition JOmniFactory.h:30
PulseGenerationConfig & config()
Retrieve reference to embedded config object.
Definition JOmniFactory.h:576
std::shared_ptr< spdlog::logger > & logger()
Retrieve reference to already-configured logger.
Definition JOmniFactory.h:573
Definition PulseGeneration_factory.h:17
void Configure()
Definition PulseGeneration_factory.h:48
void Process(int32_t, uint64_t)
Definition PulseGeneration_factory.h:55
Definition PulseGeneration.h:62
-client
Definition CalorimeterClusterRecoCoG.cc:37
Definition PulseGenerationConfig.h:10
std::string pulse_shape_function
Definition PulseGenerationConfig.h:12