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

more safety checks

parent ce0dd3f5
......@@ -71,31 +71,35 @@ int main() {
if (indP != -1 && indD != -1) {
QEC2p_calc = 1; QEC2p_err_calc = 1;
a->GetEntry(indP);
if (QEC.QEC_est == 1) {
QEC2p_est = 1; QEC2p_err_est = 1;
}
QECP = QEC.QEC;
QECP_err = QEC_err.QEC_err;
a->GetEntry(indD);
if (S2p.S2p_calc == 0) {
if (QEC.QEC_calc == 0) {
QEC2p_NAN();
} else {
if (S2p.S2p_est == 1) {
if (QEC.QEC_est == 1) {
QEC2p_est = 1; QEC2p_err_est = 1;
} else {
QEC2p_est = 0; QEC2p_err_est = 0;
}
S2pD = S2p.S2p;
S2pD_err = S2p_err.S2p_err;
QEC2p = QECP - S2pD;
QEC2p_err = Sqrt(QECP_err*QECP_err + S2pD_err*S2pD_err);
QECP = QEC.QEC;
QECP_err = QEC_err.QEC_err;
a->GetEntry(indD);
if (S2p.S2p_calc == 0) {
QEC2p_NAN();
} else {
if (S2p.S2p_est == 1) {
QEC2p_est = 1; QEC2p_err_est = 1;
} else {
QEC2p_est = 0; QEC2p_err_est = 0;
}
S2pD = S2p.S2p;
S2pD_err = S2p_err.S2p_err;
QEC2p = QECP - S2pD;
QEC2p_err = Sqrt(QECP_err*QECP_err + S2pD_err*S2pD_err);
qec2p.QEC2p = QEC2p;
qec2p.QEC2p_est = QEC2p_est;
qec2p.QEC2p_calc = QEC2p_calc;
qec2p_err.QEC2p_err = QEC2p_err;
qec2p_err.QEC2p_err_est = QEC2p_err_est;
qec2p_err.QEC2p_err_calc = QEC2p_err_calc;
qec2p.QEC2p = QEC2p;
qec2p.QEC2p_est = QEC2p_est;
qec2p.QEC2p_calc = QEC2p_calc;
qec2p_err.QEC2p_err = QEC2p_err;
qec2p_err.QEC2p_err_est = QEC2p_err_est;
qec2p_err.QEC2p_err_calc = QEC2p_err_calc;
}
}
} else if (indP != -1) {
QEC2p_NAN();
......
......@@ -80,31 +80,35 @@ int main() {
if (indP != -1 && indD != -1) {
QECp_calc = 1; QECp_err_calc = 1;
a->GetEntry(indP);
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 (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 (Sp.Sp_est == 1) {
if (QEC.QEC_est == 1) {
QECp_est = 1; QECp_err_est = 1;
} else {
QECp_est = 0; QECp_err_est = 0;
}
SpD = Sp.Sp;
SpD_err = Sp_err.Sp_err;
QECp = QECP - SpD;
QECp_err = Sqrt(QECP_err*QECP_err + SpD_err*SpD_err);
QECP = QEC.QEC;
QECP_err = QEC_err.QEC_err;
a->GetEntry(indD);
if (Sp.Sp_calc == 0) { // same goes for Sp
QECp_NAN();
} else {
if (Sp.Sp_est == 1) {
QECp_est = 1; QECp_err_est = 1;
} else {
QECp_est = 0; QECp_err_est = 0;
}
SpD = Sp.Sp;
SpD_err = Sp_err.Sp_err;
QECp = QECP - SpD;
QECp_err = Sqrt(QECP_err*QECP_err + SpD_err*SpD_err);
qecp.QECp = QECp;
qecp.QECp_est = QECp_est;
qecp.QECp_calc = QECp_calc;
qecp_err.QECp_err = QECp_err;
qecp_err.QECp_err_est = QECp_err_est;
qecp_err.QECp_err_calc = QECp_err_calc;
qecp.QECp = QECp;
qecp.QECp_est = QECp_est;
qecp.QECp_calc = QECp_calc;
qecp_err.QECp_err = QECp_err;
qecp_err.QECp_err_est = QECp_err_est;
qecp_err.QECp_err_calc = QECp_err_calc;
}
}
} else if (indP != -1) {
QECp_NAN();
......
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