Unable to combine rebdsim output

Issue #145 resolved
Laurie Nevay created an issue

Concerned only with root event output and rebdsim.

After running rebdsim, analysis (root) files are produced that have a different structure from the output files of bdsim - that's ok.

There is currently no way to combine lots of these files into one with correct histogram uncertainties. Currently, rebdsim will combine output file histograms (only in Event Tree).

The analysis/HisogramMerge class is constructed with an instance of BDSOutputROOTEventHistograms but the only part of this class that is used is the acessor for std::vector<TH1D>. I propose we change the signature of HistogramMerge() and HistogramMerge::Add() to take std::vector<TH1> as an argument or a vector of TH1 and TH2.

This class takes the same data as arguments twice - perhaps this could just be a namespaced function instead of a class. Or simply all done in the constructor - otherwise you could add different histograms to the ones it's based on (binning wise etc).

After this, I propose we copy over and adjust robdsimComb so that directories work and it uses the new calculation in HistogramMerge. Or we make rebdsim such that it'll work on the output files, but this may involve more rewriting.

Note, it is impractical to run one rebdsim process across a whole data set. It's much faster to run individual analyses with the same config file and combine later if possible.

The only thing to be careful in the proposed solution is the owernship of histograms - but a new cloned and resetted copy is made so this shouldn't nominally be a problem.

Comments (1)

  1. Laurie Nevay reporter

    hadd from root provides this functionality. All histograms inherit TH1 which has the Add method which is used in hadd.

  2. Log in to comment