2 #include "GaudiKernel/SmartIF.h"
3 #include "GaudiKernel/MsgStream.h"
4 #include "GaudiKernel/IRegistry.h"
5 #include "GaudiKernel/AttribStringParser.h"
6 #include "GaudiKernel/SmartDataPtr.h"
7 #include "GaudiKernel/IDataSourceMgr.h"
8 #include "GaudiKernel/IDataManagerSvc.h"
9 #include "GaudiKernel/GenericAddress.h"
21 declareProperty(
"AddressLeaf", m_addrLeaf =
"/Event" );
22 declareProperty(
"AddressColumn", m_addrColName =
"Address");
23 declareProperty(
"TagCollectionSvc", m_collSvcName =
"NTupleSvc");
24 declareProperty(
"ObjectsFirst", m_objectsFirst =
true);
25 declareProperty(
"Collection", m_tagName );
41 log <<
MSG::ERROR <<
"Failed to add the address column:"
48 log <<
MSG::ERROR <<
"Failed to connect to the tag collection "
55 using Parser = Gaudi::Utils::AttribStringParser;
56 std::string log_node, log_file, logical_name;
61 switch( ::
toupper(attrib.tag[0]) ) {
69 tmp += attrib.tag +
"='" + attrib.value +
"' ";
76 log_file = log_node +
" " +
m_output +
" SHARED='YES'";
87 logical_name += log_node;
90 if ( src_mgr->
isConnected(logical_name) )
return sc;
91 sc = src_mgr->
connect(log_file);
117 <<
"[Tuple write error]" <<
endmsg;
128 <<
"[Object write error]" <<
endmsg;
152 std::string*
par = (std::string*)
m_addr->par();
153 unsigned long* ipar = (
unsigned long*)
m_addr->ipar();
156 par[0] = pA->
par()[0];
157 par[1] = pA->
par()[1];
158 ipar[0] = pA->
ipar()[0];
159 ipar[1] = pA->
ipar()[1];
168 par[0] = redir->
par()[0];
170 ipar[1] = redir->
ipar()[1];
std::string m_addrColName
Property: Name of the address column of the tag collection.
virtual const std::string * par() const =0
Retrieve String parameters.
Definition of the MsgStream class used to transmit messages.
std::string m_tagName
Property: Name of the tag collection in the transient store.
static DataObject * find(SmartDataObjectPtr *ptr)
Static Object find method.
Small smart pointer class with automatic reference counting for IInterface.
virtual StatusCode connectAddress()
Connect address column, if not already connected.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode finalize() override
Terminate OutputStream.
StatusCode initialize() override
Initialize TagCollectionStream.
std::unique_ptr< GenericAddress > m_addr
Address buffer.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Specialized output stream class for event tag collections, where the basic Event entry point should b...
bool isSuccess() const
Test for a status code of SUCCESS.
StatusCode writeData()
Write data objects.
INTupleItem * m_addrColumn
NTuple column to hold the opaque address of the address leaf.
Generic Transient Address.
Data provider interface definition.
virtual long svcType() const =0
Retrieve service type.
StatusCode writeTuple()
Write tuple data.
IRegistry * registry() const
Get pointer to Registry.
bool m_objectsFirst
Property: Flag to indicate that the objects should be written first.
A small to stream Data I/O.
const std::string & name() const override
The identifying name of the algorithm object.
virtual StatusCode connect(const std::string &logon, std::string &identifier)=0
Connect data source.
std::string m_addrLeaf
Property: Name of the address leaf in the transient event store.
virtual StatusCode writeObjects()
Select the different objects and write them to file.
StatusCode writeRecord()
Write full event record.
StatusCode initialize() override
Initialize OutputStream.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual const CLID & clID() const =0
Retrieve class information from link.
#define DECLARE_COMPONENT(type)
StatusCode finalize() override
Terminate TagCollectionStream.
This class is used for returning status codes from appropriate routines.
virtual StatusCode writeRecord(NTuple::Tuple *tuple)=0
Write single record to N tuple.
virtual const std::string & rootName() const =0
Get Name of root Event.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::string m_collSvcName
Property: Name of the collection service.
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
virtual unsigned long release()=0
Release Interface instance.
A small class used to access easily (and efficiently) data items residing in data stores...
INTupleSvc * m_collectionSvc
Keep reference to the tuple service.
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Opaque address interface definition.
std::string m_output
Name of the output file specification.
NTuple::Item< IOpaqueAddress * > m_item
Address item buffer.
virtual bool isConnected(const std::string &identifier) const =0
Check if a datasource is connected.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
void toupper(std::string &s)
bool m_isTopLeaf
Short cut flag to indicate if the address leaf is the top leaf (performace cache) ...
std::string m_topLeafName
Name of the top leaf (performance cache)
StatusCode writeObjects() override
OutputStream override: Select the different objects and write them to file.
virtual const void * buffer() const =0
Access data buffer (CONST)