PartPropSvc.h
Go to the documentation of this file.
1 #ifndef __PARTPROPSVC_H__
2 #define __PARTPROPSVC_H__
3 
4 #include "GaudiKernel/Service.h"
5 #include "GaudiKernel/IPartPropSvc.h"
6 #include "HepPDT/ParticleDataTable.hh"
7 #include "HepPDT/TableBuilder.hh"
8 
9 #include <vector>
10 #include <string>
11 #include <utility>
12 #include <iostream>
13 #include <memory>
14 
15 //------------------------------------------------------------------
16 //
17 // ClassName: PartPropSvc
18 //
19 // Description: This service provides access to particle properties.
20 // Uses HepPDT as the underlying layer
21 //
22 // Author: Charles Leggett
23 //
24 // Date: 3-8-2001
25 //
26 //------------------------------------------------------------------
27 
28 class PartPropSvc: public extends1<Service, IPartPropSvc> {
29 public:
30 
31  PartPropSvc( const std::string& name, ISvcLocator* svc );
32 
33  StatusCode initialize() override;
34  StatusCode finalize() override;
35 
36  // The table
37  HepPDT::ParticleDataTable *PDT() override;
38 
39  void setUnknownParticleHandler( HepPDT::ProcessUnknownID*,
40  const std::string&) override;
41 
42  // Destructor.
43  ~PartPropSvc() override = default;
44 
45 private:
46 
47  using inputFunPtr = bool(*)(std::istream&,HepPDT::TableBuilder&);
48 
50  std::vector<std::pair<std::string,inputFunPtr>> m_inputs;
51 
53  HepPDT::ProcessUnknownID* m_upid = nullptr;
54  std::string m_upid_name;
55 
56  std::unique_ptr<HepPDT::ParticleDataTable> m_pdt;
57 
58  inputFunPtr parseTableType(const std::string&);
59 
60  mutable MsgStream m_log;
61 
62  bool m_upid_local = false;
63 
64 };
65 
66 #endif
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode initialize() override
Definition: PartPropSvc.cpp:35
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
inputFunPtr parseTableType(const std::string &)
std::unique_ptr< HepPDT::ParticleDataTable > m_pdt
Definition: PartPropSvc.h:56
MsgStream m_log
Definition: PartPropSvc.h:60
PartPropSvc(const std::string &name, ISvcLocator *svc)
Definition: PartPropSvc.cpp:25
StatusCode finalize() override
HepPDT::ProcessUnknownID * m_upid
Definition: PartPropSvc.h:53
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool(*)(std::istream &, HepPDT::TableBuilder &) inputFunPtr
Definition: PartPropSvc.h:47
bool m_upid_local
Definition: PartPropSvc.h:62
~PartPropSvc() override=default
HepPDT::ParticleDataTable * PDT() override
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode createTable()
std::vector< std::pair< std::string, inputFunPtr > > m_inputs
Definition: PartPropSvc.h:50
void setUnknownParticleHandler(HepPDT::ProcessUnknownID *, const std::string &) override
StringProperty m_pdtFiles
Definition: PartPropSvc.h:52
std::string m_upid_name
Definition: PartPropSvc.h:54