Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:14

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "ActsFatras/EventData/Particle.hpp"
0010 
0011 #include "Acts/Definitions/ParticleData.hpp"
0012 #include "Acts/Utilities/MultiIndex.hpp"
0013 
0014 #include <ostream>
0015 
0016 ActsFatras::Particle::Particle(Barcode particleId, Acts::PdgParticle pdg)
0017     : Particle(particleId, pdg, findCharge(pdg).value_or(0),
0018                findMass(pdg).value_or(0)) {}
0019 
0020 std::ostream& ActsFatras::operator<<(std::ostream& os,
0021                                      const ActsFatras::Particle& particle) {
0022   // compact format w/ only identity information but no kinematics
0023   os << "id=" << particle.particleId().value() << "(" << particle.particleId()
0024      << ")";
0025   os << "|pdg=" << particle.pdg();
0026   os << "|q=" << particle.charge();
0027   os << "|m=" << particle.mass();
0028   os << "|p=" << particle.absoluteMomentum();
0029   return os;
0030 }