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"
20 m_isTopLeaf(
false), m_collectionSvc(0)
22 declareProperty(
"AddressLeaf", m_addrLeaf =
"/Event" );
23 declareProperty(
"AddressColumn", m_addrColName =
"Address");
24 declareProperty(
"TagCollectionSvc", m_collSvcName =
"NTupleSvc");
25 declareProperty(
"ObjectsFirst", m_objectsFirst =
true);
26 declareProperty(
"Collection", m_tagName );
47 log <<
MSG::ERROR <<
"Failed to add the address column:"
54 log <<
MSG::ERROR <<
"Failed to connect to the tag collection "
61 using Parser = Gaudi::Utils::AttribStringParser;
62 std::string log_node, log_file, logical_name;
67 switch( ::
toupper(attrib.tag[0]) ) {
75 tmp += attrib.tag +
"='" + attrib.value +
"' ";
82 log_file = log_node +
" " +
m_output +
" SHARED='YES'";
93 logical_name += log_node;
99 sc = src_mgr->
connect(log_file);
107 log <<
MSG::ERROR <<
"Failed to initialize TagCollection Stream." <<
endmsg;
127 <<
"[Tuple write error]" <<
endmsg;
138 <<
"[Object write error]" <<
endmsg;
163 unsigned long* ipar = (
unsigned long*)
m_addr->
ipar();
166 par[0] = pA->
par()[0];
167 par[1] = pA->
par()[1];
168 ipar[0] = pA->
ipar()[0];
169 ipar[1] = pA->
ipar()[1];
180 par[0] = redir->
par()[0];
182 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...
virtual std::string rootName() const =0
Get Name of root Event.
void setSvcType(long typ)
Access : set the storage type of the class id.
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.
virtual StatusCode writeObjects()
OutputStream override: Select the different objects and write them to file.
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.
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.
virtual const std::string * par() const
Retrieve string parameters.
void setClID(const CLID &clid)
Access : Set class ID of the link.
virtual const unsigned long * ipar() const
Retrieve integer parameters.
virtual const CLID & clID() const =0
Retrieve class information from link.
#define DECLARE_COMPONENT(type)
virtual StatusCode finalize()
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 StatusCode finalize()
Terminate OutputStream.
virtual const std::string & name() const
The identifying name of the algorithm object.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::string m_collSvcName
Property: Name of the collection service.
virtual StatusCode initialize()
Initialize TagCollectionStream.
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
virtual unsigned long release()=0
Release Interface instance.
virtual ~TagCollectionStream()
Standard Destructor.
bool isValid() const
Allow for check if smart pointer is valid.
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 StatusCode initialize()
Initialize OutputStream.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
void toupper(std::string &s)
GenericAddress * m_addr
Address buffer.
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)
virtual const void * buffer() const =0
Access data buffer (CONST)