g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::sg::h2d2plot Class Reference
Inheritance diagram for tools::sg::h2d2plot:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::h2d2plot:
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 void bins_Sw_range (float &a_mn, float &a_mx, bool a_with_entries) const
 
virtual unsigned int x_bins () const
 
virtual unsigned int y_bins () const
 
virtual float x_axis_min () const
 
virtual float x_axis_max () const
 
virtual float y_axis_min () const
 
virtual float y_axis_max () const
 
virtual float bin_lower_edge_x (int aI) const
 
virtual float bin_upper_edge_x (int aI) const
 
virtual float bin_lower_edge_y (int aI) const
 
virtual float bin_upper_edge_y (int aI) const
 
virtual bool has_entries_per_bin () const
 
virtual unsigned int bin_entries (int aI, int aJ) const
 
virtual float bin_Sw (int aI, int aJ) const
 
virtual float bin_error (int aI, int aJ) const
 
 h2d2plot (const histo::h2d &a_data)
 
virtual ~h2d2plot ()
 
 h2d2plot (const h2d2plot &a_from)
 
h2d2plotoperator= (const h2d2plot &a_from)
 
- Public Member Functions inherited from tools::sg::bins2D
virtual ~bins2D ()
 
- Public Member Functions inherited from tools::sg::plottable
virtual ~plottable ()
 

Protected Attributes

const histo::h2dm_data
 
std::string m_name
 
std::string m_legend
 

Detailed Description

Definition at line 201 of file h2plot.

Constructor & Destructor Documentation

◆ h2d2plot() [1/2]

tools::sg::h2d2plot::h2d2plot ( const histo::h2d a_data)
inline

Definition at line 286 of file h2plot.

287  :m_data(a_data)
288  {
289 #ifdef TOOLS_MEM
290  mem::increment(s_class().c_str());
291 #endif
292  }

◆ ~h2d2plot()

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

Definition at line 293 of file h2plot.

293  {
294 #ifdef TOOLS_MEM
295  mem::decrement(s_class().c_str());
296 #endif
297  }

◆ h2d2plot() [2/2]

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

Definition at line 299 of file h2plot.

300  :plottable(a_from),bins2D(a_from)
301  ,m_data(a_from.m_data)
302  ,m_name(a_from.m_name)
303  ,m_legend(a_from.m_legend)
304  {
305 #ifdef TOOLS_MEM
306  mem::increment(s_class().c_str());
307 #endif
308  }

Member Function Documentation

◆ bin_entries()

virtual unsigned int tools::sg::h2d2plot::bin_entries ( int  aI,
int  aJ 
) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 280 of file h2plot.

280 {return m_data.bin_entries(aI,aJ);}

◆ bin_error()

virtual float tools::sg::h2d2plot::bin_error ( int  aI,
int  aJ 
) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 284 of file h2plot.

284 {return (float)m_data.bin_error(aI,aJ);}

◆ bin_lower_edge_x()

virtual float tools::sg::h2d2plot::bin_lower_edge_x ( int  aI) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 274 of file h2plot.

274 {return (float)m_data.axis_x().bin_lower_edge(aI);}

◆ bin_lower_edge_y()

virtual float tools::sg::h2d2plot::bin_lower_edge_y ( int  aI) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 276 of file h2plot.

276 {return (float)m_data.axis_y().bin_lower_edge(aI);}

◆ bin_Sw()

virtual float tools::sg::h2d2plot::bin_Sw ( int  aI,
int  aJ 
) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 282 of file h2plot.

282 {return (float)m_data.bin_height(aI,aJ);}

◆ bin_upper_edge_x()

virtual float tools::sg::h2d2plot::bin_upper_edge_x ( int  aI) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 275 of file h2plot.

275 {return (float)m_data.axis_x().bin_upper_edge(aI);}

◆ bin_upper_edge_y()

virtual float tools::sg::h2d2plot::bin_upper_edge_y ( int  aI) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 277 of file h2plot.

277 {return (float)m_data.axis_y().bin_upper_edge(aI);}

◆ bins_Sw_range()

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

Implements tools::sg::bins2D.

Definition at line 255 of file h2plot.

255  {
256  if(a_with_entries && m_data.has_entries_per_bin()) {
257  double mn,mx;
260  a_mn = float(mn);
261  a_mx = float(mx);
262  } else {
263  a_mn = (float)m_data.min_bin_height();
264  a_mx = (float)m_data.max_bin_height();
265  }
266  }

◆ cast()

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

Reimplemented from tools::sg::bins2D.

Reimplemented in tools::sg::h2d2plot_cp.

Definition at line 205 of file h2plot.

205  {
206  if(void* p = cmp_cast<h2d2plot>(this,a_class)) {return p;}
207  return bins2D::cast(a_class);
208  }

◆ copy()

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

Implements tools::sg::plottable.

Reimplemented in tools::sg::h2d2plot_cp.

Definition at line 210 of file h2plot.

210 {return new h2d2plot(*this);}

◆ has_entries_per_bin()

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

Implements tools::sg::bins2D.

Definition at line 279 of file h2plot.

279 {return m_data.has_entries_per_bin();}

◆ infos()

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

Implements tools::sg::plottable.

Definition at line 218 of file h2plot.

