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 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /externals/g4tools/include/tools/sg/h2plot_cp (Version 11.3.0) and /externals/g4tools/include/tools/sg/h2plot_cp (Version 11.1.1)


  1 // Copyright (C) 2010, Guy Barrand. All rights      1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
  2 // See the file tools.license for terms.            2 // See the file tools.license for terms.
  3                                                     3 
  4 #ifndef tools_sg_h2plot_cp                          4 #ifndef tools_sg_h2plot_cp
  5 #define tools_sg_h2plot_cp                          5 #define tools_sg_h2plot_cp
  6                                                     6 
  7 // Inheritance :                                    7 // Inheritance :
  8 #include "h2plot"                                   8 #include "h2plot"
  9                                                     9 
 10 namespace tools {                                  10 namespace tools {
 11 namespace sg {                                     11 namespace sg {
 12                                                    12 
 13 class h1d2plot_cp : public h1d2plot {              13 class h1d2plot_cp : public h1d2plot {
 14 public:                                            14 public:
 15   TOOLS_SCLASS(tools::sg::h1d2plot_cp)             15   TOOLS_SCLASS(tools::sg::h1d2plot_cp)
 16 public:                                            16 public:
 17   virtual void* cast(const std::string& a_clas     17   virtual void* cast(const std::string& a_class) const {
 18     if(void* p = cmp_cast<h1d2plot_cp>(this,a_     18     if(void* p = cmp_cast<h1d2plot_cp>(this,a_class)) {return p;}
 19     return h1d2plot::cast(a_class);                19     return h1d2plot::cast(a_class);
 20   }                                                20   }
 21 public:                                            21 public:
 22   virtual plottable* copy() const {return new      22   virtual plottable* copy() const {return new h1d2plot_cp(*this);}
 23 public:                                            23 public:
 24   h1d2plot_cp(const histo::h1d& a_data)            24   h1d2plot_cp(const histo::h1d& a_data)
 25   :h1d2plot(m_cp) //give ref of m_cp to h1d2pl     25   :h1d2plot(m_cp) //give ref of m_cp to h1d2plot.
 26   ,m_cp(a_data)   //do a local copy.               26   ,m_cp(a_data)   //do a local copy.
 27   //WARNING : the upper is ok as long as h1d2p     27   //WARNING : the upper is ok as long as h1d2plot constructor does nothing
 28   //          else than keeping the ref to m_c     28   //          else than keeping the ref to m_cp. Else it would do
 29   //          something on an empty histo (and     29   //          something on an empty histo (and not on a copy of the
 30   //          passed a_data).                      30   //          passed a_data).
 31   {                                                31   {
 32 #ifdef TOOLS_MEM                                   32 #ifdef TOOLS_MEM
 33     mem::increment(s_class().c_str());             33     mem::increment(s_class().c_str());
 34 #endif                                             34 #endif
 35   }                                                35   }
 36   virtual ~h1d2plot_cp(){                          36   virtual ~h1d2plot_cp(){
 37 #ifdef TOOLS_MEM                                   37 #ifdef TOOLS_MEM
 38     mem::decrement(s_class().c_str());             38     mem::decrement(s_class().c_str());
 39 #endif                                             39 #endif
 40   }                                                40   }
 41 public:                                            41 public:
 42   h1d2plot_cp(const h1d2plot_cp& a_from)           42   h1d2plot_cp(const h1d2plot_cp& a_from)
 43   :plottable(a_from)                               43   :plottable(a_from)
 44   ,bins1D(a_from)                                  44   ,bins1D(a_from)
 45   ,h1d2plot(m_cp)                                  45   ,h1d2plot(m_cp)
 46   ,m_cp(a_from.m_cp)                               46   ,m_cp(a_from.m_cp)
 47   {                                                47   {
 48 #ifdef TOOLS_MEM                                   48 #ifdef TOOLS_MEM
 49     mem::increment(s_class().c_str());             49     mem::increment(s_class().c_str());
 50 #endif                                             50 #endif
 51   }                                                51   }
 52   h1d2plot_cp& operator=(const h1d2plot_cp& a_     52   h1d2plot_cp& operator=(const h1d2plot_cp& a_from){
 53     h1d2plot::operator=(a_from);                   53     h1d2plot::operator=(a_from);
 54     m_cp = a_from.m_cp;                            54     m_cp = a_from.m_cp;
 55     return *this;                                  55     return *this;
 56   }                                                56   }
 57 public:                                            57 public:
 58   const histo::h1d& data() const {return m_cp;     58   const histo::h1d& data() const {return m_cp;}
 59   histo::h1d& data() {return m_cp;}                59   histo::h1d& data() {return m_cp;}
 60 protected:                                         60 protected:
 61   histo::h1d m_cp;                                 61   histo::h1d m_cp;
 62 };                                                 62 };
 63                                                    63 
 64 class h2d2plot_cp : public h2d2plot {              64 class h2d2plot_cp : public h2d2plot {
 65 public:                                            65 public:
 66   TOOLS_SCLASS(tools::sg::h2d2plot_cp)             66   TOOLS_SCLASS(tools::sg::h2d2plot_cp)
 67 public:                                            67 public:
 68   virtual void* cast(const std::string& a_clas     68   virtual void* cast(const std::string& a_class) const {
 69     if(void* p = cmp_cast<h2d2plot_cp>(this,a_     69     if(void* p = cmp_cast<h2d2plot_cp>(this,a_class)) {return p;}
 70     return h2d2plot::cast(a_class);                70     return h2d2plot::cast(a_class);
 71   }                                                71   }
 72 public:                                            72 public:
 73   virtual plottable* copy() const {return new      73   virtual plottable* copy() const {return new h2d2plot_cp(*this);}
 74 public:                                            74 public:
 75   h2d2plot_cp(const histo::h2d& a_data)            75   h2d2plot_cp(const histo::h2d& a_data)
 76   :h2d2plot(m_cp)                                  76   :h2d2plot(m_cp)
 77   ,m_cp(a_data)                                    77   ,m_cp(a_data)
 78   {                                                78   {
 79 #ifdef TOOLS_MEM                                   79 #ifdef TOOLS_MEM
 80     mem::increment(s_class().c_str());             80     mem::increment(s_class().c_str());
 81 #endif                                             81 #endif
 82   }                                                82   }
 83   virtual ~h2d2plot_cp(){                          83   virtual ~h2d2plot_cp(){
 84 #ifdef TOOLS_MEM                                   84 #ifdef TOOLS_MEM
 85     mem::decrement(s_class().c_str());             85     mem::decrement(s_class().c_str());
 86 #endif                                             86 #endif
 87   }                                                87   }
 88 public:                                            88 public:
 89   h2d2plot_cp(const h2d2plot_cp& a_from)           89   h2d2plot_cp(const h2d2plot_cp& a_from)
 90   :plottable(a_from),bins2D(a_from),h2d2plot(m     90   :plottable(a_from),bins2D(a_from),h2d2plot(m_cp)
 91   ,m_cp(a_from.m_cp)                               91   ,m_cp(a_from.m_cp)
 92   {                                                92   {
 93 #ifdef TOOLS_MEM                                   93 #ifdef TOOLS_MEM
 94     mem::increment(s_class().c_str());             94     mem::increment(s_class().c_str());
 95 #endif                                             95 #endif
 96   }                                                96   }
 97   h2d2plot_cp& operator=(const h2d2plot_cp& a_     97   h2d2plot_cp& operator=(const h2d2plot_cp& a_from){
 98     h2d2plot::operator=(a_from);                   98     h2d2plot::operator=(a_from);
 99     m_cp = a_from.m_cp;                            99     m_cp = a_from.m_cp;
100     return *this;                                 100     return *this;
101   }                                               101   }
102 protected:                                        102 protected:
103   histo::h2d m_cp;                                103   histo::h2d m_cp;
104 };                                                104 };
105                                                   105 
106 class p1d2plot_cp : public p1d2plot {             106 class p1d2plot_cp : public p1d2plot {
107 public:                                           107 public:
108   TOOLS_SCLASS(tools::sg::p1d2plot_cp)            108   TOOLS_SCLASS(tools::sg::p1d2plot_cp)
109 public:                                           109 public:
110   virtual void* cast(const std::string& a_clas    110   virtual void* cast(const std::string& a_class) const {
111     if(void* p = cmp_cast<p1d2plot_cp>(this,a_    111     if(void* p = cmp_cast<p1d2plot_cp>(this,a_class)) {return p;}
112     return p1d2plot::cast(a_class);               112     return p1d2plot::cast(a_class);
113   }                                               113   }
114 public:                                           114 public:
115   virtual plottable* copy() const {return new     115   virtual plottable* copy() const {return new p1d2plot_cp(*this);}
116 public:                                           116 public:
117   p1d2plot_cp(const histo::p1d& a_data)           117   p1d2plot_cp(const histo::p1d& a_data)
118   :p1d2plot(m_cp)                                 118   :p1d2plot(m_cp)
119   ,m_cp(a_data)                                   119   ,m_cp(a_data)
120   {                                               120   {
121 #ifdef TOOLS_MEM                                  121 #ifdef TOOLS_MEM
122     mem::increment(s_class().c_str());            122     mem::increment(s_class().c_str());
123 #endif                                            123 #endif
124   }                                               124   }
125   virtual ~p1d2plot_cp(){                         125   virtual ~p1d2plot_cp(){
126 #ifdef TOOLS_MEM                                  126 #ifdef TOOLS_MEM
127     mem::decrement(s_class().c_str());            127     mem::decrement(s_class().c_str());
128 #endif                                            128 #endif
129   }                                               129   }
130 public:                                           130 public:
131   p1d2plot_cp(const p1d2plot_cp& a_from)          131   p1d2plot_cp(const p1d2plot_cp& a_from)
132   :plottable(a_from),bins1D(a_from),p1d2plot(m    132   :plottable(a_from),bins1D(a_from),p1d2plot(m_cp)
133   ,m_cp(a_from.m_cp)                              133   ,m_cp(a_from.m_cp)
134   {                                               134   {
135 #ifdef TOOLS_MEM                                  135 #ifdef TOOLS_MEM
136     mem::increment(s_class().c_str());            136     mem::increment(s_class().c_str());
137 #endif                                            137 #endif
138   }                                               138   }
139   p1d2plot_cp& operator=(const p1d2plot_cp& a_    139   p1d2plot_cp& operator=(const p1d2plot_cp& a_from){
140     p1d2plot::operator=(a_from);                  140     p1d2plot::operator=(a_from);
141     m_cp = a_from.m_cp;                           141     m_cp = a_from.m_cp;
142     return *this;                                 142     return *this;
143   }                                               143   }
144 protected:                                        144 protected:
145   histo::p1d m_cp;                                145   histo::p1d m_cp;
146 };                                                146 };
147                                                   147 
148 }}                                                148 }}
149                                                   149 
150 #endif                                            150 #endif