From: hadaq Date: Mon, 5 May 2025 16:04:45 +0000 (+0200) Subject: update hadesroot / QA files X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;p=hadesdaq.git update hadesroot / QA files --- diff --git a/hadesroot/EMC.htm b/hadesroot/EMC.htm index 36f65dd..b234580 100644 --- a/hadesroot/EMC.htm +++ b/hadesroot/EMC.htm @@ -3,6 +3,8 @@ + + QA - EMC @@ -572,12 +519,13 @@ let helptext =
- - - - - - + + + + + + +
@@ -587,32 +535,14 @@ let helptext =
-
+
-
+ +
@@ -638,15 +568,33 @@ let helptext =
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -671,4 +619,12 @@ let helptext =
+
+
+
+
+
+
+
+
diff --git a/hadesroot/Main.htm b/hadesroot/Main.htm index 1fe21a4..3bba630 100644 --- a/hadesroot/Main.htm +++ b/hadesroot/Main.htm @@ -3,6 +3,8 @@ + + QA - Main @@ -108,6 +129,7 @@
+
@@ -119,4 +141,10 @@
+
+
+
+
+
+
diff --git a/hadesroot/Physics.htm b/hadesroot/Physics.htm index c387c49..0143bca 100644 --- a/hadesroot/Physics.htm +++ b/hadesroot/Physics.htm @@ -3,6 +3,8 @@ + + QA - Physics - - - - - -
- - - -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- diff --git a/hadesroot/WALL.htm b/hadesroot/WALL.htm index 4994bfc..cb4d42e 100644 --- a/hadesroot/WALL.htm +++ b/hadesroot/WALL.htm @@ -3,6 +3,8 @@ + + QA - WALL diff --git a/hadesroot/files/TemplateTH1.json b/hadesroot/files/TemplateTH1.json new file mode 100644 index 0000000..a9c18cd --- /dev/null +++ b/hadesroot/files/TemplateTH1.json @@ -0,0 +1,127 @@ +{ + "_typename": "TH1F", + "fUniqueID": 0, + "fBits": 520, + "fName": "REPLACEME", + "fTitle": "REPLACEME", + "fLineColor": 2, + "fLineStyle": 1, + "fLineWidth": 1, + "fFillColor": 0, + "fFillStyle": 1001, + "fMarkerColor": 1, + "fMarkerStyle": 1, + "fMarkerSize": 1, + "fNcells": -31415, + "fXaxis": { + "_typename": "TAxis", + "fUniqueID": 0, + "fBits": 0, + "fName": "xaxis", + "fTitle": "REPLACEME", + "fNdivisions": 510, + "fAxisColor": 1, + "fLabelColor": 1, + "fLabelFont": 42, + "fLabelOffset": 0.005, + "fLabelSize": 0.035, + "fTickLength": 0.03, + "fTitleOffset": 1, + "fTitleSize": 0.035, + "fTitleColor": 1, + "fTitleFont": 42, + "fNbins": -31415, + "fXmin": 0, + "fXmax": -31415, + "fXbins": [], + "fFirst": 0, + "fLast": 0, + "fBits2": 0, + "fTimeDisplay": false, + "fTimeFormat": "", + "fLabels": null, + "fModLabs": null + }, + "fYaxis": { + "_typename": "TAxis", + "fUniqueID": 0, + "fBits": 0, + "fName": "yaxis", + "fTitle": "REPLACEME", + "fNdivisions": 510, + "fAxisColor": 1, + "fLabelColor": 1, + "fLabelFont": 42, + "fLabelOffset": 0.005, + "fLabelSize": 0.035, + "fTickLength": 0.03, + "fTitleOffset": 0, + "fTitleSize": 0.035, + "fTitleColor": 1, + "fTitleFont": 42, + "fNbins": 1, + "fXmin": 0, + "fXmax": 1, + "fXbins": [], + "fFirst": 0, + "fLast": 0, + "fBits2": 0, + "fTimeDisplay": false, + "fTimeFormat": "", + "fLabels": null, + "fModLabs": null + }, + "fZaxis": { + "_typename": "TAxis", + "fUniqueID": 0, + "fBits": 0, + "fName": "zaxis", + "fTitle": "", + "fNdivisions": 510, + "fAxisColor": 1, + "fLabelColor": 1, + "fLabelFont": 42, + "fLabelOffset": 0.005, + "fLabelSize": 0.035, + "fTickLength": 0.03, + "fTitleOffset": 1, + "fTitleSize": 0.035, + "fTitleColor": 1, + "fTitleFont": 42, + "fNbins": 1, + "fXmin": 0, + "fXmax": 1, + "fXbins": [], + "fFirst": 0, + "fLast": 0, + "fBits2": 0, + "fTimeDisplay": false, + "fTimeFormat": "", + "fLabels": null, + "fModLabs": null + }, + "fBarOffset": 0, + "fBarWidth": 1000, + "fEntries": 0, + "fTsumw": 0, + "fTsumw2": 0, + "fTsumwx": 0, + "fTsumwx2": 0, + "fMaximum": -1111, + "fMinimum": -1111, + "fNormFactor": 0, + "fContour": [], + "fSumw2": [], + "fOption": "hist", + "fFunctions": { + "_typename": "TList", + "name": "TList", + "arr": [], + "opt": [] + }, + "fBufferSize": 0, + "fBuffer": [], + "fBinStatErrOpt": 0, + "fStatOverflows": 2, + "fArray": [] +} diff --git a/hadesroot/files/TemplateTH2.json b/hadesroot/files/TemplateTH2.json new file mode 100644 index 0000000..73ae6c6 --- /dev/null +++ b/hadesroot/files/TemplateTH2.json @@ -0,0 +1,131 @@ +{ + "_typename": "TH2F", + "fUniqueID": 0, + "fBits": 520, + "fName": "REPLACEME", + "fTitle": "REPLACEME", + "fLineColor": 2, + "fLineStyle": 1, + "fLineWidth": 1, + "fFillColor": 0, + "fFillStyle": 1001, + "fMarkerColor": 1, + "fMarkerStyle": 1, + "fMarkerSize": 1, + "fNcells": -31415, + "fXaxis": { + "_typename": "TAxis", + "fUniqueID": 0, + "fBits": 0, + "fName": "xaxis", + "fTitle": "", + "fNdivisions": 510, + "fAxisColor": 1, + "fLabelColor": 1, + "fLabelFont": 42, + "fLabelOffset": 0.005, + "fLabelSize": 0.05, + "fTickLength": 0.03, + "fTitleOffset": 1.15, + "fTitleSize": 0.035, + "fTitleColor": 1, + "fTitleFont": 42, + "fNbins": -31415, + "fXmin": -31415, + "fXmax": -31415, + "fXbins": [], + "fFirst": 0, + "fLast": 0, + "fBits2": 0, + "fTimeDisplay": false, + "fTimeFormat": "", + "fLabels": null, + "fModLabs": null + }, + "fYaxis": { + "_typename": "TAxis", + "fUniqueID": 0, + "fBits": 0, + "fName": "yaxis", + "fTitle": "mbo", + "fNdivisions": 510, + "fAxisColor": 1, + "fLabelColor": 1, + "fLabelFont": 42, + "fLabelOffset": 0.005, + "fLabelSize": 0.035, + "fTickLength": 0.03, + "fTitleOffset": 0, + "fTitleSize": 0.035, + "fTitleColor": 1, + "fTitleFont": 42, + "fNbins": -31415, + "fXmin": -31415, + "fXmax": -31415, + "fXbins": [], + "fFirst": 0, + "fLast": 0, + "fBits2": 0, + "fTimeDisplay": false, + "fTimeFormat": "", + "fLabels": null, + "fModLabs": null + }, + "fZaxis": { + "_typename": "TAxis", + "fUniqueID": 0, + "fBits": 0, + "fName": "zaxis", + "fTitle": "REPLACEME", + "fNdivisions": 510, + "fAxisColor": 1, + "fLabelColor": 1, + "fLabelFont": 42, + "fLabelOffset": 0.005, + "fLabelSize": 0.035, + "fTickLength": 0.03, + "fTitleOffset": 1, + "fTitleSize": 0.035, + "fTitleColor": 1, + "fTitleFont": 42, + "fNbins": 1, + "fXmin": 0, + "fXmax": 1, + "fXbins": [], + "fFirst": 0, + "fLast": 0, + "fBits2": 0, + "fTimeDisplay": false, + "fTimeFormat": "", + "fLabels": null, + "fModLabs": null + }, + "fBarOffset": 0, + "fBarWidth": 1000, + "fEntries": 0, + "fTsumw": 0, + "fTsumw2": 0, + "fTsumwx": 0, + "fTsumwx2": 0, + "fMaximum": -1111, + "fMinimum": -1111, + "fNormFactor": 0, + "fContour": [], + "fSumw2": [], + "fOption": "colz", + "fFunctions": { + "_typename": "TList", + "name": "TList", + "arr": [], + "opt": [] + }, + "fBufferSize": 0, + "fBuffer": [], + "fBinStatErrOpt": 0, + "fStatOverflows": 2, + "fScalefactor": 1, + "fTsumwy": 0, + "fTsumwy2": 0, + "fTsumwxy": 0, + "fArray": [] +} diff --git a/hadesroot/files/functions.mjs b/hadesroot/files/functions.mjs index 74e738f..d567199 100644 --- a/hadesroot/files/functions.mjs +++ b/hadesroot/files/functions.mjs @@ -1,16 +1,16 @@ import * as root from '/jsroot/modules/main.mjs'; -import * as colors from '/jsroot/modules/base/colors.mjs'; let first_call = {}; -export function initUpdate(histnames, histoptions, helptext, globalSettings) { +export async function initUpdate(histnames, histoptions, helptext, globalSettings) { for (var t = 0; t < histnames.length; t++) { first_call[t] = {}; } if (globalSettings) for (let [key, value] of Object.entries(globalSettings)) { root.settings[key] = value; } - document.getElementsByClassName("tabcontent")[0].style.display = 'flex'; - update(histnames, histoptions); + // document.getElementsByClassName("tabcontent")[0].style.display = 'flex'; + document.getElementsByClassName("tabcontent")[0].classList.add("active"); + await update(histnames, histoptions); // Array.from(document.getElementsByClassName("tabcontent")).forEach(addhelp); for (let tc = 0; tc < document.getElementsByClassName("tabcontent").length; tc++) { @@ -44,10 +44,10 @@ function deepMerge(target, source) { function setPainterSettings(painter, settings) { if (!settings) return; - if (settings.FRAME) - deepMerge(painter.getFramePainter(), settings.FRAME); if (settings.PAINTER) deepMerge(painter, settings.PAINTER); + if (settings.FRAME) + deepMerge(painter.getFramePainter(), settings.FRAME); if (settings.PAD) deepMerge(painter.getPadPainter(), settings.PAD); } @@ -60,6 +60,21 @@ function createLegendEntry(obj, lbl) { return entry; } +function AddH2(h1, h2) { + const nbinsXh1 = h1.fXaxis.fNbins; + const nbinsYh1 = h1.fYaxis.fNbins; + const nbinsXh2 = h2.fXaxis.fNbins; + const nbinsYh2 = h2.fYaxis.fNbins; + + // console.log(`In AddH2(${h1.fTitle}, ${h2.fTitle}`); + if (nbinsXh1 != nbinsXh2 || nbinsYh1 != nbinsYh2) { + console.warn('In function AddH2(h1, h2) axis dimensions not the same. Not Adding Histograms'); + return; + } + for (let iX = 0; iX <= nbinsXh1; iX++) for (let iY = 0; iY <= nbinsYh1; iY++) + h1.fArray[iX + (nbinsXh1 + 2) * iY] += h2.fArray[iX + (nbinsXh1 + 2) * iY]; +} + export async function update(histnames, histoptions) { for (var t = 0; t < histnames.length; t++) { @@ -69,8 +84,11 @@ export async function update(histnames, histoptions) { for (var i = 0; i < histnames[t].length; i++) { if (!Array.isArray(histnames[t][i])) { + if (histnames[t][i] == '') continue; let hist = await root.httpRequest('/qaweb/HadesQA/' + histnames[t][i] + '/root.json.gz?compact=23', 'object'); if (histoptions[t][i].HIST) deepMerge(hist, histoptions[t][i].HIST); + if(hist.XLABEL) + histoptions[t][i].XLABEL = hist.XLABEL; if (histoptions[t][i].XLABEL) { hist.fXaxis.fLabels = root.create('THashList'); for (let l = 0; l < histoptions[t][i].XLABEL.length; l++) { @@ -80,14 +98,27 @@ export async function update(histnames, histoptions) { hist.fXaxis.fLabels.Add(lbl, ''); } } - // console.log(hist); + if(hist.YLABEL) + histoptions[t][i].YLABEL = hist.YLABEL; + if (histoptions[t][i].YLABEL) { + hist.fYaxis.fLabels = root.create('THashList'); + for (let l = 0; l < histoptions[t][i].YLABEL.length; l++) { + let lbl = root.create('TObjString'); + lbl.fString = histoptions[t][i].YLABEL[l]; + lbl.fUniqueID = l + 1; + hist.fYaxis.fLabels.Add(lbl, ''); + } + } let painter = await root.redraw(`t${t}d${i}`, hist, ''); - // if (!first_call[t][i]) { + if (!first_call[t][i]) { setPainterSettings(painter, histoptions[t][i]); + // painter = await root.redraw(`t${t}d${i}`, hist, ''); first_call[t][i] = true; - // } + } + // console.log(hist); // console.log(painter); // console.log(painter.getFramePainter()); + // console.log(painter.getPadPainter()); } else { let histo = []; @@ -98,15 +129,17 @@ export async function update(histnames, histoptions) { if (histoptions[t][i][j].LABEL == '') label[j] = histo[j].fTitle; if (histoptions[t][i][j].LABEL) label[j] = histoptions[t][i][j].LABEL; if (histoptions[t][i][j].XLABEL) { - // console.log(histoptions[t][i][j].XLABEL); - histo[j].fXaxis.fLabels = create('THashList'); + histo[j].fXaxis.fLabels = root.create('THashList'); for (let l = 0; l < histoptions[t][i][j].XLABEL.length; l++) { - let lbl = create('TObjString'); + let lbl = root.create('TObjString'); lbl.fString = histoptions[t][i][j].XLABEL[l]; lbl.fUniqueID = l + 1; histo[j].fXaxis.fLabels.Add(lbl, ''); } } + if (histo.length > 0 && histo[0]._typename.includes('TH2') && histoptions[t][i][0].STACK) + AddH2(histo[0], histo[j]); + // console.log(histo[j]); } const stack = root.createTHStack(...histo); // console.log(stack); @@ -124,14 +157,28 @@ export async function update(histnames, histoptions) { else stack.fHists.arr[0].fFunctions.Add(leg, ''); } - let painter = await root.redraw(`t${t}d${i}`, stack, 'nostack'); - // console.log(stack); - // console.log(histo[0]); - // console.log(stack.fHistogram.fFunctions); - // if (!first_call[t][i]) { + let painter; + if (histo[0]._typename.includes('TH2') && histoptions[t][i][0].STACK) + painter = await root.redraw(`t${t}d${i}`, histo[0], ''); + else if (histoptions[t][i][0].STACK) + painter = await root.redraw(`t${t}d${i}`, stack, ''); + else + painter = await root.redraw(`t${t}d${i}`, stack, 'nostack'); + if (!first_call[t][i]) { setPainterSettings(painter, histoptions[t][i][0]); + // if (histo[0]._typename.includes('TH2') && histoptions[t][i][0].STACK) + // painter = await root.redraw(`t${t}d${i}`, histo[0], ''); + // else if (histoptions[t][i][0].STACK) + // painter = await root.redraw(`t${t}d${i}`, stack, ''); + // else + // painter = await root.redraw(`t${t}d${i}`, stack, 'nostack'); first_call[t][i] = true; - // } + } + // console.log(stack); + // console.log(histo[0]); + // console.log(painter); + // console.log(painter.getFramePainter()); + // console.log(painter.getPadPainter()); } } } @@ -144,16 +191,16 @@ export function openTab(evt, Name) { // Get all elements with class="tabcontent" and hide them tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { - tabcontent[i].style.display = 'none'; + tabcontent[i].classList.remove("active"); } // Get all elements with class="tablinks" and remove the class "active" tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { - tablinks[i].className = tablinks[i].className.replace(" active", ""); + tablinks[i].classList.remove("active"); } // Show the current tab, and add an "active" class to the button that opened the tab - document.getElementById(Name).style.display = 'flex'; - evt.currentTarget.className += " active"; + document.getElementById(Name).classList.add("active"); + evt.currentTarget.classList.add("active"); } diff --git a/hadesroot/files/tab.css b/hadesroot/files/tab.css index 8d7c10d..e0eb6e1 100644 --- a/hadesroot/files/tab.css +++ b/hadesroot/files/tab.css @@ -2,16 +2,20 @@ body { height: calc(100vh - 30px); margin:0; padding:0; - margin-top:30px; + margin-top:25px; } .tabcontent { - display: none; /* establish flex container */ + visibility: hidden; /* establish flex container */ flex-wrap: wrap; /* enable flex items to wrap */ justify-content: space-around; /* padding: 6px 12px; */ /* border: 1px solid #ccc; */ border-top: none; + width:100%; + height:calc(100vh - 30px); + position:absolute; + display: flex; } .tabcontent>div>div { @@ -28,6 +32,14 @@ body { } +.tabcontent.active { + visibility:visible; + } + +.tabcontent.cell1_2x1 { + display: grid; + } + .cell6x4>div { flex: 1 1 16%; height: calc(25vh - 10px); @@ -40,7 +52,24 @@ body { .cell3x2>div { flex: 1 1 33%; - height: calc(50vh - 20px); + height: calc(50vh - 15px); +} + +.cell1_2x1 { + grid-template-columns: 60% 40%; + grid-template-areas: "a b " "a c"; + } +.cell1_2x1>div:first-child { + grid-area: a; + height: calc(100vh - 30px); +} +.cell1_2x1>div:nth-child(2) { + grid-area: b; + height: calc(50vh - 15px); +} +.cell1_2x1>div:nth-child(3) { + grid-area: c; + height: calc(50vh - 15px); } .cell3x1>div { @@ -58,6 +87,10 @@ body { height: calc(100vh - 40px); } +.cell1x1>div { + flex: 1 1 99%; + height: calc(100vh - 40px); +} .tab { position:absolute; top: 0px; @@ -65,8 +98,8 @@ body { z-index:1; overflow: hidden; border: 1px solid #ccc; - height: 30px; - max-height: 30px; + height: 25px; + max-height: 25px; padding: 0; margin: 0; background-color: #f1f1f1; @@ -78,7 +111,7 @@ body { border: 1px solid #aaa; outline: none; cursor: pointer; - padding: 7px 20px; + padding: 5px 20px; transition: 0.3s; border-radius:10px 10px 0 0; } diff --git a/hadesroot/icons/android-chrome-192x192.png b/hadesroot/icons/android-chrome-192x192.png new file mode 100644 index 0000000..bf4c6c1 Binary files /dev/null and b/hadesroot/icons/android-chrome-192x192.png differ diff --git a/hadesroot/icons/android-chrome-512x512.png b/hadesroot/icons/android-chrome-512x512.png new file mode 100644 index 0000000..88a5655 Binary files /dev/null and b/hadesroot/icons/android-chrome-512x512.png differ diff --git a/hadesroot/icons/apple-touch-icon.png b/hadesroot/icons/apple-touch-icon.png new file mode 100644 index 0000000..1ea451e Binary files /dev/null and b/hadesroot/icons/apple-touch-icon.png differ diff --git a/hadesroot/icons/favicon-16x16.png b/hadesroot/icons/favicon-16x16.png new file mode 100644 index 0000000..5c069c7 Binary files /dev/null and b/hadesroot/icons/favicon-16x16.png differ diff --git a/hadesroot/icons/favicon-32x32.png b/hadesroot/icons/favicon-32x32.png new file mode 100644 index 0000000..8b67c5e Binary files /dev/null and b/hadesroot/icons/favicon-32x32.png differ diff --git a/hadesroot/icons/favicon.ico b/hadesroot/icons/favicon.ico new file mode 100644 index 0000000..930df26 Binary files /dev/null and b/hadesroot/icons/favicon.ico differ diff --git a/hadesroot/index.htm b/hadesroot/index.htm new file mode 100644 index 0000000..b4c4a91 --- /dev/null +++ b/hadesroot/index.htm @@ -0,0 +1,36 @@ + + + + + + + + Hades Online QA + + +
 
+

HADES Online QA

+
+ + + + + + +