Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-15 09:30:21

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 Wouter Deconinck
0003 
0004 #pragma once
0005 
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/InclusiveKinematicsCollection.h>
0008 #include <edm4hep/MCParticleCollection.h>
0009 #include <string>
0010 #include <string_view>
0011 
0012 #include "algorithms/interfaces/WithPodConfig.h"
0013 #include "services/particle/ParticleSvc.h"
0014 
0015 namespace eicrecon {
0016 
0017 using InclusiveKinematicsTruthBornAlgorithm =
0018     algorithms::Algorithm<algorithms::Input<edm4hep::MCParticleCollection>,
0019                           algorithms::Output<edm4eic::InclusiveKinematicsCollection>>;
0020 
0021 /// Born-level inclusive kinematics at the hadronic vertex, q = k - k_ISR - k' - k_FSR.
0022 ///
0023 /// The four-momentum transfer q is taken from the record topology:
0024 ///  - between the hard-scattering leptons on the lepton line, q = p(21) - p(23), or the lepton
0025 ///    following the status 21 lepton when there is no status 23 lepton (Pythia8);
0026 ///  - otherwise from momentum conservation along the lepton line, q = k - k' - sum of all real
0027 ///    photons radiated from the lepton line (DJANGOH, BeAGLE, Sartre, ...).
0028 /// When the record stores the exchanged spacelike boson, its momentum is compared with q, and a
0029 /// warning is issued if they differ (e.g. photons not attached to the lepton line). The boson is
0030 /// not used for q itself: EDM4hep stores it as momentum and mass only, and generators write that
0031 /// mass with limited precision.
0032 class InclusiveKinematicsTruthBorn : public InclusiveKinematicsTruthBornAlgorithm,
0033                                      public WithPodConfig<NoConfig> {
0034 
0035 public:
0036   InclusiveKinematicsTruthBorn(std::string_view name)
0037       : InclusiveKinematicsTruthBornAlgorithm{
0038             name,
0039             {"MCParticles"},
0040             {"inclusiveKinematics"},
0041             "Determine Born-level inclusive kinematics from truth information."} {}
0042 
0043   void init() final;
0044   void process(const Input&, const Output&) const final;
0045 
0046 private:
0047   const algorithms::ParticleSvc& m_particleSvc = algorithms::ParticleSvc::instance();
0048 };
0049 
0050 } // namespace eicrecon