Geant4 Cross Reference |
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_histo_p1d 4 #ifndef tools_histo_p1d 5 #define tools_histo_p1d 5 #define tools_histo_p1d 6 6 7 #include "p1" 7 #include "p1" 8 8 9 namespace tools { 9 namespace tools { 10 namespace histo { 10 namespace histo { 11 11 12 class p1d : public p1<double,unsigned int,unsi 12 class p1d : public p1<double,unsigned int,unsigned int,double,double,double> { 13 typedef p1<double,unsigned int,unsigned int, 13 typedef p1<double,unsigned int,unsigned int,double,double,double> parent; 14 public: 14 public: 15 static const std::string& s_class() { 15 static const std::string& s_class() { 16 static const std::string s_v("tools::histo 16 static const std::string s_v("tools::histo::p1d"); 17 return s_v; 17 return s_v; 18 } 18 } 19 const std::string& s_cls() const {return s_c 19 const std::string& s_cls() const {return s_class();} 20 public: 20 public: 21 p1d():parent("",10,0,1){} //for I/O when rea 21 p1d():parent("",10,0,1){} //for I/O when reading. 22 22 23 p1d(const std::string& a_title,unsigned int 23 p1d(const std::string& a_title,unsigned int aXnumber,double aXmin,double aXmax) 24 :parent(a_title,aXnumber,aXmin,aXmax) 24 :parent(a_title,aXnumber,aXmin,aXmax) 25 {} 25 {} 26 26 27 p1d(const std::string& a_title,unsigned int 27 p1d(const std::string& a_title,unsigned int aXnumber,double aXmin,double aXmax,double aVmin,double aVmax) 28 :parent(a_title,aXnumber,aXmin,aXmax,aVmin,a 28 :parent(a_title,aXnumber,aXmin,aXmax,aVmin,aVmax) 29 {} 29 {} 30 30 31 p1d(const std::string& a_title,const std::ve 31 p1d(const std::string& a_title,const std::vector<double>& a_edges) 32 :parent(a_title,a_edges) 32 :parent(a_title,a_edges) 33 {} 33 {} 34 34 35 p1d(const std::string& a_title,const std::ve 35 p1d(const std::string& a_title,const std::vector<double>& a_edges,double aVmin,double aVmax) 36 :parent(a_title,a_edges,aVmin,aVmax) 36 :parent(a_title,a_edges,aVmin,aVmax) 37 {} 37 {} 38 38 39 virtual ~p1d(){} 39 virtual ~p1d(){} 40 public: 40 public: 41 p1d(const p1d& a_from): parent(a_from){} 41 p1d(const p1d& a_from): parent(a_from){} 42 p1d& operator=(const p1d& a_from){ 42 p1d& operator=(const p1d& a_from){ 43 parent::operator=(a_from); 43 parent::operator=(a_from); 44 return *this; 44 return *this; 45 } 45 } 46 46 47 private:static void check_instantiation() {p1d 47 private:static void check_instantiation() {p1d p("",10,0,1);p.gather_bins(5);} 48 }; 48 }; 49 49 50 }} 50 }} 51 51 52 #endif 52 #endif 53 53 54 54 55 55 56 56