diff --git a/data/BNL/BNL_Data_PRD23_2499.root b/data/BNL/BNL_Data_PRD23_2499.root
index b666e3a..101e558 100755
Binary files a/data/BNL/BNL_Data_PRD23_2499.root and b/data/BNL/BNL_Data_PRD23_2499.root differ
diff --git a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
index b6bc1de..53b5b17 100755
--- a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
@@ -1,160 +1,160 @@
// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
/*******************************************************************************
* This file is part of NUISANCE.
*
* NUISANCE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NUISANCE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NUISANCE. If not, see .
*******************************************************************************/
#include "ANL_CCQE_Evt_1DQ2_nu.h"
//********************************************************************
ANL_CCQE_Evt_1DQ2_nu::ANL_CCQE_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CCQ2 Event Rate 1DQ2 nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("Q^{2}_{CCQE} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
if (fSettings.Found("name", "PRL31")) {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRL31_844.root;ANL_1DQ2_Data" );
fSettings.SetEnuRange(0.0, 3.0);
} else if (fSettings.Found("name", "PRD16")) {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRD16_3103.root;ANL_1DQ2_Data" );
} else {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_Data_PRD26_537.root;ANL_1DQ2_Data" );
}
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
if (applyQ2correction) {
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/ANL/ANL_CCQE_Data_PRL31_844.root");
- fSettings.SetS("q2correction_hist", "ANL_XSec_1DQ2_Correction");
+ fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = 1.0;
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void ANL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent * event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Fill histogram with reconstructed Q2 Distribution
fXVar = -999.9;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
GetQ2Box()->fQ2 = fXVar;
return;
};
//********************************************************************
bool ANL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent * event) {
//********************************************************************
if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
// Q2 cut
if (GetQ2Box()->fQ2 <= 0) return false;
return true;
};
//********************************************************************
void ANL_CCQE_Evt_1DQ2_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void ANL_CCQE_Evt_1DQ2_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
if (fMCHist_NoCorr->Integral()) {
fMCHist_NoCorr->Scale(fDataHist->Integral() / fMCHist_NoCorr->Integral());
}
}
}
diff --git a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
index 563487c..aca2998 100644
--- a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
@@ -1,154 +1,152 @@
// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
/*******************************************************************************
* This file is part of NUISANCE.
*
* NUISANCE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NUISANCE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NUISANCE. If not, see .
*******************************************************************************/
#include "ANL_CCQE_XSec_1DEnu_nu.h"
//********************************************************************
ANL_CCQE_XSec_1DEnu_nu::ANL_CCQE_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "ANL CCQ2 XSec 1DEnu nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(#E_{#nu}) (cm^{2}/neutron)");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("ANL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
// Hadronic Cut Info
if (fSettings.Found("name", "PRL31")) {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRL31_844.root;ANL_1DEnu_Data" );
fSettings.SetEnuRange(0.0, 3.0);
} else {
fSettings.SetDataInput( FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRD16_3103.root;ANL_1DEnu_fluxtuned_Data" );
}
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
- if (applyQ2correction) {
- fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/ANL/ANL_CCQE_Data_PRL31_844.root");
- fSettings.SetS("q2correction_hist", "ANL_XSec_1DQ2_Correction");
- }
+ fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/ANL/ANL_CCQE_Data_PRL31_844.root");
+ fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = (GetEventHistogram()->Integral("width") * 2.0 / 1.0 * 1E-38 / (fNEvents + 0.));
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void ANL_CCQE_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Get Q2
double q2qe = 0.0;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
q2qe = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
Enu_rec = FitUtils::EnuQErec(Pmu, cos(ThetaMu), 0., true);
fXVar = Enu_rec;
GetQ2Box()->fQ2 = q2qe;
return;
};
//********************************************************************
bool ANL_CCQE_XSec_1DEnu_nu::isSignal(FitEvent *event) {
//********************************************************************
return SignalDef::isCCQE(event, 14, EnuMin, EnuMax);
};
//********************************************************************
void ANL_CCQE_XSec_1DEnu_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void ANL_CCQE_XSec_1DEnu_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
PlotUtils::FluxUnfoldedScaling(fMCHist_NoCorr, GetFluxHistogram(),
GetEventHistogram(), fScaleFactor,
fNEvents);
}
}
diff --git a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
index 9dfb637..6e91ddb 100755
--- a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
@@ -1,148 +1,148 @@
// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
/*******************************************************************************
* This file is part of NUISANCE.
*
* NUISANCE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NUISANCE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NUISANCE. If not, see .
*******************************************************************************/
#include "BNL_CCQE_Evt_1DQ2_nu.h"
//********************************************************************
BNL_CCQE_Evt_1DQ2_nu::BNL_CCQE_Evt_1DQ2_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL_CCQE_Evt_1DQ2_nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("Q^{2}_{CCQE} (GeV^{2})");
fSettings.SetYTitle("Number of events");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "BNL/BNL_Data_PRD23_2499.root;BNL_1DQ2_Data");
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
if (applyQ2correction) {
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRL31_844.root");
- fSettings.SetS("q2correction_hist", "ANL_XSec_1DQ2_Correction");
+ fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = 1.0;
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetPoissonErrors();
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void BNL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent * event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Fill histogram with reconstructed Q2 Distribution
fXVar = -999.9;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
GetQ2Box()->fQ2 = fXVar;
return;
};
//********************************************************************
bool BNL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent * event) {
//********************************************************************
if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
// Q2 cut
if (GetQ2Box()->fQ2 <= 0) return false;
return true;
};
//********************************************************************
void BNL_CCQE_Evt_1DQ2_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void BNL_CCQE_Evt_1DQ2_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
if (fMCHist_NoCorr->Integral()) {
fMCHist_NoCorr->Scale(fDataHist->Integral() / fMCHist_NoCorr->Integral());
}
}
}
diff --git a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
index f337515..fad5e99 100644
--- a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
@@ -1,147 +1,147 @@
// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
/*******************************************************************************
* This file is part of NUISANCE.
*
* NUISANCE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NUISANCE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NUISANCE. If not, see .
*******************************************************************************/
#include "BNL_CCQE_XSec_1DEnu_nu.h"
//********************************************************************
BNL_CCQE_XSec_1DEnu_nu::BNL_CCQE_XSec_1DEnu_nu(nuiskey samplekey) {
//********************************************************************
// Sample overview ---------------------------------------------------
std::string descrip = "BNL CCQ2 XSec 1DEnu nu sample. \n" \
"Target: D2 \n" \
"Flux: \n" \
"Signal: \n";
// Setup common settings
fSettings = LoadSampleSettings(samplekey);
fSettings.SetDescription(descrip);
fSettings.SetXTitle("E_{#nu} (GeV)");
fSettings.SetYTitle("#sigma(#E_{#nu}) (cm^{2}/neutron)");
fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
fSettings.SetEnuRange(0.0, 6.0);
fSettings.DefineAllowedTargets("D,H");
// plot information
fSettings.SetTitle("BNL #nu_mu CCQE");
fSettings.DefineAllowedSpecies("numu");
fSettings.SetDataInput( FitPar::GetDataBase() + "BNL/BNL_Data_PRD23_2499.root;BNL_1DEnu_Data");
// is Q2 Correction applied
applyQ2correction = fSettings.Found("type", "Q2CORR");
if (applyQ2correction) {
fSettings.SetS("q2correction_file", FitPar::GetDataBase() + "/ANL/ANL_CCQE_Data_PRL31_844.root");
- fSettings.SetS("q2correction_hist", "ANL_XSec_1DQ2_Correction");
+ fSettings.SetS("q2correction_hist", "ANL_1DQ2_Correction");
}
FinaliseSampleSettings();
// Scaling Setup ---------------------------------------------------
// ScaleFactor for shape
fScaleFactor = (GetEventHistogram()->Integral("width") * (2.0 / 1.0) * 1E-38 / (fNEvents + 0.));
// Plot Setup -------------------------------------------------------
SetDataFromRootFile( fSettings.GetDataInput() );
SetCovarFromDiagonal();
// Correction Histogram
if (applyQ2correction) {
// Correction Hist
CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
fSettings.GetS("q2correction_hist") );
SetAutoProcessTH1(CorrectionHist, kCMD_Write);
// Make uncorrected MC hist
fMCHist_NoCorr = (TH1D*) fDataHist->Clone();
fMCHist_NoCorr->Reset();
fMCHist_NoCorr->SetNameTitle( (fName + "_NOCORR").c_str(),
(fName + "_NOCORR").c_str());
SetAutoProcessTH1(fMCHist_NoCorr);
}
// Final setup ---------------------------------------------------
FinaliseMeasurement();
}
//********************************************************************
void BNL_CCQE_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
//********************************************************************
if (event->NumFSParticle(13) == 0)
return;
// Get Q2
double q2qe = 0.0;
TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
q2qe = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
Enu_rec = FitUtils::EnuQErec(Pmu, cos(ThetaMu), 0., true);
fXVar = Enu_rec;
GetQ2Box()->fQ2 = q2qe;
return;
};
//********************************************************************
bool BNL_CCQE_XSec_1DEnu_nu::isSignal(FitEvent *event) {
//********************************************************************
return SignalDef::isCCQE(event, 14, EnuMin, EnuMax);
};
//********************************************************************
void BNL_CCQE_XSec_1DEnu_nu::FillHistograms() {
//********************************************************************
if (applyQ2correction) {
fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
}
Measurement1D::FillHistograms();
}
//********************************************************************
void BNL_CCQE_XSec_1DEnu_nu::ScaleEvents() {
//********************************************************************
Measurement1D::ScaleEvents();
// Flux unfold our extra histogram
if (applyQ2correction) {
PlotUtils::FluxUnfoldedScaling(fMCHist_NoCorr, GetFluxHistogram(),
GetEventHistogram(), fScaleFactor,
fNEvents);
}
}