00001 #ifndef __ROOTFILEBASE_H__ 00002 #define __ROOTFILEBASE_H__ 00003 00004 /* 00005 00006 Adam Hunt - Princeton University 00007 ahunt@princeton.edu 00008 00009 */ 00010 00011 #include <string> 00012 #include <sstream> 00013 00014 namespace HCAL_HLX{ 00015 00016 struct LUMI_SECTION; 00017 00018 struct LUMI_SECTION_HEADER; 00019 struct LUMI_SUMMARY; 00020 struct LUMI_DETAIL; 00021 00022 struct ET_SUM_SECTION; 00023 struct OCCUPANCY_SECTION; 00024 struct LHC_SECTION; 00025 00026 class ROOTFileBase{ 00027 00028 public: 00029 00030 ROOTFileBase(); 00031 virtual ~ROOTFileBase(); 00032 00033 void SetDir( const std::string &dir ); 00034 00035 void SetFileType( const std::string &type ); 00036 void SetDate( const std::string &date); 00037 00038 void SetFileName(const HCAL_HLX::LUMI_SECTION &lumiSection); 00039 00040 void SetFileName(unsigned int runNumber, 00041 unsigned int sectionNumber); 00042 00043 std::string GetDir(){ return dirName_; } 00044 std::string GetFileName(){ return fileName_; } 00045 00046 void SetEtSumOnly( bool bEtSumOnly ); 00047 00048 protected: 00049 00050 void Init(); 00051 void CleanUp(); 00052 00053 virtual void CreateTree() = 0; 00054 00055 HCAL_HLX::LUMI_SECTION *lumiSection_; 00056 00057 HCAL_HLX::LUMI_SECTION_HEADER *Header_; 00058 HCAL_HLX::LUMI_SUMMARY *Summary_; 00059 HCAL_HLX::LUMI_DETAIL *Detail_; 00060 00061 HCAL_HLX::ET_SUM_SECTION *EtSumPtr_[36]; 00062 HCAL_HLX::OCCUPANCY_SECTION *OccupancyPtr_[36]; 00063 HCAL_HLX::LHC_SECTION *LHCPtr_[36]; 00064 00065 std::string filePrefix_; 00066 std::string fileName_; 00067 std::string dirName_; 00068 00069 bool bEtSumOnly_; 00070 std::string date_; 00071 std::string fileType_; 00072 }; 00073 } 00074 #endif