The Combiner class reads FluxReader output files and can combine specific subsets of Spectra histograms. It can add together the histograms that share a common histogram and applied cross section, creating plots for distributions split by neutrino flavor and summed over all parents, distributions split by parent and summed over all flavors, and distributions over all neutrinos from all parents. It will not combine the histograms from SpectraCorrDet, the Spectra that calculates a variable at one detector on the x axis, and the same variable at a different detector on the y axis. This type of Spectra actual combines its own distributions automatically.

Combiner takes as input a file produced by FluxReader. It opens this file and creates a list of the Spectra inside the file, excluding any SpectraCorrDet. For each Spectra that it finds, it creates and sets up a Parameters object that corresponds to what was initially used to create the Spectra. This allows for easy access to the relevant histograms for combining.


The Combiner constructor takes a single argument, a std::string which is a path to a FluxReader output file. To emphasize, this file should NOT be a Dk2Nu file, or other flux file, rather, it should be the output from an actual FluxReader object.

  // This file is the same as shown in the FluxReader page demonstrating use of the FluxReader::ReadFlux function
  Combiner* c = new Combiner("/nova/ana/users/gkafka/FluxReader/output.root");

General Use

The user can use three different functions, CombineNuFlavs, CombineParents, and CombineAll, each which takes no arguments. These functions combine a specific subset of histograms, and writes out the results in the same directory that the uncombined histograms came from. CombineNuFlavs combines all histograms with a common parent species, applied cross section, and detector location. This results in a distribution, or distributions, of all neutrinos from a particular ancestor species at a given detector location with a particular cross section applied. Likewise, CombineParents produces distributions of a particular neutrino flavor from all parent species at a given detector location with a particular cross section applied. Finally, CombineAll calls both CombineNuFlavs and CombineParents, and combines the results from the call to CombineParents. This results in distributions of all neutrinos at a given detector location with a particular cross section applied. If the user plans on using CombineAll, it is unnecessary to call either CombineNuFlavs or CombineParents since CombineAll will do this anyway. The syntax for using one of the functions is shown below. To use any of the other functions, simply swap out the function name.