npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
fillHistoFromText.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_FILLHISTOFROMTEXT_HH_
2 #define NPSTAT_FILLHISTOFROMTEXT_HH_
3 
4 /*!
5 // \file fillHistoFromText.hh
6 //
7 // \brief A utility for filling histograms from data contained in text files
8 //
9 // Author: I. Volobouev
10 //
11 // November 2014
12 */
13 
14 #include <iostream>
15 
16 namespace npstat {
17  /**
18  // Fill a histogram with data from a text file. The text file must
19  // contain columns of numbers. The array "columnsToUse" defines which
20  // columns to histogram. The dimensionality of this array is assumed
21  // to be equal to the dimensionality of the histogram.
22  //
23  // Empty lines, lines which consist of pure white space, and lines
24  // which start with an arbitrary amount of white space (including
25  // none) followed by '#' are ignored (considered comments).
26  //
27  // "true" is returned on success, "false" on failure.
28  */
29  template <class Histo>
30  bool fillHistoFromText(std::istream& asciiStream,
31  Histo* histo, const unsigned* columnsToUse,
32  bool hasCommasBetweenValues=false);
33 }
34 
35 #include "npstat/stat/fillHistoFromText.icc"
36 
37 #endif // NPSTAT_FILLHISTOFROMTEXT_HH_
Definition: AbsArrayProjector.hh:14
bool fillHistoFromText(std::istream &asciiStream, Histo *histo, const unsigned *columnsToUse, bool hasCommasBetweenValues=false)