<commit_before>#include "Lxy_weight_calculator.h"

using namespace std;

// Defien the constants for the Lxy1 and Lxy2 binning
const int n_bins = 30; // 100 bins
const double lxy_min = 0.0; // lxy minimum in meters
const double lxy_max = 5.0; // lxy maximum in meters


//
// Calcualte the weight histogram
// Note: In Run1 this was done during the actual running on MC that generates this ntuple. But by doing it here
//       we better keep cuts consistent by keeping them close to each other.
// Note: this is not weighted, but the beta shape is (so we don't do weights twice).
Lxy_weight_calculator1D::Lxy_weight_calculator1D(const muon_tree_processor &reader)
{
	// Events where they were generated and where they passed the analysis selection
	unique_ptr<TH1D> generated(new TH1D("generated", "generated", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedA(new TH1D("passedA", "passedA", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedB(new TH1D("passedB", "passedB", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedC(new TH1D("passedC", "passedC", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedD(new TH1D("passedD", "passedD", n_bins, lxy_min, lxy_max));
	generated->Sumw2();
	passedA->Sumw2();
	passedB->Sumw2();
	passedC->Sumw2();
	passedD->Sumw2();

	reader.process_all_entries([&generated, &passedA, &passedB, &passedC, &passedD](const muon_tree_processor::eventInfo &entry) {
		generated->Fill(entry.vpi1_Lxy /1000.0, entry.weight);
		generated->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		if (entry.RegionA) {
			passedA->Fill(entry.vpi1_Lxy / 1000.0, entry.weight);
			passedA->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		}
		if (entry.RegionB) {
			passedB->Fill(entry.vpi1_Lxy / 1000.0, entry.weight);
			passedB->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		}
		if (entry.RegionC) {
			passedC->Fill(entry.vpi1_Lxy / 1000.0, entry.weight);
			passedC->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		}<commit_msg>Syntax updates<commit_after>#include "Lxy_weight_calculator.h"

using namespace std;

// Defien the constants for the Lxy1 and Lxy2 binning
const int n_bins = 30; // 100 bins
const double lxy_min = 0.0; // lxy minimum in meters
const double lxy_max = 5.0; // lxy maximum in meters


//
// Calcualte the weight histogram
// Note: In Run1 this was done during the actual running on MC that generates this ntuple. But by doing it here
//       we better keep cuts consistent by keeping them close to each other.
// Note: this is not weighted, but the beta shape is (so we don't do weights twice).
Lxy_weight_calculator1D::Lxy_weight_calculator1D(const muon_tree_processor &reader)
{
	// Events where they were generated and where they passed the analysis selection
	unique_ptr<TH1D> generated(new TH1D("generated", "generated", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedA(new TH1D("passedA", "passedA", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedB(new TH1D("passedB", "passedB", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedC(new TH1D("passedC", "passedC", n_bins, lxy_min, lxy_max));
	unique_ptr<TH1D> passedD(new TH1D("passedD", "passedD", n_bins, lxy_min, lxy_max));
	generated->Sumw2();
	passedA->Sumw2();
	passedB->Sumw2();
	passedC->Sumw2();
	passedD->Sumw2();

	reader.process_all_entries([&generated, &passedA, &passedB, &passedC, &passedD](const muon_tree_processor::eventInfo &entry) {
		generated->Fill(entry.vpi1_Lxy / 1000.0, entry.weight);
		generated->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		if (entry.RegionA) {
			passedA->Fill(entry.vpi1_Lxy / 1000.0, entry.weight);
			passedA->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		}
		if (entry.RegionB) {
			passedB->Fill(entry.vpi1_Lxy / 1000.0, entry.weight);
			passedB->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		}
		if (entry.RegionC) {
			passedC->Fill(entry.vpi1_Lxy / 1000.0, entry.weight);
			passedC->Fill(entry.vpi2_Lxy / 1000.0, entry.weight);
		}
{'fraction_non_alphanumeric': 0.13548057259713703, 'fraction_numerical': 0.03936605316973415, 'mean_word_length': 4.729136163982431, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 39, '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': '4615699', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1454, 'n_words': 363}