The Gaudi Framework  master (d98a2936)
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 
37 class PartPropSvc : public extends<Service, IPartPropSvc> {
38 public:
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 
49 private:
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 };
PartPropSvc::parseTableType
inputFunPtr parseTableType(const std::string &)
Definition: PartPropSvc.cpp:113
PartPropSvc::initialize
StatusCode initialize() override
Definition: PartPropSvc.cpp:26
PartPropSvc::m_inputs
std::vector< std::pair< std::string, inputFunPtr > > m_inputs
Definition: PartPropSvc.h:53
PartPropSvc::m_upid_name
std::string m_upid_name
Definition: PartPropSvc.h:58
PartPropSvc::m_upid
HepPDT::ProcessUnknownID * m_upid
Definition: PartPropSvc.h:57
PartPropSvc::PDT
HepPDT::ParticleDataTable * PDT() override
Definition: PartPropSvc.cpp:160
StatusCode
Definition: StatusCode.h:64
PartPropSvc
Definition: PartPropSvc.py:1
PartPropSvc::m_pdtFiles
Gaudi::Property< std::string > m_pdtFiles
Definition: PartPropSvc.h:55
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:19
Service.h
PartPropSvc::createTable
StatusCode createTable()
Definition: PartPropSvc.cpp:129
PartPropSvc::finalize
StatusCode finalize() override
Definition: PartPropSvc.cpp:92
PartPropSvc::setUnknownParticleHandler
void setUnknownParticleHandler(HepPDT::ProcessUnknownID *, const std::string &) override
Definition: PartPropSvc.cpp:175
IPartPropSvc.h
PartPropSvc::m_upid_local
bool m_upid_local
Definition: PartPropSvc.h:64
PartPropSvc::inputFunPtr
bool(*)(std::istream &, HepPDT::TableBuilder &) inputFunPtr
Definition: PartPropSvc.h:50
PartPropSvc::m_pdt
std::optional< HepPDT::ParticleDataTable > m_pdt
Definition: PartPropSvc.h:60
Gaudi::Property< std::string >