Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 2 // See the file tools.license for terms. 3 4 #ifndef tools_histo_base_cloud 5 #define tools_histo_base_cloud 6 7 #include <string> 8 #include <vector> 9 10 #ifdef TOOLS_MEM 11 #include "../mem" 12 #endif 13 14 namespace tools { 15 namespace histo { 16 17 class base_cloud { 18 static const std::string& s_class() { 19 static const std::string s_v("tools::histo 20 return s_v; 21 } 22 protected: 23 base_cloud(int aLimit) 24 :m_limit(aLimit) 25 ,m_Sw(0) 26 { 27 #ifdef TOOLS_MEM 28 mem::increment(s_class().c_str()); 29 #endif 30 } 31 virtual ~base_cloud(){ 32 #ifdef TOOLS_MEM 33 mem::decrement(s_class().c_str()); 34 #endif 35 } 36 public: 37 base_cloud(const base_cloud& a_from) 38 :m_title(a_from.m_title) 39 ,m_limit(a_from.m_limit) 40 ,m_Sw(a_from.m_Sw) 41 ,m_ws(a_from.m_ws) 42 { 43 #ifdef TOOLS_MEM 44 mem::increment(s_class().c_str()); 45 #endif 46 } 47 48 base_cloud& operator=(const base_cloud& a_fr 49 m_title = a_from.m_title; 50 m_limit = a_from.m_limit; 51 m_Sw = a_from.m_Sw; 52 m_ws = a_from.m_ws; 53 return *this; 54 } 55 public: 56 const std::string& title() const {return m_t 57 int max_entries() const {return m_limit;} 58 protected: 59 static int UNLIMITED() {return -1;} 60 static unsigned int BINS() {return 100;} 61 protected: 62 std::string m_title; 63 int m_limit; 64 double m_Sw; 65 std::vector<double> m_ws; 66 }; 67 68 }} 69 70 #endif