NearlinePlotter.cxx
Go to the documentation of this file.
1 // C++ includes
2 #include <iostream>
3 #include <vector>
4 
5 // ROOT includes
6 #include "TH1.h"
7 
8 // NOvASoft includes
11 
12 namespace nl {
13 
14 ///////////////////////////////////////////////////////////////////////////
16 {
17 }
18 
19 ///////////////////////////////////////////////////////////////////////////
21 
22 
23 ///////////////////////////////////////////////////////////////////////////
24 TH1F* NearlinePlotter::Make1DHistogram(const char* title, std::vector<double> data)
25 {
26  // Check for empty data
27  if (data.size() == 0) {
28  std::cout << "WARNING. Plotting empty data." << std::endl;
29  }
30 
31  TH1F* h = new TH1F("", title, this->BinsX(), this->MinX(), this->MaxX());
32 
33  for (double datum : data) {
34  h->Fill(datum);
35  }
36 
37  return h;
38 }
39 
40 } //end namespace nl
const XML_Char const XML_Char * data
Definition: expat.h:268
TH1F * Make1DHistogram(const char *title, std::vector< double > data)
OStream cout
Definition: OStream.cxx:6