Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-10 08:03:00

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2025 Simon Gardner
0003 //
0004 // Adds noise to a time series pulse
0005 //
0006 
0007 #pragma once
0008 
0009 #include <DDDigi/noise/FalphaNoise.h>
0010 #include <algorithms/algorithm.h>
0011 #include <edm4hep/TimeSeriesCollection.h>
0012 #include <random>
0013 #include <string>
0014 #include <string_view>
0015 
0016 #include "algorithms/digi/PulseNoiseConfig.h"
0017 #include "algorithms/interfaces/WithPodConfig.h"
0018 
0019 namespace eicrecon {
0020 
0021 using PulseNoiseAlgorithm =
0022     algorithms::Algorithm<algorithms::Input<edm4hep::TimeSeriesCollection>,
0023                           algorithms::Output<edm4hep::TimeSeriesCollection>>;
0024 
0025 class PulseNoise : public PulseNoiseAlgorithm,
0026                                public WithPodConfig<PulseNoiseConfig> {
0027 
0028 public:
0029   PulseNoise(std::string_view name)
0030       : PulseNoiseAlgorithm{name, {"RawHits"}, {"OutputPulses"}, {}} {}
0031   virtual void init() final;
0032   void process(const Input&, const Output&);
0033 
0034 private:
0035 
0036   std::default_random_engine generator; // TODO: need something more appropriate here
0037   dd4hep::detail::FalphaNoise m_noise;
0038 
0039 };
0040 
0041 } // namespace eicrecon