The Gaudi Framework  master (37c0b60a)
PartPropSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 #ifndef __PARTPROPSVC_H__
12 #define __PARTPROPSVC_H__
13 
15 #include <GaudiKernel/Service.h>
16 #include <HepPDT/ParticleDataTable.hh>
17 #include <HepPDT/TableBuilder.hh>
18 
19 #include <iostream>
20 #include <optional>
21 #include <string>
22 #include <utility>
23 #include <vector>
24 
25 //------------------------------------------------------------------
26 //
27 // ClassName: PartPropSvc
28 //
29 // Description: This service provides access to particle properties.
30 // Uses HepPDT as the underlying layer
31 //
32 // Author: Charles Leggett
33 //
34 // Date: 3-8-2001
35 //
36 //------------------------------------------------------------------
37 
38 class PartPropSvc : public extends<Service, IPartPropSvc> {
39 public:
40  using extends::extends;
41 
42  StatusCode initialize() override;
43  StatusCode finalize() override;
44 
45  // The table
46  HepPDT::ParticleDataTable* PDT() override;
47 
48  void setUnknownParticleHandler( HepPDT::ProcessUnknownID*, const std::string& ) override;
49 
50 private:
51  using inputFunPtr = bool ( * )( std::istream&, HepPDT::TableBuilder& );
52 
55 
56  Gaudi::Property<std::string> m_pdtFiles{ this, "InputFile", "PDGTABLE.MeV" };
57 
58  HepPDT::ProcessUnknownID* m_upid = nullptr;
60 
61  std::optional<HepPDT::ParticleDataTable> m_pdt;
62 
64 
65  bool m_upid_local = false;
66 };
67 
68 #endif
std::string
STL class.
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:54
PartPropSvc::m_upid_name
std::string m_upid_name
Definition: PartPropSvc.h:59
std::vector
STL class.
PartPropSvc::m_upid
HepPDT::ProcessUnknownID * m_upid
Definition: PartPropSvc.h:58
PartPropSvc::PDT
HepPDT::ParticleDataTable * PDT() override
Definition: PartPropSvc.cpp:160
StatusCode
Definition: StatusCode.h:65
PartPropSvc
Definition: PartPropSvc.py:1
PartPropSvc::m_pdtFiles
Gaudi::Property< std::string > m_pdtFiles
Definition: PartPropSvc.h:56
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
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:65
PartPropSvc::inputFunPtr
bool(*)(std::istream &, HepPDT::TableBuilder &) inputFunPtr
Definition: PartPropSvc.h:51
PartPropSvc::m_pdt
std::optional< HepPDT::ParticleDataTable > m_pdt
Definition: PartPropSvc.h:61
std::istream
STL class.
Gaudi::Property< std::string >