218  {
219  a_sinfos.clear();
220  std::string f_lf("\n");
221  std::vector<std::string> ws;
222  words(a_opts," ",false,ws);
223  std::vector<std::string>::const_iterator it;
224  for(it=ws.begin();it!=ws.end();++it) {
225  if(((*it)=="name") && m_name.size()) {
226  if(a_sinfos.size()) a_sinfos += f_lf;
227  a_sinfos += "Name\n";
228  a_sinfos += m_name;
229 
230  } else if((*it)=="entries") {
231  if(a_sinfos.size()) a_sinfos += f_lf;
232  a_sinfos += "Entries\n";
233  if(!numas<unsigned int>(m_data.all_entries(),a_sinfos)) {}
234 
235  } else if((*it)=="mean") {
236  if(a_sinfos.size()) a_sinfos += f_lf;
237  a_sinfos += "MeanX\n";
238  if(!numas<double>(m_data.mean_x(),a_sinfos)) {}
239  a_sinfos += f_lf;
240  a_sinfos += "MeanY\n";
241  if(!numas<double>(m_data.mean_y(),a_sinfos)) {}
242 
243  } else if((*it)=="rms") {
244  if(a_sinfos.size()) a_sinfos += f_lf;
245  a_sinfos += "RMS X\n";
246  if(!numas<double>(m_data.rms_x(),a_sinfos)) {}
247  a_sinfos += f_lf;
248  a_sinfos += "RMS Y\n";
249  if(!numas<double>(m_data.rms_y(),a_sinfos)) {}
250 
251  }
252  }
253  }

◆ is_valid()

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

Implements tools::sg::plottable.

Definition at line 211 of file h2plot.

211 {return true;}

◆ legend()

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

Implements tools::sg::plottable.

Definition at line 215 of file h2plot.

215 {return m_legend;}

◆ name()

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

Implements tools::sg::plottable.

Definition at line 212 of file h2plot.

212 {return m_name;}

◆ operator=()

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

Definition at line 309 of file h2plot.

309  {
310  m_name = a_from.m_name;
311  m_legend = a_from.m_legend;
312  return *this;
313  }

◆ set_legend()

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

Implements tools::sg::plottable.

Definition at line 216 of file h2plot.

216 {m_legend = a_s;}

◆ set_name()

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

Implements tools::sg::plottable.

Definition at line 213 of file h2plot.

213 {m_name = a_s;}

◆ title()

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

Implements tools::sg::plottable.

Definition at line 214 of file h2plot.

214 {return m_data.title();}

◆ x_axis_max()

virtual float tools::sg::h2d2plot::x_axis_max ( ) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 270 of file h2plot.

270 {return (float)m_data.axis_x().upper_edge();}

◆ x_axis_min()

virtual float tools::sg::h2d2plot::x_axis_min ( ) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 269 of file h2plot.

269 {return (float)m_data.axis_x().lower_edge();}

◆ x_bins()

virtual unsigned int tools::sg::h2d2plot::x_bins ( ) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 267 of file h2plot.

267 {return m_data.axis_x().bins();}

◆ y_axis_max()

virtual float tools::sg::h2d2plot::y_axis_max ( ) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 272 of file h2plot.

272 {return (float)m_data.axis_y().upper_edge();}

◆ y_axis_min()

virtual float tools::sg::h2d2plot::y_axis_min ( ) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 271 of file h2plot.

271 {return (float)m_data.axis_y().lower_edge();}

◆ y_bins()

virtual unsigned int tools::sg::h2d2plot::y_bins ( ) const
inlinevirtual

Implements tools::sg::bins2D.

Definition at line 268 of file h2plot.

268 {return m_data.axis_y().bins();}

Member Data Documentation

◆ m_data

const histo::h2d& tools::sg::h2d2plot::m_data
protected

Definition at line 315 of file h2plot.

◆ m_legend

std::string tools::sg::h2d2plot::m_legend
protected

Definition at line 317 of file h2plot.

◆ m_name

std::string tools::sg::h2d2plot::m_name
protected

Definition at line 316 of file h2plot.


The documentation for this class was generated from the following file:
tools::histo::b2::rms_x
TC rms_x() const
Definition: b2:37
tools::histo::h2::bin_error
virtual TH bin_error(int aI, int aJ) const
Definition: h2:24
tools::histo::b2::bin_height
TH bin_height(int aI, int aJ) const
Definition: b2:95
tools::mn
T mn(const T &a, const T &b)
Definition: mnmx:10
tools::sg::h2d2plot::m_legend
std::string m_legend
Definition: h2plot:317
tools::mx
T mx(const T &a, const T &b)
Definition: mnmx:13
tools::histo::b2::mean_x
TC mean_x() const
Definition: b2:27
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::histo::b2::mean_y
TC mean_y() const
Definition: b2:32
tools::histo::axis::bin_lower_edge
TC bin_lower_edge(int a_bin) const
Definition: axis:47
tools::histo::axis::bins
bn_t bins() const
Definition: axis:28
tools::histo::axis::bin_upper_edge
TC bin_upper_edge(int a_bin) const
Definition: axis:63
tools::histo::b2::axis_y
const axis_t & axis_y() const
Definition: b2:148
tools::histo::base_histo::all_entries
TN all_entries() const
Definition: base_histo:95
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::b2::bin_entries
TN bin_entries(int aI, int aJ) const
Definition: b2:57
tools::sg::h2d2plot::m_name
std::string m_name
Definition: h2plot:316
tools::histo::base_histo::min_bin_height
TH min_bin_height() const
Definition: base_histo:141
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::axis::lower_edge
TC lower_edge() const
Definition: axis:26
tools::histo::b2::axis_x
const axis_t & axis_x() const
Definition: b2:147
tools::sg::h2d2plot::h2d2plot
h2d2plot(const histo::h2d &a_data)
Definition: h2plot:286
tools::histo::base_histo::max_bin_height_with_entries
bool max_bin_height_with_entries(TH &a_value) const
Definition: base_histo:193
tools::sg::h2d2plot::m_data
const histo::h2d & m_data
Definition: h2plot:315
tools::sg::bins2D::cast
virtual void * cast(const std::string &a_class) const
Definition: plottables:46
tools::histo::b2::rms_y
TC rms_y() const
Definition: b2:43