| The Gaudi Framework v32r1 (f65d50dc)

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
18 class PersSvc : public ConversionSvc {
19 public:
21 StatusCode initialize() override;
22
24 StatusCode finalize() override;
25
27 StatusCode createRep( DataObject* pObject, IOpaqueAddress*& refpAddress ) override;
28
30 PersSvc( const std::string& name, ISvcLocator* svc ) : ConversionSvc( name, svc, ROOT_StorageType ) {}
31
32 private:
33 // undefFileName is defined in PersSvc.cpp
34 Gaudi::Property<std::string> m_defFileName{this, "OutputFile", undefFileName, "default file name"};
35 Gaudi::Property<bool> m_alphaIds{this, "ForceAlphaIds", false, "force alphabetic histograms/ntuple IDs"};
36 Gaudi::Property<bool> m_outputEnabled{this, "OutputEnabled", true, "Flag to enable/disable the output to file."};
37
38 std::unique_ptr<TFile> m_hfile;
39 bool m_prtWar = false;
40 };
41
42 } // namespace RootHistCnv
43
44 #endif // ROOTHISTCNV_PERSSVC_H
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
RootHistCnv::PersSvc::finalize
StatusCode finalize() override
Finalise the service.
Definition: PersSvc.cpp:59
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
ConversionSvc.h
RootHistCnv::PersSvc::m_alphaIds
Gaudi::Property< bool > m_alphaIds
Definition: PersSvc.h:35
RootHistCnv::PersSvc::PersSvc
PersSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
Definition: PersSvc.h:30
RootHistCnv::PersSvc::createRep
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert a collection of transient data objects into another representation.
Definition: PersSvc.cpp:74
std::string
STL class.
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
RootHistCnv::PersSvc::m_outputEnabled
Gaudi::Property< bool > m_outputEnabled
Definition: PersSvc.h:36
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:39
std::unique_ptr< TFile >
RootHistCnv::PersSvc
Persistency service - to store histograms in ROOT format.
Definition: PersSvc.h:18
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:38
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
RootHistCnv::PersSvc::initialize
StatusCode initialize() override
Initialise the service.
Definition: PersSvc.cpp:32
RootHistCnv::PersSvc::m_defFileName
Gaudi::Property< std::string > m_defFileName
Definition: PersSvc.h:34