Skip to content

Commit

Permalink
Fixes osc param to string precision/exponential format.
Browse files Browse the repository at this point in the history
  • Loading branch information
luketpickering committed Apr 3, 2019
1 parent 8422d68 commit cacae30
Showing 1 changed file with 50 additions and 27 deletions.
77 changes: 50 additions & 27 deletions OscProbConstraints.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
function GetNuName(nu_pdg){
switch(nu_pdg){
case -12: { return "anti-electron"; }
case -14: { return "anti-muon"; }
case -16: { return "anti-tau"; }
case 12: { return "electron"; }
case 14: { return "muon"; }
case 16: { return "tau"; }
function GetNuName(nu_pdg) {
switch (nu_pdg) {
case -12: {
return "anti-electron";
}
case -14: {
return "anti-muon";
}
case -16: {
return "anti-tau";
}
case 12: {
return "electron";
}
case 14: {
return "muon";
}
case 16: {
return "tau";
}
}
}

Expand Down Expand Up @@ -86,17 +98,22 @@ class OscParams {
}
}

GenToolTipHTML(pdg_from,pdg_to,baseline) {
GenToolTipHTML(pdg_from, pdg_to, baseline) {
return [
`<div>From: ${GetNuName(pdg_from)}</div>`,
`<div>To: ${GetNuName(pdg_to)}</div>`,
`<div>Baseline: ${baseline} km</div>`,
`<div>${OscParams.GetLatexName("S2Th12")}: ${this.S2Th12}</div>`,
`<div>${OscParams.GetLatexName("S2Th13")}: ${this.S2Th13}</div>`,
`<div>${OscParams.GetLatexName("S2Th23")}: ${this.S2Th23}</div>`,
`<div>${OscParams.GetLatexName("Dm2_21")}: ${this.Dm2_21}</div>`,
`<div>${OscParams.GetLatexName("Dm2_Atm")}: ${this.Dm2_Atm}</div>`,
`<div>${OscParams.GetLatexName("dcp")}: ${this.dcp}</div>`,
`<div>${OscParams.GetLatexName("S2Th12")}: ${
this.S2Th12.toPrecision(3)}</div>`,
`<div>${OscParams.GetLatexName("S2Th13")}: ${
this.S2Th13.toExponential(3)}</div>`,
`<div>${OscParams.GetLatexName("S2Th23")}: ${
this.S2Th23.toPrecision(3)}</div>`,
`<div>${OscParams.GetLatexName("Dm2_21")}: ${
this.Dm2_21.toExponential(3)}</div>`,
`<div>${OscParams.GetLatexName("Dm2_Atm")}: ${
this.Dm2_Atm.toExponential(3)}</div>`,
`<div>${OscParams.GetLatexName("dcp")}: ${this.dcp.toPrecision(3)}</div>`,
].join("");
}

Expand All @@ -107,43 +124,49 @@ class OscParams {
this.S2Th12_row.append("th")
.attr("scope", "row")
.text(OscParams.GetLatexName("S2Th12"));
this.S2Th12_tblval =
this.S2Th12_row.append("tr").attr("scope", "row").text(this.S2Th12);
this.S2Th12_tblval = this.S2Th12_row.append("tr")
.attr("scope", "row")
.text(this.S2Th12.toPrecision(3));

this.S2Th13_row = tbl_body.append("tr");
this.S2Th13_row.append("th")
.attr("scope", "row")
.text(OscParams.GetLatexName("S2Th13"));
this.S2Th13_tblval =
this.S2Th13_row.append("tr").attr("scope", "row").text(this.S2Th13);
this.S2Th13_tblval = this.S2Th13_row.append("tr")
.attr("scope", "row")
.text(this.S2Th13.toExponential(3));

this.S2Th23_row = tbl_body.append("tr");
this.S2Th23_row.append("th")
.attr("scope", "row")
.text(OscParams.GetLatexName("S2Th23"));
this.S2Th23_tblval =
this.S2Th23_row.append("tr").attr("scope", "row").text(this.S2Th23);
this.S2Th23_tblval = this.S2Th23_row.append("tr")
.attr("scope", "row")
.text(this.S2Th23.toPrecision(3));

this.Dm2_Atm_row = tbl_body.append("tr");
this.Dm2_Atm_row.append("th")
.attr("scope", "row")
.text(OscParams.GetLatexName("Dm2_Atm"));
this.Dm2_Atm_tblval =
this.Dm2_Atm_row.append("tr").attr("scope", "row").text(this.Dm2_Atm);
this.Dm2_Atm_tblval = this.Dm2_Atm_row.append("tr")
.attr("scope", "row")
.text(this.Dm2_Atm.toExponential(3));

this.Dm2_21_row = tbl_body.append("tr");
this.Dm2_21_row.append("th")
.attr("scope", "row")
.text(OscParams.GetLatexName("Dm2_21"));
this.Dm2_21_tblval =
this.Dm2_21_row.append("tr").attr("scope", "row").text(this.Dm2_21);
this.Dm2_21_tblval = this.Dm2_21_row.append("tr")
.attr("scope", "row")
.text(this.Dm2_21.toExponential(3));

this.dcp_row = tbl_body.append("tr");
this.dcp_row.append("th")
.attr("scope", "row")
.text(OscParams.GetLatexName("dcp"));
this.dcp_tblval =
this.dcp_row.append("tr").attr("scope", "row").text(this.dcp);
this.dcp_tblval = this.dcp_row.append("tr")
.attr("scope", "row")
.text(this.dcp.toPrecision(3));

this.tbl_el = tbl_body.node();
}
Expand Down

0 comments on commit cacae30

Please sign in to comment.