<commit_before>#include "RatioComparison.h"

ClassImp(RatioComparison)

//--------------------------------------------------------------------
RatioComparison::RatioComparison()
{ }

//--------------------------------------------------------------------
RatioComparison::~RatioComparison()
{ }

//--------------------------------------------------------------------
void
RatioComparison::MakeCompare(TString FileBase, Int_t NumXBins, Double_t *XBins,
                             TString XLabel, TString YLabel)
{
  DisplayFunc(__func__);

  std::vector<TH1D*> hists;

  for (UInt_t iLine = 0; iLine != fTypes.size(); ++iLine) {
    SetDefaultWeight(fNumeratorCuts[iLine].Data());
    TH1D *tempHist = GetHist(NumXBins, XBins, fTypes[iLine]);
    SetDefaultWeight(fDenominatorCuts[iLine].Data());
    tempHist->Divide(GetHist(NumXBins, XBins, fTypes[iLine]));

    /// @todo Add an option for background subraction for the ratios

    hists.push_back(tempHist);
  }

  BaseCanvas(FileBase, hists, XLabel, YLabel);

  for (UInt_t i0 = 0; i0 != hists.size(); ++i0)
    delete hists[i0];
}

//--------------------------------------------------------------------
void<commit_msg>Leaving files open was causing crash.<commit_after>#include "RatioComparison.h"

ClassImp(RatioComparison)

//--------------------------------------------------------------------
RatioComparison::RatioComparison()
{ }

//--------------------------------------------------------------------
RatioComparison::~RatioComparison()
{ }

//--------------------------------------------------------------------
void
RatioComparison::MakeCompare(TString FileBase, Int_t NumXBins, Double_t *XBins,
                             TString XLabel, TString YLabel)
{
  DisplayFunc(__func__);

  std::vector<TH1D*> hists;

  for (UInt_t iLine = 0; iLine != fTypes.size(); ++iLine) {
    SetDefaultWeight(fNumeratorCuts[iLine].Data());
    TH1D *tempHist = GetHist(NumXBins, XBins, fTypes[iLine]);
    SetDefaultWeight(fDenominatorCuts[iLine].Data());
    tempHist->Divide(GetHist(NumXBins, XBins, fTypes[iLine]));

    /// @todo Add an option for background subraction for the ratios

    hists.push_back(tempHist);
  }

  BaseCanvas(FileBase, hists, XLabel, YLabel);

  for (UInt_t i0 = 0; i0 != hists.size(); ++i0)
    delete hists[i0];

  CloseFiles();
}

//--------------------------------------------------------------------
void
{'fraction_non_alphanumeric': 0.3370974487662066, 'fraction_numerical': 0.006691760769552488, 'mean_word_length': 1.637265711135612, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1860157', 'n_tokens_mistral': 679, 'n_tokens_neox': 659, 'n_words': 127}