The Gaudi Framework  master (1304469f)
Loading...
Searching...
No Matches
PartPropSvc.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
12
14#include <GaudiKernel/Service.h>
15#include <HepPDT/ParticleDataTable.hh>
16#include <HepPDT/TableBuilder.hh>
17
18#include <iostream>
19#include <optional>
20#include <string>
21#include <utility>
22#include <vector>
23
24//------------------------------------------------------------------
25//
26// ClassName: PartPropSvc
27//
28// Description: This service provides access to particle properties.
29// Uses HepPDT as the underlying layer
30//
31// Author: Charles Leggett
32//
33// Date: 3-8-2001
34//
35//------------------------------------------------------------------
36
37class PartPropSvc : public extends<Service, IPartPropSvc> {
38public:
39 using extends::extends;
40
41 StatusCode initialize() override;
42 StatusCode finalize() override;
43
44 // The table
45 HepPDT::ParticleDataTable* PDT() override;
46
47 void setUnknownParticleHandler( HepPDT::ProcessUnknownID*, const std::string& ) override;
48
49private:
50 using inputFunPtr = bool ( * )( std::istream&, HepPDT::TableBuilder& );
51
53 std::vector<std::pair<std::string, inputFunPtr>> m_inputs;
54
55 Gaudi::Property<std::string> m_pdtFiles{ this, "InputFile", "PDGTABLE.MeV" };
56
57 HepPDT::ProcessUnknownID* m_upid = nullptr;
58 std::string m_upid_name;
59
60 std::optional<HepPDT::ParticleDataTable> m_pdt;
61
62 inputFunPtr parseTableType( const std::string& );
63
64 bool m_upid_local = false;
65};
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
Gaudi::Property< std::string > m_pdtFiles
Definition PartPropSvc.h:55
std::string m_upid_name
Definition PartPropSvc.h:58
inputFunPtr parseTableType(const std::string &)
StatusCode finalize() override
HepPDT::ProcessUnknownID * m_upid
Definition PartPropSvc.h:57
std::vector< std::pair< std::string, inputFunPtr > > m_inputs
Definition PartPropSvc.h:53
bool(*)(std::istream &, HepPDT::TableBuilder &) inputFunPtr
Definition PartPropSvc.h:50
bool m_upid_local
Definition PartPropSvc.h:64
StatusCode initialize() override
std::optional< HepPDT::ParticleDataTable > m_pdt
Definition PartPropSvc.h:60
HepPDT::ParticleDataTable * PDT() override
StatusCode createTable()
void setUnknownParticleHandler(HepPDT::ProcessUnknownID *, const std::string &) override
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Base class used to extend a class implementing other interfaces.
Definition extends.h:19