HistoTable.h
Go to the documentation of this file.
1 /// \file HistoTable.h
2 /// \brief Class to read, hold, and deliver histogram data
3 /// \author messier@indiana.edu, mbaird42@fnal.gov
4 /// \version $Id: HistoTable.h,v 1.5 2012-06-11 17:41:58 messier Exp $
5 #ifndef OM_HISTOTABLE_H
6 #define OM_HISTOTABLE_H
7 #include <string>
8 #include <map>
10 class TH1F;
11 class TH2F;
12 
13 namespace om {
14  class HistoTable {
15  public:
16  static HistoTable& Instance(const char* f=0, Detector_t d=kALLDET);
17 
18  /// Load the histogram data from a .csv file
19  /// \param file - name of file to read
20  /// \param d - which detector context to apply (far/near/NDOS?)
21  void ReadFile(const char* file, Detector_t d);
22 
23  /// Look up histogram data given name of histogram
24  /// \param nm - "C++" name of histogram
25  const HistoData* LookUp (const char* nm) const;
26  const HistoData& operator[](const char* nm) const;
27 
28  private:
29  HistoTable();
30  char NewLineChar(const char* f);
31  void Unquote(std::string& s);
32 
33  public:
34  std::map<std::string,HistoData> fTable; ///< Histogram data by C++ name
35  };
36 }
37 
38 #endif
39 ////////////////////////////////////////////////////////////////////////
char NewLineChar(const char *f)
Definition: HistoTable.cxx:45
const HistoData * LookUp(const char *nm) const
Definition: HistoTable.cxx:293
static constexpr Double_t nm
Definition: Munits.h:133
const XML_Char * s
Definition: expat.h:262
void ReadFile(const char *file, Detector_t d)
Definition: HistoTable.cxx:75
Float_t d
Definition: plot.C:236
const HistoData & operator[](const char *nm) const
Definition: HistoTable.cxx:334
TFile * file
Definition: cellShifts.C:17
std::map< std::string, HistoData > fTable
Histogram data by C++ name.
Definition: HistoTable.h:34
static HistoTable & Instance(const char *f=0, Detector_t d=kALLDET)
Definition: HistoTable.cxx:21
enum om::_det_types Detector_t
void Unquote(std::string &s)
Definition: HistoTable.cxx:31
Online Monitoring package header.
enum BeamMode string