Commit 0162b708 authored by Erik Asbjørn Mikkelsen Jensen's avatar Erik Asbjørn Mikkelsen Jensen
Browse files

more safety checks

parent ce0dd3f5
......@@ -71,6 +71,9 @@ int main() {
if (indP != -1 && indD != -1) {
QEC2p_calc = 1; QEC2p_err_calc = 1;
a->GetEntry(indP);
if (QEC.QEC_calc == 0) {
QEC2p_NAN();
} else {
if (QEC.QEC_est == 1) {
QEC2p_est = 1; QEC2p_err_est = 1;
}
......@@ -97,6 +100,7 @@ int main() {
qec2p_err.QEC2p_err_est = QEC2p_err_est;
qec2p_err.QEC2p_err_calc = QEC2p_err_calc;
}
}
} else if (indP != -1) {
QEC2p_NAN();
} else {
......
......@@ -80,13 +80,16 @@ int main() {
if (indP != -1 && indD != -1) {
QECp_calc = 1; QECp_err_calc = 1;
a->GetEntry(indP);
if (QEC.QEC_calc == 0) { // this is new compared to 'expand-nuchart-QEC.cxx': QEC might not be defined, so we need to check for this
QECp_NAN();
} else {
if (QEC.QEC_est == 1) {
QECp_est = 1; QECp_err_est = 1;
}
QECP = QEC.QEC;
QECP_err = QEC_err.QEC_err;
a->GetEntry(indD);
if (Sp.Sp_calc == 0) { // this is new compared to 'expand-nuchart-QEC.cxx': Sp might not be defined, so we need to check for this
if (Sp.Sp_calc == 0) { // same goes for Sp
QECp_NAN();
} else {
if (Sp.Sp_est == 1) {
......@@ -106,6 +109,7 @@ int main() {
qecp_err.QECp_err_est = QECp_err_est;
qecp_err.QECp_err_calc = QECp_err_calc;
}
}
} else if (indP != -1) {
QECp_NAN();
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment