ATLAS Offline Software
Loading...
Searching...
No Matches
StreamToFileTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JIVEXML__STREAMTOFILETOOL_H
6#define JIVEXML__STREAMTOFILETOOL_H
7
8//IAlgTool interface
11#include "GaudiKernel/ServiceHandle.h"
13
14namespace JiveXML {
15
22 class StreamToFileTool : virtual public IStreamTool, public AthAlgTool {
23
24 public:
25
27 StreamToFileTool( const std::string&, const std::string&, const IInterface*);
28
30 virtual StatusCode initialize();
31
33 virtual StatusCode finalize();
34
36 virtual StatusCode StreamEvent( const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream* EventBuffer ) ;
37
38 private:
39
40 ServiceHandle<IOnlineEventDisplaysSvc> m_onlineEDsvc{this, "OnlineEventDisplaysSvc", "Online Event Displays Service"};
41
42 Gaudi::Property<bool> m_isOnline {this, "IsOnline", false, "If running at point 1"};
43
45 std::string m_FileNamePrefix;
46
48 std::string m_FileNameSuffix;
49
51 std::string MakeFileName( const unsigned long EventNumber, const unsigned int RunNumber ) const;
52
54 StatusCode NewFile( const unsigned long EventNumber, const unsigned int RunNumber, std::ofstream *& outFile ) const ;
55
57 StatusCode CloseFile( std::ofstream *& outFile ) const ;
58
59 };
60
61} //Namespace
62
63#endif
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Abstract interface to JiveXML event streaming classes.
Definition IStreamTool.h:24
std::string MakeFileName(const unsigned long EventNumber, const unsigned int RunNumber) const
Generate a file name.
virtual StatusCode finalize()
Finalize.
StreamToFileTool(const std::string &, const std::string &, const IInterface *)
Constructor.
virtual StatusCode StreamEvent(const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream *EventBuffer)
Stream one event.
StatusCode CloseFile(std::ofstream *&outFile) const
Closes output stream.
Gaudi::Property< bool > m_isOnline
ServiceHandle< IOnlineEventDisplaysSvc > m_onlineEDsvc
StatusCode NewFile(const unsigned long EventNumber, const unsigned int RunNumber, std::ofstream *&outFile) const
Creates a new output stream to write XML to.
virtual StatusCode initialize()
Initialize.
std::string m_FileNamePrefix
Prefix put in front of JiveXML file name.
std::string m_FileNameSuffix
Suffix put at the end of the file name (including type)
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.