NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
Converter.h
1 // Converter.h
2 //
3 // Author : Jeromy Tompkins
4 // Date : 5/7/2013
5 //
6 // Purpose: Defines the base class from which all concrete converter
7 // objects derive. See more information below.
8 
9 #ifndef CONVERTER_H
10 #define CONVERTER_H
11 
12 #include <string>
13 
14 class TFile;
15 class TTree;
16 class CRingItem;
17 
37 class Converter
38 {
39 
40  protected:
41  TFile *m_fileout;
42  TTree *m_treeout;
44  public:
50  Converter() : m_fileout(0), m_treeout(0) {}
51 
61  virtual ~Converter()
62  {
63  if (m_fileout!=0) Close();
64  }
65 
77  virtual void Initialize(std::string in_fname, std::string fileout);
78 
90  virtual void DumpData(const CRingItem& item) = 0;
91 
97  virtual void Close();
98 
101  TFile* GetFile() { return m_fileout;}
102 
105  TTree* GetTree() { return m_treeout;}
106 
107 };
108 
109 #endif
Converter()
Default constructor.
Definition: Converter.h:50
virtual void Initialize(std::string in_fname, std::string fileout)
Open output root file and creates the tree structure.
Definition: Converter.cpp:12
TTree * m_treeout
Definition: Converter.h:42
virtual void Close()
Close ROOT file.
Definition: Converter.cpp:37
TFile * GetFile()
Access the output file.
Definition: Converter.h:101
virtual ~Converter()
Default destructor.
Definition: Converter.h:61
virtual void DumpData(const CRingItem &item)=0
Dump the data from ring into a object in a root file.
TFile * m_fileout
Definition: Converter.h:41
TTree * GetTree()
Access the output tree.
Definition: Converter.h:105
Base class for all converter objects.
Definition: Converter.h:37