ATLAS Offline Software
StreamToServerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace JiveXML {
8 
14  StreamToServerTool::StreamToServerTool( const std::string& type , const std::string& name, const IInterface* p):
16  m_ServerSvc("JiveXML::ONCRPCServerSvc",name){
17 
18  //Provide interface
19  declareInterface<IStreamTool>(this);
20 
22  declareProperty("StreamName", m_StreamName = "default");
24  declareProperty("ServerService", m_ServerSvc );
25  }
26 
31 
32  //Make sure we can get hold of the server and the online event displays service
33  if (m_ServerSvc.retrieve().isFailure()){
34  ATH_MSG_ERROR("Unable to initialize server service with name " << m_ServerSvc.name());
35  return StatusCode::FAILURE;
36  }
37 
38  if( m_onlineEDsvc.retrieve().isFailure()){
39  ATH_MSG_ERROR("Could not locate the online event displays service");
40  return StatusCode::FAILURE;
41  }
42 
43  return StatusCode::SUCCESS;
44  }
45 
50  return StatusCode::SUCCESS;
51  }
52 
60  const unsigned int RunNumber,
61  const std::ostringstream* const EventBuffer ) {
62  m_StreamName = m_onlineEDsvc->getStreamName();
63  ATH_MSG_VERBOSE("Streaming event Number " << EventNumber
64  << " from run Number " << RunNumber
65  << " to stream " << m_StreamName
66  << " on " << m_ServerSvc.name() << " service");
67 
70 
72  return m_ServerSvc->UpdateEventForStream(evtStreamID,EventBuffer->str());
73  }
74 
75 } //namespace
JiveXML::StreamToServerTool::StreamToServerTool
StreamToServerTool(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: StreamToServerTool.cxx:14
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
JiveXML::StreamToServerTool::initialize
virtual StatusCode initialize()
Initialize.
Definition: StreamToServerTool.cxx:30
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
StreamToServerTool.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
sct_calib_tf.EventNumber
int EventNumber
Definition: sct_calib_tf.py:29
JiveXML::StreamToServerTool::finalize
virtual StatusCode finalize()
Finalize.
Definition: StreamToServerTool.cxx:49
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JiveXML::StreamToServerTool::m_ServerSvc
ServiceHandle< IServerSvc > m_ServerSvc
Handle to the server that this tools shall stream events to.
Definition: StreamToServerTool.h:44
JiveXML::EventStreamID
For the client-server communication, each event is uniquely identified by the run number,...
Definition: EventStream.h:19
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:21
EventInfoWrite.RunNumber
RunNumber
Definition: EventInfoWrite.py:50
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JiveXML::StreamToServerTool::m_onlineEDsvc
ServiceHandle< IOnlineEventDisplaysSvc > m_onlineEDsvc
Definition: StreamToServerTool.h:45
JiveXML::StreamToServerTool::StreamEvent
virtual StatusCode StreamEvent(const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream *const EventBuffer)
Stream one event.
Definition: StreamToServerTool.cxx:59
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthAlgTool
Definition: AthAlgTool.h:26
JiveXML::StreamToServerTool::m_StreamName
std::string m_StreamName
Stream name under which these events shall appear.
Definition: StreamToServerTool.h:49