Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-02 09:08:02

0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003 
0004   //proxies to have less verbose user programming :
0005 
0006   //WARNING : the plotter must have at least 1x1 plotting area,
0007   //          else the below will crash because current_plotter()
0008   //          will return a null pointer.
0009 
0010   tools::sg::plots& plots() {return m_plots;}
0011   const tools::sg::plots& plots() const {return m_plots;}
0012 
0013   void next() {m_plots.next();}
0014   bool set_current_plotter(unsigned int a_index) {return m_plots.set_current_plotter(a_index);}
0015 
0016   void add_plottable(tools::sg::plottable* a_plottable) {
0017     m_plots.current_plotter().add_plottable(a_plottable); //it takes ownership.
0018   }
0019 
0020   tools::sg::plottable* plot(const tools::histo::h1d& a_histo) {
0021     tools::sg::plottable* p = new tools::sg::h1d2plot(a_histo);
0022     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0023     return p;
0024   }
0025 
0026   tools::sg::plottable* plot(const tools::histo::h2d& a_histo) {
0027     tools::sg::plottable* p = new tools::sg::h2d2plot(a_histo);
0028     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0029     return p;
0030   }
0031 
0032   tools::sg::plottable* plot(const tools::histo::p1d& a_histo) {
0033     tools::sg::plottable* p = new tools::sg::p1d2plot(a_histo);
0034     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0035     return p;
0036   }
0037 
0038   tools::sg::plottable* plot(const tools::histo::c2d& a_cloud) {
0039     tools::sg::plottable* p = new tools::sg::c2d2plot(a_cloud);
0040     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0041     return p;
0042   }
0043 
0044   tools::sg::plottable* plot(const tools::histo::c3d& a_cloud) {
0045     tools::sg::plottable* p = new tools::sg::c3d2plot(a_cloud);
0046     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0047     return p;
0048   }
0049 
0050   tools::sg::plottable* plot_cp(const tools::histo::h1d& a_histo) {
0051     tools::sg::plottable* p = new tools::sg::h1d2plot_cp(a_histo);
0052     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0053     return p;
0054   }
0055 
0056   tools::sg::plottable* plot_cp(const tools::histo::h2d& a_histo) {
0057     tools::sg::plottable* p = new tools::sg::h2d2plot_cp(a_histo);
0058     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0059     return p;
0060   }
0061 
0062   tools::sg::plottable* plot_cp(const tools::histo::p1d& a_histo) {
0063     tools::sg::plottable* p = new tools::sg::p1d2plot_cp(a_histo);
0064     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0065     return p;
0066   }
0067 
0068   tools::sg::plottable* plot_cp(const tools::histo::c2d& a_cloud) {
0069     tools::sg::plottable* p = new tools::sg::c2d2plot_cp(a_cloud);
0070     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0071     return p;
0072   }
0073 
0074   tools::sg::plottable* plot_cp(const tools::histo::c3d& a_cloud) {
0075     tools::sg::plottable* p = new tools::sg::c3d2plot_cp(a_cloud);
0076     m_plots.current_plotter().add_plottable(p); //it takes ownership.
0077     return p;
0078   }
0079 
0080   template <class T>
0081   tools::sg::plottable* plot(const T& a_func) {
0082     tools::sg::plottable* p = new tools::sg::f1d2plot<T>(a_func);
0083     m_plots.current_plotter().add_plottable(p);
0084     return p;
0085   }
0086 
0087   template <class T>
0088   tools::sg::plottable* plot(const std::vector<T>& a_xs,const std::vector<T>& a_ys) {
0089     tools::sg::plottable* p = new tools::sg::xy2plot<T>(a_xs,a_ys);
0090     m_plots.current_plotter().add_plottable(p);
0091     return p;
0092   }
0093 
0094   tools::sg::plottable* plot_fit(const std::vector<std::string>& a_names,const std::vector<double>& a_output) {
0095     tools::sg::plottable* p = new tools::sg::fit2plot(a_names,a_output);
0096     m_plots.current_plotter().add_plottable(p);
0097     return p;
0098   }
0099