NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
RootFileDataSink.h
Go to the documentation of this file.
1 /*
2  This software is Copyright by the Board of Trustees of Michigan
3  State University (c) Copyright 2017.
4 
5  You may use this software under the terms of the GNU public license
6  (GPL). The terms of this license are described at:
7 
8  http://www.gnu.org/licenses/gpl.txt
9 
10  Authors:
11  Ron Fox
12  Jeromy Tompkins
13  Aaron Chester
14  FRIB
15  Michigan State University
16  East Lansing, MI 48824-1321
17 */
18 
24 #ifndef ROOTFILEDATASINK_H
25 #define ROOTFILEDATASINK_H
26 
27 #include <stdlib.h>
28 
29 class TTree;
30 class TFile;
31 namespace ddasfmt {
32  class DDASHitUnpacker;
33 }
34 class DDASRootEvent; // Holds the decoded event for output.
35 namespace ufmt {
36  class RingItemFactoryBase;
37  class CRingItem;
38 }
39 
51 {
52 private:
53  ufmt::RingItemFactoryBase* m_pFactory;
54  ddasfmt::DDASHitUnpacker* m_pUnpacker;
55  DDASRootEvent* m_pEvent;
56  TTree* m_pTree;
57  TFile* m_pFile;
58  bool m_warnedPutUsed;
59 
60 public:
70  ufmt::RingItemFactoryBase* pFactory, const char* fileName,
71  const char* treeName="ddas"
72  );
74  virtual ~RootFileDataSink();
75 
76 public:
82  virtual void putItem(const ufmt::CRingItem& item);
88  virtual void put(const void* pData, size_t nBytes);
89 };
90 
91 #endif
Encapsulates a built DDAS event with added capabilities for writing to ROOT files.
Definition: DDASRootEvent.h:59
A ROOT file sink for DDAS data.
Definition: RootFileDataSink.h:51
virtual void put(const void *pData, size_t nBytes)
Called to put arbitrary data to the file.
Definition: RootFileDataSink.cpp:181
virtual ~RootFileDataSink()
Destructor.
Definition: RootFileDataSink.cpp:86
RootFileDataSink(ufmt::RingItemFactoryBase *pFactory, const char *fileName, const char *treeName="ddas")
Constructor.
Definition: RootFileDataSink.cpp:54
virtual void putItem(const ufmt::CRingItem &item)
Put a ring item to file.
Definition: RootFileDataSink.cpp:102
Definition: RootFileDataSink.h:31
Definition: DataSource.h:27