g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::sg::p1d2plot Class Reference
Inheritance diagram for tools::sg::p1d2plot:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::p1d2plot:
Collaboration graph
[legend]

Public Member Functions

virtual void * cast (const std::string &a_class) const
 
virtual plottablecopy () const
 
virtual bool is_valid () const
 
virtual const std::string & name () const
 
virtual void set_name (const std::string &a_s)
 
virtual const std::string & title () const
 
virtual const std::string & legend () const
 
virtual void set_legend (const std::string &a_s)
 
virtual void infos (const std::string &a_opts, std::string &a_sinfos) const
 
virtual unsigned int bins () const
 
virtual void bins_Sw_range (float &a_mn, float &a_mx, bool a_with_entries) const
 
virtual float axis_min () const
 
virtual float axis_max () const
 
virtual float bin_lower_edge (int aI) const
 
virtual float bin_upper_edge (int aI) const
 
virtual bool has_entries_per_bin () const
 
virtual unsigned int bin_entries (int aI) const
 
virtual float bin_Sw (int aI) const
 
virtual float bin_error (int aI) const
 
virtual bool is_profile () const
 
 p1d2plot (const histo::p1d &a_data)
 
virtual ~p1d2plot ()
 
 p1d2plot (const p1d2plot &a_from)
 
p1d2plotoperator= (const p1d2plot &a_from)
 
- Public Member Functions inherited from tools::sg::bins1D
virtual ~bins1D ()
 
- Public Member Functions inherited from tools::sg::plottable
virtual ~plottable ()
 

Protected Attributes

const histo::p1dm_data
 
std::string m_name
 
std::string m_legend
 

Detailed Description

Definition at line 321 of file h2plot.

Constructor & Destructor Documentation

◆ p1d2plot() [1/2]

tools::sg::p1d2plot::p1d2plot ( const histo::p1d a_data)
inline

Definition at line 396 of file h2plot.

396 :m_data(a_data){}

◆ ~p1d2plot()

virtual tools::sg::p1d2plot::~p1d2plot ( )
inlinevirtual

Definition at line 397 of file h2plot.

397 {}

◆ p1d2plot() [2/2]

tools::sg::p1d2plot::p1d2plot ( const p1d2plot a_from)
inline

Definition at line 399 of file h2plot.

400  :plottable(a_from),bins1D(a_from)
401  ,m_data(a_from.m_data)
402  ,m_name(a_from.m_name)
403  ,m_legend(a_from.m_legend)
404  {}

Member Function Documentation

◆ axis_max()

virtual float tools::sg::p1d2plot::axis_max ( ) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 383 of file h2plot.

383 {return (float)m_data.axis().upper_edge();}

◆ axis_min()

virtual float tools::sg::p1d2plot::axis_min ( ) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 382 of file h2plot.

382 {return (float)m_data.axis().lower_edge();}

◆ bin_entries()

virtual unsigned int tools::sg::p1d2plot::bin_entries ( int  aI) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 388 of file h2plot.

388 {return m_data.bin_entries(aI);}

◆ bin_error()

virtual float tools::sg::p1d2plot::bin_error ( int  aI) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 392 of file h2plot.

392 {return (float)m_data.bin_error(aI);}

◆ bin_lower_edge()

virtual float tools::sg::p1d2plot::bin_lower_edge ( int  aI) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 384 of file h2plot.

384 {return (float)m_data.axis().bin_lower_edge(aI);}

◆ bin_Sw()

virtual float tools::sg::p1d2plot::bin_Sw ( int  aI) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 390 of file h2plot.

390 {return (float)m_data.bin_height(aI);}

◆ bin_upper_edge()

virtual float tools::sg::p1d2plot::bin_upper_edge ( int  aI) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 385 of file h2plot.

385 {return (float)m_data.axis().bin_upper_edge(aI);}

◆ bins()

virtual unsigned int tools::sg::p1d2plot::bins ( ) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 367 of file h2plot.

367 {return m_data.axis().bins();}

◆ bins_Sw_range()

virtual void tools::sg::p1d2plot::bins_Sw_range ( float &  a_mn,
float &  a_mx,
bool  a_with_entries 
) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 369 of file h2plot.

369  {
370  if(a_with_entries && m_data.has_entries_per_bin()) {
371  double mn,mx;
374  a_mn = float(mn);
375  a_mx = float(mx);
376  } else {
377  a_mn = (float)m_data.min_bin_height();
378  a_mx = (float)m_data.max_bin_height();
379  }
380  }

◆ cast()

virtual void* tools::sg::p1d2plot::cast ( const std::string &  a_class) const
inlinevirtual

Reimplemented from tools::sg::bins1D.

Reimplemented in tools::sg::p1d2plot_cp.

Definition at line 325 of file h2plot.

325  {
326  if(void* p = cmp_cast<p1d2plot>(this,a_class)) {return p;}
327  return bins1D::cast(a_class);
328  }

◆ copy()

virtual plottable* tools::sg::p1d2plot::copy ( ) const
inlinevirtual

Implements tools::sg::plottable.

Reimplemented in tools::sg::p1d2plot_cp.

Definition at line 330 of file h2plot.

330 {return new p1d2plot(*this);}

◆ has_entries_per_bin()

virtual bool tools::sg::p1d2plot::has_entries_per_bin ( ) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 387 of file h2plot.

387 {return m_data.has_entries_per_bin();}

◆ infos()

virtual void tools::sg::p1d2plot::infos ( const std::string &  a_opts,
std::string &  a_sinfos 
) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 338 of file h2plot.

