00001 #ifndef __ROOTFILEWRITER_H__ 00002 #define __ROOTFILEWRITER_H__ 00003 00004 /* 00005 00006 Adam Hunt - Princeton University 00007 ahunt@princeton.edu 00008 00009 */ 00010 00011 #include "RecoLuminosity/ROOTSchema/interface/ROOTFileBase.h" 00012 00013 #include <string> 00014 00015 class TFile; 00016 class TTree; 00017 00018 namespace HCAL_HLX{ 00019 00020 struct LUMI_SECTION; 00021 00022 class ROOTFileWriter: public ROOTFileBase{ 00023 00024 public: 00025 00026 ROOTFileWriter(); 00027 ~ROOTFileWriter(); 00028 00029 bool OpenFile(const HCAL_HLX::LUMI_SECTION &lumiSection); 00030 bool OpenFile(const unsigned int runNumber, 00031 const unsigned int sectionNumber); 00032 00033 void FillTree(const HCAL_HLX::LUMI_SECTION &localSection); 00034 bool CloseFile(); 00035 00036 void SetMerge( const bool bMerge ){ bMerge_ = bMerge; } 00037 00038 protected: 00039 00040 void CreateTree(); 00041 template< class T > 00042 void MakeBranch(const T &in, T **out, int HLXNum); 00043 00044 void InsertInformation(); 00045 00046 TFile* m_file; 00047 TTree* m_tree; 00048 00049 bool bMerge_; 00050 00051 }; 00052 } 00053 #endif