Public Member Functions | Private Attributes | List of all members
om::HistoSource Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/OnlineMonitoring/viewer/HistoSource.h"

Inheritance diagram for om::HistoSource:
om::HistoSourceBase

Public Member Functions

 HistoSource (const char *n)
 
 ~HistoSource ()
 
void SetName (const char *nm)
 Set the source name. More...
 
TH1F * GetTH1FCopy (const char *n)
 
TH2F * GetTH2FCopy (const char *n)
 
void GetHistogramList (std::list< std::string > &h)
 Get a list of all histograms held by this source. More...
 
void GetStatus (std::string &nm, unsigned int *run, unsigned int *subrun, unsigned int *event, pid_t *pid, long *stime, long *utime, long *cpu, long *rsize, time_t *t)
 Get the histogram server status. More...
 
void FindAllMatches (const char *include_pattern, const char *exclude_pattern, std::list< std::string > &objs)
 

Private Attributes

HistoSourceBasefSource
 

Detailed Description

The generic source. Figures out which of the above to use based on the . extension

Definition at line 108 of file HistoSource.h.

Constructor & Destructor Documentation

HistoSource::HistoSource ( const char *  n)

Definition at line 154 of file HistoSource.cxx.

References SetName().

154  : fSource(0)
155 {
156  this->SetName(n);
157 }
void SetName(const char *nm)
Set the source name.
HistoSourceBase * fSource
Definition: HistoSource.h:129
HistoSource::~HistoSource ( )

Definition at line 161 of file HistoSource.cxx.

References fSource.

162 {
163  if (fSource) {
164  delete fSource;
165  fSource = 0;
166  }
167 }
HistoSourceBase * fSource
Definition: HistoSource.h:129

Member Function Documentation

void HistoSourceBase::FindAllMatches ( const char *  include_pattern,
const char *  exclude_pattern,
std::list< std::string > &  objs 
)
inherited

Return the names of all objects in the file who's names match a particular set of patterns

Parameters
include_pattern- Names must match this expression
exclude_pattern- Names must not match this expression
objs- List of object names that satisfy the above

Definition at line 10 of file HistoSource.cxx.

References om::HistoSourceBase::GetHistogramList(), make_syst_table_plots::h, MECModelEnuComparisons::i, in, om::regex_match(), and string.

Referenced by om::HistoSourceBase::GetStatus().

13 {
14  std::string include_p(include_pattern);
15  std::string exclude_p(exclude_pattern);
16  bool in, ex;
17 
18  std::list<std::string> h;
19  this->GetHistogramList(h);
20 
21  std::list<std::string>::iterator i(h.begin());
22  std::list<std::string>::iterator iend(h.end());
23  for (; i!=iend; ++i) {
24  in = (regex_match(*i, include_p)==0);
25  ex = (regex_match(*i, exclude_p)==0);
26  if (in && !ex) objs.push_back(*i);
27  }
28 }
virtual void GetHistogramList(std::list< std::string > &h)=0
Get a list of all histograms held by this source.
ifstream in
Definition: comparison.C:7
int regex_match(const std::string &s, const std::string &p)
Definition: RegexMatch.cxx:7
enum BeamMode string
void HistoSource::GetHistogramList ( std::list< std::string > &  h)
virtual

Get a list of all histograms held by this source.

Implements om::HistoSourceBase.

Definition at line 200 of file HistoSource.cxx.

References fSource, and om::HistoSourceBase::GetHistogramList().

201 {
203 }
virtual void GetHistogramList(std::list< std::string > &h)=0
Get a list of all histograms held by this source.
HistoSourceBase * fSource
Definition: HistoSource.h:129
void HistoSource::GetStatus ( std::string nm,
unsigned int run,
unsigned int subrun,
unsigned int event,
pid_t *  pid,
long *  stime,
long *  utime,
long *  cpu,
long *  rsize,
time_t *  t 
)
virtual

Get the histogram server status.

Reimplemented from om::HistoSourceBase.

Definition at line 207 of file HistoSource.cxx.

References fSource, and om::HistoSourceBase::GetStatus().

Referenced by om::HeaderBar::HandleTimer(), and om::PlotOptions::MakeLabelText().

217 {
218  if (fSource) {
219  fSource->GetStatus(nm, run, subrun, event,
220  pid, stime, utime, cpu, rsize, t);
221  }
222 }
virtual void GetStatus(std::string &nm, unsigned int *run, unsigned int *subrun, unsigned int *event, pid_t *pid, long *stime, long *utime, long *cpu, long *rsize, time_t *t)
Get the histogram server status.
Definition: HistoSource.h:36
static constexpr Double_t nm
Definition: Munits.h:133
HistoSourceBase * fSource
Definition: HistoSource.h:129
Definition: run.py:1
TH1F * HistoSource::GetTH1FCopy ( const char *  n)
virtual

Read a copy of a named histogram into memory. User accepts ownership and responsibility for deletetion

Implements om::HistoSourceBase.

Definition at line 184 of file HistoSource.cxx.

References fSource, and om::HistoSourceBase::GetTH1FCopy().

185 {
186  if (fSource) return fSource->GetTH1FCopy(n);
187  return 0;
188 }
virtual TH1F * GetTH1FCopy(const char *n)=0
HistoSourceBase * fSource
Definition: HistoSource.h:129
TH2F * HistoSource::GetTH2FCopy ( const char *  n)
virtual

Read a copy of a named histogram into memory. User accepts ownership and responsibility for deletion.

Implements om::HistoSourceBase.

Definition at line 192 of file HistoSource.cxx.

References fSource, and om::HistoSourceBase::GetTH2FCopy().

193 {
194  if (fSource) return fSource->GetTH2FCopy(n);
195  return 0;
196 }
HistoSourceBase * fSource
Definition: HistoSource.h:129
virtual TH2F * GetTH2FCopy(const char *n)=0
void HistoSource::SetName ( const char *  nm)
virtual

Set the source name.

Implements om::HistoSourceBase.

Definition at line 171 of file HistoSource.cxx.

References fSource, and string.

Referenced by HistoSource().

172 {
173  std::string s(nm);
174  bool is_root = s.find(".root")<s.length();
175  bool is_shm = s.find(".shm")< s.length();
176  if (is_root&&is_shm) abort();
177 
178  if (is_root) fSource = new HistoFile(nm);
179  if (is_shm) fSource = new HistoSHM(nm);
180 }
static constexpr Double_t nm
Definition: Munits.h:133
const XML_Char * s
Definition: expat.h:262
HistoSourceBase * fSource
Definition: HistoSource.h:129
enum BeamMode string

Member Data Documentation

HistoSourceBase* om::HistoSource::fSource
private

The documentation for this class was generated from the following files: