| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 namespace RootHistCnv
11 {
12
19 class PersSvc : public ConversionSvc
20 {
21 public:
23 StatusCode initialize() override;
24
26 StatusCode finalize() override;
27
29 StatusCode createRep( DataObject* pObject, IOpaqueAddress*& refpAddress ) override;
30
32 PersSvc( const std::string& name, ISvcLocator* svc ) : ConversionSvc( name, svc, ROOT_StorageType ) {}
33
35 ~PersSvc() override = default;
36
37 private:
38 // undefFileName is defined in PersSvc.cpp
39 Gaudi::Property<std::string> m_defFileName{this, "OutputFile", undefFileName, "default file name"};
40 Gaudi::Property<bool> m_alphaIds{this, "ForceAlphaIds", false, "force alphabetic histograms/ntuple IDs"};
41 Gaudi::Property<bool> m_outputEnabled{this, "OutputEnabled", true, "Flag to enable/disable the output to file."};
42
43 std::unique_ptr<TFile> m_hfile;
44 bool m_prtWar = false;
45 };
46
47 } // namespace RootHistCnv
48
49 #endif // ROOTHISTCNV_PERSSVC_H
RootHistCnv::PersSvc::~PersSvc
~PersSvc() override=default
Standard destructor.
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
RootHistCnv::PersSvc::finalize
StatusCode finalize() override
Finalise the service.
Definition: PersSvc.cpp:61
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
ConversionSvc.h
RootHistCnv::PersSvc::m_alphaIds
Gaudi::Property< bool > m_alphaIds
Definition: PersSvc.h:40
RootHistCnv::PersSvc::PersSvc
PersSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
Definition: PersSvc.h:32
RootHistCnv::PersSvc::createRep
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert a collection of transient data objects into another representation.
Definition: PersSvc.cpp:75
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
RootHistCnv::PersSvc::m_outputEnabled
Gaudi::Property< bool > m_outputEnabled
Definition: PersSvc.h:41
RootHistCnv
Definition: DirectoryCnv.h:17
ROOT_StorageType
const long ROOT_StorageType
Definition: ClassID.h:52
RootHistCnv::PersSvc::m_prtWar
bool m_prtWar
Already printed a Warning.
Definition: PersSvc.h:44
std::unique_ptr< TFile >
RootHistCnv::PersSvc
Persistency service - to store histograms in ROOT format.
Definition: PersSvc.h:19
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
ConversionSvc
Base class for all conversion services.
Definition: ConversionSvc.h:45
RootHistCnv::PersSvc::m_hfile
std::unique_ptr< TFile > m_hfile
Pointer to the ROOT file.
Definition: PersSvc.h:43
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
RootHistCnv::PersSvc::initialize
StatusCode initialize() override
Initialise the service.
Definition: PersSvc.cpp:33
RootHistCnv::PersSvc::m_defFileName
Gaudi::Property< std::string > m_defFileName
Definition: PersSvc.h:39