DDASToys for NSCLDAQ  6.2-000
Public Member Functions | List of all members
RootFileDataSink Class Reference

This class knows how to write ROOT files from the ring items created by the fitting program. More...

#include <RootFileDataSink.h>

Inheritance diagram for RootFileDataSink:
Inheritance graph
[legend]
Collaboration diagram for RootFileDataSink:
Collaboration graph
[legend]

Public Member Functions

 RootFileDataSink (const char *filename, const char *treename="DDASFit")
 Constructor. More...
 
virtual ~RootFileDataSink ()
 Destructor. More...
 
virtual void putItem (const CRingItem &item)
 Put a ring item to file. More...
 
virtual void put (const void *pData, size_t nBytes)
 Called to put arbitrary data to the file. More...
 

Detailed Description

This class knows how to write ROOT files from the ring items created by the fitting program.

Note
Put is not intended to be used by this file. If it's used, a warning will be output to stderr. pData will then be treated as a raw ring item, turned into a CRingItem and putItem will be called from then on.

Constructor & Destructor Documentation

◆ RootFileDataSink()

RootFileDataSink::RootFileDataSink ( const char *  filename,
const char *  treename = "DDASFit" 
)

Constructor.

Parameters
filenameROOT file to open.
treenameName of the tree to create in the root file. The tree name defaults to "DDASFit" if not provided.
Exceptions
...All exceptions back to the caller.

We're going to make this sink so it can be used in other programs. That implies presrving ROOT's concept of a current working directory across our operation.

◆ ~RootFileDataSink()

RootFileDataSink::~RootFileDataSink ( )
virtual

Destructor.

Flush the stuff to file and delete all the dynamic components.

Member Function Documentation

◆ put()

void RootFileDataSink::put ( const void *  pData,
size_t  nBytes 
)
virtual

Called to put arbitrary data to the file.

Parameters
pDataPointer to the data.
nBytesNumber of bytes of data to put; actually ignored.

We really don't know how to do this so:

  • First time we're called we'll emit a warning that users shouldn't really do this.
  • We'll treat the data pointer as a pointer to a raw ring item, turn it into a CRingItem and call putItem.

◆ putItem()

void RootFileDataSink::putItem ( const CRingItem &  item)
virtual

Put a ring item to file.

Parameters
itemReference to a ring item object.

The ring item is assumed to consist of a set of fragments. Each fragment contains a hit. The hits are decoded and added to the tree event. Once that's done we can fill the tree and delete any dynamic storage we got.


The documentation for this class was generated from the following files: