EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
ChargedMCParticleSelector.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2024 - 2025 Dmitry Kalinkin, Derek Anderson, Wouter Deconinck
3
4#pragma once
5
6#include <memory>
7#include <utility>
8
9#include <algorithms/algorithm.h>
10#include <edm4hep/MCParticleCollection.h>
11#include <spdlog/logger.h>
12
14
15namespace eicrecon {
16
18 algorithms::Algorithm<algorithms::Input<edm4hep::MCParticleCollection>,
19 algorithms::Output<edm4hep::MCParticleCollection>>;
20
22 public WithPodConfig<NoConfig> {
23
24public:
25 ChargedMCParticleSelector(std::string_view name)
27 name, {"inputParticles"}, {"outputParticles"}, "select charged particles"} {}
28
29 // algorithm initialization
30 void init() final {}
31
32 // primary algorithm call
33 void process(const Input& input, const Output& output) const final {
34 const auto [mc_particles_in] = input;
35 auto [mc_particles_out] = output;
36
37 mc_particles_out->setSubsetCollection();
38
39 for (const auto& particle : *mc_particles_in) {
40 if (particle.getCharge() != 0.) {
41 mc_particles_out->push_back(particle);
42 }
43 }
44 }
45};
46
47} // namespace eicrecon
Definition ChargedMCParticleSelector.h:22
void process(const Input &input, const Output &output) const final
Definition ChargedMCParticleSelector.h:33
ChargedMCParticleSelector(std::string_view name)
Definition ChargedMCParticleSelector.h:25
void init() final
Definition ChargedMCParticleSelector.h:30
Definition WithPodConfig.h:22
-client
Definition CalorimeterClusterRecoCoG.cc:37
algorithms::Algorithm< algorithms::Input< edm4hep::MCParticleCollection >, algorithms::Output< edm4hep::MCParticleCollection > > ChargedMCParticleSelectorAlgorithm
Definition ChargedMCParticleSelector.h:19