-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ScatteredElectronsEMinusPz: refactor to use algorithms interface and …
…ParticleSvc (#1615) ### Briefly, what does this PR introduce? Refactor to use algorithms interface and ParticleSvc. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No
- Loading branch information
Showing
3 changed files
with
62 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,45 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright (C) 2024 Daniel Brandenburg | ||
// Copyright (C) 2024 Daniel Brandenburg, Dmitry Kalinkin | ||
|
||
#pragma once | ||
|
||
#include <algorithms/algorithm.h> | ||
#include <edm4eic/ReconstructedParticleCollection.h> | ||
#include <spdlog/logger.h> | ||
#include <memory> | ||
#include <string> | ||
#include <string_view> | ||
|
||
#include "algorithms/reco/ScatteredElectronsEMinusPzConfig.h" | ||
#include "algorithms/interfaces/ParticleSvc.h" | ||
#include "algorithms/interfaces/WithPodConfig.h" | ||
#include "algorithms/reco/ScatteredElectronsEMinusPzConfig.h" | ||
|
||
|
||
namespace eicrecon { | ||
|
||
class ScatteredElectronsEMinusPz : public WithPodConfig<ScatteredElectronsEMinusPzConfig>{ | ||
using ScatteredElectronsEMinusPzAlgorithm = algorithms::Algorithm< | ||
algorithms::Input< | ||
edm4eic::ReconstructedParticleCollection, | ||
edm4eic::ReconstructedParticleCollection | ||
>, | ||
algorithms::Output< | ||
edm4eic::ReconstructedParticleCollection | ||
> | ||
>; | ||
|
||
class ScatteredElectronsEMinusPz : public ScatteredElectronsEMinusPzAlgorithm, WithPodConfig<ScatteredElectronsEMinusPzConfig>{ | ||
|
||
public: | ||
|
||
public: | ||
ScatteredElectronsEMinusPz(std::string_view name) | ||
: ScatteredElectronsEMinusPzAlgorithm{name, | ||
{"inputParticles", "inputElectronCandidates"}, | ||
{"outputElectrons"}, | ||
"Outputs DIS electrons ordered in decreasing E-pz"} {} | ||
void init() final; | ||
void process(const Input&, const Output&) const final; | ||
|
||
void init(std::shared_ptr<spdlog::logger>& logger); | ||
std::unique_ptr<edm4eic::ReconstructedParticleCollection> execute( | ||
const edm4eic::ReconstructedParticleCollection *rcparts, | ||
const edm4eic::ReconstructedParticleCollection *rcele | ||
); | ||
private: | ||
const algorithms::ParticleSvc& m_particleSvc = algorithms::ParticleSvc::instance(); | ||
|
||
private: | ||
std::shared_ptr<spdlog::logger> m_log; | ||
double m_electron{0.000510998928}, m_pion{0.13957}; | ||
}; | ||
|
||
}; | ||
} // namespace eicrecon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters