File indexing completed on 2025-01-30 10:30:21
0001
0002
0003
0004 #ifndef PARTICLESVC_H
0005 #define PARTICLESVC_H
0006
0007 #include <map>
0008
0009 #include "GaudiKernel/Service.h"
0010
0011 #include "JugBase/IParticleSvc.h"
0012
0013
0014
0015
0016
0017
0018
0019 class ParticleSvc : public extends<Service, IParticleSvc> {
0020 public:
0021 using Particle = Jug::Base::ParticleData;
0022 using ParticleMap = std::map<int, Particle>;
0023
0024 const ParticleMap m_particleMap;
0025
0026 public:
0027 ParticleSvc(const std::string& name, ISvcLocator* svc);
0028
0029 virtual ~ParticleSvc();
0030
0031 virtual StatusCode initialize() final;
0032 virtual StatusCode finalize() final { return StatusCode::SUCCESS; }
0033
0034 virtual ParticleMap particleMap() const { return m_particleMap; }
0035 virtual Particle particle(int pdg) const {
0036 if (m_particleMap.count(pdg) == 0) {
0037
0038 return m_particleMap.at(0);
0039 }
0040 return m_particleMap.at(pdg);
0041 }
0042 };
0043
0044 #endif