Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:55:37

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 Sylvester Joosten, Whitney Armstrong, Wouter Deconinck
0003 
0004 #include <algorithms/algorithm.h>
0005 #include <algorithms/random.h>
0006 
0007 // Event Model related classes
0008 #include <edm4eic/ReconstructedParticleCollection.h>
0009 #include <edm4hep/MCParticleCollection.h>
0010 
0011 namespace algorithms::truth {
0012 
0013 using MC2SmearedParticleAlgorithm = Algorithm<Input<edm4hep::MCParticleCollection>,
0014                                               Output<edm4eic::ReconstructedParticleCollection>>;
0015 
0016 class MC2SmearedParticle : public MC2SmearedParticleAlgorithm {
0017 public:
0018   MC2SmearedParticle(std::string_view name)
0019       : MC2SmearedParticleAlgorithm{name,
0020                                     {"inputParticles"},
0021                                     {"outputParticles"},
0022                                     "Create mock reconstructed particles out of input MCParticles "
0023                                     "using Gaussian momentum smearing"} {}
0024 
0025   void init() final;
0026   void process(const Input&, const Output&) const final;
0027 
0028 private:
0029   Generator m_rng = RandomSvc::instance().generator();
0030 
0031   // (0.01 --> 1%)
0032   Property<double> m_smearing{this, "smearing", 0.01, "Sigma for Gaussian smearing factor"};
0033 };
0034 
0035 } // namespace algorithms::truth
0036