ATLAS Offline Software
Loading...
Searching...
No Matches
GenData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef GENERATORMODULES_GENDATA_H
6#define GENERATORMODULES_GENDATA_H
7
8#include "GaudiKernel/ServiceHandle.h"
9#include "GaudiKernel/IPartPropSvc.h"
11
12#include <atomic>
13#include <optional>
14#include <string>
15
17
18class GenData {
19public:
20
21 GenData();
22
23 GenData(const std::string& sname, const std::string& name);
24
25 virtual ~GenData() = default;
26
28 std::optional<double> particleMass(int pdgId) const;
29
31 std::optional<double> particleLifetime(int pdgId) const;
32
34 std::optional<std::string> particleName(int pdgId) const;
35
36private:
37
38 struct ParticleInfo {
39 std::optional<double> mass;
40 std::optional<double> lifetime;
41 std::optional<std::string> name;
42 };
43 ParticleInfo particleInfo(int absPid) const;
44
46 std::string m_service_name{"PartPropSvc"};
47 std::string m_name{"GenData"};
49 mutable std::atomic<bool> m_initialized{false};
50
51};
52
53#endif
Define macros for attributes used to control the static checker.
std::string m_name
Definition GenData.h:47
ParticleInfo particleInfo(int absPid) const
Definition GenData.cxx:19
std::optional< std::string > particleName(int pdgId) const
Get the name of a particle by PDG ID.
Definition GenData.cxx:46
GenData()
Definition GenData.cxx:15
std::optional< double > particleMass(int pdgId) const
Get the mass of a particle by PDG ID.
Definition GenData.cxx:38
ServiceHandle< IPartPropSvc > m_ppSvc
Definition GenData.h:48
std::optional< double > particleLifetime(int pdgId) const
Get the lifetime of a particle by PDG ID.
Definition GenData.cxx:42
std::string m_service_name
Handle on the particle property service.
Definition GenData.h:46
std::atomic< bool > m_initialized
Definition GenData.h:49
virtual ~GenData()=default
std::optional< double > lifetime
Definition GenData.h:40
std::optional< double > mass
Definition GenData.h:39
std::optional< std::string > name
Definition GenData.h:41