338  {
339  a_sinfos.clear();
340  std::string f_lf("\n");
341  std::vector<std::string> ws;
342  words(a_opts," ",false,ws);
343  std::vector<std::string>::const_iterator it;
344  for(it=ws.begin();it!=ws.end();++it) {
345  if(((*it)=="name") && m_name.size()) {
346  if(a_sinfos.size()) a_sinfos += f_lf;
347  a_sinfos += "Name\n";
348  a_sinfos += m_name;
349 
350  } else if((*it)=="entries") {
351  if(a_sinfos.size()) a_sinfos += f_lf;
352  a_sinfos += "Entries\n";
353  if(!numas<unsigned int>(m_data.all_entries(),a_sinfos)) {}
354  } else if((*it)=="mean") {
355  if(a_sinfos.size()) a_sinfos += f_lf;
356  a_sinfos += "Mean\n";
357  if(!numas<double>(m_data.mean(),a_sinfos)) {}
358  } else if((*it)=="rms") {
359  if(a_sinfos.size()) a_sinfos += f_lf;
360  a_sinfos += "RMS\n";
361  if(!numas<double>(m_data.rms(),a_sinfos)) {}
362 
363  }
364  }
365  }

◆ is_profile()

virtual bool tools::sg::p1d2plot::is_profile ( ) const
inlinevirtual

Implements tools::sg::bins1D.

Definition at line 394 of file h2plot.

394 {return true;}

◆ is_valid()

virtual bool tools::sg::p1d2plot::is_valid ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 331 of file h2plot.

331 {return true;}

◆ legend()

virtual const std::string& tools::sg::p1d2plot::legend ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 335 of file h2plot.

335 {return m_legend;}

◆ name()

virtual const std::string& tools::sg::p1d2plot::name ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 332 of file h2plot.

332 {return m_name;}

◆ operator=()

p1d2plot& tools::sg::p1d2plot::operator= ( const p1d2plot a_from)
inline

Definition at line 405 of file h2plot.

405  {
406  m_name = a_from.m_name;
407  m_legend = a_from.m_legend;
408  return *this;
409  }

◆ set_legend()

virtual void tools::sg::p1d2plot::set_legend ( const std::string &  a_s)
inlinevirtual

Implements tools::sg::plottable.

Definition at line 336 of file h2plot.

336 {m_legend = a_s;}

◆ set_name()

virtual void tools::sg::p1d2plot::set_name ( const std::string &  a_s)
inlinevirtual

Implements tools::sg::plottable.

Definition at line 333 of file h2plot.

333 {m_name = a_s;}

◆ title()

virtual const std::string& tools::sg::p1d2plot::title ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 334 of file h2plot.

334 {return m_data.title();}

Member Data Documentation

◆ m_data

const histo::p1d& tools::sg::p1d2plot::m_data
protected

Definition at line 411 of file h2plot.

◆ m_legend

std::string tools::sg::p1d2plot::m_legend
protected

Definition at line 413 of file h2plot.

◆ m_name

std::string tools::sg::p1d2plot::m_name
protected

Definition at line 412 of file h2plot.


The documentation for this class was generated from the following file:
tools::sg::p1d2plot::m_data
const histo::p1d & m_data
Definition: h2plot:411
tools::sg::bins1D::cast
virtual void * cast(const std::string &a_class) const
Definition: plottables:17
tools::sg::p1d2plot::p1d2plot
p1d2plot(const histo::p1d &a_data)
Definition: h2plot:396
tools::mn
T mn(const T &a, const T &b)
Definition: mnmx:10
tools::mx
T mx(const T &a, const T &b)
Definition: mnmx:13
tools::histo::base_histo::min_bin_height_with_entries
bool min_bin_height_with_entries(TH &a_value) const
Definition: base_histo:175
tools::histo::axis::upper_edge
TC upper_edge() const
Definition: axis:27
tools::sg::p1d2plot::m_name
std::string m_name
Definition: h2plot:412
tools::histo::p1::bin_error
virtual TH bin_error(int aI) const
Definition: p1:52
tools::histo::axis::bin_lower_edge
TC bin_lower_edge(int a_bin) const
Definition: axis:47
tools::histo::b1::axis
const axis_t & axis() const
Definition: b1:103
tools::histo::axis::bins
bn_t bins() const
Definition: axis:28
tools::histo::b1::rms
TC rms() const
Definition: b1:37
tools::histo::axis::bin_upper_edge
TC bin_upper_edge(int a_bin) const
Definition: axis:63
tools::histo::base_histo::all_entries
TN all_entries() const
Definition: base_histo:95
tools::histo::b1::bin_height
TH bin_height(int aI) const
Definition: b1:75
tools::histo::base_histo::title
const std::string & title() const
Definition: base_histo:87
tools::words
void words(const std::string &a_string, const std::string &a_sep, bool a_take_empty, std::vector< std::string > &a_words, bool a_clear=true)
Definition: words:12
tools::histo::base_histo::min_bin_height
TH min_bin_height() const
Definition: base_histo:141
tools::sg::p1d2plot::m_legend
std::string m_legend
Definition: h2plot:413
tools::histo::base_histo::has_entries_per_bin
bool has_entries_per_bin() const
Definition: base_histo:211
tools::histo::base_histo::max_bin_height
TH max_bin_height() const
Definition: base_histo:158
tools::histo::b1::mean
TC mean() const
Definition: b1:30
tools::histo::axis::lower_edge
TC lower_edge() const
Definition: axis:26
tools::histo::base_histo::max_bin_height_with_entries
bool max_bin_height_with_entries(TH &a_value) const
Definition: base_histo:193
tools::histo::b1::bin_entries
TN bin_entries(int aI) const
Definition: b1:47