PersSvc.h
Go to the documentation of this file.
1 #ifndef ROOTHISTCNV_PERSSVC_H
2 #define ROOTHISTCNV_PERSSVC_H 1
3 
4 // Include files
5 #include "GaudiKernel/ConversionSvc.h"
6 
7 // Forward declarations
8 class TFile;
9 
10 
11 namespace RootHistCnv {
12 
19  class PersSvc : public ConversionSvc {
20  public:
22  StatusCode initialize() override;
23 
25  StatusCode finalize() override;
26 
28  StatusCode createRep(DataObject* pObject, IOpaqueAddress*& refpAddress) override;
29 
31  PersSvc( const std::string& name, ISvcLocator* svc );
32 
34  ~PersSvc() override = default;
35 
36  private:
37  std::string m_defFileName;
38  std::unique_ptr<TFile> m_hfile;
39  bool m_prtWar = false;
40  bool m_alphaIds;
42  };
43 
44 } // namespace RootHistCnv
45 
46 #endif // ROOTHISTCNV_PERSSVC_H
bool m_outputEnabled
Flag to enable/disable the output to file.
Definition: PersSvc.h:41
~PersSvc() override=default
Standard destructor.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
StatusCode finalize() override
Finalise the service.
Definition: PersSvc.cpp:62
PersSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
Definition: PersSvc.cpp:127
std::string m_defFileName
Default file name.
Definition: PersSvc.h:37
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert a collection of transient data objects into another representation.
Definition: PersSvc.cpp:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool m_alphaIds
Force alphabetic histograms/ntuple IDs.
Definition: PersSvc.h:40
bool m_prtWar
Already printed a Warning.
Definition: PersSvc.h:39
Persistency service - to store histograms in ROOT format.
Definition: PersSvc.h:19
Opaque address interface definition.
Base class for all conversion services.
Definition: ConversionSvc.h:46
std::unique_ptr< TFile > m_hfile
Pointer to the ROOT file.
Definition: PersSvc.h:38
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
StatusCode initialize() override
Initialise the service.
Definition: PersSvc.cpp:31