Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-03 09:10:21

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2025 Simon Gardner
0003 //
0004 // Convert energy deposition into ADC pulses
0005 // ADC pulses are assumed to follow the shape of landau function
0006 
0007 #pragma once
0008 
0009 #include <algorithms/algorithm.h>
0010 #include <edm4eic/SimPulseCollection.h>
0011 #include <cstdint>
0012 #include <string>
0013 #include <string_view>
0014 #include <vector>
0015 
0016 #include "algorithms/digi/PulseCombinerConfig.h"
0017 #include "algorithms/interfaces/WithPodConfig.h"
0018 
0019 namespace eicrecon {
0020 
0021 using PulseType = edm4eic::SimPulse;
0022 
0023 using PulseCombinerAlgorithm =
0024     algorithms::Algorithm<algorithms::Input<PulseType::collection_type>,
0025                           algorithms::Output<PulseType::collection_type>>;
0026 
0027 class PulseCombiner : public PulseCombinerAlgorithm, public WithPodConfig<PulseCombinerConfig> {
0028 
0029 public:
0030   PulseCombiner(std::string_view name)
0031       : PulseCombinerAlgorithm{name, {"InputPulses"}, {"OutputPulses"}, {}} {}
0032   virtual void init() final;
0033   void process(const Input&, const Output&) const final;
0034 
0035 private:
0036   std::vector<std::vector<PulseType>> clusterPulses(const std::vector<PulseType> pulses) const;
0037   static std::vector<float> sumPulses(const std::vector<PulseType> pulses);
0038   uint64_t m_detector_bitmask = 0xFFFFFFFFFFFFFFFF;
0039 };
0040 
0041 } // namespace eicrecon