g4tools  5.4.0
histos
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_histo_histos
5 #define tools_histo_histos
6 
7 #include "h1d"
8 #include "h2d"
9 #include "h3d"
10 #include "p1d"
11 #include "p2d"
12 
13 #include "../forit"
14 
15 namespace tools {
16 namespace histo {
17 
18 inline void delete_histos(std::vector< std::pair<std::string,void*> >& a_hists) {
19  typedef std::pair<std::string,void*> class_pointer;
20 
21  tools_vforit(class_pointer,a_hists,it) {
22  const std::string& scls = (*it).first;
23  if(scls==h1d::s_class()) {
24  h1d* h = (h1d*)(*it).second;
25  delete h;
26 
27  } else if(scls==h2d::s_class()) {
28  h2d* h = (h2d*)(*it).second;
29  delete h;
30 
31  } else if(scls==h3d::s_class()) {
32  h3d* h = (h3d*)(*it).second;
33  delete h;
34 
35  } else if(scls==p1d::s_class()) {
36  p1d* h = (p1d*)(*it).second;
37  delete h;
38 
39  } else if(scls==p2d::s_class()) {
40  p2d* h = (p2d*)(*it).second;
41  delete h;
42  }
43  }
44  a_hists.clear();
45 }
46 
47 }}
48 
49 #endif
h2d
tools::histo::p1d
Definition: p1d:12
tools::histo::h3d::s_class
static const std::string & s_class()
Definition: h3d:15
tools::histo::h1d
Definition: h1d:14
tools::histo::delete_histos
void delete_histos(std::vector< std::pair< std::string, void * > > &a_hists)
Definition: histos:18
tools::histo::p1d::s_class
static const std::string & s_class()
Definition: p1d:15
tools::histo::h2d::s_class
static const std::string & s_class()
Definition: h2d:15
p1d
tools::histo::p2d
Definition: p2d:12
tools::histo::h2d
Definition: h2d:12
tools::histo::p2d::s_class
static const std::string & s_class()
Definition: p2d:15
h1d
h3d
tools_vforit
#define tools_vforit(a__T, a__v, a__it)
Definition: forit:13
tools::histo::h1d::s_class
static const std::string & s_class()
Definition: h1d:17
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
p2d
tools::histo::h3d
Definition: h3d:12