DDASToys for NSCLDAQ  6.2-000
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 <CDataSink.h>
28 
29 #include <vector>
30 
31 class TTree;
32 class TFile;
33 
34 class CRingItem;
35 
36 namespace ddastoys {
37  class DDASFitHitUnpacker;
38  class DDASRootFitEvent; // Holds the decoded event for output.
39  class RootHitExtension;
40 }
41 
52 class RootFileDataSink : public CDataSink
53 {
54 public:
62  RootFileDataSink(const char* filename, const char* treename="DDASFit");
64  virtual ~RootFileDataSink();
65 
66 public:
71  virtual void putItem(const CRingItem& item);
77  virtual void put(const void* pData, size_t nBytes);
78 
79 private:
80  ddastoys::DDASFitHitUnpacker* m_pUnpacker;
81  ddastoys::DDASRootFitEvent* m_pTreeEvent;
82  TTree* m_pTree;
83  TFile* m_pFile;
84  bool m_warnedPutUsed;
85 };
86 
87 #endif
This class knows how to write ROOT files from the ring items created by the fitting program.
Definition: RootFileDataSink.h:53
virtual void put(const void *pData, size_t nBytes)
Called to put arbitrary data to the file.
Definition: RootFileDataSink.cpp:134
RootFileDataSink(const char *filename, const char *treename="DDASFit")
Constructor.
Definition: RootFileDataSink.cpp:52
virtual ~RootFileDataSink()
Destructor.
Definition: RootFileDataSink.cpp:81
virtual void putItem(const CRingItem &item)
Put a ring item to file.
Definition: RootFileDataSink.cpp:97
Unpack raw hit data from DDAS event files.
Definition: DDASFitHitUnpacker.h:62
Defines the object that's put in a ROOT TTree for each event.
Definition: DDASRootFitEvent.h:56