]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
add new QA web files
authorhadaq <jan@lxhadeb07>
Thu, 1 May 2025 17:44:41 +0000 (19:44 +0200)
committerhadaq <jan@lxhadeb07>
Thu, 1 May 2025 17:44:41 +0000 (19:44 +0200)
50 files changed:
beamabort/beam_abort_init_beamCond.trbcmd
evtbuild/start_eb_gbe.sh
hadesroot/EMC.htm [new file with mode: 0644]
hadesroot/MDC.htm [new file with mode: 0644]
hadesroot/Main.htm [new file with mode: 0644]
hadesroot/Physics.htm [new file with mode: 0644]
hadesroot/RICH.htm [new file with mode: 0644]
hadesroot/RPC.htm [new file with mode: 0644]
hadesroot/Start.htm [new file with mode: 0644]
hadesroot/TOF.htm [new file with mode: 0644]
hadesroot/Trigger.htm [new file with mode: 0644]
hadesroot/WALL.htm [new file with mode: 0644]
hadesroot/files/functions.mjs [new file with mode: 0644]
hadesroot/files/tab.css [new file with mode: 0644]
hmon/QA.pm
hmon/hmon_adcvolt.pl
hmon/hmon_calibration.pl
hmon/hmon_ipcheck.pl
hmon/hmon_mdc_busy.pl
hmon/hmon_mdc_plotmissingboards.pl
hmon/hmon_mdc_retr.pl
hmon/hmon_mdc_tokenmiss.pl
hmon/hmon_mdc_voltage.pl
hmon/hmon_mdcnew_endpoints.pl
hmon/hmon_startrate.pl
hmon/hmon_tofrate.pl
hmon/index.cgi
hmon/permanent/hmon_cpu.pl
hmon/permanent/hmon_ecalhv.pl
hmon/permanent/hmon_expertsoncall.pl
hmon/permanent/hmon_hub.pl
hmon/permanent/hmon_magnet.pl
hmon/permanent/hmon_richIsobutan.pl
hmon/permanent/hmon_spillmon.pl
hmon/qawindows/mdc-errors.htm
hmon/qawindows/mdctimesraw-mdcpotatoraw.htm
hmon/qawindows/test_legend.htm
main/startup_briccolage.sh
mdc/startup.script
mdc/thresholds/register_thresholds_jul14.db
oracle/boards.txt
oracle/postgres2ora.pl [changed from file to symlink]
oracle/postgres2ora_dst.pl [new file with mode: 0755]
oracle/postgres2ora_nodst.pl [new file with mode: 0755]
oracle/runstatsfromora.pl
oracle/runstatsfromora_testplot.sh
start/set_threshold_start.sh
start/startup.script
start/threshold/thresholds_T0.txt
utils/HV_switches.pl

index f6616606a2fd32393b5d5343f99cf0c4b61dd33e..646b2423e6475062989f0de534a4e85d76a9f2db 100644 (file)
@@ -31,21 +31,21 @@ w 0x0130 0xe01d 0x000003e8  #Indiv_Timewindow.29
 w 0x0130 0xe01e 0x000003e8     #Indiv_Timewindow.30
 w 0x0130 0xe01f 0x000003e8     #Indiv_Timewindow.31
 
-w 0x0130 0xe100 10000
-w 0x0130 0xe101 10000
-w 0x0130 0xe102 10000
-w 0x0130 0xe103 10000
-w 0x0130 0xe104 10000
-w 0x0130 0xe105 10000
+w 0x0130 0xe100 18000
+w 0x0130 0xe101 18000
+w 0x0130 0xe102 18000
+w 0x0130 0xe103 18000
+w 0x0130 0xe104 18000
+w 0x0130 0xe105 18000
 w 0x0130 0xe106 0x00000000     #Indiv_Limit.6
 w 0x0130 0xe107 0x00000000     #Indiv_Limit.7
-w 0x0130 0xe108 10000
-w 0x0130 0xe109 10000
-w 0x0130 0xe10a 10000
-w 0x0130 0xe10b 10000
+w 0x0130 0xe108 18000
+w 0x0130 0xe109 18000
+w 0x0130 0xe10a 18000
+w 0x0130 0xe10b 18000
 w 0x0130 0xe10c 0x00000000     #Indiv_Limit.12
-w 0x0130 0xe10d 10000
-w 0x0130 0xe10e 10000
+w 0x0130 0xe10d 18000
+w 0x0130 0xe10e 18000
 w 0x0130 0xe10f 0x00000000     #Indiv_Limit.15
 w 0x0130 0xe110 0x00000000     #Indiv_Limit.16
 w 0x0130 0xe111 0x00000000     #Indiv_Limit.17
index c45cfe6640e3190373e29052e3aa0fce53cc8b19..5cfa4cf5e00add1b7cfa01db33ee86a4beb4f71b 100755 (executable)
@@ -1 +1 @@
-./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 1;
+./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 8;
diff --git a/hadesroot/EMC.htm b/hadesroot/EMC.htm
new file mode 100644 (file)
index 0000000..36f65dd
--- /dev/null
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import {openTab} from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+    
+    let histnames = 
+      [
+        [
+          "EMC/hEmc_mult_raw_total",
+          [
+            "EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__0_",
+            "EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__1_",
+            "EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__2_",
+            "EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__3_",
+            "EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__4_",
+            "EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__5_"
+          ],
+          "EMC/hEmc_raw_sec",
+          "EMC/trending/hEmc_mult_raw_total_trend",
+          [
+            "EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__0_",
+            "EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__1_",
+            "EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__2_",
+            "EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__3_",
+            "EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__4_",
+            "EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__5_"
+          ],
+          "EMC/hEmc_CellHits"
+        ],
+        [
+          "EMC/hEmc_width_module",
+          "EMC/hEmc_leadTime_module"
+        ],
+        [
+          "EMC/hEmc_raw_slowtime_sec",
+          "EMC/hEmc_raw_slowtot_sec",
+          "EMC/hEmc_raw_fasttime_sec",
+          "EMC/hEmc_raw_fasttot_sec"
+        ]
+      ];
+    
+    let histoptions = 
+      [
+        [
+          {},
+          [
+            {HIST: {fLineColor : 1, fLineWidth: 2}},
+            {HIST: {fLineColor : 600, fLineWidth: 2}},
+            {HIST: {fLineColor : 418, fLineWidth: 2}},
+            {HIST: {fLineColor : 861, fLineWidth: 2}},
+            {HIST: {fLineColor : 612, fLineWidth: 2}},
+            {HIST: {fLineColor : 806, fLineWidth: 2}}
+          ],
+          {},
+          {HIST: {fLineWidth: 2}},
+          [
+            {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}},
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}},
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'l'}},
+            {HIST: {fFillStyle : 0, fLineColor : 861, fLineWidth: 2, fOption: 'l'}},
+            {HIST: {fFillStyle : 0, fLineColor : 612, fLineWidth: 2, fOption: 'l'}},
+            {HIST: {fFillStyle : 0, fLineColor : 806, fLineWidth: 2, fOption: 'l'}}
+          ],
+          {}
+        ],
+        [
+          {HIST: {fOption: 'colz2 logz'}},
+          {HIST: {fOption: 'colz2 logz'}}
+        ],
+        [
+          {HIST: {fOption: 'colz2 logz'}},
+          {HIST: {fOption: 'colz2 logz'}},
+          {HIST: {fOption: 'colz2 logz'}},
+          {HIST: {fOption: 'colz2 logz'}}
+        ]
+      ];
+    
+    let helptext = 
+     [
+      [
+        "Raw hit multiplicity per event",
+        "Raw hit multiplicity per event and sector",
+        "Raw hits per cell",
+        "Changes in raw hit multiplicity per event over time",
+        "Changes in raw hit multiplicity per event and sector over time",
+        "Raw hits per cell"        
+      ],  
+     ["",""],
+     ["","","","","",""]
+    ];
+      
+      
+    // console.log(histoptions);
+    initUpdate(histnames, histoptions, helptext, {Palette: 84});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>EMC</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Main</button>
+    <button class="tablinks" onclick="openTab(event, 't1')">TimeWidth</button>
+    <button class="tablinks" onclick="openTab(event, 't2')">ExpertTimeTot</button>
+  </div>
+
+  <div id="t0" class="tabcontent active cell3x2">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell2x1">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+  </div>
+  <div id="t2" class="tabcontent cell2x2">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+  </div>
+</body>
diff --git a/hadesroot/MDC.htm b/hadesroot/MDC.htm
new file mode 100644 (file)
index 0000000..7f6f3ec
--- /dev/null
@@ -0,0 +1,674 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+// [
+//   [
+//     "MDC/hMdcWiresEventMean/hMdcWiresEventMean__0__0_",
+//     "MDC/hMdcWiresEventMean/hMdcWiresEventMean__0__1_",
+//     "MDC/hMdcWiresEventMean/hMdcWiresEventMean__0__2_"
+//   ],
+//   [
+//     "MDC/hMdcTotMean/hMdcTotMean__0__0_",
+//     "MDC/hMdcTotMean/hMdcTotMean__0__1_",
+//     "MDC/hMdcTotMean/hMdcTotMean__0__2_"
+//   ],
+//   [
+//     "MDC/stacks/hMdcMboVsChamberStack/hMdcMboVsChamber__0__0_",
+//     "MDC/stacks/hMdcMboVsChamberStack/hMdcMboVsChamberMissing"
+//   ],
+//   [
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__0_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__1_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__2_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__3_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__4_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__5_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__6_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__7_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__8_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__9_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__10_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__11_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__12_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__13_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__14_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__15_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__16_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__17_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__18_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__19_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__20_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__21_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__22_",
+//     "MDC/hMdcWireDistr/hMdcWireDistr__0__23_"
+//   ],
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__0_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__1_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__2_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__3_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__4_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__5_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__6_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__7_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__8_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__9_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__10_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__11_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__12_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__13_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__14_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__15_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__16_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__17_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__18_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__19_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__20_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__21_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__22_",
+//       "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__23_",
+//         ,
+// ]' 
+
+
+
+
+//Missing hMdcWireVsLayer  (neuer Plot)
+
+
+    let histnames = 
+      [
+        [
+          [
+            "MDC/hMdccutstat/hMdccutstat__0__0_",   
+            "MDC/hMdcWiresEventMean/hMdcWiresEventMean__0__0_",
+            "MDC/hMdcWiresEventMean/hMdcWiresEventMean__0__1_",
+            "MDC/hMdcWiresEventMean/hMdcWiresEventMean__0__2_",
+          ],
+          [
+            "MDC/hMdcTotMean/hMdcTotMean__0__0_",
+            "MDC/hMdcTotMean/hMdcTotMean__0__1_",
+            "MDC/hMdcTotMean/hMdcTotMean__0__2_"          
+          ],
+          [
+            "MDC/stacks/hMdcMboVsChamberStack/hMdcMboVsChamber__0__0_",
+            "MDC/stacks/hMdcMboVsChamberStack/hMdcMboVsChamberMissing",
+          ],
+          [
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__0_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__1_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__2_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__3_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__4_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__5_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__6_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__7_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__8_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__9_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__10_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__11_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__12_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__13_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__14_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__15_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__16_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__17_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__18_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__19_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__20_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__21_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__22_",
+            "MDC/hMdcWireDistr/hMdcWireDistr__0__23_"
+          ],     
+          [
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__0_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__1_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__2_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__3_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__4_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__5_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__6_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__7_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__8_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__9_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__10_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__11_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__12_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__13_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__14_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__15_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__16_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__17_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__18_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__19_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__20_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__21_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__22_",
+            "MDC/trending/hMdcTotMeanTrend/hMdcTotMeanTrend__0__23_",        
+          ],
+          "MDC/hMdcDboVsChamber/hMdcDboVsChamber__0__0_"
+        ],
+        [
+          "MDC/hMdctime1_12/hMdctime1_12__0__0_",
+          "MDC/hMdctime1_12/hMdctime1_12__1__0_",
+          "MDC/hMdctime1_12/hMdctime1_12__2__0_",
+          "MDC/hMdctime1_12/hMdctime1_12__3__0_",
+          "MDC/hMdctime1_12/hMdctime1_12__4__0_",
+          "MDC/hMdctime1_12/hMdctime1_12__5__0_",
+          "MDC/hMdctime1_12/hMdctime1_12__0__1_",
+          "MDC/hMdctime1_12/hMdctime1_12__1__1_",
+          "MDC/hMdctime1_12/hMdctime1_12__2__1_",
+          "MDC/hMdctime1_12/hMdctime1_12__3__1_",
+          "MDC/hMdctime1_12/hMdctime1_12__4__1_",
+          "MDC/hMdctime1_12/hMdctime1_12__5__1_",
+          "MDC/hMdctime1_12/hMdctime1_12__0__2_",
+          "MDC/hMdctime1_12/hMdctime1_12__1__2_",
+          "MDC/hMdctime1_12/hMdctime1_12__2__2_",
+          "MDC/hMdctime1_12/hMdctime1_12__3__2_",
+          "MDC/hMdctime1_12/hMdctime1_12__4__2_",
+          "MDC/hMdctime1_12/hMdctime1_12__5__2_",
+          "MDC/hMdctime1_12/hMdctime1_12__0__3_",
+          "MDC/hMdctime1_12/hMdctime1_12__1__3_",
+          "MDC/hMdctime1_12/hMdctime1_12__2__3_",
+          "MDC/hMdctime1_12/hMdctime1_12__3__3_",
+          "MDC/hMdctime1_12/hMdctime1_12__4__3_",
+          "MDC/hMdctime1_12/hMdctime1_12__5__3_"
+        ],
+        [
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__0__0_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__1__0_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__2__0_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__3__0_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__4__0_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__5__0_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__0__1_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__1__1_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__2__1_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__3__1_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__4__1_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__5__1_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__0__2_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__1__2_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__2__2_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__3__2_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__4__2_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__5__2_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__0__3_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__1__3_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__2__3_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__3__3_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__4__3_",
+          "MDC/hMdctime1_12raw/hMdctime1_12raw__5__3_"
+        ],
+        [
+          [
+            "MDC/hMdclayerS0M0/hMdclayerS0M0__0__0_",
+            "MDC/hMdclayerS0M0/hMdclayerS0M0__0__1_",
+            "MDC/hMdclayerS0M0/hMdclayerS0M0__0__2_",
+            "MDC/hMdclayerS0M0/hMdclayerS0M0__0__3_",
+            "MDC/hMdclayerS0M0/hMdclayerS0M0__0__4_",
+            "MDC/hMdclayerS0M0/hMdclayerS0M0__0__5_",        
+          ],
+          [
+            "MDC/hMdclayerS1M0/hMdclayerS1M0__0__0_",
+            "MDC/hMdclayerS1M0/hMdclayerS1M0__0__1_",
+            "MDC/hMdclayerS1M0/hMdclayerS1M0__0__2_",
+            "MDC/hMdclayerS1M0/hMdclayerS1M0__0__3_",
+            "MDC/hMdclayerS1M0/hMdclayerS1M0__0__4_",
+            "MDC/hMdclayerS1M0/hMdclayerS1M0__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS2M0/hMdclayerS2M0__0__0_",
+            "MDC/hMdclayerS2M0/hMdclayerS2M0__0__1_",
+            "MDC/hMdclayerS2M0/hMdclayerS2M0__0__2_",
+            "MDC/hMdclayerS2M0/hMdclayerS2M0__0__3_",
+            "MDC/hMdclayerS2M0/hMdclayerS2M0__0__4_",
+            "MDC/hMdclayerS2M0/hMdclayerS2M0__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS3M0/hMdclayerS3M0__0__0_",
+            "MDC/hMdclayerS3M0/hMdclayerS3M0__0__1_",
+            "MDC/hMdclayerS3M0/hMdclayerS3M0__0__2_",
+            "MDC/hMdclayerS3M0/hMdclayerS3M0__0__3_",
+            "MDC/hMdclayerS3M0/hMdclayerS3M0__0__4_",
+            "MDC/hMdclayerS3M0/hMdclayerS3M0__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS4M0/hMdclayerS4M0__0__0_",
+            "MDC/hMdclayerS4M0/hMdclayerS4M0__0__1_",
+            "MDC/hMdclayerS4M0/hMdclayerS4M0__0__2_",
+            "MDC/hMdclayerS4M0/hMdclayerS4M0__0__3_",
+            "MDC/hMdclayerS4M0/hMdclayerS4M0__0__4_",
+            "MDC/hMdclayerS4M0/hMdclayerS4M0__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS5M0/hMdclayerS5M0__0__0_",
+            "MDC/hMdclayerS5M0/hMdclayerS5M0__0__1_",
+            "MDC/hMdclayerS5M0/hMdclayerS5M0__0__2_",
+            "MDC/hMdclayerS5M0/hMdclayerS5M0__0__3_",
+            "MDC/hMdclayerS5M0/hMdclayerS5M0__0__4_",
+            "MDC/hMdclayerS5M0/hMdclayerS5M0__0__5_",        
+          ],        
+        ],
+        [
+          [
+            "MDC/hMdclayerS0M1/hMdclayerS0M1__0__0_",
+            "MDC/hMdclayerS0M1/hMdclayerS0M1__0__1_",
+            "MDC/hMdclayerS0M1/hMdclayerS0M1__0__2_",
+            "MDC/hMdclayerS0M1/hMdclayerS0M1__0__3_",
+            "MDC/hMdclayerS0M1/hMdclayerS0M1__0__4_",
+            "MDC/hMdclayerS0M1/hMdclayerS0M1__0__5_",        
+          ],
+          [
+            "MDC/hMdclayerS1M1/hMdclayerS1M1__0__0_",
+            "MDC/hMdclayerS1M1/hMdclayerS1M1__0__1_",
+            "MDC/hMdclayerS1M1/hMdclayerS1M1__0__2_",
+            "MDC/hMdclayerS1M1/hMdclayerS1M1__0__3_",
+            "MDC/hMdclayerS1M1/hMdclayerS1M1__0__4_",
+            "MDC/hMdclayerS1M1/hMdclayerS1M1__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS2M1/hMdclayerS2M1__0__0_",
+            "MDC/hMdclayerS2M1/hMdclayerS2M1__0__1_",
+            "MDC/hMdclayerS2M1/hMdclayerS2M1__0__2_",
+            "MDC/hMdclayerS2M1/hMdclayerS2M1__0__3_",
+            "MDC/hMdclayerS2M1/hMdclayerS2M1__0__4_",
+            "MDC/hMdclayerS2M1/hMdclayerS2M1__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS3M1/hMdclayerS3M1__0__0_",
+            "MDC/hMdclayerS3M1/hMdclayerS3M1__0__1_",
+            "MDC/hMdclayerS3M1/hMdclayerS3M1__0__2_",
+            "MDC/hMdclayerS3M1/hMdclayerS3M1__0__3_",
+            "MDC/hMdclayerS3M1/hMdclayerS3M1__0__4_",
+            "MDC/hMdclayerS3M1/hMdclayerS3M1__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS4M1/hMdclayerS4M1__0__0_",
+            "MDC/hMdclayerS4M1/hMdclayerS4M1__0__1_",
+            "MDC/hMdclayerS4M1/hMdclayerS4M1__0__2_",
+            "MDC/hMdclayerS4M1/hMdclayerS4M1__0__3_",
+            "MDC/hMdclayerS4M1/hMdclayerS4M1__0__4_",
+            "MDC/hMdclayerS4M1/hMdclayerS4M1__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS5M1/hMdclayerS5M1__0__0_",
+            "MDC/hMdclayerS5M1/hMdclayerS5M1__0__1_",
+            "MDC/hMdclayerS5M1/hMdclayerS5M1__0__2_",
+            "MDC/hMdclayerS5M1/hMdclayerS5M1__0__3_",
+            "MDC/hMdclayerS5M1/hMdclayerS5M1__0__4_",
+            "MDC/hMdclayerS5M1/hMdclayerS5M1__0__5_",        
+          ], 
+        ],
+        [
+          [
+            "MDC/hMdclayerS0M2/hMdclayerS0M2__0__0_",
+            "MDC/hMdclayerS0M2/hMdclayerS0M2__0__1_",
+            "MDC/hMdclayerS0M2/hMdclayerS0M2__0__2_",
+            "MDC/hMdclayerS0M2/hMdclayerS0M2__0__3_",
+            "MDC/hMdclayerS0M2/hMdclayerS0M2__0__4_",
+            "MDC/hMdclayerS0M2/hMdclayerS0M2__0__5_",        
+          ],
+          [
+            "MDC/hMdclayerS1M2/hMdclayerS1M2__0__0_",
+            "MDC/hMdclayerS1M2/hMdclayerS1M2__0__1_",
+            "MDC/hMdclayerS1M2/hMdclayerS1M2__0__2_",
+            "MDC/hMdclayerS1M2/hMdclayerS1M2__0__3_",
+            "MDC/hMdclayerS1M2/hMdclayerS1M2__0__4_",
+            "MDC/hMdclayerS1M2/hMdclayerS1M2__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS2M2/hMdclayerS2M2__0__0_",
+            "MDC/hMdclayerS2M2/hMdclayerS2M2__0__1_",
+            "MDC/hMdclayerS2M2/hMdclayerS2M2__0__2_",
+            "MDC/hMdclayerS2M2/hMdclayerS2M2__0__3_",
+            "MDC/hMdclayerS2M2/hMdclayerS2M2__0__4_",
+            "MDC/hMdclayerS2M2/hMdclayerS2M2__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS3M2/hMdclayerS3M2__0__0_",
+            "MDC/hMdclayerS3M2/hMdclayerS3M2__0__1_",
+            "MDC/hMdclayerS3M2/hMdclayerS3M2__0__2_",
+            "MDC/hMdclayerS3M2/hMdclayerS3M2__0__3_",
+            "MDC/hMdclayerS3M2/hMdclayerS3M2__0__4_",
+            "MDC/hMdclayerS3M2/hMdclayerS3M2__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS4M2/hMdclayerS4M2__0__0_",
+            "MDC/hMdclayerS4M2/hMdclayerS4M2__0__1_",
+            "MDC/hMdclayerS4M2/hMdclayerS4M2__0__2_",
+            "MDC/hMdclayerS4M2/hMdclayerS4M2__0__3_",
+            "MDC/hMdclayerS4M2/hMdclayerS4M2__0__4_",
+            "MDC/hMdclayerS4M2/hMdclayerS4M2__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS5M2/hMdclayerS5M2__0__0_",
+            "MDC/hMdclayerS5M2/hMdclayerS5M2__0__1_",
+            "MDC/hMdclayerS5M2/hMdclayerS5M2__0__2_",
+            "MDC/hMdclayerS5M2/hMdclayerS5M2__0__3_",
+            "MDC/hMdclayerS5M2/hMdclayerS5M2__0__4_",
+            "MDC/hMdclayerS5M2/hMdclayerS5M2__0__5_",        
+          ], 
+        ],
+        [
+          [
+            "MDC/hMdclayerS0M3/hMdclayerS0M3__0__0_",
+            "MDC/hMdclayerS0M3/hMdclayerS0M3__0__1_",
+            "MDC/hMdclayerS0M3/hMdclayerS0M3__0__2_",
+            "MDC/hMdclayerS0M3/hMdclayerS0M3__0__3_",
+            "MDC/hMdclayerS0M3/hMdclayerS0M3__0__4_",
+            "MDC/hMdclayerS0M3/hMdclayerS0M3__0__5_",        
+          ],
+          [
+            "MDC/hMdclayerS1M3/hMdclayerS1M3__0__0_",
+            "MDC/hMdclayerS1M3/hMdclayerS1M3__0__1_",
+            "MDC/hMdclayerS1M3/hMdclayerS1M3__0__2_",
+            "MDC/hMdclayerS1M3/hMdclayerS1M3__0__3_",
+            "MDC/hMdclayerS1M3/hMdclayerS1M3__0__4_",
+            "MDC/hMdclayerS1M3/hMdclayerS1M3__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS2M3/hMdclayerS2M3__0__0_",
+            "MDC/hMdclayerS2M3/hMdclayerS2M3__0__1_",
+            "MDC/hMdclayerS2M3/hMdclayerS2M3__0__2_",
+            "MDC/hMdclayerS2M3/hMdclayerS2M3__0__3_",
+            "MDC/hMdclayerS2M3/hMdclayerS2M3__0__4_",
+            "MDC/hMdclayerS2M3/hMdclayerS2M3__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS3M3/hMdclayerS3M3__0__0_",
+            "MDC/hMdclayerS3M3/hMdclayerS3M3__0__1_",
+            "MDC/hMdclayerS3M3/hMdclayerS3M3__0__2_",
+            "MDC/hMdclayerS3M3/hMdclayerS3M3__0__3_",
+            "MDC/hMdclayerS3M3/hMdclayerS3M3__0__4_",
+            "MDC/hMdclayerS3M3/hMdclayerS3M3__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS4M3/hMdclayerS4M3__0__0_",
+            "MDC/hMdclayerS4M3/hMdclayerS4M3__0__1_",
+            "MDC/hMdclayerS4M3/hMdclayerS4M3__0__2_",
+            "MDC/hMdclayerS4M3/hMdclayerS4M3__0__3_",
+            "MDC/hMdclayerS4M3/hMdclayerS4M3__0__4_",
+            "MDC/hMdclayerS4M3/hMdclayerS4M3__0__5_",        
+          ],          
+          [
+            "MDC/hMdclayerS5M3/hMdclayerS5M3__0__0_",
+            "MDC/hMdclayerS5M3/hMdclayerS5M3__0__1_",
+            "MDC/hMdclayerS5M3/hMdclayerS5M3__0__2_",
+            "MDC/hMdclayerS5M3/hMdclayerS5M3__0__3_",
+            "MDC/hMdclayerS5M3/hMdclayerS5M3__0__4_",
+            "MDC/hMdclayerS5M3/hMdclayerS5M3__0__5_",        
+          ], 
+        ],
+      ];
+/*hMdcMboVsChamberStack
+hMdcDboVsChamber
+hMdcWireVsLayer*/    
+    let histoptions = 
+      [
+        [
+          [
+            // {XLABEL: ['','','I1','','','','','','I2','','','','','','I1','','','','','','I1','','','','','','I1','','','','','','I1','','','',
+            //           '','','I1','','','','','','I2','','','','','','I1','','','','','','I1','','','','','','I1','','','','','','I1','','','',
+            //           '','','I1','','','','','','I2','','','','','','I1','','','','','','I1','','','','','','I1','','','','','','I1','','','',
+            //           '','','I1','','','','','','I2','','','','','','I1','','','','','','I1','','','','','','I1','','','','','','I1','','',''
+            // ]},
+            {HIST: { fOption: 'l'}},
+            {},
+            {},
+            {},
+          ],
+          [
+            {FRAME: {zoom_ymin: 0, zoom_ymax: 400, zoom_changed_y: true}},
+            {},
+            {},
+          ],
+          [
+            {HIST: { fOption: 'colz2 logz'}},
+            {HIST: { fOption: 'text'}},
+          ],
+          [{HIST: { fOption: 'logy'}},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}],
+          [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}],
+          {}
+        ],
+        [
+          {HIST: {fTitle: 'Plane 1, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 6', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 6', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 6', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 6', fOption: 'colz2'}}
+        ],
+        [
+          {HIST: {fTitle: 'Plane 1, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 1, Sector 6', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 2, Sector 6', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 3, Sector 6', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Plane 4, Sector 6', fOption: 'colz2'}}
+        ],
+        [
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+        ],
+        [
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+        ],
+        [
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+        ],
+        [
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+          [{},{},{},{},{},{}],
+        ],
+      ];
+      
+let helptext = 
+    [
+      [ "","","","","",""],
+      [
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns.",
+        "Time vs. ToT for a single chamber. Note that the x-axis shows time running backwards and units are 0.5ns."
+      ],
+      ["","","","","","","","","","","","","","","","","","","","","","","",""],
+      ["","","","","",""],
+      ["","","","","",""],
+      ["","","","","",""],
+      ["","","","","",""],
+    ];
+      
+      
+    initUpdate(histnames, histoptions, helptext, {Palette: 55});
+    update(histnames,histoptions);
+    setInterval(update, 10000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>MDC</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Main</button>
+    <button class="tablinks"        onclick="openTab(event, 't1')">Potatos</button>
+    <button class="tablinks"        onclick="openTab(event, 't2')">PotatosRaw</button>
+    <button class="tablinks"        onclick="openTab(event, 't3')">Wires I</button>
+    <button class="tablinks"        onclick="openTab(event, 't4')">Wires II</button>
+    <button class="tablinks"        onclick="openTab(event, 't5')">Wires III</button>
+    <button class="tablinks"        onclick="openTab(event, 't6')">Wires IV</button>
+  </div>
+ <div id="t0" class="tabcontent cell3x2 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell6x4">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+    <div><div id="t1d3"></div></div>
+    <div><div id="t1d4"></div></div>
+    <div><div id="t1d5"></div></div>
+    <div><div id="t1d6"></div></div>
+    <div><div id="t1d7"></div></div>
+    <div><div id="t1d8"></div></div>
+    <div><div id="t1d9"></div></div>
+    <div><div id="t1d10"></div></div>
+    <div><div id="t1d11"></div></div>
+    <div><div id="t1d12"></div></div>
+    <div><div id="t1d13"></div></div>
+    <div><div id="t1d14"></div></div>
+    <div><div id="t1d15"></div></div>
+    <div><div id="t1d16"></div></div>
+    <div><div id="t1d17"></div></div>
+    <div><div id="t1d18"></div></div>
+    <div><div id="t1d19"></div></div>
+    <div><div id="t1d20"></div></div>
+    <div><div id="t1d21"></div></div>
+    <div><div id="t1d22"></div></div>
+    <div><div id="t1d23"></div></div>
+  </div>
+  <div id="t2" class="tabcontent cell6x4">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+    <div><div id="t2d4"></div></div>
+    <div><div id="t2d5"></div></div>
+    <div><div id="t2d6"></div></div>
+    <div><div id="t2d7"></div></div>
+    <div><div id="t2d8"></div></div>
+    <div><div id="t2d9"></div></div>
+    <div><div id="t2d10"></div></div>
+    <div><div id="t2d11"></div></div>
+    <div><div id="t2d12"></div></div>
+    <div><div id="t2d13"></div></div>
+    <div><div id="t2d14"></div></div>
+    <div><div id="t2d15"></div></div>
+    <div><div id="t2d16"></div></div>
+    <div><div id="t2d17"></div></div>
+    <div><div id="t2d18"></div></div>
+    <div><div id="t2d19"></div></div>
+    <div><div id="t2d20"></div></div>
+    <div><div id="t2d21"></div></div>
+    <div><div id="t2d22"></div></div>
+    <div><div id="t2d23"></div></div>
+  </div>  
+  <div id="t3" class="tabcontent cell3x2">
+    <div><div id="t3d0"></div></div>
+    <div><div id="t3d1"></div></div>
+    <div><div id="t3d2"></div></div>
+    <div><div id="t3d3"></div></div>
+    <div><div id="t3d4"></div></div>
+    <div><div id="t3d5"></div></div>
+  </div>    
+  <div id="t4" class="tabcontent cell3x2">
+    <div><div id="t4d0"></div></div>
+    <div><div id="t4d1"></div></div>
+    <div><div id="t4d2"></div></div>
+    <div><div id="t4d3"></div></div>
+    <div><div id="t4d4"></div></div>
+    <div><div id="t4d5"></div></div>
+  </div>    
+  <div id="t5" class="tabcontent cell3x2">
+    <div><div id="t5d0"></div></div>
+    <div><div id="t5d1"></div></div>
+    <div><div id="t5d2"></div></div>
+    <div><div id="t5d3"></div></div>
+    <div><div id="t5d4"></div></div>
+    <div><div id="t5d5"></div></div>
+  </div>    
+  <div id="t6" class="tabcontent cell3x2">
+    <div><div id="t6d0"></div></div>
+    <div><div id="t6d1"></div></div>
+    <div><div id="t6d2"></div></div>
+    <div><div id="t6d3"></div></div>
+    <div><div id="t6d4"></div></div>
+    <div><div id="t6d5"></div></div>
+  </div>    
+</body>
diff --git a/hadesroot/Main.htm b/hadesroot/Main.htm
new file mode 100644 (file)
index 0000000..1fe21a4
--- /dev/null
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+
+
+    let histnames = 
+      [
+        [
+          "general/hLatch_Norm",
+          "START/hStart_EventID",
+          "general/hLatch_Mult",
+          [
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__0_",
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__1_",
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__2_",
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__3_"
+          ],
+          [
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__0_",
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__1_",
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__2_",
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__3_"
+          ],
+          [
+            "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__0_"     , 
+            "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__1_"     ,
+            "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__2_"     , 
+            "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__3_"     , 
+            "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__4_"     , 
+            "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__5_"     ,
+            "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__0_"     , 
+            "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__1_"     ,
+            "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__2_"     , 
+            "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__3_"     , 
+            "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__4_"     , 
+            "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__5_"               
+            ]
+        ],
+      ];
+
+
+      
+    let histoptions = 
+      [
+        [
+          {XLABEL: ['Start', 'Veto', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M2 nn', 'M3 nn', 'M2 opp', 'PT1', 'PT2', 'PT3', 'PT4', 'PT5', 'FW', 'RICH', 'PT8'],
+            HIST : {fTitle: 'hLatch - Trigger Type', fOption: 'logy'}, FRAME: {zoom_xmin: 0, zoom_xmax: 19, zoom_changed_x: true}
+           },
+          {},
+          {HIST : {fTitle: 'hLatchMult'}},
+          [
+            {LABEL: 'all', LEGENDNOAUTO: { fX1NDC: 0.8, fY1NDC: 0.45, fX2NDC: 0.99, fY2NDC: 0.90, fNColumns : 1, fTextSize : 0.04 }},
+            {LABEL: 'PT1'},
+            {LABEL: 'PT2'},
+            {LABEL: 'PT3'}
+          ],
+          [
+            {LABEL: 'all', LEGENDNOAUTO: { fX1NDC: 0.8, fY1NDC: 0.45, fX2NDC: 0.99, fY2NDC: 0.90, fNColumns : 1, fTextSize : 0.04 }},
+            {LABEL: 'PT1'},
+            {LABEL: 'PT2'},
+            {LABEL: 'PT3'}
+          ],
+          [
+           {},
+           {},
+           {},
+           {},
+           {},
+           {},
+           {},
+           {},
+           {},
+           {},
+           {},
+           {}
+          ],
+        ]
+      ];
+      
+    let helptext = 
+      [
+        [
+          "Number of events with each of the possible trigger sources set",
+          "Event Type - either real data or some calibration event (this number should be close to 0 during data taking)",
+          "Number of simultanously set trigger source bits, e.g. PT2 and PT3 can fire at the same time",
+          "Track multiplicity in TOF+RPC depending on trigger source PT1 - PT3. Clean cut-offs at the set particle multiplicities should be visible.",
+          "Track multiplicity in TOF depending on trigger source PT1 - PT3",
+          ""
+          ],  
+      ];       
+      
+      
+    initUpdate(histnames,histoptions, helptext, {Palette : 55});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>Main</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Main</button>
+  </div>
+
+  <div id="t0" class="tabcontent cell3x2 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+  </div>
+
+</body>
diff --git a/hadesroot/Physics.htm b/hadesroot/Physics.htm
new file mode 100644 (file)
index 0000000..c387c49
--- /dev/null
@@ -0,0 +1,431 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+
+    let histnames = 
+      [
+        [
+          [
+          "general/hPhys_candTheta_Sys0/hPhys_candTheta_Sys0__0__0_",
+          "general/hPhys_candTheta_Sys0/hPhys_candTheta_Sys0__0__1_",
+          "general/hPhys_candTheta_Sys0/hPhys_candTheta_Sys0__0__2_",
+          "general/hPhys_candTheta_Sys0/hPhys_candTheta_Sys0__0__3_",
+          "general/hPhys_candTheta_Sys0/hPhys_candTheta_Sys0__0__4_",
+          "general/hPhys_candTheta_Sys0/hPhys_candTheta_Sys0__0__5_"
+          ],
+          [
+          "general/hPhys_candTheta_Sys1/hPhys_candTheta_Sys1__0__0_",
+          "general/hPhys_candTheta_Sys1/hPhys_candTheta_Sys1__0__1_",
+          "general/hPhys_candTheta_Sys1/hPhys_candTheta_Sys1__0__2_",
+          "general/hPhys_candTheta_Sys1/hPhys_candTheta_Sys1__0__3_",
+          "general/hPhys_candTheta_Sys1/hPhys_candTheta_Sys1__0__4_",
+          "general/hPhys_candTheta_Sys1/hPhys_candTheta_Sys1__0__5_"
+          ],
+          [
+          "general/hPhys_candPhi_Sys/hPhys_candPhi_Sys__0__0_",
+          "general/hPhys_candPhi_Sys/hPhys_candPhi_Sys__0__1_"
+          ],
+          [
+          "general/hPhys_candTheta_Used_Sys0/hPhys_candTheta_Used_Sys0__0__0_",
+          "general/hPhys_candTheta_Used_Sys0/hPhys_candTheta_Used_Sys0__0__1_",
+          "general/hPhys_candTheta_Used_Sys0/hPhys_candTheta_Used_Sys0__0__2_",
+          "general/hPhys_candTheta_Used_Sys0/hPhys_candTheta_Used_Sys0__0__3_",
+          "general/hPhys_candTheta_Used_Sys0/hPhys_candTheta_Used_Sys0__0__4_",
+          "general/hPhys_candTheta_Used_Sys0/hPhys_candTheta_Used_Sys0__0__5_"
+          ],
+          [
+          "general/hPhys_candTheta_Used_Sys1/hPhys_candTheta_Used_Sys1__0__0_",
+          "general/hPhys_candTheta_Used_Sys1/hPhys_candTheta_Used_Sys1__0__1_",
+          "general/hPhys_candTheta_Used_Sys1/hPhys_candTheta_Used_Sys1__0__2_",
+          "general/hPhys_candTheta_Used_Sys1/hPhys_candTheta_Used_Sys1__0__3_",
+          "general/hPhys_candTheta_Used_Sys1/hPhys_candTheta_Used_Sys1__0__4_",
+          "general/hPhys_candTheta_Used_Sys1/hPhys_candTheta_Used_Sys1__0__5_"
+          ],
+          [
+          "general/hPhys_candPhi_Used_Sys/hPhys_candPhi_Used_Sys__0__0_",
+          "general/hPhys_candPhi_Used_Sys/hPhys_candPhi_Used_Sys__0__1_"
+          ]
+        ],      
+        [
+        "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__0_" , 
+        "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__1_" ,
+        "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__2_" , 
+        "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__3_" , 
+        "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__4_" , 
+        "general/hPhys_candBetaMom_Sys0/hPhys_candBetaMom_Sys0__0__5_" 
+        ],
+        [
+        "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__0_" , 
+        "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__1_" ,
+        "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__2_" , 
+        "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__3_" , 
+        "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__4_" , 
+        "general/hPhys_candBetaMom_Sys1/hPhys_candBetaMom_Sys1__0__5_" 
+        ],
+        [
+          [
+          "general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__0_",
+          "general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__1_",
+          "general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__2_",
+          "general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__3_",
+          "general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__4_",
+          "general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__5_"
+          ],
+          [
+          "general/hPhys_candMatchQA_Sys1/hPhys_candMatchQA_Sys1__0__0_",
+          "general/hPhys_candMatchQA_Sys1/hPhys_candMatchQA_Sys1__0__1_",
+          "general/hPhys_candMatchQA_Sys1/hPhys_candMatchQA_Sys1__0__2_",
+          "general/hPhys_candMatchQA_Sys1/hPhys_candMatchQA_Sys1__0__3_",
+          "general/hPhys_candMatchQA_Sys1/hPhys_candMatchQA_Sys1__0__4_",
+          "general/hPhys_candMatchQA_Sys1/hPhys_candMatchQA_Sys1__0__5_"
+          ],
+          [
+          "general/hPhys_candMatchQA_SHR/hPhys_candMatchQA_SHR__0__0_",
+          "general/hPhys_candMatchQA_SHR/hPhys_candMatchQA_SHR__0__1_",
+          "general/hPhys_candMatchQA_SHR/hPhys_candMatchQA_SHR__0__2_",
+          "general/hPhys_candMatchQA_SHR/hPhys_candMatchQA_SHR__0__3_",
+          "general/hPhys_candMatchQA_SHR/hPhys_candMatchQA_SHR__0__4_",
+          "general/hPhys_candMatchQA_SHR/hPhys_candMatchQA_SHR__0__5_"
+          ],
+          [
+          "general/hPhys_candMatchQA_Used_Sys0/hPhys_candMatchQA_Used_Sys0__0__0_",
+          "general/hPhys_candMatchQA_Used_Sys0/hPhys_candMatchQA_Used_Sys0__0__1_",
+          "general/hPhys_candMatchQA_Used_Sys0/hPhys_candMatchQA_Used_Sys0__0__2_",
+          "general/hPhys_candMatchQA_Used_Sys0/hPhys_candMatchQA_Used_Sys0__0__3_",
+          "general/hPhys_candMatchQA_Used_Sys0/hPhys_candMatchQA_Used_Sys0__0__4_",
+          "general/hPhys_candMatchQA_Used_Sys0/hPhys_candMatchQA_Used_Sys0__0__5_"
+          ],
+          [
+          "general/hPhys_candMatchQA_Used_Sys1/hPhys_candMatchQA_Used_Sys1__0__0_",
+          "general/hPhys_candMatchQA_Used_Sys1/hPhys_candMatchQA_Used_Sys1__0__1_",
+          "general/hPhys_candMatchQA_Used_Sys1/hPhys_candMatchQA_Used_Sys1__0__2_",
+          "general/hPhys_candMatchQA_Used_Sys1/hPhys_candMatchQA_Used_Sys1__0__3_",
+          "general/hPhys_candMatchQA_Used_Sys1/hPhys_candMatchQA_Used_Sys1__0__4_",
+          "general/hPhys_candMatchQA_Used_Sys1/hPhys_candMatchQA_Used_Sys1__0__5_"
+          ],
+          [
+          "general/hPhys_candMatchQA_Used_SHR/hPhys_candMatchQA_Used_SHR__0__0_",
+          "general/hPhys_candMatchQA_Used_SHR/hPhys_candMatchQA_Used_SHR__0__1_",
+          "general/hPhys_candMatchQA_Used_SHR/hPhys_candMatchQA_Used_SHR__0__2_",
+          "general/hPhys_candMatchQA_Used_SHR/hPhys_candMatchQA_Used_SHR__0__3_",
+          "general/hPhys_candMatchQA_Used_SHR/hPhys_candMatchQA_Used_SHR__0__4_",
+          "general/hPhys_candMatchQA_Used_SHR/hPhys_candMatchQA_Used_SHR__0__5_"
+          ]
+        ],
+        [
+        "general/hPhys_candMult_Sys/hPhys_candMult_Sys__0__0_", 
+        "general/hPhys_candMult_SUM/hPhys_candMult_SUM__0__0_", 
+        "general/hPhys_candMult_Lep_SUM/hPhys_candMult_Lep_SUM__0__0_", 
+        "general/hPhys_candMult_Sys/hPhys_candMult_Sys__0__1_", 
+        "general/hPhys_candMult_SUM/hPhys_candMult_SUM__0__1_",
+        "general/hPhys_candMult_Lep_SUM/hPhys_candMult_Lep_SUM__0__1_" 
+        ],
+        [
+          [
+          "general/hPhys_candTot_P0/hPhys_candTot_P0__0__0_",
+          "general/hPhys_candTot_P0/hPhys_candTot_P0__0__1_",
+          "general/hPhys_candTot_P0/hPhys_candTot_P0__0__2_",
+          "general/hPhys_candTot_P0/hPhys_candTot_P0__0__3_",
+          "general/hPhys_candTot_P0/hPhys_candTot_P0__0__4_",
+          "general/hPhys_candTot_P0/hPhys_candTot_P0__0__5_"
+          ],
+          [
+          "general/hPhys_candTot_P1/hPhys_candTot_P1__0__0_",
+          "general/hPhys_candTot_P1/hPhys_candTot_P1__0__1_",
+          "general/hPhys_candTot_P1/hPhys_candTot_P1__0__2_",
+          "general/hPhys_candTot_P1/hPhys_candTot_P1__0__3_",
+          "general/hPhys_candTot_P1/hPhys_candTot_P1__0__4_",
+          "general/hPhys_candTot_P1/hPhys_candTot_P1__0__5_"
+          ],
+          [
+          "general/hPhys_candTot_P2/hPhys_candTot_P2__0__0_",
+          "general/hPhys_candTot_P2/hPhys_candTot_P2__0__1_",
+          "general/hPhys_candTot_P2/hPhys_candTot_P2__0__2_",
+          "general/hPhys_candTot_P2/hPhys_candTot_P2__0__3_",
+          "general/hPhys_candTot_P2/hPhys_candTot_P2__0__4_",
+          "general/hPhys_candTot_P2/hPhys_candTot_P2__0__5_"
+          ],
+          [
+          "general/hPhys_candTot_P3/hPhys_candTot_P3__0__0_",
+          "general/hPhys_candTot_P3/hPhys_candTot_P3__0__1_",
+          "general/hPhys_candTot_P3/hPhys_candTot_P3__0__2_",
+          "general/hPhys_candTot_P3/hPhys_candTot_P3__0__3_",
+          "general/hPhys_candTot_P3/hPhys_candTot_P3__0__4_",
+          "general/hPhys_candTot_P3/hPhys_candTot_P3__0__5_"
+          ]
+        ],
+        [
+        "general/hPhys_candVertex_XY",
+        "general/hPhys_candVertex_X",
+        "general/hPhys_candVertex_Y",
+        "general/hPhys_candVertex_Z",
+        "general/hPhys_candVertex_Zclust"
+        ]      
+      ];
+    
+    let histoptions = 
+      [
+/*tab0*/[
+          [
+            // {HIST: {fOption: 'p', fMarkerSize:1, fMarkerStyle:8, fMarkerColor: 2}},
+            // {HIST: {fOption: 'p', fMarkerSize:1, fMarkerStyle:8, fMarkerColor: 3}},
+            // {HIST: {fOption: 'p', fMarkerSize:1, fMarkerStyle:8, fMarkerColor: 4}},
+            // {HIST: {fOption: 'p', fMarkerSize:1, fMarkerStyle:8, fMarkerColor: 5}},
+            // {HIST: {fOption: 'p', fMarkerSize:1, fMarkerStyle:8, fMarkerColor: 6}},
+            // {HIST: {fOption: 'p', fMarkerSize:1, fMarkerStyle:8, fMarkerColor: 7}}
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+            
+          ],
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],            
+          [
+            {},
+            {}
+          ],
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],            
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],
+          [
+            {},
+            {}
+          ],        
+        ],
+/*tab1*/[
+          {HIST: {fTitle: 'RPC, Sector 0', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'RPC, Sector 1', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'RPC, Sector 2', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'RPC, Sector 3', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'RPC, Sector 4', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'RPC, Sector 5', fOption: 'colz2 pal50'}}
+        ],
+/*tab2*/[
+          {HIST: {fTitle: 'TOF, Sector 0', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'TOF, Sector 1', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'TOF, Sector 2', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'TOF, Sector 3', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'TOF, Sector 4', fOption: 'colz2 pal50'}},
+          {HIST: {fTitle: 'TOF, Sector 5', fOption: 'colz2 pal50'}}
+        ],
+/*tab3*/[
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],            
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],            
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],        
+        ],
+        [
+          {HIST: {fTitle: 'RPC, Track Cand Mult'}},
+          {HIST: {fTitle: 'RPC, Track Mult Sum'}},
+          {HIST: {fTitle: 'RPC, Mult Lep Sum'}},
+          {HIST: {fTitle: 'TOF, Track Cand Mult'}},
+          {HIST: {fTitle: 'TOF, Track Mult Sum'}},
+          {HIST: {fTitle: 'TOF, Mult Lep Sum'}}
+        ],
+        [
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],            
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ],
+          [
+            {},
+            {},
+            {},
+            {},
+            {},
+            {}
+          ]   
+        ],
+        [
+          {},
+          {},
+          {},
+          {},
+          {},
+          {}
+        ]        
+      ];
+   let helptext  =
+   [
+    [
+      "Theta distribution of hits in RPC, separated in sectors",
+      "Theta distribution of hits in TOF, separated in sectors",
+      "Phi distribution of tracks in ROC and TOF",
+      "Theta distribution of hits used in tracking in RPC, separated in sectors",
+      "Theta distribution of hits used in tracking in TOF, separated in sectors",
+      "Phi distribution of tracks used in tracking in ROC and TOF",
+      ],
+    ["","","","","",""],
+    ["","","","","",""],
+    ["","","","","",""],
+    ["","","","","",""],
+    ["","","",""],
+    ["","","","","",""]
+   ];
+    initUpdate(histnames, histoptions, helptext, {Palette: 84});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>Physics</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Main</button>
+    <button class="tablinks" onclick="openTab(event, 't1')">BetaMom RPC</button>
+    <button class="tablinks" onclick="openTab(event, 't2')">BetaMom TOF</button>
+    <button class="tablinks" onclick="openTab(event, 't3')">Match</button>
+    <button class="tablinks" onclick="openTab(event, 't4')">MultDist</button>
+    <button class="tablinks" onclick="openTab(event, 't5')">ToT MIPS</button>
+    <button class="tablinks" onclick="openTab(event, 't6')">Vertex</button>
+  </div>
+
+  <div id="t0" class="tabcontent active cell3x2">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell3x2">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+    <div><div id="t1d3"></div></div>
+    <div><div id="t1d4"></div></div>
+    <div><div id="t1d5"></div></div>
+  </div>  
+  <div id="t2" class="tabcontent cell3x2">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+    <div><div id="t2d4"></div></div>
+    <div><div id="t2d5"></div></div>
+  </div>    
+  <div id="t3" class="tabcontent cell3x2">
+    <div><div id="t3d0"></div></div>
+    <div><div id="t3d1"></div></div>
+    <div><div id="t3d2"></div></div>
+    <div><div id="t3d3"></div></div>
+    <div><div id="t3d4"></div></div>
+    <div><div id="t3d5"></div></div>
+  </div>    
+  <div id="t4" class="tabcontent cell3x2">
+    <div><div id="t4d0"></div></div>
+    <div><div id="t4d1"></div></div>
+    <div><div id="t4d2"></div></div>
+    <div><div id="t4d3"></div></div>
+    <div><div id="t4d4"></div></div>
+    <div><div id="t4d5"></div></div>
+  </div> 
+  <div id="t5" class="tabcontent cell2x2">
+    <div><div id="t5d0"></div></div>
+    <div><div id="t5d1"></div></div>
+    <div><div id="t5d2"></div></div>
+    <div><div id="t5d3"></div></div>
+  </div>    
+  <div id="t6" class="tabcontent cell3x2">
+    <div><div id="t6d0"></div></div>
+    <div><div id="t6d1"></div></div>
+    <div><div id="t6d2"></div></div>
+    <div><div id="t6d3"></div></div>
+    <div><div id="t6d4"></div></div>
+    <div><div id="t6d5"></div></div>
+  </div>   
+</body>
diff --git a/hadesroot/RICH.htm b/hadesroot/RICH.htm
new file mode 100644 (file)
index 0000000..b2d9e68
--- /dev/null
@@ -0,0 +1,217 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+    
+    let histnames = 
+      [
+        [
+          [
+            "RICH/trending/hRichLaserTrend/hRichLaserTrend__0__6_",
+            "RICH/trending/hRichLaserTrend/hRichLaserTrend__0__0_",
+            "RICH/trending/hRichLaserTrend/hRichLaserTrend__0__1_",
+            "RICH/trending/hRichLaserTrend/hRichLaserTrend__0__2_",
+            "RICH/trending/hRichLaserTrend/hRichLaserTrend__0__3_",
+            "RICH/trending/hRichLaserTrend/hRichLaserTrend__0__4_",
+            "RICH/trending/hRichLaserTrend/hRichLaserTrend__0__5_"
+          ],
+          [
+            "RICH/trending/hRichCalsTrend/hRichCalsTrend__0__6_",
+            "RICH/trending/hRichCalsTrend/hRichCalsTrend__0__0_",
+            "RICH/trending/hRichCalsTrend/hRichCalsTrend__0__1_",
+            "RICH/trending/hRichCalsTrend/hRichCalsTrend__0__2_",
+            "RICH/trending/hRichCalsTrend/hRichCalsTrend__0__3_",
+            "RICH/trending/hRichCalsTrend/hRichCalsTrend__0__4_",
+            "RICH/trending/hRichCalsTrend/hRichCalsTrend__0__5_"
+          ],
+          [
+            "RICH/trending/hRichRingsTrend/hRichRingsTrend__0__6_",
+            "RICH/trending/hRichRingsTrend/hRichRingsTrend__0__0_",
+            "RICH/trending/hRichRingsTrend/hRichRingsTrend__0__1_",
+            "RICH/trending/hRichRingsTrend/hRichRingsTrend__0__2_",
+            "RICH/trending/hRichRingsTrend/hRichRingsTrend__0__3_",
+            "RICH/trending/hRichRingsTrend/hRichRingsTrend__0__4_",
+            "RICH/trending/hRichRingsTrend/hRichRingsTrend__0__5_"
+          ]
+        ],
+        [
+          "RICH/hRichCalsColRowEvent/hRichCalsColRowEvent__0__0_",
+          "RICH/hRichCalsColRowEvent/hRichCalsColRowEvent__0__1_",
+          "RICH/hRichCalsColRowEvent/hRichCalsColRowEvent__0__2_",
+          "RICH/hRichCalsColRowEvent/hRichCalsColRowEvent__0__3_"
+        ],
+        [
+          "RICH/hRichRawToT",
+          "RICH/hRichRawLeadingEdge",
+          "RICH/hRichRawUIDVsToT",
+          "RICH/hRichRawUIDVsLeadingEdge"
+        ],
+        [
+          "RICH/hRichNofEdgeTypes",
+          "RICH/hRichNofEdges",
+          "RICH/hRichRawUIDVsNofIncompleteHit"
+        ],
+        [
+          "RICH/hRichNofCalsPerEvent",
+          "RICH/hRichNofRingsPerEvent",
+          "RICH/hRichNofRawPerEvent",
+          "RICH/hRichNofRawMultPerEvent"
+        ],
+        [
+          "RICH/hRichCalsXY",
+          "RICH/hRichCalsPmtXPmtY"
+        ],
+        [
+          "RICH/hRichCalsPmtId",
+          "RICH/hRichCalsSectors",
+          "RICH/hRichCalsTheta",
+          "RICH/hRichCalsPhi",
+          "RICH/hRichRawPmtPixel",
+          "RICH/hRichRawMult"
+        ]
+      ];
+    
+    let histoptions = 
+      [
+        [
+          [
+            {HIST: {fOption: 'histl logy', fYaxis : {fTitle: 'Number of Laser Hits per Event'}}, LABEL: 'Sum', LEGENDNOAUTO: { fX1NDC: 0.1, fY1NDC: 0.89, fX2NDC: 0.9, fY2NDC: 0.95, fNColumns: 3, fTextSize: 0.04}},
+            {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec1'},
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec2'},
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec3'},
+            {HIST: {fFillStyle : 0, fLineColor : 861, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec4'},
+            {HIST: {fFillStyle : 0, fLineColor : 612, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec5'},
+            {HIST: {fFillStyle : 0, fLineColor : 806, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec6'}
+          ],
+          [
+            {HIST: {fOption: 'histl logy', fYaxis : {fTitle: 'Number of Hits per Event'}}, LABEL: 'Sum', LEGENDNOAUTO: { fX1NDC: 0.1, fY1NDC: 0.89, fX2NDC: 0.9, fY2NDC: 0.95, fNColumns: 3, fTextSize: 0.04}},
+            {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec1'},
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec2'},
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec3'},
+            {HIST: {fFillStyle : 0, fLineColor : 861, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec4'},
+            {HIST: {fFillStyle : 0, fLineColor : 612, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec5'},
+            {HIST: {fFillStyle : 0, fLineColor : 806, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec6'}
+          ],
+          [
+            {HIST: {fOption: 'histl logy', fYaxis : {fTitle: 'Number of Rings per Event'}}, LABEL: 'Sum', LEGENDNOAUTO: { fX1NDC: 0.1, fY1NDC: 0.89, fX2NDC: 0.9, fY2NDC: 0.95, fNColumns: 3, fTextSize: 0.04}},
+            {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec1'},
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec2'},
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec3'},
+            {HIST: {fFillStyle : 0, fLineColor : 861, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec4'},
+            {HIST: {fFillStyle : 0, fLineColor : 612, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec5'},
+            {HIST: {fFillStyle : 0, fLineColor : 806, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec6'}
+          ]
+        ],
+        [
+          {HIST: {fTitle: 'Single Event 1', fOption: 'col pal57'}, FRAME: {fillatt: {color: 'black'}}},
+          {HIST: {fTitle: 'Single Event 2', fOption: 'col pal57'}, FRAME: {fillatt: {color: 'black'}}},
+          {HIST: {fTitle: 'Single Event 3', fOption: 'col pal57'}, FRAME: {fillatt: {color: 'black'}}},
+          {HIST: {fTitle: 'Single Event 4', fOption: 'col pal57'}, FRAME: {fillatt: {color: 'black'}}}
+        ],
+        [
+          {},
+          {},
+          {HIST: {fOption: 'colz2 logz'}},
+          {HIST: {fOption: 'colz2 logz'}}
+        ],
+        [
+          {HIST: {fOption: 'logy'}, XLABEL: ['only LE', 'only TE', 'both']},
+          {HIST: {fOption: 'logy'}},
+          {HIST: {fOption: 'logy'}}
+        ],
+        [
+          {HIST: {fOption: 'hist'}},
+          {HIST: {fOption: 'hist'}},
+          {HIST: {fOption: 'hist'}},
+          {HIST: {fOption: 'hist'}}
+        ],
+        [
+          {HIST: {fOption: 'colz'}},
+          {HIST: {fOption: 'colz'}}
+        ],
+        [
+          {},
+          {},
+          {},
+          {},
+          {HIST: {fOption: 'colz'}},
+          {}
+        ]
+      ];
+      
+    let helptext = 
+      [
+        ["","",""],  
+        ["","","",""],
+        ["","","",""],
+        ["","","",""],
+        ["","","",""],
+        ["",""],
+        ["","","","","",""]
+      ];      
+    initUpdate(histnames, histoptions, helptext, {Palette : 84});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>RICH</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">TrendPlots</button>
+    <button class="tablinks" onclick="openTab(event, 't1')">SingleEvent</button>
+    <button class="tablinks" onclick="openTab(event, 't2')">RawTiming</button>
+    <button class="tablinks" onclick="openTab(event, 't3')">EdgeInfo</button>
+    <button class="tablinks" onclick="openTab(event, 't4')">NofPerEvent</button>
+    <button class="tablinks" onclick="openTab(event, 't5')">RichXY</button>
+    <button class="tablinks" onclick="openTab(event, 't6')">RichSpatial</button>
+  </div>
+
+  <div id="t0" class="tabcontent cell3x1 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell2x2">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+    <div><div id="t1d3"></div></div>
+  </div>
+  <div id="t2" class="tabcontent cell2x2">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+  </div>
+  <div id="t3" class="tabcontent cell2x2">
+    <div><div id="t3d0"></div></div>
+    <div><div id="t3d1"></div></div>
+    <div><div id="t3d2"></div></div>
+    <div><div id="t3d3"></div></div>
+  </div>
+  <div id="t4" class="tabcontent cell2x2">
+    <div><div id="t4d0"></div></div>
+    <div><div id="t4d1"></div></div>
+    <div><div id="t4d2"></div></div>
+    <div><div id="t4d3"></div></div>
+  </div>
+  <div id="t5" class="tabcontent cell2x1">
+    <div><div id="t5d0"></div></div>
+    <div><div id="t5d1"></div></div>
+  </div>
+  <div id="t6" class="tabcontent cell3x2">
+    <div><div id="t6d0"></div></div>
+    <div><div id="t6d1"></div></div>
+    <div><div id="t6d2"></div></div>
+    <div><div id="t6d3"></div></div>
+    <div><div id="t6d4"></div></div>
+    <div><div id="t6d5"></div></div>
+  </div>
+</body>
diff --git a/hadesroot/RPC.htm b/hadesroot/RPC.htm
new file mode 100644 (file)
index 0000000..78ef5a8
--- /dev/null
@@ -0,0 +1,314 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+
+
+    let histnames = 
+      [
+        [
+        "RPC/hRpcMultiplicity",
+        "RPC/hRpcPattern_raw",
+        "RPC/hRpcPatternL_raw",
+        "RPC/hRpcPatternR_raw",
+        "RPC/hRpcTof_hit",
+        "RPC/hRpcPhi_hit"
+        ],
+        [
+          [
+          "RPC/trending/hRpcrawhitstrend/hRpcrawhitstrend__0__0_", 
+          "RPC/trending/hRpcrawhitstrend/hRpcrawhitstrend__0__1_", 
+          "RPC/trending/hRpcrawhitstrend/hRpcrawhitstrend__0__2_", 
+          "RPC/trending/hRpcrawhitstrend/hRpcrawhitstrend__0__3_", 
+          "RPC/trending/hRpcrawhitstrend/hRpcrawhitstrend__0__4_",
+          "RPC/trending/hRpcrawhitstrend/hRpcrawhitstrend__0__5_"
+          ],
+          [
+          "RPC/hRpcrawsecmult/hRpcrawsecmult__0__0_",
+          "RPC/hRpcrawsecmult/hRpcrawsecmult__0__1_", 
+          "RPC/hRpcrawsecmult/hRpcrawsecmult__0__2_", 
+          "RPC/hRpcrawsecmult/hRpcrawsecmult__0__3_", 
+          "RPC/hRpcrawsecmult/hRpcrawsecmult__0__4_",
+          "RPC/hRpcrawsecmult/hRpcrawsecmult__0__5_"
+          ]
+        ],
+        [
+        "RPC/hRpcColCellCharge/hRpcColCellCharge__0__0_",
+        "RPC/hRpcColCellCharge/hRpcColCellCharge__0__1_",
+        "RPC/hRpcColCellCharge/hRpcColCellCharge__0__2_",
+        "RPC/hRpcColCellCharge/hRpcColCellCharge__0__3_",
+        "RPC/hRpcColCellCharge/hRpcColCellCharge__0__4_",
+        "RPC/hRpcColCellCharge/hRpcColCellCharge__0__5_"       
+        ],
+        [
+        "RPC/hRpcColCellmult/hRpcColCellmult__0__0_",
+        "RPC/hRpcColCellmult/hRpcColCellmult__0__1_",
+        "RPC/hRpcColCellmult/hRpcColCellmult__0__2_",
+        "RPC/hRpcColCellmult/hRpcColCellmult__0__3_",
+        "RPC/hRpcColCellmult/hRpcColCellmult__0__4_",
+        "RPC/hRpcColCellmult/hRpcColCellmult__0__5_"       
+        ],
+        [
+          ["RPC/hRpcColCellmult2s0/hRpcColCellmult2s0__0__0_",
+           "RPC/hRpcColCellmult2s0/hRpcColCellmult2s0__0__1_"],
+          ["RPC/hRpcColCellmult2s1/hRpcColCellmult2s1__0__0_",
+           "RPC/hRpcColCellmult2s1/hRpcColCellmult2s1__0__1_"],
+          ["RPC/hRpcColCellmult2s2/hRpcColCellmult2s2__0__0_",
+           "RPC/hRpcColCellmult2s2/hRpcColCellmult2s2__0__1_"],
+          ["RPC/hRpcColCellmult2s3/hRpcColCellmult2s3__0__0_",
+           "RPC/hRpcColCellmult2s3/hRpcColCellmult2s3__0__1_"],
+          ["RPC/hRpcColCellmult2s4/hRpcColCellmult2s4__0__0_",
+           "RPC/hRpcColCellmult2s4/hRpcColCellmult2s4__0__1_"],
+          ["RPC/hRpcColCellmult2s5/hRpcColCellmult2s5__0__0_",
+           "RPC/hRpcColCellmult2s5/hRpcColCellmult2s5__0__1_"]
+        ],
+        [
+          "RPC/hRpcMultiplicity",
+          ["/RPC/hRpcTofPTMultiplicity/hRpcTofPTMultiplicity__0__0_",
+           "/RPC/hRpcTofPTMultiplicity/hRpcTofPTMultiplicity__0__1_",
+           "/RPC/hRpcTofPTMultiplicity/hRpcTofPTMultiplicity__0__2_"
+          ],
+          "RPC/hRpcLatch",
+          ["RPC/hRpcPTMultiplicity/hRpcPTMultiplicity__0__0_",
+           "RPC/hRpcPTMultiplicity/hRpcPTMultiplicity__0__1_",
+           "RPC/hRpcPTMultiplicity/hRpcPTMultiplicity__0__2_"
+          ]
+        ],
+        [
+        "RPC/hRpcXYHit/hRpcXYHit__0__0_",
+        "RPC/hRpcXYHit/hRpcXYHit__0__1_",
+        "RPC/hRpcXYHit/hRpcXYHit__0__2_",
+        "RPC/hRpcXYHit/hRpcXYHit__0__3_",
+        "RPC/hRpcXYHit/hRpcXYHit__0__4_",
+        "RPC/hRpcXYHit/hRpcXYHit__0__5_"       
+        ],        
+        // [
+        // "RPC/hRpcMboDbomult/hRpcMboDbomult__0__0_",
+        // "RPC/hRpcMboDbomult/hRpcMboDbomult__0__1_",
+        // "RPC/hRpcMboDbomult/hRpcMboDbomult__0__2_",
+        // "RPC/hRpcMboDbomult/hRpcMboDbomult__0__3_",
+        // "RPC/hRpcMboDbomult/hRpcMboDbomult__0__4_",
+        // "RPC/hRpcMboDbomult/hRpcMboDbomult__0__5_"       
+        // ],        
+        // [
+        // "RPC/hRpcTrbChanmult/hRpcTrbChanmult__0__0_",
+        // "RPC/hRpcTrbChanmult/hRpcTrbChanmult__0__1_",
+        // "RPC/hRpcTrbChanmult/hRpcTrbChanmult__0__2_",
+        // "RPC/hRpcTrbChanmult/hRpcTrbChanmult__0__3_",
+        // "RPC/hRpcTrbChanmult/hRpcTrbChanmult__0__4_",
+        // "RPC/hRpcTrbChanmult/hRpcTrbChanmult__0__5_"       
+        // ],
+        // [
+        // "RPC/hRpcTrbMbomult/hRpcTrbMbomult__0__0_",
+        // "RPC/hRpcTrbMbomult/hRpcTrbMbomult__0__1_",
+        // "RPC/hRpcTrbMbomult/hRpcTrbMbomult__0__2_",
+        // "RPC/hRpcTrbMbomult/hRpcTrbMbomult__0__3_",
+        // "RPC/hRpcTrbMbomult/hRpcTrbMbomult__0__4_",
+        // "RPC/hRpcTrbMbomult/hRpcTrbMbomult__0__5_"       
+        // ],
+      ];
+    
+    let histoptions = 
+      [
+        [
+          {},
+          {},
+          {},
+          {},
+          {},
+          {}
+        ],
+        [
+          [
+           {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec1'},
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec2'},
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec3'},
+            {HIST: {fFillStyle : 0, fLineColor : 861, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec4'},
+            {HIST: {fFillStyle : 0, fLineColor : 612, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec5'},
+            {HIST: {fFillStyle : 0, fLineColor : 806, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec6'}
+          ],
+          [
+           {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec1'},
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec2'},
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec3'},
+            {HIST: {fFillStyle : 0, fLineColor : 861, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec4'},
+            {HIST: {fFillStyle : 0, fLineColor : 612, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec5'},
+            {HIST: {fFillStyle : 0, fLineColor : 806, fLineWidth: 2, fOption: 'l'}, LABEL: 'Sec6'}
+          ],            
+        ],
+        [
+          {},
+          {},
+          {},
+          {},
+          {},
+          {}
+        ],
+        [
+          {},
+          {},
+          {},
+          {},
+          {},
+          {}
+        ],
+        [
+          [{},{}],
+          [{},{}],
+          [{},{}],
+          [{},{}],
+          [{},{}],
+          [{},{}]
+        ],
+        [
+          {},
+          [{},{},{}],
+          {},
+          [{},{},{}]
+        ],
+        [ {}, {}, {}, {}, {}, {} ],
+/*        [ 
+          {HIST: {fTitle: 'Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 6', fOption: 'colz2'}},
+        ],
+        [ 
+          {HIST: {fTitle: 'Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 6', fOption: 'colz2'}},
+        ],        
+        [ 
+          {HIST: {fTitle: 'Sector 1', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 2', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 3', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 4', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 5', fOption: 'colz2'}},
+          {HIST: {fTitle: 'Sector 6', fOption: 'colz2'}},
+        ], */       
+      ];
+      
+    let helptext = 
+      [
+        ["","","","","",""],  
+        ["","","",""],
+        ["","","","","",""],
+        ["","","","","",""],
+        ["","","","","",""],
+        ["","","",""],
+        ["","","","","",""],
+        // ["","","","","",""],
+        // ["","","","","",""],
+        // ["","","","","",""],
+      ];    
+      
+    initUpdate(histnames,histoptions, helptext, {Palette : 55});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>RPC</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Main</button>
+    <button class="tablinks" onclick="openTab(event, 't1')">Mult</button>
+    <button class="tablinks" onclick="openTab(event, 't2')">ChargeDiff</button>
+    <button class="tablinks" onclick="openTab(event, 't3')">CellMult</button>
+    <button class="tablinks" onclick="openTab(event, 't4')">CellMultEnds</button>
+    <button class="tablinks" onclick="openTab(event, 't5')">RawMult</button>    
+    <button class="tablinks" onclick="openTab(event, 't6')">HitXY</button>    
+<!--    <button class="tablinks" onclick="openTab(event, 't7')">MboDboMult</button>    
+    <button class="tablinks" onclick="openTab(event, 't8')">TrbChanMult</button>    
+    <button class="tablinks" onclick="openTab(event, 't9')">TrbMboMult</button>    -->
+  </div>
+
+  <div id="t0" class="tabcontent cell3x2 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell2x2">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+    <div><div id="t1d3"></div></div>
+  </div>
+  <div id="t2" class="tabcontent cell3x2">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+    <div><div id="t2d4"></div></div>
+    <div><div id="t2d5"></div></div>
+  </div>
+  <div id="t3" class="tabcontent cell3x2">
+    <div><div id="t3d0"></div></div>
+    <div><div id="t3d1"></div></div>
+    <div><div id="t3d2"></div></div>
+    <div><div id="t3d3"></div></div>
+    <div><div id="t3d4"></div></div>
+    <div><div id="t3d5"></div></div>
+  </div>
+  <div id="t4" class="tabcontent cell3x2">
+    <div><div id="t4d0"></div></div>
+    <div><div id="t4d1"></div></div>
+    <div><div id="t4d2"></div></div>
+    <div><div id="t4d3"></div></div>
+    <div><div id="t4d4"></div></div>
+    <div><div id="t4d5"></div></div>
+  </div>
+  <div id="t5" class="tabcontent cell2x2">
+    <div><div id="t5d0"></div></div>
+    <div><div id="t5d1"></div></div>
+    <div><div id="t5d2"></div></div>
+    <div><div id="t5d3"></div></div>
+  </div>  
+  <div id="t6" class="tabcontent cell3x2">
+    <div><div id="t6d0"></div></div>
+    <div><div id="t6d1"></div></div>
+    <div><div id="t6d2"></div></div>
+    <div><div id="t6d3"></div></div>
+    <div><div id="t6d4"></div></div>
+    <div><div id="t6d5"></div></div>
+  </div>  
+<!--  <div id="t7" class="tabcontent cell3x2">
+    <div><div id="t7d0"></div></div>
+    <div><div id="t7d1"></div></div>
+    <div><div id="t7d2"></div></div>
+    <div><div id="t7d3"></div></div>
+    <div><div id="t7d4"></div></div>
+    <div><div id="t7d5"></div></div>
+  </div>  
+  <div id="t8" class="tabcontent cell3x2">
+    <div><div id="t8d0"></div></div>
+    <div><div id="t8d1"></div></div>
+    <div><div id="t8d2"></div></div>
+    <div><div id="t8d3"></div></div>
+    <div><div id="t8d4"></div></div>
+    <div><div id="t8d5"></div></div>
+  </div>   
+  <div id="t9" class="tabcontent cell3x2">
+    <div><div id="t9d0"></div></div>
+    <div><div id="t9d1"></div></div>
+    <div><div id="t9d2"></div></div>
+    <div><div id="t9d3"></div></div>
+    <div><div id="t9d4"></div></div>
+    <div><div id="t9d5"></div></div>
+  </div> -->  
+</body>
diff --git a/hadesroot/Start.htm b/hadesroot/Start.htm
new file mode 100644 (file)
index 0000000..9cdebbd
--- /dev/null
@@ -0,0 +1,160 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+
+
+    let histnames = 
+      [
+        [
+        "START/hStart_beamProf/hStart_beamProf__0__0_",
+        "START/hStart_beamProf/hStart_beamProf__0__1_",
+        "START/hStart_beamProf/hStart_beamProf__0__3_",
+        "START/hStart_beamSpot",
+        "START/hStart_Veto_tot",
+          [
+            "START/hStart_CalClus_Mult/hStart_CalClus_Mult__0__0_",
+            "START/hStart_CalClus_Mult/hStart_CalClus_Mult__0__1_",
+            "START/hStart_CalClus_Mult/hStart_CalClus_Mult__0__3_"
+          ],
+        "START/hStart_Veto_tdiff/hStart_Veto_tdiff__0__0_",
+          [
+            "START/hStart_CalHits_tDiff/hStart_CalHits_tDiff__0__0_",
+            "START/hStart_CalHits_tDiff/hStart_CalHits_tDiff__0__1_",
+            "START/hStart_CalHits_tDiff/hStart_CalHits_tDiff__0__3_"
+          ],
+          [
+            "START/hStart_CalHits_Mult/hStart_CalHits_Mult__0__0_",
+            "START/hStart_CalHits_Mult/hStart_CalHits_Mult__0__1_",
+            "START/hStart_CalHits_Mult/hStart_CalHits_Mult__0__3_"
+          ],
+        ],
+        [
+          "START/hStartTimes",
+          "START/hStartTimesRaw",
+          "START/hStart_Veto_tdiff0",
+          "START/hStart_Veto_tdiff1"
+        ],
+        [
+          "START/hStart_Veto_tdiff/hStart_Veto_tdiff__0__0_",
+          "START/hStart_Veto_tdiff/hStart_Veto_tdiff__0__1_",
+          "START/hStart_Veto_tdiff/hStart_Veto_tdiff__0__2_",
+          "START/hStart_Veto_tdiff/hStart_Veto_tdiff__0__3_"
+        ],
+      ];
+
+
+      
+    let histoptions = 
+      [
+        [
+          {HIST : {fTitle: 'Start X Profile'}},
+          {HIST : {fTitle: 'Start Y Profile'}},
+          {HIST : {fTitle: 'Veto Profile'}},
+          {},
+          {},
+          [
+            {LABEL: 'Start X', LEGENDNOAUTO: { fX1NDC: 0.8, fY1NDC: 0.75, fX2NDC: 0.99, fY2NDC: 0.90, fNColumns : 1, fTextSize : 0.04 }},
+            {LABEL: 'Start Y'},
+            {LABEL: 'Veto'},
+          ],
+          {},
+          [
+            {HIST: {fFillStyle : 0, fLineColor : 2, fLineWidth: 1, fOption: 'l logy'}, LABEL: 'Start X', LEGENDNOAUTO: { fX1NDC: 0.8, fY1NDC: 0.75, fX2NDC: 0.99, fY2NDC: 0.90, fNColumns : 1, fTextSize : 0.04 }},
+            {HIST: {fFillStyle : 0, fLineColor : 4, fLineWidth: 1, fOption: 'l logy'}, LABEL: 'Start Y'},
+            {HIST: {fFillStyle : 0, fLineColor : 3, fLineWidth: 1, fOption: 'l logy'}, LABEL: 'Veto'},
+          ],        
+          [
+            {LABEL: 'Start X', LEGENDNOAUTO: { fX1NDC: 0.8, fY1NDC: 0.75, fX2NDC: 0.99, fY2NDC: 0.90, fNColumns : 1, fTextSize : 0.04 }},
+            {LABEL: 'Start Y'},
+            {LABEL: 'Veto'},
+          ],        
+        ],
+        [
+          {HIST: {fOption: 'colz2 pal50'}},
+          {HIST: {fOption: 'colz2 pal50'}},
+          {HIST: {fOption: 'colz2 pal50', fZaxis: {fTitle: 'counts'}}},
+          {HIST: {fOption: 'colz2 pal50', fZaxis: {fTitle: 'counts'}}}
+        ],
+        [
+          {HIST: {fOption: 'colz2 pal50', fZaxis: {fTitle: 'counts'}}},
+          {HIST: {fOption: 'colz2 pal50', fZaxis: {fTitle: 'counts'}}},
+          {HIST: {fOption: 'colz2 pal50', fZaxis: {fTitle: 'counts'}}},
+          {HIST: {fOption: 'colz2 pal50', fZaxis: {fTitle: 'counts'}}}
+        ],        
+      ];
+      
+    let helptext = 
+      [
+        [
+          "Beam profile on Start in X direction",
+          "Beam profile on Start in Y direction",
+          "Beam profile on Veto",
+          "Beam Spot on Start",
+          "ToT values on all channels of Start/Veto",
+          "Cluster Multiplicities on Start/Veto",
+          "Time Difference between Start and Veto",
+          "Time Differences between neighboring channels",
+          "Hit multiplicity"
+        ],
+        [ 
+          "the time of arrival of cal hits in the clusters with 5 ns time matching. Should form a band around 0",
+          "the time of arrival of all raw hits without any selection. The 3 Âµs time window is seen here",
+          "the time difference between cal hit clusters related to other clusters. Correlated hits produce a narrow band around 0, and here you can see that in veto we have some correlated noise, systematically giving a signal at -60 ns",
+          " time difference between not all, but closest clusters. Obviously, -60 noise disapears here, and you can check a systematic small shift in correlated hits"
+        ],
+        [
+          "",
+          "",
+          "",
+          ""
+        ]
+      ];       
+      
+      
+    initUpdate(histnames,histoptions, helptext, {Palette : 56});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>Start</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Main</button>
+    <button class="tablinks"        onclick="openTab(event, 't1')">Times</button>
+    <button class="tablinks"        onclick="openTab(event, 't2')">Veto Time Diff</button>
+  </div>
+
+  <div id="t0" class="tabcontent cell3x3 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+    <div><div id="t0d6"></div></div>
+    <div><div id="t0d7"></div></div>
+    <div><div id="t0d8"></div></div>
+  </div>
+
+  <div id="t1" class="tabcontent cell2x2">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+    <div><div id="t1d3"></div></div>
+  </div>  
+  <div id="t2" class="tabcontent cell2x2">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+  </div>    
+</body>
diff --git a/hadesroot/TOF.htm b/hadesroot/TOF.htm
new file mode 100644 (file)
index 0000000..b434803
--- /dev/null
@@ -0,0 +1,124 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+
+
+    let histnames = 
+      [
+        [
+          "TOF/hTofmulttof_raw",
+          "TOF/hTofpatternL_raw",
+          "TOF/hTofpattern_hit",
+          "TOF/hTofsum_hit",
+          "TOF/hTofpatternR_raw",
+          "TOF/hTofphi_hit"
+        ],
+        [
+          "TOF/hTofadcL_raw",
+          "TOF/hTofadcR_raw",
+          "TOF/hTofadcSum_hit",
+          "TOF/hTofadcPos_hit"
+        ],
+        [
+          "TOF/hToftdcL_raw",
+          "TOF/hToftdcR_raw",
+          "TOF/hToftdcSum_hit",
+          "TOF/hToftdcDiff_hit"
+        ],
+        [
+          "TOF/hTofsum_hit",
+          "TOF/hTofyvsx_hit",
+          "TOF/hToftheta_hit",
+          "TOF/hTofphi_hit"
+        ]
+      ];
+    
+    let histoptions = 
+      [
+        [
+          {},
+          {},
+          {},
+          {},
+          {},
+          {}
+        ],
+        [
+          {HIST: {fOption: 'colz2'}},
+          {HIST: {fOption: 'colz2'}},
+          {HIST: {fOption: 'colz2'}},
+          {HIST: {fOption: 'colz2'}}
+        ],
+        [
+          {HIST: {fOption: 'colz2'}},
+          {HIST: {fOption: 'colz2'}},
+          {HIST: {fOption: 'colz2'}},
+          {HIST: {fOption: 'colz2'}}
+        ],
+        [
+          {},
+          {},
+          {},
+          {}
+        ]
+      ];
+      
+    let helptext = 
+      [
+        ["","","","","",""],  
+        ["","","",""],
+        ["","","",""],
+        ["","","",""]
+      ];       
+      
+      
+    initUpdate(histnames,histoptions, helptext, {Palette : 55});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>TOF</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Main</button>
+    <button class="tablinks" onclick="openTab(event, 't1')">ADC</button>
+    <button class="tablinks" onclick="openTab(event, 't2')">TDC</button>
+    <button class="tablinks" onclick="openTab(event, 't3')">Hit</button>
+  </div>
+
+  <div id="t0" class="tabcontent cell3x2 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell2x2">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+    <div><div id="t1d3"></div></div>
+  </div>
+  <div id="t2" class="tabcontent cell2x2">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+  </div>
+  <div id="t3" class="tabcontent cell2x2">
+    <div><div id="t3d0"></div></div>
+    <div><div id="t3d1"></div></div>
+    <div><div id="t3d2"></div></div>
+    <div><div id="t3d3"></div></div>
+  </div>
+</body>
diff --git a/hadesroot/Trigger.htm b/hadesroot/Trigger.htm
new file mode 100644 (file)
index 0000000..2e10f16
--- /dev/null
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+    let histnames = 
+      [
+        [
+          "general/hLatch_Norm",
+          "START/hStart_EventID",
+          "general/hLatch_Mult",
+          [
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__0_",
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__1_",
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__2_",
+            "RPC/hTof_RpcTofMultiplicity/hTof_RpcTofMultiplicity__0__3_"
+          ],
+          [
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__0_",
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__1_",
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__2_",
+            "TOF/hTofMultiplicity/hTofMultiplicity__0__3_"
+          ],
+          // "general/hRpcTofMultiplicity",
+        ],
+        [
+          "general/trending/hLatch_Trend/hLatch_Trend__0__11_",
+          "general/trending/hLatch_Trend/hLatch_Trend__0__12_",
+          "general/trending/hLatch_Trend/hLatch_Trend__0__13_",
+          "general/trending/hLatch_Trend/hLatch_Trend__0__14_"
+        ]
+      ];
+    
+    let histoptions = 
+      [
+        [
+          {XLABEL: ['','','','','','','','','','PT1','PT2','PT3','PT4','PT5','PT6','PT7','PT8','PT9','PT10']},
+          {HIST: {fOption: 'logy'}},
+          {},
+          [
+            {HIST: {fLineWidth: 2}},
+            {HIST: {fLineWidth: 2}},
+            {HIST: {fLineWidth: 2}},
+            {HIST: {fLineWidth: 2}},
+          ],
+          [
+            {HIST: {fLineWidth: 2}},
+            {HIST: {fLineWidth: 2}},
+            {HIST: {fLineWidth: 2}},
+            {HIST: {fLineWidth: 2}},
+          ],
+          {}
+        ],
+        [
+          {HIST: {fOption: 'hist l', fTitle: 'PT1'}},
+          {HIST: {fOption: 'hist l', fTitle: 'PT2'}},
+          {HIST: {fOption: 'hist l', fTitle: 'PT3'}},
+          {HIST: {fOption: 'hist l', fTitle: 'PT4'}}
+        ]
+      ];
+      
+    let helptext = 
+      [
+        ["","","","","",""],  
+        ["","","",""]
+      ]; 
+      
+    initUpdate(histnames,histoptions, helptext);
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>Trigger</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Trigger</button>
+    <button class="tablinks" onclick="openTab(event, 't1')">TriggerTrend</button>
+  </div>
+
+  <div id="t0" class="tabcontent cell3x2 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+    <div><div id="t0d3"></div></div>
+    <div><div id="t0d4"></div></div>
+    <div><div id="t0d5"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell2x2">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+    <div><div id="t1d3"></div></div>
+  </div>
+</body>
diff --git a/hadesroot/WALL.htm b/hadesroot/WALL.htm
new file mode 100644 (file)
index 0000000..4994bfc
--- /dev/null
@@ -0,0 +1,232 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <link rel="stylesheet" type="text/css" href="files/tab.css">
+  <script type='module'>
+    import { openTab } from './files/functions.mjs';
+    window.openTab = openTab;
+  </script>
+
+  <script type='module'>
+    import { initUpdate, update } from './files/functions.mjs';
+
+    let histnames = 
+      [
+        [
+          [
+            "WALL/hWallProf1/hWallProf1__0__0_",
+            "WALL/hWallProf1/hWallProf1__0__1_"
+          ],
+          [
+            "WALL/hWallProf2/hWallProf2__0__0_",
+            "WALL/hWallProf2/hWallProf2__0__1_"
+          ],
+          [
+            "WALL/hWallProf3/hWallProf3__0__0_",
+            "WALL/hWallProf3/hWallProf3__0__1_"
+          ]
+        ],
+        [
+          [
+            "/WALL/hWallCellHits/hWallCellHits__0__0_",
+            "/WALL/hWallCellHits/hWallCellHits__0__0_"
+          ],
+          "/WALL/hWallTimeRawCell",
+          "/WALL/hWallWidthRawCell"
+        ],
+        [
+          [
+            "/WALL/hWallRawMult/hWallRawMult__0__0_",
+            "/WALL/hWallRawMult/hWallRawMult__0__1_",
+            "/WALL/hWallRawMult/hWallRawMult__0__2_",
+            "/WALL/hWallRawMult/hWallRawMult__0__3_"
+          ],
+          [
+            "/WALL/hWallRawMultBySize/hWallRawMultBySize__0__0_",
+            "/WALL/hWallRawMultBySize/hWallRawMultBySize__0__1_",
+            "/WALL/hWallRawMultBySize/hWallRawMultBySize__0__2_"
+          ],
+          [
+            "/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__0_",
+            "/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__1_",
+            "/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__2_",
+            "/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__3_"
+          ],
+          [
+            "/WALL/trending/hWallRawMultBySize_trend/hWallRawMultBySize_trend__0__0_",
+            "/WALL/trending/hWallRawMultBySize_trend/hWallRawMultBySize_trend__0__1_",
+            "/WALL/trending/hWallRawMultBySize_trend/hWallRawMultBySize_trend__0__2_"
+          ],
+        ],
+        [
+          "/WALL/hWallHitTime",
+          "/WALL/hWallHitCharge",
+          "/WALL/hWallHitXY"
+        ],
+        [
+          "/WALL/hWallTimeSmall",
+          "/WALL/hWallTimeMedium",
+          "/WALL/hWallTimeLarge",
+          "/WALL/hWallADCSmall",
+          "/WALL/hWallADCMedium",
+          "/WALL/hWallADCLarge"
+        ],
+        [
+          "/WALL/hWallLatchTimeSmall",
+          "/WALL/hWallLatchTimeMedium",
+          "/WALL/hWallLatchTimeLarge",
+          "/WALL/hWallLatchADCSmall",
+          "/WALL/hWallLatchADCMedium",
+          "/WALL/hWallLatchADCLarge"
+        ],
+        [
+          "/WALL/hWallTimeCalCell",
+          "/WALL/hWallChargeCalCell"
+        ]
+      ];
+    
+    let histoptions = 
+      [
+        [
+          [
+            {HIST: {fOption: 'hist'}},//"WALL/hWallProf1/hWallProf1__0__0_",
+            {HIST: {fOption: 'hist'}} //"WALL/hWallProf1/hWallProf1__0__1_"
+          ],
+          [
+            {HIST: {fOption: 'hist'}},//"WALL/hWallProf2/hWallProf2__0__0_",
+            {HIST: {fOption: 'hist'}} //"WALL/hWallProf2/hWallProf2__0__1_"
+          ],
+          [
+            {HIST: {fOption: 'hist'}},//"WALL/hWallProf3/hWallProf3__0__0_",
+            {HIST: {fOption: 'hist'}} //"WALL/hWallProf3/hWallProf3__0__1_"
+          ]
+        ],
+        [
+          [
+            {HIST: {fOption: 'hist'}},//"/WALL/hWallCellHits/hWallCellHits__0__0_",
+            {HIST: {fOption: 'hist'}} //"/WALL/hWallCellHits/hWallCellHits__0__0_"
+          ],
+          {HIST: {fOption: 'colz2 logz'}},//"/WALL/hWallTimeRawCell",
+          {HIST: {fOption: 'colz2 logz'}} //"/WALL/hWallWidthRawCell"
+        ],
+        [
+          [
+            {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'hist logy'}},//"/WALL/hWallRawMult/hWallRawMult__0__0_",
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'hist logy'}},//"/WALL/hWallRawMult/hWallRawMult__0__1_",
+            {HIST: {ffFillStyle : 0, fLineColor : 418, fLineWidth: 2, Option: 'hist logy'}},//"/WALL/hWallRawMult/hWallRawMult__0__2_",
+            {HIST: {ffFillStyle : 0, fLineColor : 861, fLineWidth: 2, Option: 'hist logy'}} //"/WALL/hWallRawMult/hWallRawMult__0__3_"
+          ],
+          [
+            {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'hist logy'}},//"/WALL/hWallRawMultBySize/hWallRawMultBySize__0__0_",
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'hist logy'}},//"/WALL/hWallRawMultBySize/hWallRawMultBySize__0__1_",
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'hist logy'}}//"/WALL/hWallRawMultBySize/hWallRawMultBySize__0__2_"
+          ],
+          [
+            {HIST: {fMarkerSize:0, fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}},//"/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__0_",
+            {HIST: {fMarkerSize:0, fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}},//"/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__1_",
+            {HIST: {fMarkerSize:0, ffFillStyle : 0, fLineColor : 418, fLineWidth: 2, Option: 'l'}},//"/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__2_",
+            {HIST: {fMarkerSize:0, ffFillStyle : 0, fLineColor : 861, fLineWidth: 2, Option: 'l'}} //"/WALL/trending/hWallRawMult_trend/hWallRawMult_trend__0__3_"
+          ],
+          [
+            {HIST: {fFillStyle : 0, fLineColor : 1, fLineWidth: 2, fOption: 'l'}},//"/WALL/trending/hWallRawMultBySize_trend/hWallRawMultBySize_trend__0__0_",
+            {HIST: {fFillStyle : 0, fLineColor : 600, fLineWidth: 2, fOption: 'l'}},//"/WALL/trending/hWallRawMultBySize_trend/hWallRawMultBySize_trend__0__1_",
+            {HIST: {fFillStyle : 0, fLineColor : 418, fLineWidth: 2, fOption: 'l'}}//"/WALL/trending/hWallRawMultBySize_trend/hWallRawMultBySize_trend__0__2_"
+          ],
+        ],
+        [
+          {},//"/WALL/hWallHitTime",
+          {},//"/WALL/hWallHitCharge",
+          {} //"/WALL/hWallHitXY"
+        ],
+        [
+          {},//"/WALL/hWallTimeSmall",
+          {},//"/WALL/hWallTimeMedium",
+          {},//"/WALL/hWallTimeLarge",
+          {},//"/WALL/hWallADCSmall",
+          {},//"/WALL/hWallADCMedium",
+          {} //"/WALL/hWallADCLarge"
+        ],
+        [
+          {},//"/WALL/hWallLatchTimeSmall",
+          {},//"/WALL/hWallLatchTimeMedium",
+          {},//"/WALL/hWallLatchTimeLarge",
+          {},//"/WALL/hWallLatchADCSmall",
+          {},//"/WALL/hWallLatchADCMedium",
+          {}//"/WALL/hWallLatchADCLarge",
+        ],
+        [
+          {HIST: {fOption: 'colz2 logz'}},//"/WALL/hWallTimeCalCell",
+          {HIST: {fOption: 'colz2 logz'}} //"/WALL/hWallChargeCalCell"
+        ]
+      ];
+    let helptext = 
+      [
+        ["","",""],
+        ["","",""],
+        ["","","",""],
+        ["","",""],
+        ["","","","","",""],
+        ["","","","","",""],
+        ["",""]
+      ]; 
+      
+    initUpdate(histnames, histoptions, helptext, {Palette : 55});
+    setInterval(update, 3000, histnames, histoptions);
+  </script>
+</head>
+
+<body>
+  <div class="tab">
+    <a href="/hadesroot"><button><b>WALL</b></button></a>
+    <button class="tablinks active" onclick="openTab(event, 't0')">Profile</button>
+    <button class="tablinks" onclick="openTab(event, 't1')">Main</button>
+    <button class="tablinks" onclick="openTab(event, 't2')">Trend</button>
+    <button class="tablinks" onclick="openTab(event, 't3')">Hit</button>
+    <button class="tablinks" onclick="openTab(event, 't4')">Control</button>
+    <button class="tablinks" onclick="openTab(event, 't5')">ControlLATCH</button>
+    <button class="tablinks" onclick="openTab(event, 't6')">Cal</button>
+  </div>
+
+  <div id="t0" class="tabcontent cell3x1 active">
+    <div><div id="t0d0"></div></div>
+    <div><div id="t0d1"></div></div>
+    <div><div id="t0d2"></div></div>
+  </div>
+  <div id="t1" class="tabcontent cell3x1">
+    <div><div id="t1d0"></div></div>
+    <div><div id="t1d1"></div></div>
+    <div><div id="t1d2"></div></div>
+  </div>
+  <div id="t2" class="tabcontent cell2x2">
+    <div><div id="t2d0"></div></div>
+    <div><div id="t2d1"></div></div>
+    <div><div id="t2d2"></div></div>
+    <div><div id="t2d3"></div></div>
+  </div>
+  <div id="t3" class="tabcontent cell3x1">
+    <div><div id="t3d0"></div></div>
+    <div><div id="t3d1"></div></div>
+    <div><div id="t3d2"></div></div>
+  </div>
+  <div id="t4" class="tabcontent cell3x2">
+    <div><div id="t4d0"></div></div>
+    <div><div id="t4d1"></div></div>
+    <div><div id="t4d2"></div></div>
+    <div><div id="t4d3"></div></div>
+    <div><div id="t4d4"></div></div>
+    <div><div id="t4d5"></div></div>
+  </div>
+  <div id="t5" class="tabcontent cell3x2">
+    <div><div id="t5d0"></div></div>
+    <div><div id="t5d1"></div></div>
+    <div><div id="t5d2"></div></div>
+    <div><div id="t5d3"></div></div>
+    <div><div id="t5d4"></div></div>
+    <div><div id="t5d5"></div></div>
+  </div>
+  <div id="t6" class="tabcontent cell2x1">
+    <div><div id="t6d0"></div></div>
+    <div><div id="t6d1"></div></div>
+  </div>
+</body>
diff --git a/hadesroot/files/functions.mjs b/hadesroot/files/functions.mjs
new file mode 100644 (file)
index 0000000..74e738f
--- /dev/null
@@ -0,0 +1,159 @@
+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) {
+    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);
+
+    // Array.from(document.getElementsByClassName("tabcontent")).forEach(addhelp);
+    for (let tc = 0; tc < document.getElementsByClassName("tabcontent").length; tc++) {
+        for (let t = 0; t < document.getElementsByClassName("tabcontent")[tc].children.length; t++) {
+            addhelp(tc, t, helptext[tc][t]);
+        }
+    }
+}
+
+function addhelp(tc, t, h) {
+    const obj = document.getElementsByClassName("tabcontent")[tc].children[t];
+    const box = document.createElement("div");
+    box.classList.add("help");
+    box.innerHTML = h;
+    obj.append(box)
+}
+
+function deepMerge(target, source) {
+    if (!source)
+        return target;
+    Object.entries(source).forEach(([key, value]) => {
+        if (value && typeof value === 'object') {
+            deepMerge(target[key] = target[key] || {}, value);
+            return;
+        }
+        target[key] = value;
+    });
+    return target;
+}
+
+function setPainterSettings(painter, settings) {
+    if (!settings)
+        return;
+    if (settings.FRAME)
+        deepMerge(painter.getFramePainter(), settings.FRAME);
+    if (settings.PAINTER)
+        deepMerge(painter, settings.PAINTER);
+    if (settings.PAD)
+        deepMerge(painter.getPadPainter(), settings.PAD);
+}
+
+function createLegendEntry(obj, lbl) {
+    let entry = root.create('TLegendEntry');
+    entry.fObject = obj;
+    entry.fLabel = lbl;
+    entry.fOption = 'l';
+    return entry;
+}
+
+export async function update(histnames, histoptions) {
+
+    for (var t = 0; t < histnames.length; t++) {
+        let tablinks = document.getElementsByClassName("tablinks");
+        if (!tablinks[t].className.includes("active"))
+            continue;
+
+        for (var i = 0; i < histnames[t].length; i++) {
+            if (!Array.isArray(histnames[t][i])) {
+                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 (histoptions[t][i].XLABEL) {
+                    hist.fXaxis.fLabels = root.create('THashList');
+                    for (let l = 0; l < histoptions[t][i].XLABEL.length; l++) {
+                        let lbl = root.create('TObjString');
+                        lbl.fString = histoptions[t][i].XLABEL[l];
+                        lbl.fUniqueID = l + 1;
+                        hist.fXaxis.fLabels.Add(lbl, '');
+                    }
+                }
+                // console.log(hist);
+                let painter = await root.redraw(`t${t}d${i}`, hist, '');
+                // if (!first_call[t][i]) {
+                    setPainterSettings(painter, histoptions[t][i]);
+                    first_call[t][i] = true;
+                // }
+                // console.log(painter);
+                // console.log(painter.getFramePainter());
+            }
+            else {
+                let histo = [];
+                let label = {};
+                for (var j = 0; j < histnames[t][i].length; j++) {
+                    histo[j] = await root.httpRequest('/qaweb/HadesQA/' + histnames[t][i][j] + '/root.json.gz?compact=23', 'object');
+                    deepMerge(histo[j], histoptions[t][i][j].HIST);
+                    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');
+                        for (let l = 0; l < histoptions[t][i][j].XLABEL.length; l++) {
+                            let lbl = create('TObjString');
+                            lbl.fString = histoptions[t][i][j].XLABEL[l];
+                            lbl.fUniqueID = l + 1;
+                            histo[j].fXaxis.fLabels.Add(lbl, '');
+                        }
+                    }
+                }
+                const stack = root.createTHStack(...histo);
+                // console.log(stack);
+                if (histo[0].fTitle) stack.fTitle = histo[0].fTitle;
+                if (Object.keys(label).length) {
+                    let leg = root.create('TLegend');
+                    if (histoptions[t][i][Object.keys(label)[0]].LEGENDNOAUTO)
+                        Object.assign(leg, histoptions[t][i][Object.keys(label)[0]].LEGENDNOAUTO);
+                    for (let [key, value] of Object.entries(label)) {
+                        leg.fPrimitives.Add(createLegendEntry(histo[key], value));
+                    }
+                    // console.log(leg);
+                    if (!histoptions[t][i][Object.keys(label)[0]].LEGENDNOAUTO)
+                        stack.fHists.arr[0].fFunctions.Add(leg, 'autoplace');
+                    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]) {
+                    setPainterSettings(painter, histoptions[t][i][0]);
+                    first_call[t][i] = true;
+                // }
+            }
+        }
+    }
+}
+
+export function openTab(evt, Name) {
+    // Declare all variables
+    var i, tabcontent, tablinks;
+
+    // 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';
+    }
+
+    // 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", "");
+    }
+
+    // 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";
+}
diff --git a/hadesroot/files/tab.css b/hadesroot/files/tab.css
new file mode 100644 (file)
index 0000000..8d7c10d
--- /dev/null
@@ -0,0 +1,127 @@
+body {
+  height: calc(100vh - 30px);
+  margin:0;
+  padding:0;
+  margin-top:30px;
+  }
+  
+.tabcontent {
+  display: none;                       /* 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;
+}
+
+.tabcontent>div>div {
+  width:100%;
+  height:100%;
+}
+
+.tabcontent>div {
+/*   padding: 5px; */
+/*   margin-bottom: 5px; */
+  background-color: #999;
+  border:1px solid #aaa;
+  position:relative;
+  
+}
+
+.cell6x4>div {
+  flex: 1 1 16%;                       
+  height: calc(25vh - 10px);
+}
+
+.cell3x3>div {
+  flex: 1 1 33%;                       
+  height: calc(33vh - 15px);
+}
+
+.cell3x2>div {
+  flex: 1 1 33%;                       
+  height: calc(50vh - 20px);
+}
+
+.cell3x1>div {
+  flex: 1 1 33%;                       
+  height: calc(100vh - 40px);
+}
+
+.cell2x2>div {
+  flex: 1 1 49%;                       
+  height:  calc(50vh - 20px);
+}
+
+.cell2x1>div {
+  flex: 1 1 49%;                       
+  height: calc(100vh - 40px);
+}
+
+.tab {
+  position:absolute;
+  top: 0px;
+  width: calc(100% - 2px);
+  z-index:1;
+  overflow: hidden;
+  border: 1px solid #ccc;
+  height: 30px;
+  max-height: 30px;
+  padding: 0;
+  margin: 0;
+  background-color: #f1f1f1;
+}
+
+.tab button {
+  background-color: inherit;
+  float: left;
+  border: 1px solid #aaa;
+  outline: none;
+  cursor: pointer;
+  padding: 7px 20px;
+  transition: 0.3s;
+  border-radius:10px 10px 0 0;
+}
+
+.tab button:hover {
+  background-color: #ddd;
+}
+
+.tab button.active {
+  background-color: #fff;
+}
+
+
+.tabcontent .help {
+  position:absolute;
+  top:0;
+  right:0;
+  max-width:1em;
+  max-height:1.2em;
+  overflow:hidden;
+  background:#eed;
+  text-align:center;
+  z-index:2;
+  transition: max-width 200ms, max-height 200ms;
+}
+
+.tabcontent .help:hover {
+  max-width:none;
+  max-height:none;
+  text-align:left;
+  background:#ddd;
+  overflow:scroll;
+  width:200px;
+  height:200px;
+  font-size:80%;
+  margin:5px;
+  padding:5px;
+  border:1px solid black;  
+}
+
+.tabcontent .help::before{
+  content:"?";
+}
+.tabcontent .help:hover::before{
+  content:"";
+}
index 5c0547ba70a4513a948ea546220c23e0183db805..ff9d8b3e1d44bc577161166832088743ebef37f9 100644 (file)
@@ -93,11 +93,11 @@ our @EcalTempLimits    = (55, 60, 65);
 our @StartTempLimits    = (55, 60, 65);
 our @ItofTempLimits    = (55, 60, 65);
 our @RichInnerTempLimits = (37.5,38.5,39);
-our @TrgErrLimits     = (100, 1000, 10000);
+our @TrgErrLimits     = (1000, 2000, 10000);
 our @CPULimits        = (95, 100, 100);
 our @TimeoutLimits    = (0, 0, 1);
 our @TimeoutLimitsOnlyRICHMDC = (4, 6, 10);
-our @LinkErrLimits     = (50, 500, 1000);
+our @LinkErrLimits     = (150, 500, 1000);
 our @MdcEndpMissingLimits   =  (4, 5, 6);  #(0, 4, 5)!!! Oh dear.
 our @RichEndpMissingLimits   = (1, 3, 4);
 our @TofEndpMissingLimits   = (0, 0, 0);
@@ -114,7 +114,7 @@ our @MdcTokenMissLimits = (10,50,100);
 # Modification of 4.Feb2024 P1S3 supplied by different HV channels, so taken out here:
 our $MdcNominalHV = [[1750,1750,1750,1750,1750,1750],[1770,1790,1770,1770,1770,1770],[1900,1900,1900,1900,1900,1900],[2150,2150,2150,2150,2150,2150]];
 our $MdcHVOffsetLimits = [[5,10,255],[5,30,255],[5,10,255],[10,110,325]];
-our @EcalHvLimits = (978,960,950);
+our @EcalHvLimits = (977,960,950);
 our @RpcHvLimits = (12,12,12);
 our @TofHvLimits = (764,760,759);
 our @FwHvLimits = (280,250,200);
@@ -123,6 +123,7 @@ our @ItofHvLimits = (29,28,0);
 
 our @TdcCalibrationInterval = (3200000,4500000,6000000);   
 our @TdcCalibrationTemperature = (4,5,7);    
+our @TdcCalibrationTemperatureRich = (7,9,10);    
     
 our @PionLvCurrLimits = (4,5,6);
 
@@ -155,7 +156,7 @@ our $RichGasOff = 0;
 our $TofHvOff = 0;
 our $RpcHvOff = 0;
 our $FwHvOff = 0;
-our $MagnetOff = 1;
+our $MagnetOff = 0;
 our $StsHvOff = 1;
 our $StartHvOff = 1;
 our $ItofHvOff = 1;
@@ -169,7 +170,8 @@ our $QAServerOff = 0;
 ###############################################################################
 
 our @mdc_boards_removed =(0x2257); # 2333 added 2024-03-01 #(0x2203, 0x2027, 0x2057); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23
-our @mdc_new_boards_removed =(); #(0x8e95,0xa950,0xa951);
+our @mdc_new_boards_removed =(0x8e7b,0xa7b0,0xa7b1,
+                              0x8e5a,0xa5a0,0xa5a1,0xa5a2); #(0x8e95,0xa950,0xa951); #0x8e7b,0xa7b0,0xa7b1
 
 our @mdc_chambers_removed =();
 our @rich_boards_removed =();#(0x71a4,0x71a5,0x71b4,0x71b5,0x72a4,0x72a5,0x72b4,0x72b5,0x73a4,0x73a5,0x73b4,0x73b5,0x826a);
index def467206b5ef1201d60511b1a3a8e6c9a0c68d8..7970bc3d9f3cf24a039ac629ec8e16833bb3a85b 100755 (executable)
@@ -338,8 +338,8 @@ while(1) {
 
   my $value = '';
   my $status = QA::OK;
-  if($min[0]<3270  || $min[1]<2500  || $min[2]<1250  || $min[3]<1160)  {$status = QA::WARN}
-  if($min[10]<3330 || $min[11]<2560 || $min[12]<1250 || $min[13]<1160) {$status = QA::WARN}
+  if($min[0]<3270  || $min[1]<2500  || $min[2]<1240  || $min[3]<1160)  {$status = QA::WARN}
+  if($min[10]<3330 || $min[11]<2560 || $min[12]<1240 || $min[13]<1160) {$status = QA::WARN}
   
 #  QA::WriteQALog($fqa,"rich","volt",30,$status,'Voltages',$value,$longtext);
 
@@ -384,7 +384,7 @@ while(1) {
   print $fh   encode_json($dirich2V5);
   close $fh;
 
-  $dirich1V2->{min} = 1250;
+  $dirich1V2->{min} = 1240;
   $dirich1V2->{max} = 1400;
   $dirich1V2->{symbol} = 'mV';
   $dirich1V2->{title} = 'RICH 1.2V';
index 7fb81378183bc51c2433e6b1580f5f4e5f1494fa..cd7d7bbb9cf0eb4b5e5e97bc8d7e9c233e21ab45 100755 (executable)
@@ -42,9 +42,9 @@ while(1){
     
    
 #   print Dumper $store;
-  my ($min,$max) = (0,0);
+  my ($min,$max,$minrich,$maxrich) = (0,0,0,0);
   my ($minvdiff,$maxvdiff) = (10000,0);
-  my ($minboard,$maxboard) = (0,0);
+  my ($minboard,$maxboard,$minboardrich,$maxboardrich) = (0,0,0,0);
   my ($maxvdiffboard,$minvdiffboard) = (0,0);
 #   print "Read\n";
     
@@ -55,14 +55,23 @@ while(1){
       $newstore->{boards}{$b} = $t;
       if($store->{boards}) {
         next unless $store->{boards}{$b};
-        if ($t - $store->{boards}{$b} > $max) {
+        if ($t - $store->{boards}{$b} > $max && ($b&0xF000) != 0x7000) {
           $max = $t - $store->{boards}{$b};
           $maxboard = $b;
           }
-        if ($t - $store->{boards}{$b} < $min) {
+        if ($t - $store->{boards}{$b} < $min && ($b&0xF000) != 0x7000) {
           $min = $t - $store->{boards}{$b};
           $minboard = $b;
           }
+        if ($t - $store->{boards}{$b} > $maxrich && ($b&0xF000) == 0x7000) {
+          $maxrich = $t - $store->{boards}{$b};
+          $maxboardrich = $b;
+          }
+        if ($t - $store->{boards}{$b} < $minrich && ($b&0xF000) == 0x7000) {
+          $minrich = $t - $store->{boards}{$b};
+          $minboardrich = $b;
+          }
+          
         }
       }
     if(($b&0xF000) == 0x7000) {
@@ -97,7 +106,7 @@ while(1){
   $export->{time}    = time();
   $export->{quality} = $data->{LastCalibr}{'quality'};
   $export->{status}{time} = QA::GetQAState('below',$timesincecalib,@QA::TdcCalibrationInterval);
-  $export->{status}{temp} = QA::GetQAState('below',max(-$min,$max),@QA::TdcCalibrationTemperature);
+  $export->{status}{temp} = max(QA::GetQAState('below',max(-$min,$max),@QA::TdcCalibrationTemperature),QA::GetQAState('below',max(-$minrich,$maxrich),@QA::TdcCalibrationTemperatureRich));
   $export->{status}{volt} = ($minvdiffboard || $maxvdiffboard)?QA::ERROR:QA::OK;
   $export->{status}{quality} = ($export->{quality} < 0.9)?QA::ERROR:QA::OK;
   # JAM12-2021: 0.9 means error was acknowledged by operator (???) , 1.0 means all is perfect
@@ -130,7 +139,8 @@ while(1){
     my $txt = strftime("%d.%m. %H:%M",localtime($data->{LastCalibr}{'time'}));
     my $longtext = "Last Calibration was done at $txt <br/>";
       $longtext .= sprintf("Temperature changed in the interval of %.1f (%04x) to %.1f (%04x) degrees.<br/>",$min,$minboard,$max,$maxboard);
-      if($minvdiffboard) {
+      $longtext .= sprintf("Temperature changed in the interval of %.1f (%04x) to %.1f (%04x) degrees in RICH.<br/>",$minrich,$minboardrich,$maxrich,$maxboardrich);
+       if($minvdiffboard) {
         $longtext .= sprintf("Voltage changed by %.1f (%04x) mV.<br/>",$minvdiff,$minvdiffboard);
         }
       if($maxvdiffboard) {
index 7b347cc94b70a113f45041407b5f74f717f86b3e..50958ce6cdf69a2acba00af55fea8a12051063c3 100755 (executable)
@@ -29,6 +29,14 @@ my %hubnames = (
   'trb3sc315' => 'ECal',
   'trb3sc318' => 'ECal',
   'trb3sc316' => 'ECal',
+  
+  'trb3sc548' => 'MDC',
+  'trb3sc565' => 'MDC',
+  'trb3sc546' => 'MDC',
+  'trb3sc554' => 'MDC',
+  'trb3sc563' => 'MDC',
+  'trb3sc555' => 'MDC',
+  
   'trb3sc134' => 'RPC',
   'trb3sc009' => 'RPC',
   'trb3sc130' => 'RPC',
@@ -86,7 +94,7 @@ while(1) {
 #       }      
 #     }
 
-
+print "n\n";
 trb_init_ports() or die trb_strerror();
 
 my $errorfound = 0;
index a836d6f029fdf66d4b90c36865d71a04bd14b064..5fa653861ad243b293ac3e1772050b4bb4d9b3d2 100755 (executable)
@@ -63,7 +63,7 @@ while (1) {
   }
   Hmon::WriteFile("MDCBusy",
                  $str[0][4]."<p>" #.$str[1][0].$str[1][1]."<p>".
-                 .$str[1][2]."<p>".$str[1][3].$str[2][0]);
+                 .$str[1][2]."<p>".$str[1][3].$str[2][2]);
 
   ($min, $max, $avg, $mean) = Hmon::MakeMinMax3($values, 4, 6, 16, 1);
 #   Hmon::WriteLog($flog, "MDC BusyTime",
index a7295fa94192e9eda2336f6c1feac6c0f0d1cc0e..c7c4928c87029743462fb1f39dfa867d8c6054c1 100755 (executable)
@@ -48,7 +48,7 @@ my $store = {};
     $str[2][$l] .= Hmon::MakeFooter();
     #                         Hmon::WriteFile("MDC".$l."Temperature",$str[0][$l].$str[1][$l].$str[2][$l]);
   }
-  Hmon::WriteFile("MDCFailure",$str[0][4]."<p>".$str[1][0].$str[1][1]."<p>".$str[1][2]."<p>".$str[1][3].$str[2][0]);
+  Hmon::WriteFile("MDCFailure",$str[0][4]."<p>".$str[1][0].$str[1][1]."<p>".$str[1][2]."<p>".$str[1][3].$str[2][3]);
 
 
 
index 47cad36d7f969e6c40e90324277d8130e4c15557..28f06267ca06cfa402d0647b101669ad53160fb2 100755 (executable)
@@ -101,7 +101,7 @@ while (1) {
 
     Hmon::WriteFile("MDCRetransmission",
         $str[0][4]."<p>". #$str[1][0].$str[1][1]."<p>".
-        $str[1][2]."<p>".$str[1][3].$str[2][0]);
+        $str[1][2]."<p>".$str[1][3].$str[2][3]);
                    
     
     sleep 1;
index 52ce360cb98cc66cf42d4987cc7f292f24e96ae0..5b77694370be595f73185683d14ef32d241d4caf 100755 (executable)
@@ -67,7 +67,7 @@ while (1) {
   
   Hmon::WriteFile("MDCTokenMiss",
                   $str[0][4]."<p>". #$str[1][0].$str[1][1]."<p>".
-                  $str[1][2]."<p>".$str[1][3].$str[2][0]);
+                  $str[1][2]."<p>".$str[1][3].$str[2][3]);
                   
   my $qastate = QA::GetQAState('below', $sum, @QA::MdcTokenMissLimits);
 #   QA::WriteQALog($fqa, "mdc", "oeps", 20, $qastate, 
index f31d36c48f60d54932ca71369eeb70d0428ffee9..4d713ad159b507720518928554eff9650aa0c3fd 100755 (executable)
@@ -64,7 +64,34 @@ while (1) {
       $reg_address++;
     }
   }
+
   
+  my $values = trb_register_read_mem(0xfe90,0xd488,0,4);
+  foreach my $b (sort keys %{$values}) {
+    my $value = $values->{$b}[0] / 16;
+    if ($value > 1550) {
+      my $boardstr = sprintf("%04x",$b);
+      $msg .= " $boardstr 1.1V high (".sprintf("%.2fV),",$value/1000.); 
+      $high++;    
+      }
+    if ($value < 1350) {
+      my $boardstr = sprintf("%04x",$b);
+      $msg .= " $boardstr 1.1V low (".sprintf("%.2fV),",$value/1000.); 
+      $low++;    
+      }
+    $value = $values->{$b}[2] / 16;
+    if ($value > 3750) {
+      my $boardstr = sprintf("%04x",$b);
+      $msg .= " $boardstr 3.3V high (".sprintf("%.2fV),",$value/1000.); 
+      $high++;    
+      }
+    if ($value < 3550) {
+      my $boardstr = sprintf("%04x",$b);
+      $msg .= " $boardstr 3.3V low (".sprintf("%.2fV),",$value/1000.); 
+      $low++;    
+      }
+    }
+    
   $status = $high + $low . " warnings";
   my $qastate = QA::GetQAState('below', $high + $low, @QA::MdcVoltageLimits);
   QA::WriteQALog($fqa, "mdc", "voltage", 30, $qastate,"Voltages", $status,$msg);
index 68cd0fe5885d5c997271756d71b45ec726969483..773cd7b0d555a8a709ced749abb6aae886e13812 100755 (executable)
@@ -128,8 +128,10 @@ my $value    = "OK ".(scalar @mdc_boards - scalar @QA::mdc_new_boards_removed);
 
 my $longtext = "";
    $longtext .= "Missing boards: $missinglist<br>" if $missing_number;
+   $longtext .= "$removedboards removed<br>" if $removedboards;
    
-Hmon::Speak('mdcmissonce',"$missing_number new M-D-C Frontends missing") if($qastate > 60 );
+Hmon::Speak('mdcmissonce',"$missing_number new M-D-C Frontends missing") if($qastate > 60 && $qastate < QA::ERROR );
+Hmon::Speak('mdcmiss',"$missing_number new M-D-C Frontends missing") if($qastate >= QA::ERROR );
 
 QA::WriteQALog($flog,"endp","mdc12",10,$qastate,"MDC 1/2",$value,$longtext);
 
index f3657643e8a274e5d7dcb3c95c01cbb078ae4b24..208e0a402c46551b85f7cd0ebd898f5a653e6155 100755 (executable)
@@ -86,10 +86,36 @@ my $plot5 = {
   set obj 2 rect from   -1, 10E7 to  2000, 100E7 fc rgb '#ffdddd' behind
     "
     };
-
-
 HPlot::PlotInit($plot5);
 
+my $plot5_online = {
+    name    => "StartRateX_histbar_online",
+    file    => "files/StartRateX_histbar_online",
+    entries => 600,
+    type    => HPlot::TYPE_BARGRAPH,
+    output  => HPlot::OUT_PNG,
+    titles  => ["0","1","2","3","4","5","6","7","8","9","10","11"],
+    xlabel  => "Time / 100 ms",
+    ylabel  => "Hitrate / Hz",
+    sizex   => 800,
+    sizey   => 500,
+    xmin    => 0,
+    xmax    => 600,
+    ymin    => "0",
+    ymax    => "5E5<*",
+    curves  => 12,
+    nokey   => 1,
+    xscale  => 10, # xscale does not work with TYPE_BARGRAPH
+    buffer  => 1,
+    stacked => 1,
+    curvewidth  => .9,
+    additional => "
+  set obj 1 rect from   -1, 7E7 to  2000, 10E7 fc rgb '#ffffbb' behind \n
+  set obj 2 rect from   -1, 10E7 to  2000, 100E7 fc rgb '#ffdddd' behind
+    "
+    };
+HPlot::PlotInit($plot5_online);
+
 # my $plot6 = {
 #     name    => "StartRateX_1histbar_VW",
 #     file    => "files/StartRateX_1histbar_VW",
@@ -490,6 +516,11 @@ $str .= qq@<img src="%ADDPNG files/StartRateX_histbar.png%" type="image/png"><br
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("StartRateX_histbar",$str);
 
+$str  = Hmon::MakeTitle(11, 11, "Beamintensity",0);
+$str .= qq@<img src="%ADDPNG files/StartRateX_histbar_online.png%" type="image/png"><br>\n@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("StartRateX_histbar_online",$str);
+
 $str  = Hmon::MakeTitle(12, 7, "Start Summed Rates Y",0);
 $str .= qq@<img src="%ADDPNG files/StartRateY_histbar.png%" type="image/png"><br>\n@;
 $str .= Hmon::MakeFooter();
@@ -777,6 +808,7 @@ while(1) {
             for my $i (0..11){              
                 HPlot::PlotAdd("StartRateX_histbar",$summedRatesFor4Channels_X0[$i],$i);
                 HPlot::PlotAdd("StartRateY_histbar",$summedRatesFor4Channels_Y0[$i],$i);
+                HPlot::PlotAdd("StartRateX_histbar_online",$summedRatesFor4Channels_X0[$i],$i);
                 HPlot::PlotAdd("StartRateX_histbar_short",$summedRatesFor4Channels_X0[$i],$i);
                 HPlot::PlotAdd("StartRateY_histbar_short",$summedRatesFor4Channels_Y0[$i],$i);
             
@@ -1015,6 +1047,7 @@ while(1) {
 
             HPlot::PlotDrawFork('StartPositionRMS')      if ($iter == 3);
             HPlot::PlotDrawFork('StartRateX_histbar') if ($iter == 4);
+            HPlot::PlotDrawFork('StartRateX_histbar_online') if ($iter == 4);
 #             HPlot::PlotDrawFork('StartRateX_1histbar_VW') if ($iter == 5);
             HPlot::PlotDrawFork('StartRateY_histbar') if ($iter == 6);
             HPlot::PlotDrawFork('StartRateY_histbar_short') if ($iter == 7);
index 188390fd03f9f549034000fcba8714d0d3b277d3..f295c51de15e4527fadb82b3e6b4c3b4532570c0 100755 (executable)
@@ -92,7 +92,7 @@ while(1) {
         $lowrate++  if ($diff->{$b}->[$v] < $lowratelimit);        
         }
       }
-    HPlot::PlotDraw('TofRate');    
+    HPlot::PlotDrawFork('TofRate');    
 
    }
 # print $highrate." ".$lowrate."\n";
@@ -114,5 +114,5 @@ while(1) {
    
   $old = $o;
   $oldtime = time();
-  sleep 2;
+  sleep 1;
   }
index 6701949281d8354421e9a80871dc2aee06e5196e..c33e415cf6d68509a7c4d3c19702eff7d924a22e 100755 (executable)
@@ -35,7 +35,7 @@ function openwin(url) {
 <li><a href="../daqtools/index.pl" target="_blank">Web Tools (daqtools)</a></li>
 <li><a href="../eb/?browser=fix" target="_blank">Eventbuilder Monitor</a></li>
 <li><a href="../rawmon/" target="_blank">Raw Data Monitor</a></li>
-<li><a href="https://web-docs.gsi.de/~webhades/onlineMon/feb24/hades-online-auau800.html" target="_blank">Accumulated Run Statistics</a>
+<li><a href="https://web-docs.gsi.de/~webhades/onlineMon/apr25/hades-online.html" target="_blank">Accumulated Run Statistics</a>
 </ul></div>
 
 <div class="linkbox" style="float:right"><h4>Documents</h4><ul>
index cc3cb570022f37e7b3e8e9089085b42dc4b3e1d2..a6e853d9eba5df7e9ddef31dec6bb4050169a0e5 100755 (executable)
@@ -135,9 +135,9 @@ while(1) {
     $str .= Hmon::MakeFooter();
     Hmon::WriteFile("EBCPU",$str);
     my $qastate = QA::GetQAState('below',$max,@QA::CPULimits);
-    if($busy_counter - $qa_overwrite > 0) {
+    if($busy_counter - $qa_overwrite > 0) {
       $qastate = QA::OK;
-    }
+    }
     QA::WriteQALog($fqa,"server","cpu",40,$qastate,"Max. CPU",$maxstr,$busystr);
     sleep 5;
     }
index 42a1393ce6ecc404982299fa95d1c7e3cb9da389..33b55b2d1bc74094480a6ee1d3d43395d36b987b 100755 (executable)
@@ -129,13 +129,9 @@ for(my $i = 1; $i <=6; $i++) {
 #  if ($i>=2){
   for(my $j = 1; $j<=168; $j++) {
     my $cnt = (($i)*168)+$j-1;
-    if($j<10) {$s = sprintf("HAD:ECAL:HV:S%i:M00%i:imon",$i,$j);}
-    if($j>=10 and $j<100) {$s = sprintf("HAD:ECAL:HV:S%i:M0%i:imon",$i,$j);}
-    if($j>=100) {$s = sprintf("HAD:ECAL:HV:S%i:M%i:imon",$i,$j);}
+    $s = sprintf("HAD:ECAL:HV:S%i:M%03i:imon",$i,$j);
     Perl2Epics::Connect("I$cnt",$s);
-    if($j<10) {$s = sprintf("HAD:ECAL:HV:S%i:M00%i:vmon",$i,$j);}
-    if($j>=10 and $j<100) {$s = sprintf("HAD:ECAL:HV:S%i:M0%i:vmon",$i,$j);}
-    if($j>=100) {$s = sprintf("HAD:ECAL:HV:S%i:M%i:vmon",$i,$j);}
+    $s = sprintf("HAD:ECAL:HV:S%i:M%03i:vmon",$i,$j);
     Perl2Epics::Connect("U$cnt",$s);
 #  }
   }
@@ -346,15 +342,14 @@ while(1) {
   if ($ChnlsOn == 0){ $qastate = QA::ERROR;}
   if ($QA::EcalHvOff == 1) { $qastate = QA::NOTE;}
 
-
  
  $str = "";
    if($timer%8 == 0) {
      if ($ChnlsOn>0 and $ChnlsOn<$TOTALCHANS and ($TOTALCHANS - $ChnlsOn) < 16) {  #only report if a small number of channels is off
      for(my $i = 1; $i <=6; $i++) {
  #       if ($i>=2){
-            for(my $j = 1; $j<=168; $j++) {
-                my $cnt = (($i-1)*168)+$j-1;
+            for(my $j = 1; $j<=163; $j++) {
+                my $cnt = (($i)*168)+$j-1;
                 if($data->{"U$cnt"}->{val}<1000 and $data->{"I$cnt"}->{val}>=10){ $str .= sprintf("Low voltage on module %i, sector %i.<br>",$j,$i);}
                 if($data->{"I$cnt"}->{val}<10 and $data->{"U$cnt"}->{val}>=1000){ $str .= sprintf("Low current on module %i, sector %i.<br>",$j,$i);}
                 if($data->{"U$cnt"}->{val}<10 and $data->{"I$cnt"}->{val}<10){ $str .= sprintf("Module %i, sector %i is switched off. Check!<br>",$j,$i);}
index a75facace130d8aaaeb42a903a84841f4161c1fe..7dd0223ee85a5f59fc37a190017c4466f6513297 100755 (executable)
@@ -47,8 +47,21 @@ while(1) {
   my $hour = strftime ("%H", localtime(time+$offset*86400+150));
      $hour =~ s/\s//;  
 
- my $plan = get("https://hessenbox-a10.rz.uni-frankfurt.de/dl/fiUP5enanrB2pwwuBDJxGj/ExpertsPlan.csv");
- my @plan = split("\n",$plan);
+  my $plan = get("https://hessenbox-a10.rz.uni-frankfurt.de/dl/fiUP5enanrB2pwwuBDJxGj/ExpertsPlan.csv");
+  if (!$plan) {
+    my $fileplan;
+    open($fileplan, "<", '/home/hadaq/trbsoft/daq/hmon/permanent/ExpertsPlan.csv') or die "can't open file";
+    local $/;
+    $plan = <$fileplan>;
+    close $fileplan;
+  }
+  else {
+    my $fileplan;
+    open($fileplan, ">", '/home/hadaq/trbsoft/daq/hmon/permanent/ExpertsPlan.csv') or die "can't open file";
+    print $fileplan $plan;
+    close $fileplan;
+  }
+  my @plan = split("\n",$plan);
  
   foreach my $line (@plan) {
    my @s = split(",",$line);
@@ -72,6 +85,7 @@ while(1) {
   my $text; my @ret;
   run3($oraclecmd, \$text, \@ret);
   my $cnt=0;
+  print Dumper $text;
   foreach my $line (@ret) {
     next unless $line =~ /^<td/;
     my $onshift = $line =~/on shift/;
@@ -114,7 +128,7 @@ while(1) {
       next if $store->{onshift}{$ex}{$n} eq '.';
       next if $store->{onshift}{$ex}{$n} eq '';
       
-      $str .= "<tr><td>".($ex eq 'DaqProf'?'DAQ':$ex)."<td>";
+      $str .= "<tr><td>".($ex eq 'DaqProf'?'DaqPro':$ex)."<td>";
       $str .=  "<div class=\"greenbutton inline\"></div>"     if $store->{onshift}{$ex}{$n} eq 'S' and $ex ne "SL";
       $str .=  "<div class=\"darkgreenbutton inline\"></div>" if $store->{onshift}{$ex}{$n} eq 'X';
       $str .=  "<div class=\"yellowbutton inline\"></div>"    if $store->{onshift}{$ex}{$n} eq '-';
index a9e99141bb4ffbb808a1502372a6c9a7b73d3ddd..abe0138f0d66dad72eb92239f0ccc8e4d9c97be2 100755 (executable)
@@ -205,9 +205,15 @@ sub isFeeHub {
   if (index($hubs,$hs) != -1) {
     return 1;
   }
-  if ($h > 0x1000 && $h < 0x1200 && $h%16) {
+  if ($h >= 0x1000 && $h < 0x1200 && $h%16) {
     return 1;
   }
+  if ($h >= 0x8e00 && $h < 0x9000) {
+    return 1;
+  }  
+  if ($h >= 0x8500 && $h < 0x8600 && $h%16) {
+    return 1;
+  }  
   return 0;
 }
 
index a2396c034b133e2e982fe5e79d3efcd6a8f0473e..6bf11fff023bcf8a5e8f8ab4012acc75a4268541 100755 (executable)
@@ -79,8 +79,8 @@ my %range_list = (
                   'HAD:MAGNET:HR3104(a)'        => {},#{},     
                   'HAD:MAGNET:HR3108R'          => {},#{}, 
                   'HAD:MAGNET:MV1106R'          => {},#{}, 
-                  'HAD:CRYO:TS105'              => {'minerror' => 125, 'min' => 130, 'max' => 155 , 'maxerror' => 160  },
-                  'HAD:CRYO:TIC106'             => {'minerror' => 8.5, 'min' => 8.7, 'max' => 10.2, 'maxerror' => 10.3 },
+                  'HAD:CRYO:TS105'              => {'minerror' => 80, 'min' => 85, 'max' => 105 , 'maxerror' => 110  },
+                  'HAD:CRYO:TIC106'             => {'minerror' => 8.5, 'min' => 8.7, 'max' => 10.5, 'maxerror' => 11 },
                   'HAD:CRYO:UpdateCounter:roc'  => {}#{},
                  );
 
@@ -223,7 +223,7 @@ while (1) {
     $longtext = "Checked at $time</br>";
     $longtext .= "TIC106: ".$range_list_href->{"HAD:CRYO:TIC106"}->{'min'}." K < <b>$TIC106 K</b> < ".$range_list_href->{"HAD:CRYO:TIC106"}->{'max'}." K</br>";
     $longtext .= "TS105: ".$range_list_href->{"HAD:CRYO:TS105"}->{'min'}." K < <b>$TS105 K</b> < ".$range_list_href->{"HAD:CRYO:TS105"}->{'max'}." K</br>";
-    $longtext .= sprintf("LL1708: %.2f%% < <b>%.2f%%</b> < %.2f%%", $range_list_href->{"HAD:MAGNET:LL1708"}->{'min'}, $LL1708, $range_list_href->{"HAD:MAGNET:LL1708"}->{'max'});
+    $longtext .= sprintf("LL1708: %.2f%% < <b>%.2f%%</b> < %.2f%%", $range_list_href->{"HAD:MAGNET:MCS:LL1708"}->{'min'}, $LL1708, $range_list_href->{"HAD:MAGNET:MCS:LL1708"}->{'max'});
     QA::WriteQALog($flog,"misc","magnet",$interval+20,QA::OK,$title,$value,$longtext);
     $last_good_time = $time;
   } 
index a450bfbb362509b14d800f14fc399fd69062b1d4..b09d9b9b0096610f6e4378a7ceaf1ad9b08a8db1 100755 (executable)
@@ -101,8 +101,8 @@ HPlot::PlotInit($plotScale);
 my $timer = 0;
 my $offset_o2 = 0;
 my $str = "";
-#my @emailAddrs = ("juergen.friese\@ph.tum.de", "foertsch\@uni-wuppertal.de", "pauly\@physik.uni-wuppertal.de");
-my @emailAddrs = ();
+my @emailAddrs = ("juergen.friese\@ph.tum.de", "foertsch\@uni-wuppertal.de", "pauly\@physik.uni-wuppertal.de");
+#my @emailAddrs = ()
 my $mailoutWarn = 0;
 my $mailoutErr = 0;
 my $mailoutDaily = 0;
@@ -173,8 +173,8 @@ while(1) {
   my $longtext = "";
 
   $qastate = QA::OK      if ($IsobPress <= 2.0 && $IsobPress >= 0.9);    
-  $qastate = QA::WARN_2  if (($IsobPress < 0.9) || ($IsobO2 >2000.0) || ($IsobRefR < 70.0));
-  $qastate = QA::ERROR_2 if (($IsobPress > 2.0) || ($IsobPress < 0.7) || ($IsobO2 > 5000.0) || ($IsobRefR < 50.0));
+  $qastate = QA::WARN_2  if (($IsobPress < 0.9) || ($IsobO2 >3500.0) || ($IsobRefR < 50.0));
+  $qastate = QA::ERROR_2 if (($IsobPress > 2.0) || ($IsobPress < 0.7) || ($IsobO2 > 5000.0) || ($IsobRefR < 20.0));
   # $qastate = QA::WARN_2  if (($IsobPress < 0.9) || ($IsobO2 >300.0) || ($IsobRefR < 70.0) || ($IsobScale1 < 40) || ($IsobScale2 < 40));
   # $qastate = QA::ERROR_2 if (($IsobPress > 2.0) || ($IsobPress < 0.7) || ($IsobO2 > 800.0) || ($IsobRefR < 50.0) || ($IsobScale1 < 37) || ($IsobScale2 < 37));
   $qastate = min(QA::WARN_2,$qastate) if $QA::RichHvOff;
index ab7870291510cc0f0f92685c553d3cb528b06068..1205c5db46b8158c30778c411d95fc2cfba1acec 100755 (executable)
@@ -95,8 +95,6 @@ HPlot::PlotInit({
     output  => HPlot::OUT_PNG,
     zlabel  => "Hitrate",
     sizex   => 310,
-    sizey   => 250,
-    nokey   => 1,
     buffer  => 1,
     ymin    => -0.5,
     ymax    => 15.5,
@@ -132,6 +130,34 @@ HPlot::PlotInit({
     curvewidth  => .9,
     });
     
+# my $plot5_online = {
+#     name    => "StartRateX_histbar_online",
+#     file    => "files/StartRateX_histbar_online",
+#     entries => 600,
+#     type    => HPlot::TYPE_BARGRAPH,
+#     output  => HPlot::OUT_PNG,
+#     titles  => ["3","4","5","6","7","8","9","10","11","12","13","14"],
+#     xlabel  => "Time / 100 ms",
+#     ylabel  => "Hitrate / Hz",
+#     sizex   => 800,
+#     sizey   => 500,
+#     xmin    => 0,
+#     xmax    => 600,
+#     ymin    => "0",
+#     ymax    => "5E5<*",
+#     curves  => 12,
+#     nokey   => 1,
+#     xscale  => 10, # xscale does not work with TYPE_BARGRAPH
+#     buffer  => 1,
+#     stacked => 1,
+#     curvewidth  => .9,
+#     additional => "
+#   set obj 1 rect from   -1, 7E7 to  2000, 10E7 fc rgb '#ffffbb' behind \n
+#   set obj 2 rect from   -1, 10E7 to  2000, 100E7 fc rgb '#ffdddd' behind
+#     "
+#     };
+# HPlot::PlotInit($plot5_online);
+
     
 my $str  = Hmon::MakeTitle(8, 7, "Beam QFactor",0);
 $str .= qq@<img src="%ADDPNG files/QFactor.png%" type="image/png">\n@;
@@ -165,12 +191,18 @@ $str .= qq@<img src="%ADDPNG files/StartClusterSize.png%" type="image/png">\n@;
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("StartClusterSize",$str);
 
+# $str  = Hmon::MakeTitle(11, 11, "Beamintensity",0);
+# $str .= qq@<img src="%ADDPNG files/StartRateX_histbar_online.png%" type="image/png"><br>\n@;
+# $str .= Hmon::MakeFooter();
+# Hmon::WriteFile("StartRateX_histbar_online",$str);
+
 trb_init_ports() or die trb_strerror();
 
 my $old;
 my $oldtime = time();
 my $time = time();
 my $diff;
+my $diff1DX;
 my $round = 0;
 
 #C+C beam
@@ -268,11 +300,13 @@ while(1) {
 
 #       for my $v (0..255) {
       for my $x (0..15) {
+        $diff1DX->[$xpos[$x]] = 0;
         for my $y (0..15) {
           my $v = $x + $y * 16;
           my $vdiff = ($o->{$b}->[$v]&0xfffff) - ($old->{$b}->[$v]&0xfffff);
           if ($vdiff < 0) { $vdiff += 2**20;}
           $diff->[$xpos[$x]][$ypos[$y]] = $vdiff/$tdiff;
+          $diff1DX->[$xpos[$x]] += $vdiff/$tdiff;
           }
         }
       
@@ -317,6 +351,10 @@ while(1) {
 #             }
 #           }
 #         }
+    #   for my $x (3..14) {
+    #     HPlot::PlotAdd("StartRateX_histbar_online",$diff1DX->[$x],$x-3);
+    #   }
+    # HPlot::PlotDrawFork('StartRateX_histbar_online');
         
       for my $x (0..15) {
         for my $y (0..15) {
index 44383a17e64b82571597b8ca19fdb9518dbdb1e7..fb1598c1576dd06af7c3cc66de3055b5d72dc127 100644 (file)
@@ -6,13 +6,13 @@
 
 <body style="width:100%;border:none;height:98vh;overflow:hidden;margin:0;padding:0;">
 
-<iframe src='/qaweb/?browser=off&monitoring=10000&layout=grid4x2&items=
+<iframe src='/qaweb/?browser=off&monitoring=10000&layout=grid4x2&opts=[,,"colz+text",,,,,]&items=
 [
           "HadesQA/MDC/hMdctime1Cal1/hMdctime1Cal1__0__0_+HadesQA/MDC/hMdctime1Cal1/hMdctime1Cal1__0__1_"
        ,
           "HadesQA/MDC/trending/hMdctime1Cal1MeanTrend"
        ,
-          "HadesQA/MDC/stacks/hMdcMboVsChamberCalibrationStack/hMdcMboVsChamberMissing+HadesQA/MDC/stacks/hMdcMboVsChamberCalibrationStack/hMdcMboVsChamberCalibration"
+          "HadesQA/MDC/stacks/hMdcMboVsChamberCalibrationStack/hMdcMboVsChamberCalibration+HadesQA/MDC/stacks/hMdcMboVsChamberCalibrationStack/hMdcMboVsChamberMissing"
        ,
           "HadesQA/MDC/hMdcDboVsChamber/hMdcDboVsChamber__0__0_"
        ,
@@ -34,3 +34,4 @@ style="height:100%;width:100%;border:none;margin:none;padding:none;" ></iframe>
 
 
 </body>
+//"colz+text"
index b5bd35b41da6ee23d3fb5851420de91bd518d936..9197d414815872720a7013bfdfb92869dbab4587 100644 (file)
@@ -48,7 +48,7 @@ style="height:50%;width:33%;border:none;margin:none;padding:none;" ></iframe>-->
        ,  "HadesQA/MDC/hMdctime1_12raw/hMdctime1_12raw__5__3_" 
        ,
 
-]' 
+]&palette=50
 style="height:100%;width:100%;border:none;margin:none;padding:none;" ></iframe>
 
 
index 70b1e705529af61bae0738e464c1e019148194c3..c85faec710dcbca397fa295a6017febb975386d4 100644 (file)
@@ -6,7 +6,7 @@
 
 <body style="width:100%;border:none;height:98vh;overflow:hidden;margin:0;padding:0;">
 
-<iframe src='/qaweb/?browser=off&monitoring=10000&layout=simple&item=[HadesQA/general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__0_,HadesQA/general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__1_,HadesQA/general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__2_,HadesQA/general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__3_,HadesQA/general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__4_,HadesQA/general/hPhys_candMatchQA_Sys0/hPhys_candMatchQA_Sys0__0__5_,$legend]&opt=[,,,,,,all]' 
+<iframe src='/qaweb/?browser=off&monitoring=10000&layout=grid2x2&items=["HadesQA/MDC/hMdctime1_12raw/hMdctime1_12raw__0__3_","HadesQA/MDC/hMdctime1_12raw/hMdctime1_12raw__1__3_"]&palette=12
 style="height:100%;width:100%;border:none;margin:none;padding:none;" ></iframe>
 
 
index 4da18c97db129bb874a9ec8e3fb8d6524024e224..5712e6d19fda19ff1b9752cbd981ac47dc0cdb0c 100755 (executable)
@@ -58,6 +58,9 @@ echo "  <EB>      DAQ restart: Closing file run";
 
 
 #Disable failing boards
+switchport.pl 0x8503 0 off   #7b
+switchport.pl 0x8521 7 off   #5a
+
 ###switchport.pl 0x1104 2 off  #2309 ,  didn't like spike rejection 0x10 (means off), mt 2021.02.14
 #switchport.pl 0x1101 4 off  #2203, 02.02.22
 #switchport.pl 0x1024 7 off  #2057, 04.02.22
@@ -65,6 +68,7 @@ echo "  <EB>      DAQ restart: Closing file run";
 #switchport.pl 0x1132 5 off  #2333, 29.02.24
 switchport.pl 0x1152 1 off  #2257, 30.01.25
 
+
 #Quick network test
 #trbcmd i 0xffff | wc
 #CNT=`trbcmd i 0xffff | wc | cut -f 5 -d " "`; echo -e "\033[1mBoards online: $CNT\033[0m"
index 45d2aa73b4eca3613c6bff69a0d642ca4e8af131..239cb4b17d999a436430a14f5c7cdb9fbae04e3e 100644 (file)
@@ -6,10 +6,11 @@
   trbcmd w 0xfffd 0x8000 0xd
   trbcmd w 0xfffd 0x8000 0x9
 
-trbcmd w 0xfe91 0x7111 100
+trbcmd w 0xfe91 0x7111 50         #80 words per TDC max to stay below 32kB/subevt
 trbcmd w 0xfe91 0x7114 0x00020000 #min number of words per board
-trbcmd w 0xfe91 0xc001 0x06148301 #window -2000..+100, spike rej 3
-trbcmd w 0xfe91 0xc002 0x9c       #max ToT 1000 us
+trbcmd w 0xfe91 0xc001 0x06148303 #window -2000..+100, spike rej 3, ext. calibration (0), write long ToT (1)
+trbcmd w 0xfe91 0xc002 140        #max ToT 1000 us (0x9c), 900 us (140)
+
 
 #Load TDC settings
 #   !ifndef MDCnomasks
index 1eafe4556469e07d5e4a3c4822c4573227380a5d..534952dfe8cec8be1b51b249ea3eaf21cd3d3f7b 100644 (file)
 0x221e     2    0x50    0x54    0x5e    0x60    0x60    0x60    
 0x221f     1    0x5a    0x54    0x50    0x50    
 ########################################################################
+#0x2220 2 0xff 0xff 0xff 0xff 0xff 0xff
 0x2220     2    0x5a    0x5e    0x5e    0x58    0x50    0x5a    
 0x2221     1    0x60    0x60    0x60    0x5a    
+#0x2221 1 0xff 0xff 0xff 0xff
 0x2222     1    0x60    0x5e    0x5e    0x60    
 0x2223     1    0x5a    0x60    0x5c    0x5c    
 0x2224     1    0x5e    0x60    0x60    0x60    
 0x2225     2    0x6e    0x60    0x60    0x5e    0x60    0x60    
 0x2226     2    0x5a    0x5e    0x60    0x54    0x60    0x60    
+#0x2226 2 0xff 0xff 0xff 0xff 0xff 0xff
 0x2227     1    0x5a    0x5a    0x5e    0x60    
 0x2228     1    0x60    0x60    0x60    0x5e    
 0x2229     1    0x60    0x60    0x60    0x60    
index b3f5757a9ab135be29b71ff9d85b9d80fefc8b0e..9a9dbb895d5fef1d393b79dfc74a5c46dae47adb 100644 (file)
@@ -1,4 +1,60 @@
-       CTS  900  9300000270e8dd28   0002
+readSubEvtIdsDB is reading file ../main/subevtids.db 
+ readSerialsDB is reading file ../start/serials_dirich5d.db for type Start , mode is 2
+ readSerialsDB is reading file ../start/serials_trb3sc.db for type iTOF , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type Ecal-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type Rich-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type RPC-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3.db for type TOF-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3.db for type Wall-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type Central-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3.db for type STS-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3.db for type fRPC-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type CTS-Hub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type StartHub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3.db for type VetoHub , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type iTOF-Hub , mode is 1
+ readSerialsDB is reading file ../cts/serials_cts.db for type CTS , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type CTS , mode is 1
+ readSerialsDB is reading file ../mdc/serials_mdcaddon.db for type MDC-AddOn , mode is 1
+ readSerialsDB is reading file ../mdc/serials_oep.db for type MDC-OEP , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type ECal , mode is 1
+ readSerialsDB is reading file ../rich/serials_dirich.db for type Rich , mode is 2
+ readSerialsDB is reading file ../rich/serials_dirich_concentrator.db for type Rich-Comb , mode is 1
+ readSerialsDB is reading file ../rpc/serials_trb3sc.db for type RPC , mode is 1
+ readSerialsDB is reading file ../tof/serials_trb3.db for type TOF , mode is 1
+ readSerialsDB is reading file ../sts/serials_trb3.db for type Wall , mode is 1
+ readSerialsDB is reading file ../sts/serials_trb3.db for type STS , mode is 1
+ readSerialsDB is reading file ../frpc/serials_trb3.db for type fRPC , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_mdcmbo.db for type MDCnew-TDC , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_mdcmbo.db for type MDCnew-OEP , mode is 1
+ readSerialsDB is reading file ../../daqtools/base/serials_trb3sc.db for type MDCnew-Hub , mode is 1
+ readAddressesDB is reading file ../start/addresses_dirich5d.db for type Start 
+ readAddressesDB is reading file ../start/addresses_trb3sc.db for type iTOF 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3sc.db for type Ecal-Hub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3sc.db for type Rich-Hub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3sc.db for type RPC-Hub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3.db for type TOF-Hub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3sc.db for type Central-Hub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3sc.db for type CTS-Hub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3sc.db for type StartHub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3.db for type VetoHub 
+ readAddressesDB is reading file ../hub/addresses_hub_trb3.db for type Wall-Hub 
+ readAddressesDB is reading file ../hub/addresses_hub_mdcupgrade.db for type MDCnew-Hub 
+ readAddressesDB is reading file ../cts/addresses_cts.db for type CTS 
+ readAddressesDB is reading file ../start/addresses_trb3sc.db for type CTS 
+ readAddressesDB is reading file ../mdc/addresses_mdcaddon.db for type MDC-AddOn 
+ readAddressesDB is reading file ../mdc/addresses_oep.db for type MDC-OEP 
+ readAddressesDB is reading file ../ecal/addresses_ecal.db for type ECal 
+ readAddressesDB is reading file ../rich/addresses_dirich.db for type Rich 
+ readAddressesDB is reading file ../rich/addresses_dirich_concentrator.db for type Rich-Comb 
+ readAddressesDB is reading file ../rpc/addresses_rpc_trb3sc.db for type RPC 
+ readAddressesDB is reading file ../tof/addresses_tofnew.db for type TOF 
+ readAddressesDB is reading file ../tof/addresses_tofnew.db for type Wall 
+ readAddressesDB is reading file ../sts/addresses_sts.db for type STS 
+ readAddressesDB is reading file ../frpc/addresses_frpc.db for type fRPC 
+ readAddressesDB is reading file ../../hades_mdc_settings/settings_oep/auto/addresses_mdc.db for type MDCnew-OEP 
+ readAddressesDB is reading file ../../hades_mdc_settings/settings_oep/auto/addresses_mdc.db for type MDCnew-TDC 
+        CTS  900  9300000270e8dd28   0002
     TRB3sc 1421  2c00000940a5fa28   8800
     TRB3sc 3101  2900000a63092028   8810
     TRB3sc 1461  4d00000940a62f28   8018
     TRB3sc 1341  120000094094a928   8a00
  MDC-AddOn    1  8200000270f2b328   1150
  MDC-AddOn    3  fd00000270e01728   1120
- MDC-AddOn    7  5900000270dd8b28   1010
  MDC-AddOn    9  b200000270dd8e28   1130
- MDC-AddOn   10  b500000270d5f628   1030
  MDC-AddOn   11  6a00000270dcb528   1140
  MDC-AddOn   13  a400000270d5eb28   1110
  MDC-AddOn   14  7f00000270dd9728   1100
- MDC-AddOn   15  cb00000270dda428   1040
- MDC-AddOn   16  cf00000270dd8228   1020
- MDC-AddOn   17  3e00000270ca8628   1050
- MDC-AddOn   18  5700000270e0c528   1000
    MDC-OEP   13  4f000001fc5ef428   2210
+   MDC-OEP   19  8a000001fc639628   234d
    MDC-OEP   21  62000001fc57e328   2210
    MDC-OEP   22  5e000001fc535c28   2214
    MDC-OEP   23  59000001fc488628   2240
    MDC-OEP   72  6b000001fc5dd028   225f
    MDC-OEP   73  b5000001fc5dc728   2205
    MDC-OEP   74  c8000001fc60fc28   225e
-   MDC-OEP   75  f9000001fc5dff28   201a
    MDC-OEP   76  bb000001fc5e9528   231d
-   MDC-OEP   77  62000001fc644a28   203c
    MDC-OEP   79  43000001fc5e9e28   225d
    MDC-OEP   80  ad000001fc644028   231c
    MDC-OEP   81  2e000001fc2e9e28   231e
    MDC-OEP   83  42000001ff5fea28   2359
    MDC-OEP   84  8f000001ff5ff328   220e
    MDC-OEP   86  0d000001ff5f4428   225c
-   MDC-OEP   87  16000001ff3a6628   2025
    MDC-OEP   89  d2000001fc2eb328   220d
    MDC-OEP   90  91000001ff3a7228   2222
    MDC-OEP   91  cf000001ff3ac128   2351
-   MDC-OEP   92  c1000001ff3ab828   234d
-   MDC-OEP   95  bb000001ff463c28   2109
    MDC-OEP   96  5c000001ff465328   2212
-   MDC-OEP   97  56000001ff253a28   201c
-   MDC-OEP   98  3e000001ff463b28   2046
    MDC-OEP   99  73000001ff291c28   235d
    MDC-OEP  100  8b000001ff3ab528   2356
    MDC-OEP  101  9f000001ff472a28   2312
    MDC-OEP  102  f4000001ff588528   2238
    MDC-OEP  103  d6000001ff458328   2204
    MDC-OEP  104  9e000001ff58a128   2311
-   MDC-OEP  106  b4000001ff46c028   2049
    MDC-OEP  107  57000001ff589e28   232a
    MDC-OEP  109  2c000001ff4a1c28   2315
    MDC-OEP  110  66000001ff58aa28   2258
    MDC-OEP  130  0e000001fc431f28   235e
    MDC-OEP  131  4d000001fc2c4128   225b
    MDC-OEP  133  b8000001fc2bea28   234e
-   MDC-OEP  135  ba000001fc2bf928   201b
-   MDC-OEP  136  ce000001fc44a628   2143
    MDC-OEP  140  74000001fc774528   2314
    MDC-OEP  141  58000001fc44af28   2256
    MDC-OEP  142  27000001fc44b028   2354
    MDC-OEP  144  e8000001fc44ba28   2352
-   MDC-OEP  145  1b000001fc457228   2007
    MDC-OEP  146  2c000001fc457328   2353
    MDC-OEP  148  d1000001fc44c228   2224
    MDC-OEP  149  e6000001fc44c328   235f
    MDC-OEP  150  c2000001fc44cc28   2355
    MDC-OEP  151  21000001fc42d328   221a
    MDC-OEP  152  68000001fc749c28   2235
-   MDC-OEP  153  85000001fc2bb428   2038
-   MDC-OEP  154  27000001fc4d6128   2151
-   MDC-OEP  155  06000001fc4b9b28   222f
-   MDC-OEP  156  d5000001fc364228   203b
-   MDC-OEP  158  30000001fc42ce28   2102
-   MDC-OEP  159  c3000001fc4bce28   2000
    MDC-OEP  160  c1000001fc454328   225a
    MDC-OEP  161  74000001fc42ba28   233c
    MDC-OEP  162  28000001fc4faf28   2349
    MDC-OEP  170  54000001fc497028   2334
    MDC-OEP  171  3f000001fc33bf28   2333
    MDC-OEP  172  22000001fc33c828   2338
+   MDC-OEP  173  ca000001fc493528   222f
    MDC-OEP  174  8c000001fc364128   223b
    MDC-OEP  175  c4000001fc756228   2248
    MDC-OEP  176  ff000001fc42c428   2234
    MDC-OEP  177  d2000001fc454d28   2226
    MDC-OEP  178  39000001fc454828   232c
    MDC-OEP  180  41000001fc756528   223a
-   MDC-OEP  182  96000001fc31c928   202b
    MDC-OEP  183  60000001fc739f28   2331
    MDC-OEP  184  3f000001fc73a928   2337
    MDC-OEP  185  af000001fc329a28   232e
    MDC-OEP  186  1b000001fc32a928   224d
-   MDC-OEP  187  60000001fc329028   212d
-   MDC-OEP  188  8b000001fc329528   2015
-   MDC-OEP  189  bc000001fc31bf28   2030
-   MDC-OEP  190  10000001fc2c6428   2032
-   MDC-OEP  191  6f000001fc491b28   2036
    MDC-OEP  192  f1000001fc757028   2233
-   MDC-OEP  193  e6000001fc755828   2057
    MDC-OEP  194  06000001fc673c28   2335
    MDC-OEP  195  ef000001fc748828   232f
    MDC-OEP  196  b6000001fc748b28   2239
-   MDC-OEP  197  eb000001fc415128   2154
    MDC-OEP  198  66000001fc795028   2247
    MDC-OEP  199  bf000001fc320228   2201
    MDC-OEP  200  9f000001fc322b28   224a
    MDC-OEP  201  f5000001fc44cd28   2300
-   MDC-OEP  202  67000001fc44e228   204c
    MDC-OEP  203  08000001fc33be28   2221
    MDC-OEP  204  0b000001fc346728   2229
    MDC-OEP  205  fb000001fc42e228   2249
-   MDC-OEP  206  d9000001fc42d828   2034
    MDC-OEP  207  f1000001fc44eb28   233d
    MDC-OEP  209  45000001fc44d828   223d
    MDC-OEP  210  3e000001fc44e128   2350
-   MDC-OEP  212  1b000001fc74e928   211a
-   MDC-OEP  213  77000001fc74f828   2019
-   MDC-OEP  215  8f000001fc74f328   211b
-   MDC-OEP  216  90000001fc29bd28   212b
    MDC-OEP  217  61000001fc297f28   223e
-   MDC-OEP  218  42000001fc29c028   2048
    MDC-OEP  220  c7000001fc29c728   2207
-   MDC-OEP  221  c2000001fc530a28   2018
    MDC-OEP  223  62000001fc54c828   2307
-   MDC-OEP  224  3a000001fc530128   215d
-   MDC-OEP  225  bc000001fc3f2128   2009
    MDC-OEP  226  90000001fc641e28   230a
-   MDC-OEP  228  d1000001fc64c928   2056
-   MDC-OEP  230  52000001fc547928   2031
    MDC-OEP  232  2c000001fc665328   234f
-   MDC-OEP  233  e1000001fc664a28   2050
-   MDC-OEP  234  b8000001fc664928   2055
-   MDC-OEP  235  a9000001fc665428   2004
-   MDC-OEP  236  66000001fc665e28   202c
-   MDC-OEP  237  2e000001fc664028   2148
    MDC-OEP  238  44000001fc728928   222c
-   MDC-OEP  239  d3000001fc66e828   2106
-   MDC-OEP  240  06000001fc72c828   2037
    MDC-OEP  242  6e000001fc33f028   2202
    MDC-OEP  243  77000001fc2be028   2211
    MDC-OEP  244  62000001fc2bdb28   223f
-   MDC-OEP  245  c8000001fc2c4628   2043
    MDC-OEP  246  dc000001fc31c428   2324
-   MDC-OEP  247  9c000001fc2be528   2158
    MDC-OEP  248  21000001fc2c5028   230b
-   MDC-OEP  249  e3000001fc72b428   202d
-   MDC-OEP  250  b0000001fc33e728   2003
-   MDC-OEP  252  02000001fc643128   200a
-   MDC-OEP  253  48000001fc643c28   2023
-   MDC-OEP  254  46000001fc644528   2044
-   MDC-OEP  258  63000001fc3eaa28   2005
    MDC-OEP  261  99000001fc66e528   2200
-   MDC-OEP  262  9a000001fc77e328   203a
-   MDC-OEP  263  c9000001fc68b128   2045
    MDC-OEP  264  19000001fc785628   2301
-   MDC-OEP  265  d2000001fc68f328   200b
-   MDC-OEP  266  dd000001fc65ba28   2002
    MDC-OEP  272  dc000001fc298528   2209
-   MDC-OEP  273  13000001fc298f28   214f
    MDC-OEP  274  0a000001fc585328   235a
    MDC-OEP  275  b0000001fc299428   220b
-   MDC-OEP  276  9c000001fc585a28   210d
-   MDC-OEP  277  f8000001fc298a28   214c
    MDC-OEP  278  fa000001fc299928   2330
-   MDC-OEP  279  b4000001fc441a28   2115
    MDC-OEP  280  4e000001fc6cc128   2332
    MDC-OEP  281  17000001242ca328   2346
    MDC-OEP  282  94000001fc3f4428   2231
    MDC-OEP  283  de000001fc3f4928   234a
    MDC-OEP  284  e2000001fc500828   2237
    MDC-OEP  285  db000001fc507028   224b
-   MDC-OEP  286  16000001fc506928   214d
    MDC-OEP  288  22000001fc441328   2232
-   MDC-OEP  290  92000001242ca428   214e
-   MDC-OEP  291  e300000123f27e28   2156
-   MDC-OEP  292  ca00000123efa228   2155
-   MDC-OEP  293  8000000123efaf28   2152
-   MDC-OEP  295  4f00000123efa528   212f
-   MDC-OEP  296  d900000123efac28   212e
-   MDC-OEP  297  8d00000124393428   215b
    MDC-OEP  300  6600000123f27928   2236
    MDC-OEP  301  f7000001fc2f2028   222b
-   MDC-OEP  302  a9000001fc2e8a28   2116
-   MDC-OEP  303  39000001fc6d8b28   204a
-   MDC-OEP  304  8a000001fc2d1e28   210f
-   MDC-OEP  305  aa000001fc685c28   2047
-   MDC-OEP  307  bb000001fc2f1828   205b
-   MDC-OEP  310  8b000001fc796028   2117
-   MDC-OEP  311  03000001fc668628   2107
-   MDC-OEP  312  5e000001fc66a328   2022
-   MDC-OEP  314  2a000001fc71a028   2129
-   MDC-OEP  315  09000001fc3cbc28   2042
-   MDC-OEP  316  2d000001fc3cb328   205c
-   MDC-OEP  319  f5000001fc6d1728   205a
    MDC-OEP  320  1a000001fc3cb228   2320
-   MDC-OEP  321  2e000001fc422f28   2104
-   MDC-OEP  323  16000001fc39a528   213a
-   MDC-OEP  324  ee000001fc39ae28   2033
-   MDC-OEP  326  21000001fc39a428   2149
-   MDC-OEP  328  86000001fc399928   2006
-   MDC-OEP  329  67000001fc39c328   2105
-   MDC-OEP  330  8d000001fc423428   2054
-   MDC-OEP  331  1e000001fc686f28   2120
-   MDC-OEP  332  d7000001fc685028   211d
-   MDC-OEP  333  29000001fc686e28   2144
    MDC-OEP  334  b3000001fc742828   220c
-   MDC-OEP  335  18000001fc685a28   2140
-   MDC-OEP  336  74000001fc757728   2153
-   MDC-OEP  339  45000001fc777128   2131
-   MDC-OEP  340  95000001fc679628   2122
-   MDC-OEP  341  5d000001fc392d28   2059
-   MDC-OEP  342  07000001fc39b828   2016
-   MDC-OEP  343  76000001fc485328   2051
-   MDC-OEP  344  cc000001fc4d6428   2008
-   MDC-OEP  345  3c000001fc365428   2058
-   MDC-OEP  346  bb000001fc364028   2001
-   MDC-OEP  348  13000001fc404328   2011
    MDC-OEP  350  7c000001fc4d7128   2306
-   MDC-OEP  351  42000001fc423e28   2127
-   MDC-OEP  352  d7000001fc39d628   2147
-   MDC-OEP  353  e2000001fc3f9228   213d
-   MDC-OEP  354  79000001fc392228   210c
    MDC-OEP  355  e0000001fc39d728   220f
-   MDC-OEP  356  74000001fc39cd28   2103
-   MDC-OEP  357  50000001fc39c228   211c
-   MDC-OEP  358  43000001fc39cc28   215c
-   MDC-OEP  359  2c000001fc432528   214b
-   MDC-OEP  360  90000001fc424328   2124
-   MDC-OEP  362  c7000001fc457628   2027
    MDC-OEP  363  07000001fc458028   230f
-   MDC-OEP  364  30000001fc458128   2108
-   MDC-OEP  365  14000001fc66ae28   2020
-   MDC-OEP  366  eb000001fc769c28   2017
-   MDC-OEP  367  3a000001fc776e28   2100
-   MDC-OEP  368  d3000001fc777828   2101
-   MDC-OEP  369  f5000001fc776428   2125
    MDC-OEP  370  db000001fc66a428   2308
-   MDC-OEP  371  6c000001fc7b3d28   2133
-   MDC-OEP  373  58000001fc4b2828   2014
-   MDC-OEP  374  bd000001fc428528   212a
-   MDC-OEP  375  6f000001fc41d328   2110
-   MDC-OEP  376  ea000001fc41d428   2141
-   MDC-OEP  377  3b000001fc7b4728   2123
    MDC-OEP  378  7c000001fc41dd28   230d
    MDC-OEP  380  65000001fc7aed28   2206
-   MDC-OEP  381  54000001fc6c0628   2135
-   MDC-OEP  382  0d000001fc721228   2112
    MDC-OEP  383  88000001fc6a5428   2304
-   MDC-OEP  384  d1000001fc6a5728   2012
-   MDC-OEP  385  47000001fc6a5e28   2150
-   MDC-OEP  386  be000001fc7b4028   2118
-   MDC-OEP  387  18000001fc6a6828   211e
-   MDC-OEP  388  a8000001fc7af428   211f
    MDC-OEP  391  60000001fc6bde28   230e
    MDC-OEP  392  c0000001fc6a4a28   2302
-   MDC-OEP  393  94000001fc7b3628   2130
    MDC-OEP  394  3f000001fc6be828   2230
-   MDC-OEP  396  72000001fc720d28   2157
    MDC-OEP  397  66000001fc6af228   2305
    MDC-OEP  398  f7000001fc6b5228   2208
-   MDC-OEP  399  a9000001fc6be128   2028
-   MDC-OEP  400  fd000001fc717e28   2139
    MDC-OEP  401  db000001fc3ef328   2225
    MDC-OEP  403  6b000001fc39a928   2259
-   MDC-OEP  404  e8000001fc4d6b28   2159
-   MDC-OEP  405  a0000001fc4d7528   210e
    MDC-OEP  406  fb000001fc399528   233a
-   MDC-OEP  407  03000001fc399e28   215a
    MDC-OEP  408  4d000001fc3efa28   222e
    MDC-OEP  409  df000001fc4d6a28   233b
-   MDC-OEP  410  97000001fc4d7428   212c
-   MDC-OEP  411  e2000001fc6b6928   2029
    MDC-OEP  412  2f000001fc6b7028   2339
    MDC-OEP  413  bd000001fc6b5f28   2303
-   MDC-OEP  414  76000001fc6b7328   2138
    MDC-OEP  417  8c000001fc6a7228   220a
-   MDC-OEP  418  d8000001fc6b8728   213b
-   MDC-OEP  419  41000001fc6a6b28   2052
-   MDC-OEP  420  81000001fc6b8428   2137
-   MDC-OEP  424  d3000001fc628c28   2142
-   MDC-OEP  425  72000001fc6b5528   2053
-   MDC-OEP  427  4d000001fc61e228   2013
-   MDC-OEP  428  aa000001fc710428   204b
-   MDC-OEP  441  12000001fc770b28   2119
-   MDC-OEP  442  4b000001fc770828   2113
-   MDC-OEP  444  6e000001fc778228   213f
-   MDC-OEP  445  23000001fc66af28   2039
-   MDC-OEP  446  ea000001fc669028   2132
-   MDC-OEP  447  4d000001fc773d28   214a
    MDC-OEP  449  5a000001fc771528   2322
-   MDC-OEP  450  df000001fc771228   2040
-   MDC-OEP  451  2d000001fc757428   215e
-   MDC-OEP  452  e2000001fc757e28   210a
-   MDC-OEP  453  44000001fc796a28   2041
    MDC-OEP  454  21000001fc78ab28   224e
-   MDC-OEP  455  f6000001fc2bc128   204d
-   MDC-OEP  457  c9000001fc76a628   213c
-   MDC-OEP  458  00000001fc769928   215f
    MDC-OEP  459  0c000001fc797428   2325
-   MDC-OEP  460  22000001fc76a328   2024
-   MDC-OEP  461  24000001fc791128   2134
-   MDC-OEP  462  13000001fc791028   2010
-   MDC-OEP  463  cd000001fc790728   200d
    MDC-OEP  464  fa000001fc790628   233f
    MDC-OEP  466  12000001fc6d7828   233e
-   MDC-OEP  467  86000001fc679828   2128
    MDC-OEP  468  55000001fc476b28   224c
    MDC-OEP  469  dc000001fc699328   2203
-   MDC-OEP  470  1c000001fc46e928   2021
-   MDC-OEP  472  84000001fc398a28   2114
-   MDC-OEP  473  74000001fc3bff28   2026
    MDC-OEP  474  43000001fc3bfe28   234b
-   MDC-OEP  475  e8000001fc5bb428   2111
-   MDC-OEP  476  f7000001fc5bd028   2136
-   MDC-OEP  478  38000001fc5bda28   2121
-   MDC-OEP  480  ae000001fc5bd328   201d
-   MDC-OEP  481  8e000001fc3ca828   2126
-   MDC-OEP  482  e6000001fc3c9f28   202a
-   MDC-OEP  483  81000001fc5c4928   205d
    MDC-OEP  486  db000001fc5cdc28   2223
    MDC-OEP  488  2e000001fc5c3828   234c
    MDC-OEP  489  b9000001fc3ca928   2227
-   MDC-OEP  490  d1000001fc3c9e28   200c
    MDC-OEP  491  cc000001fc771c28   230c
    MDC-OEP  492  17000001fc76b128   2321
    MDC-OEP  493  81000001fc76b828   222a
-   MDC-OEP  494  d8000001fc76bb28   203d
-   MDC-OEP  495  e9000001fc768f28   2146
-   MDC-OEP  496  dd000001fc770128   210b
-   MDC-OEP  497  f8000001fc769228   2035
-   MDC-OEP  498  85000001fc778728   2145
-   MDC-OEP  500  46000001fc76fe28   213e
+    TRB3sc 5071  7d00000bb6c2e628   8533
+    TRB3sc 5081  eb00000bb6faa528   8511
+    TRB3sc 5091  b700000bb7185e28   8512
+    TRB3sc 5121  7b00000bb6fa9928   8502
+    TRB3sc 5171  1c00000bb7568128   8522
+    TRB3sc 5191  2a00000bb7e0fd28   8542
+    TRB3sc 5201  ed00000bb6c2da28   8552
+    TRB3sc 5211  5d00000bb7896228   8554
+    TRB3sc 5231  8000000bb6fa0428   8521
+    TRB3sc 5261  b100000bb7a9dc28   8503
+    TRB3sc 5301  4f00000bb7185528   8543
+    TRB3sc 5311  9f00000bb6c33328   8504
+    TRB3sc 5331  cd00000bb6c2f328   8541
+    TRB3sc 5341  ff00000bb6c34828   8553
+    TRB3sc 5361  fa00000bb72e3728   8531
+    TRB3sc 5371  c200000bb76ab828   8513
+    TRB3sc 5381  4600000bb7892028   8501
+    TRB3sc 5391  ef00000bb719c128   8551
+    TRB3sc 5401  9a00000bb72e4c28   8523
+    TRB3sc 5431  eb00000bb6c2ef28   8532
+    TRB3sc 5461  be00000bb72e4328   8520
+    TRB3sc 5481  d900000bb6fa0728   8500
+    TRB3sc 5541  0f00000bb7180728   8530
+    TRB3sc 5551  3c00000bb75f7928   8550
+    TRB3sc 5631  2400000bb7567c28   8540
+    TRB3sc 5651  ee00000bb72da228   8510
+    MdcOep  965  0000be6300822941   8e06
+    MdcOep 1005  00003cdc00822941   8e02
+    MdcOep 1035  0000274500822941   8e1a
+    MdcOep 1095  0000dad300822941   8e33
+    MdcOep 1125  0000628000822941   8e8e
+    MdcOep 1145  00002bb000822941   8e0a
+    MdcOep 1155  0000b10d00822941   8e0c
+    MdcOep 3015  0000b1da00822941   8eac
+    MdcOep 3025  00003caf00822941   8e59
+    MdcOep 3035  00009e4700822941   8e7d
+    MdcOep 3045  0000a30f00822941   8e9d
+    MdcOep 3065  000085b600822941   8e0d
+    MdcOep 3075  000056c200822941   8e74
+    MdcOep 3085  0000851500822941   8e88
+    MdcOep 3095  0000390b00822941   8eb8
+    MdcOep 3115  0000779f00822941   8e5b
+    MdcOep 3125  000077ac00822941   8e50
+    MdcOep 3135  00008fc500822941   8e1b
+    MdcOep 3145  0000946200822941   8eb1
+    MdcOep 3155  0000620000822941   8e1d
+    MdcOep 3165  0000589e00822941   8e65
+    MdcOep 3175  0000b82a00822941   8ebc
+    MdcOep 3185  0000c59900822941   8ebb
+    MdcOep 3195  00003c2400822941   8ebd
+    MdcOep 3205  00003c6900822941   8eb6
+    MdcOep 3215  0000db0600822941   8e03
+    MdcOep 3225  0000537f00822941   8e00
+    MdcOep 3235  000081da00822941   8e7a
+    MdcOep 3245  00002ad500822941   8e08
+    MdcOep 3265  00002ad000822941   8e66
+    MdcOep 3275  0000b1fb00822941   8e05
+    MdcOep 3285  00003dda00822941   8ea1
+    MdcOep 3295  0000beec00822941   8e67
+    MdcOep 3315  0000951f00822941   8e8a
+    MdcOep 3325  0000596200822941   8e94
+    MdcOep 3345  0000ceb000822941   8ea3
+    MdcOep 3355  000058ff00822941   8e55
+    MdcOep 3365  0000194800822941   8e09
+    MdcOep 3375  0000b8cc00822941   8e0b
+    MdcOep 3385  0000808600822941   8e13
+    MdcOep 3395  0000ca8c00822941   8e35
+    MdcOep 3405  0000256800822941   8e30
+    MdcOep 3415  0000942f00822941   8e10
+    MdcOep 3425  0000599700822941   8e45
+    MdcOep 3435  00003c5b00822941   8e40
+    MdcOep 3445  0000acdf00822941   8e82
+    MdcOep 3455  0000946d00822941   8e04
+    MdcOep 3465  0000b8cb00822941   8e15
+    MdcOep 3475  0000a32300822941   8e3d
+    MdcOep 3485  0000ca1700822941   8e4b
+    MdcOep 3495  0000a14500822941   8eb4
+    MdcOep 3515  000072bb00822941   8e3b
+    MdcOep 3525  0000624a00822941   8eb2
+    MdcOep 3545  00007f1b00822941   8e54
+    MdcOep 3555  0000733400822941   8e39
+    MdcOep 3565  00009d4a00822941   8e58
+    MdcOep 3575  0000808d00822941   8e49
+    MdcOep 3585  0000617100822941   8e34
+    MdcOep 3595  0000c9d800822941   8e18
+    MdcOep 3605  0000cf9000822941   8e48
+    MdcOep 3615  0000273600822941   8e53
+    MdcOep 3625  00003ddf00822941   8e44
+    MdcOep 3645  0000ca9f00822941   8e43
+    MdcOep 3655  00003dc100822941   8e19
+    MdcOep 3675  0000940800822941   8e96
+    MdcOep 3685  0000398300822941   8ea5
+    MdcOep 3695  0000ce4d00822941   8ea4
+    MdcOep 3725  000025b200822941   8e91
+    MdcOep 3735  0000806700822941   8e99
+    MdcOep 3745  00003c0d00822941   8e9c
+    MdcOep 3765  0000b1ce00822941   8e84
+    MdcOep 3815  0000ceb800822941   8ea2
+    MdcOep 3835  0000534c00822941   8e73
+    MdcOep 3865  0000538900822941   8e72
+    MdcOep 3895  000094e300822941   8eaa
+    MdcOep 3905  0000c8ef00822941   8e97
+    MdcOep 3915  0000b10500822941   8e9b
+    MdcOep 3925  0000733e00822941   8e90
+    MdcOep 3935  0000b22700822941   8e92
+    MdcOep 3945  000059b400822941   8e95
+    MdcOep 3955  0000ca1a00822941   8e8d
+    MdcOep 3965  00003caa00822941   8e23
+    MdcOep 3975  00007f6100822941   8e20
+    MdcOep 3985  00007f2400822941   8e2b
+    MdcOep 3995  0000cb3300822941   8e28
+    MdcOep 4005  0000762b00822941   8ea6
+    MdcOep 4015  00009dff00822941   8eba
+    MdcOep 4035  000058d500822941   8e2d
+    MdcOep 4045  000057af00822941   8e25
+    MdcOep 4055  000057a600822941   8e89
+    MdcOep 4065  0000b1b800822941   8e29
+    MdcOep 4085  00002a6d00822941   8e7c
+    MdcOep 4095  00002c9d00822941   8e87
+    MdcOep 4105  000029ca00822941   8e8c
+    MdcOep 4115  0000582300822941   8eb7
+    MdcOep 4125  0000d3fa00822941   8e98
+    MdcOep 4145  0000cbb300822941   8e85
+    MdcOep 4155  0000745100822941   8ea0
+    MdcOep 4165  0000cb0500822941   8e6a
+    MdcOep 4175  00009d4200822941   8e75
+    MdcOep 4185  0000534300822941   8e93
+    MdcOep 4195  0000538400822941   8e9a
+    MdcOep 4205  000056c100822941   8e8b
+    MdcOep 4215  0000bcb400822941   8eb0
+    MdcOep 4225  0000b9f600822941   8ea8
+    MdcOep 4245  0000acc600822941   8e6c
+    MdcOep 4275  00002be500822941   8ea9
+    MdcOep 4285  0000760000822941   8eb5
+    MdcOep 4295  000061ba00822941   8ea7
+    MdcOep 4305  00002b2700822941   8eab
+    MdcOep 4315  0000952e00822941   8e38
+    MdcOep 4325  0000c9cb00822941   8e60
+    MdcOep 4335  0000ae6100822941   8eb9
+    MdcOep 4355  0000b90500822941   8e4d
+    MdcOep 4365  00008fe700822941   8e64
+    MdcOep 4375  0000c8f200822941   8ead
+    MdcOep 4395  00009ddd00822941   8e62
+    MdcOep 4405  0000b29f00822941   8eb3
+    MdcOep 4415  000094fa00822941   8e6d
+    MdcOep 4425  0000624e00822941   8e68
+    MdcOep 4445  0000760f00822941   8e6b
+    MdcOep 4455  000094b200822941   8e69
+    MdcOep 4475  0000caed00822941   8e77
+    MdcOep 4485  0000190e00822941   8e63
+    MdcOep 4505  0000cf5500822941   8e80
+    MdcOep 4515  0000390500822941   8e83
+    MdcOep 4525  0000daec00822941   8e61
+    MdcOep 4535  0000441600822941   8e79
+    MdcOep 4555  0000667000822941   8e86
+    MdcOep 4575  000025f300822941   8e81
+    MdcOep 4605  0000cfc700822941   8e7b
+    MdcOep 4615  00002b9200822941   8e76
+    MdcOep 4625  0000801700822941   8e71
+    MdcOep 4635  0000d3e100822941   8e70
+    MdcOep 4645  0000b90100822941   8e78
+    MdcOep 4665  0000255200822941   8e14
+    MdcOep 4735  00009db300822941   8e24
+    MdcOep 5085  0000693700a62941   8e5d
+    MdcOep 8005  0000b96700822941   8e52
+    MdcOep 8015  0000ba3900822941   8ebf
+    MdcOep 8035  00003c6800822941   8eaf
+    MdcOep 8075  00009df800822941   8e56
+    MdcOep 8125  0000ce5700822941   8e3c
+    MdcOep 8175  0000ce6900822941   8e1c
+    MdcOep 8185  0000b8e400822941   8e47
+    MdcOep 8195  0000d6d900822941   8e2c
+    MdcOep 8225  0000da9100822941   8e11
+    MdcOep 8235  000075e900822941   8e37
+    MdcOep 8265  00009ef300822941   8e36
+    MdcOep 8275  0000624b00822941   8e46
+    MdcOep 8305  0000c8d800822941   8e42
+    MdcOep 8315  00002b7400822941   8e41
+    MdcOep 8325  0000b9a300822941   8e57
+    MdcOep 8365  000049c700822941   8e16
+    MdcOep 8385  0000494d00822941   8e12
+    MdcOep 8395  000066f000822941   8e31
+    MdcOep 8405  00003b2400822941   8e4a
+    MdcOep 8415  00003b2300822941   8e32
+    MdcOep 8425  0000451700822941   8e3a
+    MdcOep 8435  0000b81e00822941   8e4c
+    MdcOep 8445  0000be3300822941   8e5c
+    MdcOep 8455  0000db0f00822941   8e2a
+    MdcOep 8475  0000621500822941   8e5a
+    MdcOep 8515  000059af00822941   8e26
+    MdcOep 8545  00008ff500822941   8e21
+    MdcOep 8555  000066e200822941   8e8f
+    MdcOep 8575  0000256200822941   8e9f
+    MdcOep 8715  00003bee00822941   8e6e
+    MdcOep 8725  00003cd900822941   8eae
+    MdcOep 8755  0000772600822941   8e7e
+    MdcOep 8765  0000621200822941   8e7f
+    MdcOep 8835  0000618f00822941   8e07
+    MdcOep 8845  0000acb500822941   8e17
+    MdcOep 8855  0000211100822941   8e01
+    MdcOep 9115  0000715c00822941   8e51
+    MdcOep 9155  000044e800822941   8e6f
+    MdcOep 9165  0000254f00822941   8e9e
+    MdcOep 9185  00002af200822941   8ebe
+    MdcOep 9535  0000452500822941   8e22
+    MdcOep 9545  00009e5400822941   8e27
+    MdcTdc  960  000058c500822941   a060
+    MdcTdc  961  00002b9100822941   a061
+    MdcTdc  962  0000b1a500822941   a062
+    MdcTdc 1000  000080b900822941   a020
+    MdcTdc 1001  0000464900822941   a021
+    MdcTdc 1002  00003b3000822941   a022
+    MdcTdc 1030  0000263400822941   a1a0
+    MdcTdc 1031  000062c000822941   a1a1
+    MdcTdc 1032  0000a31500822941   a1a2
+    MdcTdc 1090  000075c300822941   a330
+    MdcTdc 1091  00009de100822941   a331
+    MdcTdc 1120  0000cb7100822941   a8e0
+    MdcTdc 1121  0000cb9c00822941   a8e1
+    MdcTdc 1122  0000650900822941   a8e2
+    MdcTdc 1140  00002cda00822941   a0a0
+    MdcTdc 1141  00003cf500822941   a0a1
+    MdcTdc 1142  0000617800822941   a0a2
+    MdcTdc 1150  0000b27a00822941   a0c0
+    MdcTdc 1151  0000be2000822941   a0c1
+    MdcTdc 1152  00009e6300822941   a0c2
+    MdcTdc 3010  0000cec500822941   aac0
+    MdcTdc 3011  0000268f00822941   aac1
+    MdcTdc 3020  000044a800822941   a590
+    MdcTdc 3021  00007f7800822941   a591
+    MdcTdc 3030  0000269900822941   a7d0
+    MdcTdc 3031  0000537100822941   a7d1
+    MdcTdc 3040  0000b11f00822941   a9d0
+    MdcTdc 3041  0000269c00822941   a9d1
+    MdcTdc 3060  0000b1c100822941   a0d0
+    MdcTdc 3061  0000d3e700822941   a0d1
+    MdcTdc 3070  0000591b00822941   a740
+    MdcTdc 3071  000049ca00822941   a741
+    MdcTdc 3080  0000390300822941   a880
+    MdcTdc 3081  00003c7600822941   a881
+    MdcTdc 3090  0000585500822941   ab80
+    MdcTdc 3091  00003de900822941   ab81
+    MdcTdc 3110  00009e5600822941   a5b0
+    MdcTdc 3111  0000caf900822941   a5b1
+    MdcTdc 3120  0000455b00822941   a500
+    MdcTdc 3121  0000cfc900822941   a501
+    MdcTdc 3130  00009ed500822941   a1b0
+    MdcTdc 3131  000043d000822941   a1b1
+    MdcTdc 3140  0000ce7400822941   ab10
+    MdcTdc 3141  000054a600822941   ab11
+    MdcTdc 3150  00001e1000822941   a1d0
+    MdcTdc 3151  0000c87000822941   a1d1
+    MdcTdc 3160  0000c8f000822941   a650
+    MdcTdc 3161  00002ae200822941   a651
+    MdcTdc 3170  0000197f00822941   abc0
+    MdcTdc 3171  0000b89300822941   abc1
+    MdcTdc 3180  00009e7d00822941   abb0
+    MdcTdc 3181  00001a8d00822941   abb1
+    MdcTdc 3190  000025ee00822941   abd0
+    MdcTdc 3191  0000c56b00822941   abd1
+    MdcTdc 3200  00009d6a00822941   ab60
+    MdcTdc 3201  00003d0100822941   ab61
+    MdcTdc 3210  000071d300822941   a030
+    MdcTdc 3211  00003c6700822941   a031
+    MdcTdc 3220  0000ca0900822941   a000
+    MdcTdc 3221  0000acaf00822941   a001
+    MdcTdc 3230  0000443000822941   a7a0
+    MdcTdc 3231  0000620300822941   a7a1
+    MdcTdc 3240  0000716000822941   a080
+    MdcTdc 3241  0000593c00822941   a081
+    MdcTdc 3260  0000953400822941   a660
+    MdcTdc 3261  00003dc400822941   a661
+    MdcTdc 3270  000062bd00822941   a050
+    MdcTdc 3271  00007f7d00822941   a051
+    MdcTdc 3280  0000b95d00822941   aa10
+    MdcTdc 3281  0000855500822941   aa11
+    MdcTdc 3290  0000957b00822941   a670
+    MdcTdc 3291  00007f7b00822941   a671
+    MdcTdc 3310  0000c74700822941   a8a0
+    MdcTdc 3311  0000438800822941   a8a1
+    MdcTdc 3320  00003e0800822941   a940
+    MdcTdc 3321  000076b600822941   a941
+    MdcTdc 3340  0000c50e00822941   aa30
+    MdcTdc 3341  0000a38400822941   aa31
+    MdcTdc 3350  0000bee600822941   a550
+    MdcTdc 3351  000057a700822941   a551
+    MdcTdc 3360  0000b0ce00822941   a090
+    MdcTdc 3361  0000439300822941   a091
+    MdcTdc 3370  00009d9300822941   a0b0
+    MdcTdc 3371  000062c200822941   a0b1
+    MdcTdc 3380  00002b3f00822941   a130
+    MdcTdc 3381  0000943e00822941   a131
+    MdcTdc 3390  0000c9dc00822941   a350
+    MdcTdc 3391  0000811000822941   a351
+    MdcTdc 3400  000075c800822941   a300
+    MdcTdc 3401  0000b92e00822941   a301
+    MdcTdc 3410  0000ce6d00822941   a100
+    MdcTdc 3411  00003c0700822941   a101
+    MdcTdc 3420  00002a9a00822941   a450
+    MdcTdc 3421  0000614100822941   a451
+    MdcTdc 3430  0000ce9400822941   a400
+    MdcTdc 3431  0000448500822941   a401
+    MdcTdc 3440  00009fa500822941   a820
+    MdcTdc 3441  0000651200822941   a821
+    MdcTdc 3450  000044e200822941   a040
+    MdcTdc 3451  0000ca0c00822941   a041
+    MdcTdc 3460  000095c500822941   a150
+    MdcTdc 3461  0000464400822941   a151
+    MdcTdc 3470  000018e700822941   a3d0
+    MdcTdc 3471  0000be3f00822941   a3d1
+    MdcTdc 3480  0000637400822941   a4b0
+    MdcTdc 3481  00007f4100822941   a4b1
+    MdcTdc 3490  00003c7e00822941   ab40
+    MdcTdc 3491  0000940400822941   ab41
+    MdcTdc 3510  0000954700822941   a3b0
+    MdcTdc 3511  000085b700822941   a3b1
+    MdcTdc 3520  00001a9200822941   ab20
+    MdcTdc 3521  0000952700822941   ab21
+    MdcTdc 3540  0000276c00822941   a540
+    MdcTdc 3541  00003bed00822941   a541
+    MdcTdc 3550  0000b13c00822941   a390
+    MdcTdc 3551  000075b900822941   a391
+    MdcTdc 3560  00001e1200822941   a580
+    MdcTdc 3561  00007f1200822941   a581
+    MdcTdc 3570  00002b0700822941   a490
+    MdcTdc 3571  00003b1e00822941   a491
+    MdcTdc 3580  0000448f00822941   a340
+    MdcTdc 3581  0000444e00822941   a341
+    MdcTdc 3590  00003d5f00822941   a180
+    MdcTdc 3591  00003b2c00822941   a181
+    MdcTdc 3600  0000a2fa00822941   a480
+    MdcTdc 3601  0000597500822941   a481
+    MdcTdc 3610  0000636a00822941   a530
+    MdcTdc 3611  00003c7000822941   a531
+    MdcTdc 3620  0000192100822941   a440
+    MdcTdc 3621  00003c8900822941   a441
+    MdcTdc 3640  0000ce4500822941   a430
+    MdcTdc 3641  000085af00822941   a431
+    MdcTdc 3650  0000cb4800822941   a190
+    MdcTdc 3651  00009d6300822941   a191
+    MdcTdc 3670  0000808200822941   a960
+    MdcTdc 3671  0000b2af00822941   a961
+    MdcTdc 3680  000026e800822941   aa50
+    MdcTdc 3681  000080a000822941   aa51
+    MdcTdc 3690  0000198b00822941   aa40
+    MdcTdc 3691  0000cf1b00822941   aa41
+    MdcTdc 3720  0000b8bb00822941   a910
+    MdcTdc 3721  0000caa700822941   a911
+    MdcTdc 3730  00002b2e00822941   a990
+    MdcTdc 3731  000044c100822941   a991
+    MdcTdc 3740  0000d48500822941   a9c0
+    MdcTdc 3741  00009dc700822941   a9c1
+    MdcTdc 3760  0000446500822941   a840
+    MdcTdc 3761  0000ce1400822941   a841
+    MdcTdc 3810  0000941400822941   aa20
+    MdcTdc 3811  00007f3900822941   aa21
+    MdcTdc 3830  0000b0d100822941   a730
+    MdcTdc 3831  0000d49700822941   a731
+    MdcTdc 3860  0000acfa00822941   a720
+    MdcTdc 3861  0000262000822941   a721
+    MdcTdc 3890  0000451600822941   aaa0
+    MdcTdc 3891  00002a8200822941   aaa1
+    MdcTdc 3900  0000d42100822941   a970
+    MdcTdc 3901  00007f9900822941   a971
+    MdcTdc 3910  00009db500822941   a9b0
+    MdcTdc 3911  0000b2bd00822941   a9b1
+    MdcTdc 3920  0000590e00822941   a900
+    MdcTdc 3921  0000ac9100822941   a901
+    MdcTdc 3930  00007fdf00822941   a920
+    MdcTdc 3931  0000449800822941   a921
+    MdcTdc 3940  00003cea00822941   a950
+    MdcTdc 3941  0000da9700822941   a951
+    MdcTdc 3950  000026d500822941   a8d0
+    MdcTdc 3951  0000da9000822941   a8d1
+    MdcTdc 3960  0000c5b900822941   a230
+    MdcTdc 3961  00002a4c00822941   a231
+    MdcTdc 3970  0000b89600822941   a200
+    MdcTdc 3971  0000715d00822941   a201
+    MdcTdc 3980  0000c9d400822941   a2b0
+    MdcTdc 3981  00009e3600822941   a2b1
+    MdcTdc 3990  0000302300822941   a280
+    MdcTdc 3991  00002a9600822941   a281
+    MdcTdc 4000  0000941000822941   aa60
+    MdcTdc 4001  000057f400822941   aa61
+    MdcTdc 4010  00003c6400822941   aba0
+    MdcTdc 4011  0000cb4600822941   aba1
+    MdcTdc 4030  0000ba0800822941   a2d0
+    MdcTdc 4031  0000a2a400822941   a2d1
+    MdcTdc 4040  000058c600822941   a250
+    MdcTdc 4041  0000b0f000822941   a251
+    MdcTdc 4050  00007fad00822941   a890
+    MdcTdc 4051  000060b300822941   a891
+    MdcTdc 4060  00003c5e00822941   a290
+    MdcTdc 4061  0000761b00822941   a291
+    MdcTdc 4080  00002c9e00822941   a7c0
+    MdcTdc 4081  0000589f00822941   a7c1
+    MdcTdc 4090  000043ce00822941   a870
+    MdcTdc 4091  0000837500822941   a871
+    MdcTdc 4100  000060de00822941   a8c0
+    MdcTdc 4101  0000199700822941   a8c1
+    MdcTdc 4110  00009cee00822941   ab70
+    MdcTdc 4111  0000b1ab00822941   ab71
+    MdcTdc 4120  00009dbf00822941   a980
+    MdcTdc 4121  0000d3b700822941   a981
+    MdcTdc 4140  0000da5c00822941   a850
+    MdcTdc 4141  00002bf000822941   a851
+    MdcTdc 4150  000043b600822941   aa00
+    MdcTdc 4151  0000928f00822941   aa01
+    MdcTdc 4160  0000955100822941   a6a0
+    MdcTdc 4161  0000b1b500822941   a6a1
+    MdcTdc 4170  0000ca3e00822941   a750
+    MdcTdc 4171  0000b1a200822941   a751
+    MdcTdc 4180  00002a6a00822941   a930
+    MdcTdc 4181  0000d66500822941   a931
+    MdcTdc 4190  0000768600822941   a9a0
+    MdcTdc 4191  0000538800822941   a9a1
+    MdcTdc 4200  000076ef00822941   a8b0
+    MdcTdc 4201  00009eef00822941   a8b1
+    MdcTdc 4210  0000c50800822941   ab00
+    MdcTdc 4211  0000da5b00822941   ab01
+    MdcTdc 4220  000057d400822941   aa80
+    MdcTdc 4221  0000d48e00822941   aa81
+    MdcTdc 4240  0000450300822941   a6c0
+    MdcTdc 4241  00009d4700822941   a6c1
+    MdcTdc 4270  0000ce1800822941   aa90
+    MdcTdc 4271  00002a8000822941   aa91
+    MdcTdc 4280  0000b0e200822941   ab50
+    MdcTdc 4281  0000b86900822941   ab51
+    MdcTdc 4290  0000c9c100822941   aa70
+    MdcTdc 4291  00009e8500822941   aa71
+    MdcTdc 4300  00007f3000822941   aab0
+    MdcTdc 4301  0000b27800822941   aab1
+    MdcTdc 4310  0000b22600822941   a380
+    MdcTdc 4311  0000d9a900822941   a381
+    MdcTdc 4320  0000305000822941   a600
+    MdcTdc 4321  0000be3400822941   a601
+    MdcTdc 4330  0000257400822941   ab90
+    MdcTdc 4331  0000498c00822941   ab91
+    MdcTdc 4350  000019ca00822941   a4d0
+    MdcTdc 4351  0000cba700822941   a4d1
+    MdcTdc 4360  0000744900822941   a640
+    MdcTdc 4361  00008fea00822941   a641
+    MdcTdc 4370  0000610900822941   aad0
+    MdcTdc 4371  0000be3c00822941   aad1
+    MdcTdc 4390  0000953d00822941   a620
+    MdcTdc 4391  00007ff700822941   a621
+    MdcTdc 4400  0000be3d00822941   ab30
+    MdcTdc 4401  0000272600822941   ab31
+    MdcTdc 4410  00001e0200822941   a6d0
+    MdcTdc 4411  0000d69800822941   a6d1
+    MdcTdc 4420  0000952200822941   a680
+    MdcTdc 4421  00003c2700822941   a681
+    MdcTdc 4440  0000b8d300822941   a6b0
+    MdcTdc 4441  0000ac9900822941   a6b1
+    MdcTdc 4450  00002ba900822941   a690
+    MdcTdc 4451  0000cb1000822941   a691
+    MdcTdc 4470  000026a100822941   a770
+    MdcTdc 4471  00009d9e00822941   a771
+    MdcTdc 4480  00002b6c00822941   a630
+    MdcTdc 4481  000061c600822941   a631
+    MdcTdc 4500  000080b200822941   a800
+    MdcTdc 4501  0000621100822941   a801
+    MdcTdc 4510  000056c900822941   a830
+    MdcTdc 4511  0000274000822941   a831
+    MdcTdc 4520  0000ae5a00822941   a610
+    MdcTdc 4521  00009dfa00822941   a611
+    MdcTdc 4530  000071e200822941   a790
+    MdcTdc 4531  0000d3c600822941   a791
+    MdcTdc 4550  0000442d00822941   a860
+    MdcTdc 4551  0000259800822941   a861
+    MdcTdc 4570  00009e4800822941   a810
+    MdcTdc 4571  00003e0900822941   a811
+    MdcTdc 4600  00002bc800822941   a7b0
+    MdcTdc 4601  0000854500822941   a7b1
+    MdcTdc 4610  00009ccc00822941   a760
+    MdcTdc 4611  0000ca1d00822941   a761
+    MdcTdc 4620  0000275100822941   a710
+    MdcTdc 4621  0000449d00822941   a711
+    MdcTdc 4630  0000b2b000822941   a700
+    MdcTdc 4631  0000b93000822941   a701
+    MdcTdc 4640  0000274900822941   a780
+    MdcTdc 4641  00001aa400822941   a781
+    MdcTdc 4660  0000cb1c00822941   a140
+    MdcTdc 4661  0000d3ea00822941   a141
+    MdcTdc 4730  000019b800822941   a240
+    MdcTdc 4731  0000444300822941   a241
+    MdcTdc 5080  0000977f00a62941   a5d0
+    MdcTdc 5081  0000a62500a62941   a5d1
+    MdcTdc 8000  0000305400822941   a520
+    MdcTdc 8001  0000d92d00822941   a521
+    MdcTdc 8002  0000768200822941   a522
+    MdcTdc 8010  0000ce6400822941   abf0
+    MdcTdc 8011  0000d65e00822941   abf1
+    MdcTdc 8012  000058c900822941   abf2
+    MdcTdc 8030  00009eb200822941   aaf0
+    MdcTdc 8031  00002afe00822941   aaf1
+    MdcTdc 8032  0000627800822941   aaf2
+    MdcTdc 8070  00007ffb00822941   a560
+    MdcTdc 8071  000094f400822941   a561
+    MdcTdc 8072  0000438000822941   a562
+    MdcTdc 8120  000044ea00822941   a3c0
+    MdcTdc 8121  00001aa600822941   a3c1
+    MdcTdc 8122  00002ba500822941   a3c2
+    MdcTdc 8170  0000b8bc00822941   a1c0
+    MdcTdc 8171  0000d40600822941   a1c1
+    MdcTdc 8172  0000854e00822941   a1c2
+    MdcTdc 8180  0000ceea00822941   a470
+    MdcTdc 8181  0000248400822941   a471
+    MdcTdc 8182  0000c9d700822941   a472
+    MdcTdc 8190  0000197700822941   a2c0
+    MdcTdc 8191  00003c8a00822941   a2c1
+    MdcTdc 8192  0000807b00822941   a2c2
+    MdcTdc 8220  0000ac1000822941   a110
+    MdcTdc 8221  00008fb300822941   a111
+    MdcTdc 8222  0000b13700822941   a112
+    MdcTdc 8230  0000770000822941   a370
+    MdcTdc 8231  0000945f00822941   a371
+    MdcTdc 8232  0000c5bb00822941   a372
+    MdcTdc 8260  0000945a00822941   a360
+    MdcTdc 8261  0000b25c00822941   a361
+    MdcTdc 8262  0000d41c00822941   a362
+    MdcTdc 8270  000049c100822941   a460
+    MdcTdc 8271  0000211700822941   a461
+    MdcTdc 8272  0000305800822941   a462
+    MdcTdc 8300  00003cfc00822941   a420
+    MdcTdc 8301  0000d12a00822941   a421
+    MdcTdc 8302  0000956900822941   a422
+    MdcTdc 8310  0000932700822941   a410
+    MdcTdc 8311  000019bd00822941   a411
+    MdcTdc 8312  0000c51500822941   a412
+    MdcTdc 8320  00009d0a00822941   a570
+    MdcTdc 8321  0000440700822941   a571
+    MdcTdc 8322  0000442b00822941   a572
+    MdcTdc 8360  000080ad00822941   a160
+    MdcTdc 8361  0000d3d400822941   a161
+    MdcTdc 8362  0000803800822941   a162
+    MdcTdc 8380  0000498b00822941   a120
+    MdcTdc 8381  00007fcb00822941   a121
+    MdcTdc 8382  0000caee00822941   a122
+    MdcTdc 8390  0000254800822941   a310
+    MdcTdc 8391  0000cf5600822941   a311
+    MdcTdc 8392  0000763800822941   a312
+    MdcTdc 8400  0000b2b400822941   a4a0
+    MdcTdc 8401  0000191c00822941   a4a1
+    MdcTdc 8402  0000ca0e00822941   a4a2
+    MdcTdc 8410  0000585f00822941   a320
+    MdcTdc 8411  000060b700822941   a321
+    MdcTdc 8412  0000da6000822941   a322
+    MdcTdc 8420  00007f6500822941   a3a0
+    MdcTdc 8421  0000acf900822941   a3a1
+    MdcTdc 8422  0000950a00822941   a3a2
+    MdcTdc 8430  0000b11c00822941   a4c0
+    MdcTdc 8431  0000955c00822941   a4c1
+    MdcTdc 8432  000066f700822941   a4c2
+    MdcTdc 8440  0000a2be00822941   a5c0
+    MdcTdc 8441  000049c300822941   a5c1
+    MdcTdc 8442  00002a3100822941   a5c2
+    MdcTdc 8450  000074da00822941   a2a0
+    MdcTdc 8451  000060ad00822941   a2a1
+    MdcTdc 8452  0000b2b100822941   a2a2
+    MdcTdc 8470  00009eb700822941   a5a0
+    MdcTdc 8471  0000cb9a00822941   a5a1
+    MdcTdc 8472  0000946700822941   a5a2
+    MdcTdc 8510  0000cf4c00822941   a260
+    MdcTdc 8511  0000cec900822941   a261
+    MdcTdc 8512  0000c86e00822941   a262
+    MdcTdc 8540  0000c86400822941   a210
+    MdcTdc 8541  00002a7700822941   a211
+    MdcTdc 8542  00009e0000822941   a212
+    MdcTdc 8550  000037a500822941   a8f0
+    MdcTdc 8551  0000cf7d00822941   a8f1
+    MdcTdc 8552  0000b82600822941   a8f2
+    MdcTdc 8570  0000802f00822941   a9f0
+    MdcTdc 8571  0000b8d600822941   a9f1
+    MdcTdc 8572  000094e900822941   a9f2
+    MdcTdc 8710  0000cee500822941   a6e0
+    MdcTdc 8711  0000710300822941   a6e1
+    MdcTdc 8712  0000b91300822941   a6e2
+    MdcTdc 8720  0000854200822941   aae0
+    MdcTdc 8721  000074d800822941   aae1
+    MdcTdc 8722  0000265300822941   aae2
+    MdcTdc 8750  000019c300822941   a7e0
+    MdcTdc 8751  0000c58b00822941   a7e1
+    MdcTdc 8752  00003d8700822941   a7e2
+    MdcTdc 8760  0000810500822941   a7f0
+    MdcTdc 8761  000095a100822941   a7f1
+    MdcTdc 8762  0000cacd00822941   a7f2
+    MdcTdc 8830  0000d92500822941   a070
+    MdcTdc 8831  00002acf00822941   a071
+    MdcTdc 8832  0000ca8d00822941   a072
+    MdcTdc 8840  000094d200822941   a170
+    MdcTdc 8841  0000950000822941   a171
+    MdcTdc 8842  00003d1a00822941   a172
+    MdcTdc 8850  000076b800822941   a010
+    MdcTdc 8851  0000305a00822941   a011
+    MdcTdc 8852  00001e0800822941   a012
+    MdcTdc 9110  0000b9ed00822941   a510
+    MdcTdc 9111  000054aa00822941   a511
+    MdcTdc 9112  000018ec00822941   a512
+    MdcTdc 9150  0000ce7e00822941   a6f0
+    MdcTdc 9151  00009dc500822941   a6f1
+    MdcTdc 9152  0000be2a00822941   a6f2
+    MdcTdc 9160  0000cb9600822941   a9e0
+    MdcTdc 9161  000075af00822941   a9e1
+    MdcTdc 9162  000061d800822941   a9e2
+    MdcTdc 9180  0000d3d900822941   abe0
+    MdcTdc 9181  0000438b00822941   abe1
+    MdcTdc 9182  00003d2a00822941   abe2
+    MdcTdc 9530  0000b12c00822941   a220
+    MdcTdc 9531  0000802600822941   a221
+    MdcTdc 9532  0000254e00822941   a222
+    MdcTdc 9540  0000949600822941   a270
+    MdcTdc 9541  0000aca600822941   a271
+    MdcTdc 9542  0000579000822941   a272
     TRB3sc 2011  3300000a62e98e28   5813
     TRB3sc 2021  9900000a6244ce28   5818
     TRB3sc 2041  ec00000a6300a428   5847
@@ -818,21 +1302,11 @@ DiRichConcentrator  109  6800000a5236b428   8266
       TRB3 1571  050000070f310628   6471
       TRB3 1572  6e0000070ecaa428   6472
       TRB3 1573  360000070f3ea628   6473
-      TRB3  315  9c00000390194c28   8b13
-      TRB3  645  f50000046f394c28   8b02
-      TRB3  715  b1000003131f9328   8b10
-      TRB3 1085  ef000004fa0e3d28   8b01
-      TRB3 1185  e7000005ed389e28   8b03
-      TRB3 1225  f9000005ed797028   8b12
-      TRB3 1255  e7000005ed7ede28   8b00
-      TRB3 1545  9e0000070ee47628   8b15
-      TRB3 1555  360000070f366e28   8b11
-      TRB3 1575  b90000070f3dd528   8b14
   Dirich5d   31  7100000e5bf17f28   5004
-  Dirich5d   41  1700000e5cb29d28   5000
-  Dirich5d   51  0d00000e5ca1f828   5001
-  Dirich5d   61  2200000e5cb28f28   5002
-  Dirich5d   71  d000000e5bf17728   5003
+  Dirich5d   41  1700000e5cb29d28   5003
+  Dirich5d   71  d000000e5bf17728   5002
+  Dirich5d  101  ae00000e5cb16a28   5000
+  Dirich5d  131  fd00000e5b9b5628   5001
     TRB3sc 4381  54000003480e4728   8880
       TRB3   60  b5000003482d3d28   5c20
       TRB3   61  d5000003481eef28   5c21
@@ -888,8 +1362,6 @@ DiRichConcentrator  109  6800000a5236b428   8266
       TRB3 2611  6500000941758a28   6801
       TRB3 2612  210000094176d528   6802
       TRB3 2613  800000094175f628   6803
-      TRB3 2385  470000094285e028   8c10
-      TRB3 2615  4300000941759628   8c00
     TRB3sc 3371  72000005b6f3e028   5d02
     TRB3sc 3381  060000070f046f28   5d00
     TRB3sc 3391  fb000005b7443428   5d04
deleted file mode 100755 (executable)
index 13f1643986fd85e59431bf9373b357cadbf87f0a..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,752 +0,0 @@
-#!/usr/bin/perl -w
-###################
-# JAM2016 - cronjob script to transfer EPICS slow control archiver data from postgres to hades oracle 
-# following attempt was based on daq2ora_client.pl and other Perl examples
-# it tries to implement Ilse Koenigs suggested code with DBI methods
-#######
-# V0.1 10-Oct-2016 by JAM( j.adamczewski@gsi.de) - first draft for discussion. Did never run
-# V0.2 11-Oct-2016 by JAM( j.adamczewski@gsi.de) - added oracle option. Bugfixes.
-# V0.3 13-Oct-2016 by JAM( j.adamczewski@gsi.de) - tested with read acccess to both databases
-# V0.4 10-Jan-2017 by JAM - renamed to postgres2ora.pl, exclude passwords from code, check if table is empty
-
-use English;
-use strict;
-use Getopt::Long;
-use Data::Dumper;
-#use Scalar::Util qw(reftype);
-use IO::Socket;
-use IO::Select;
-use FileHandle;
-use Time::Local;
-use DateTime;
-use threads;
-use threads::shared;
-
-use DBI;
-use DBD::ODBC;
-
-#my $cmd_server_port   = 4799;
-#my $cmd_server_prtcl  = 'tcp';
-#my $opt_sport       = 50998;  # open this port for status server
-my $opt_help = 0;
-my $opt_verb = 0;
-my $opt_oracle = 0;
-
-# JAM optionally change account here:
-my $orauser      = 'DAQ_PUB';
-my $orapass      = 'please_give_oracle_password';
-#my $oradatabase  = 'db-hades-test';
-my $oradatabase  = 'db-hades';
-
-# JAM access details for postgres
-my $pguser      = 'report';
-my $pgpass      = 'please_give_postgres_password';
-
-my $pgdatabase  = 'archive';
-my $pghost      = 'lxhaddcs10.gsi.de';
-#'lxhadeb05.gsi.de';
-my $pgport      = '5432';
-
-# JAM real passwords are delivered by command line options now.
-
-
-GetOptions ('h|help'      => \$opt_help,
-           'v|verb'      => \$opt_verb,
-           'o|oracle'    => \$opt_oracle,
-           'opass=s'     => \$orapass,
-           'ppass=s'     => \$pgpass
-         );
-
-if( $opt_help ) {
-    &help();
-    exit(0);
-}
-
-
-
-
-
-# JAM here definition of table names
-my $pgseverity     = 'severity';
-my $oraseverity    = 'hades_scs.pgimport_severity';
-my $pgstatus       = 'status';
-my $orastatus      = 'hades_scs.pgimport_status';
-my $orahcsschannel = 'hades_scs.hcss_import_channel';
-my $orahcsid       = 'hades_scs.hcss_channel';
-my $pgchannel      = 'channel';
-my $pgnummeta      = 'num_metadata';
-my $pgsample       = 'sample';
-my $orasample      = 'hades_scs.pgimport_sample';
-my $orachannel     = 'hades_scs.pgimport_channel';
-
-my $ExitCode : shared = -1;
-my $status : shared = "OK";
-
-#- POSIX signal handlers: see signal(7) or kill(1) for available signals
-foreach my $signal ( qw(HUP INT QUIT ILL ABRT FPE SEGV TERM USR1 USR2) ){
-   $SIG{$signal} = sub { &finishAndExit( $signal ); };
-}
-
-
-my $app_logfile = "/home/hadaq/log/postgres2ora.log"; 
-
-#- Daemonize
-# if($opt_daemon){
-#     open(STDIN,  '>/dev/null');
-#     open(STDOUT, ">$app_logfile") || die "Cannot redirect STDOUT";
-#     open(STDERR, ">&STDOUT") || die "Cannot dup STDERR";
-#     select STDERR; $| = 1; # make unbuffered
-#     select STDOUT; $| = 1; # make unbuffered
-# }
-
-
-# JAM2016 - we do not need statusserver for cronjob
-#-------- Start status server thread
-# threads->new( \&statusServer );
-# TODO if we should work with statusserver/daemon mode later, still need infinite main loop with check of time
-
-
-#-------- need to explicitely set oracle environment if this was started by icinga restarthandler (not-login ssh!)
-$ENV{ORACLE_HOME}='/usr/lib/oracle/12.1/client64';
-$ENV{LD_LIBRARY_PATH}='/usr/lib/oracle/12.1/client64/lib';
-
-#-------- Connect the database
-#$status = "Try to connect to the Oracle Data Base ...";
-print "Try to connect to the Oracle Data Base ...\n" if($opt_verb);
-
-#- Disable autocommit and enable error handling
-#print "database=$oradatabase, user=$orauser,pass=$orapass \n";
-my $oradbh = DBI->connect( "dbi:Oracle:$oradatabase", $orauser, $orapass, {AutoCommit=>0, RaiseError=>1, 'PrintError'=>1}) 
-  or die "Couldn't connect to oracle database: " . DBI->errstr;
-#my $dbh = DBI->connect( "dbi:Oracle:$database", $user,$pass, {AutoCommit=>0});
-print "Oracle Connected!\n" if($opt_verb);
-print Dumper $oradbh;
-
-
-# JAM connect the postgresql here with second handle.
-
-print "Try to connect to the Postgres Data Base ...\n" if($opt_verb);
-my $pgdbh = DBI->connect( "dbi:Pg:dbname=$pgdatabase;host=$pghost;port=$pgport", $pguser, $pgpass, {AutoCommit=>0, RaiseError=>0, 'PrintError'=>1})
- or die "Couldn't connect to Postgres database: " . DBI->errstr;
-print "Postgres Connected!\n" if($opt_verb);
-print Dumper $pgdbh;
-
-
-################################################################
-# JAM: here we implement all  functions according to ilses plan:
-
-
-# JAM TODO: test if import table is empty here:
-
-&testOracleImportTableEmpty() or die "Oracle import table is not empty!";
-
-#exit(0); 
-# test only connection up to here
-
-# function to get current date in perl.
-my $dt   = DateTime->now - DateTime::Duration->new( days => 1 ); 
-# -> one day before today
-my $impDay      = $dt->ymd;
-#my $impDay      = '2016-11-28';
-#import day ( = yesterday) defined by perl program
-
-#my $impDayBegin = '2016-09-20 00:00:00.000000';
-
-# JAM25-07-2018: import everything since start of magnet service???
-#my $impDayBegin = '2018-07-15 00:00:00.000000';
-
-my $impDayBegin = "$impDay 00:00:00.000000";
-#begin of import day
-my $impDayEnd   = "$impDay 23:59:59.999999";
-#end of import day
-
-
-
-
-print "Got begin:$impDayBegin end:$impDayEnd\n" if($opt_verb);
-
-# define list of channels to import, is filled later:
-my @channelList =();
-# define list of channel last import times to be  filled later:
-my @channelTimes =();
-
-
-# The perl program stores all data read from Postgres in staging tables in Oracle
-# and starts an Oracle job to process the data.
-# 1. Reads full Postgres table SEVERITY and stores all records in Oracle table
-#    PGIMPORT_SEVERITY.
-
-&transferSeverities() or die "Failed to transfer severities\n";
-      
-# 2. Reads full Postgres table STATUS and stores the records in Oracle table
-#    PGIMPORT_SEVERITY.
-
-&transferStatus() or die "Failed to transfer status\n";
-
-
-# 3. Reads the list of active channels (only defined by name) from Oracle table
-#    HCSS_IMPORT_CHANNEL and stores them in memory (see remark A).
-
-&readChannelList() or die "Failed to read channel list\n";
-
-print "After readChannelList, got (0 - $#channelList) channels\n" if ($opt_verb);
-
-die "!!! Import channel list from Oracle is empty! Check last import day!!!! Terminated. \n\n" unless ($#channelList > 0);
-
-# 
-# 4. Then it loops over this list of channels and reads for each channel:
-#   4.1 the channel id and the sampling parameters from Postgres table CHANNEL
-#       and the precision and unit from table NUM_METADATA,
-#   4.2 the data from Postgres table SAMPLE since last import (see remark B)
-#       and stores them in Oracle table PGIMPORT_SAMPLE.
-#       This must be done in larger batches, single read/write are too slow.
-#       (see also remark D)
-#   4.3 Then the channel parameters are stored in the Oracle table
-#       PGIMPORT_CHANNEL together with the the start and end time of the import
-#       day (independing of the sample timestamps, because there might be no data
-#       at all in the import date range).
-
-# global variables to keep the per-channel parameters:
-my $ch_id=0;
-my $ch_name=0;
-my $ch_smplid=0;
-my $ch_smplval=0;
-my $ch_smplper=0;
-my $ch_prec=0;
-my $ch_unit=0;
-
-
-
-
-my $pgsth_channel_id = $pgdbh->prepare("SELECT a.channel_id, a.name, a.smpl_mode_id, a.smpl_val, a.smpl_per,
-             b.prec, b.unit
-        FROM $pgchannel a LEFT OUTER JOIN $pgnummeta b ON (a.channel_id = b.channel_id)
-        WHERE a.name = ? ") 
-      or die "Couldn't prepare channel id statement: " . $pgdbh->errstr;      
-
-
-# arguments: channel_id,  channel_id, lastImpEndtime,  channel_id,
-my $pgsth_get_samples = $pgdbh->prepare("SELECT channel_id,
-           to_char(smpl_time,'YYYY-MM-DD HH24:MI:SS.US') as smpl_time,
-           severity_id, status_id, num_val, float_val, str_val
-        FROM $pgsample
-        WHERE channel_id = ?
-          AND smpl_time = ( SELECT MAX(smpl_time)
-                              FROM $pgsample
-                              WHERE channel_id = ?
-                                AND smpl_time > to_timestamp(  ?  ,'YYYY-MM-DD HH24:MI:SS.US')
-                                AND smpl_time < to_timestamp('$impDayBegin','YYYY-MM-DD HH24:MI:SS.US') )
-    UNION
-    SELECT channel_id, 
-           to_char(smpl_time,'YYYY-MM-DD HH24:MI:SS.US') as smpl_time,
-           severity_id, status_id, num_val, float_val, str_val
-        FROM $pgsample
-        WHERE channel_id = ?
-          AND smpl_time >= to_timestamp('$impDayBegin','YYYY-MM-DD HH24:MI:SS.US')
-          AND smpl_time <= to_timestamp('$impDayEnd','YYYY-MM-DD HH24:MI:SS.US')
-    ORDER BY smpl_time") 
-      or die "Couldn't prepare get sample statement: " . $pgdbh->errstr;        
-      
-
-my $orasth_store_samples;
-my $orasth_store_paras; 
-my $orasth_channel_id;
-my $orasth_check_old_id;
-
-if($opt_oracle){
-
-#JAM2021: need to also get the Oracle ID of existing PV:
-
-$orasth_channel_id = $oradbh->prepare_cached("SELECT channel_id, channel_name
-        FROM $orahcsid 
-        WHERE channel_name = ? ") 
-      or die "Couldn't prepare oracle channel id statement: " . $oradbh->errstr;      
-
-$orasth_check_old_id = $oradbh->prepare_cached("SELECT channel_id
-        FROM $orahcsid 
-        WHERE channel_id = ? ") 
-      or die "Couldn't prepare oracle check channel id statement: " . $oradbh->errstr; 
-
-
-
-# arguments: channelId, smplTime, $severity, $statusId, $numVal, $floatVal, $strVal 
-$orasth_store_samples = $oradbh->prepare_cached("INSERT INTO $orasample 
-               ( channel_id, smpl_time, severity_id, status_id, num_val, float_val, str_val)
-        VALUES ( ? ,
-                 to_timestamp(? , 'YYYY-MM-DD HH24:MI:SS.FF6'),
-                 ? , ? , ? , ? , ? )") 
-      or die "Couldn't prepare store samples statement: " . $oradbh->errstr;    
-      
-
-# arguments:  $channelId, $channelName, $smplModeId, $smplVal, $smplPer, $prec, $unit   
-$orasth_store_paras = $oradbh->prepare_cached("INSERT INTO $orachannel
-               ( channel_id, channel_name, smpl_mode_id, smpl_val, smpl_per, prec, unit, starttime, endtime )
-        VALUES ( ? , ? , ? , ? , ? , ? , ? ,
-                 to_timestamp('$impDayBegin','YYYY-MM-DD HH24:MI:SS.FF6'), to_timestamp('$impDayEnd','YYYY-MM-DD HH24:MI:SS.FF6') )") 
-      or die "Couldn't prepare store parameters statement: " . $oradbh->errstr;     
-
-}      
-      
-#foreach my $channelName(@channelList)
-for my $i (0 .. $#channelList)
-{
-  &transferChannelData($channelList[$i], $channelTimes[$i]) or printf "Failed to transfer channel of name $channelList[$i]\n";
-}
-
-
-
-# 5. Finally the perl program executes the Oracle procedure
-#    hades_scs.hcss_move_data_make_summary to process the import data.
-#    This procedure starts an Oracle job to check the data and to copy new data
-#    into the final tables. After import it starts two other jobs: the first one
-#    generates the run-based summaries while the second one running some hours
-#    later truncates the import tables.
-&processOracleImportedData() or die "Failed to start Oracle jobs\n";
-                                      
-                                    
-
-
-#-------- Finish and disconnect
-&finishAndDisconnect();
-print "Import of postgres2ora finished successfully.\n"; 
-#if ($opt_verb);
-exit(0);
-
-################### END OF MAIN ####################
-
-
-
-
-
-
-
-sub help()
-{
-    print "\n";
-    print << 'EOF';
-postgres2ora.pl
-
-   This script exports slow control data from postgres to oracle
-Usage:
-
-   Command line:  postgres2ora.pl
-   [-h|--help]            : Print this help.
-   [-o|--oracle]          : Really import into Oracle (otherwise just dummy mode)
-   [-opass orapass]       : Specify password for Oracle database
-   [-ppass pgpass]        : Specify password for Posstgres database
-   [-v|--verb]               : More verbose.
-
-Examples:
-
-   Transfer slow control archiver data from postgres to Oracle and be verbose:
-      postgres2ora.pl -v -o 
-
-EOF
-}
-
-sub finishAndDisconnect()
-{
-
-  $pgsth_channel_id->finish() if(defined $pgsth_channel_id);
-  $pgsth_get_samples->finish() if(defined $pgsth_get_samples);
-
-  if($opt_oracle){ 
-    $orasth_store_samples->finish() if(defined $orasth_store_samples);
-    $orasth_store_paras ->finish() if(defined $orasth_store_paras);
-    }
-    
-    if(defined $oradbh){
-       $oradbh->disconnect || die "Failed to disconnect from Oracle\n";
-    }    
-    if(defined $pgdbh){
-       $pgdbh->disconnect || die "Failed to disconnect from Postgres\n";
-    }
-}
-
-sub finishAndExit()
-{
-    # don't allow nested signal handling
-    return if ($ExitCode ne "-1");
-
-    # this will stop the treads, too
-    $ExitCode = shift;
-
-    print "postgres2ora_client.pl exited (signal/exit code: $ExitCode).\n";
-
-    &finishAndDisconnect();
-
-    # wait until all threads ended - don't join the main thread or ourselves
-#    foreach my $thread (threads->list()){
-#        $thread->join()
-#          if ($thread->tid() && !threads::equal( $thread, threads->self() ));
-#    }
-
-    close(STDOUT);
-    close(STDERR);
-
-    exit(1);
-}
-
-
-
-sub transferSeverities()
-{
-my $pgsth_severity = $pgdbh->prepare(" SELECT severity_id, name FROM $pgseverity ORDER BY severity_id") 
-      or die "Couldn't prepare statement: " . $pgdbh->errstr;
-my $orasth_severity;   
-if($opt_oracle)
-{
-  $orasth_severity = $oradbh->prepare_cached("INSERT INTO $oraseverity (severity_id, severity_name) VALUES (?,?)") 
-      or die "Couldn't prepare statement: " . $oradbh->errstr;      
-}     
-# get values from postgres:
-  print "get severities\n" if ($opt_verb);
-$pgsth_severity->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;
-my $success = 1;
-my @data;
-while (@data = $pgsth_severity->fetchrow_array()) {
-  my $sid =   $data[0];
-  my $sname = $data[1];
-  print "inserting severities \t$sid  $sname\n" if ($opt_verb);
-  if($opt_oracle)
-    {
-      $success &&= $orasth_severity->execute($sid, $sname);
-    }
-    else
-    {
-      print "    - just pretend!\n" if ($opt_verb);
-    }
-}
-# end while
-if($opt_oracle)
-{
-  my $result = ($success ? $oradbh->commit : $oradbh->rollback);
-  unless ($result) { 
-            die "Couldn't finish transaction: " . $oradbh->errstr; 
-          }
-  $orasth_severity->finish();          
-}        
-$pgsth_severity->finish();
-return $success;
-}
-
-
-sub transferStatus()
-{
-my $pgsth_status = $pgdbh->prepare(" SELECT status_id, name FROM $pgstatus ORDER BY status_id") 
-      or die "Couldn't prepare statement: " . $pgdbh->errstr;
-my $orasth_status;
-
-if($opt_oracle){     
-$orasth_status = $oradbh->prepare_cached("INSERT INTO $orastatus (status_id, status_name) values (?,?)") 
-      or die "Couldn't prepare statement: " . $oradbh->errstr;      
-}      
-# get values from postgres:
-  print "get status values\n" if ($opt_verb);
-$pgsth_status->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;;
-my $success = 1;
-my @data;
-while (@data = $pgsth_status->fetchrow_array()) {
-  my $stid =   $data[0];
-  my $stname = $data[1];
-  print "inserting status \t$stid  $stname\n" if ($opt_verb);
-  if($opt_oracle)
-    {
-      $success &&= $orasth_status->execute($stid, $stname);
-  }
-  else
-    {
-      print "    - just pretend!\n" if ($opt_verb);
-    }
-  
-  }
-#end while  
-
-if($opt_oracle)
-  {  
-  my $result = ($success ? $oradbh->commit : $oradbh->rollback);
-  unless ($result) { 
-            die "Couldn't finish transaction: " . $oradbh->errstr 
-          }
-  $orasth_status->finish();
- } 
-$pgsth_status->finish();
-return $success;
-}
-
-
-sub readChannelList()
-{
-
-my $orasth_channel_list = $oradbh->prepare(" SELECT channel_name,
-           to_char(cast(nvl(imp_endtime,trunc(sysdate)-90) as timestamp),'YYYY-MM-DD HH24:MI:SS.FF6') AS last_imp_endtime
-        FROM $orahcsschannel WHERE active = 1
-          AND ( imp_endtime IS NULL OR imp_endtime < to_date('$impDay','YYYY-MM-DD') )
-        ORDER BY channel_name") 
-      or die "Couldn't prepare statement: " . $oradbh->errstr;      
-      
-# get channel names  from oracle:
-print "get channel names\n"if ($opt_verb);
-$orasth_channel_list->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;;
-my $success = 1;
-my @data;
-while (@data = $orasth_channel_list->fetchrow_array()) {
-  my $chname =   $data[0];
-  my $last_imp_endtime = $data[1];
-  print "getting channel \t$chname  with time $last_imp_endtime\n" if ($opt_verb);
-  push @channelList, $chname;
-  push @channelTimes, $last_imp_endtime;
-  }
-  
-$orasth_channel_list->finish();
-return $success;
-}
-
-
-
-sub transferChannelData()
-{
-    my ($currentChannel, $currentTime) = @_;
-    my @data;
-    my $oraid;
-    print "transferChannelData for $currentChannel\n" if ($opt_verb);
-     
-#      4.1 the channel id and the sampling parameters from Postgres table CHANNEL
-#       and the precision and unit from table NUM_METADATA,
-#     a.channel_id, a.name, a.smpl_mode_id, a.smpl_val, a.smpl_per, b.prec, b.unit 
-  $pgsth_channel_id->execute($currentChannel)  or print "Couldn't execute channel id statement: " . $pgdbh->errstr;
-  
-  
-  
-  
-  unless (@data = $pgsth_channel_id->fetchrow_array()){
-       print "Couldn't get channel id from postgres!!!\n " if ($opt_verb);
-       return 1;
-  }
-  $ch_id       =       $data[0];
-  $ch_name     =       $data[1];
-  $ch_smplid   =       $data[2];
-  $ch_smplval  =       $data[3];
-  $ch_smplper  =       $data[4]; 
-  $ch_prec     =       $data[5];   
-  $ch_unit     =       $data[6];
-  
-  
-  print "got id:$ch_id name:$ch_name smplid:$ch_smplid smplper:$ch_smplper prec:$ch_prec unit:$ch_unit  \n" if ($opt_verb);
-  
-  # check here if there is another result of the id select (should not be?)
-  if (@data = $pgsth_channel_id->fetchrow_array()){
-       print "Warning: found duplicate ids1'!!";
-       }
-
-       
-if($opt_oracle)
-  {  
-  # JAM2021: here we have to replace the new postgres PV id by the previous oracle id, if it exists
-  my @orachannelids;
-  $orasth_channel_id->execute($currentChannel)  or die "Couldn't execute oracle channel id statement: " . $oradbh->errstr;
-  
-  if (@orachannelids = $orasth_channel_id->fetchrow_array()){
-       #  here assign the  new id
-       print "Got ora id $orachannelids[0] for PV $orachannelids[1] \n" if ($opt_verb);
-       $oraid=$orachannelids[0];
-    }
-  else
-    {
-        print "Couldn't get channel id for $currentChannel from oracle - assign new id\n " if ($opt_verb);
-        # check here if new id from postgres is already used in ora:
-        my @oracheckids;
-        my $count=0;;
-        my $nid;
-        $nid=$ch_id-1;
-        do{
-            $nid += 1;
-            print "Testing if new id $nid is already used....\n" if ($opt_verb);
-            $orasth_check_old_id->execute($nid)  or die "Couldn't execute oracle check newchannel id statement: " . $oradbh->errstr;
-            $count+=1;
-            die "oracle check id loop not finished after $count increases, nid=$nid !!!" if ($count>1000);
-        }
-        while (@oracheckids = $orasth_check_old_id->fetchrow_array());            
-        # for newly added pvs, we keep the postgres id unless this id is already used in oracle
-        $oraid=$nid;
-        print "Assing new ora id $oraid for PV $orachannelids[1], postgres id was $ch_id \n" if ($opt_verb);
-    }
-  
-  }
-       
-       
-    
-#   4.2 the data from Postgres table SAMPLE since last import (see remark B)
-#       and stores them in Oracle table PGIMPORT_SAMPLE.
-#       This must be done in larger batches, single read/write are too slow.
-#       (see also remark D)
-
-print "Getting samples from postgres...\n" if ($opt_verb);
-# arguments: channel_id,  channel_id, lastImpEndtime,  channel_id,
-$pgsth_get_samples->execute($ch_id, $ch_id, $currentTime, $ch_id) or die "Couldn't execute get samples statement: " . $pgdbh->errstr;;
-
-my $success = 1;
-my @sampdata;
-while (@sampdata = $pgsth_get_samples->fetchrow_array()) {
-# TODO : exit counter?
-# TODO: fetch all rows into variable arrays, then insert to oracle outside loop?
-  
-  
-#  my $channel_id      =       $sampdata[0];
-#  my $smpl_time       =       $sampdata[1];
-#  my $severity_id     =       $sampdata[2];
-#  my $status_id       =       $sampdata[3];
-#  my $num_val         =       $sampdata[4];
-#  my $float_val               =       $sampdata[5];
-#  my $str_val         =       $sampdata[6];
-#  
-# # supress some warnings if certain type is not available:
-#  $num_val = -1 unless $num_val;
-#  $float_val = -1.0 unless $float_val;
-#  $str_val = "nothing" unless $str_val;
-#  
-#   print "transfer data - id:$channel_id time:$smpl_time sev_id: $severity_id st_id:$status_id numval: $num_val floatval:$float_val strval:$str_val \n" if ($opt_verb);
-#  # arguments: channelId, smplTime, $severity, $statusId, $numVal, $floatVal, $strVal 
-  
-  if($opt_oracle)
-  {  
-  
-  
-##   print "before orasth_store_samples: $channel_id \n";
-#    $success &&= $orasth_store_samples->execute($channel_id, $smpl_time, $severity_id, $status_id, $num_val, $float_val, $str_val);  
-
-#     $success &&= $orasth_store_samples->execute($sampdata[0],$sampdata[1],$sampdata[2],$sampdata[3],$sampdata[4],$sampdata[5],$sampdata[6]);  
-# JAM2021: use different oracle id for same PV:    
-    $success &&= $orasth_store_samples->execute($oraid,$sampdata[1],$sampdata[2],$sampdata[3],$sampdata[4],$sampdata[5],$sampdata[6]);   
-    
-
-unless( $success){
-      print "ERROR during store samples!";
-    }
-  }
-  else
-    {
-      print "    - just pretend!\n" if ($opt_verb);
-    }
-  
-}
-#end while  
-  
-return $success unless($opt_oracle);
-
-
-
-#print "before orasth_store_paras: $ch_id \n";
-
-#   4.3 Then the channel parameters are stored in the Oracle table
-#       PGIMPORT_CHANNEL together with the the start and end time of the import
-#       day (independing of the sample timestamps, because there might be no data
-#       at all in the import date range)
-
-# arguments:  $channelId, $channelName, $smplModeId, $smplVal, $smplPer, $prec, $unit   $ch_prec, $ch_unit
-
-#$success &&= $orasth_store_paras->execute($ch_id, $ch_name, $ch_smplid, $ch_smplval, $ch_smplper, $ch_prec, $ch_unit);
-$success &&= $orasth_store_paras->execute($oraid, $ch_name, $ch_smplid, $ch_smplval, $ch_smplper, $ch_prec, $ch_unit);
-
- unless( $success){
-    print "ERROR during store parameters!";
-  }
-
- # print "success is: $success";
-  
-my $result = ($success ? $oradbh->commit : $oradbh->rollback);
-
-
-
-unless ($result) { 
-            die "Couldn't finish transferChannelData transaction: " . $oradbh->errstr 
-          }
-return $success;
-
-}
-
-
-sub processOracleImportedData()
-{
-
-  return 1 unless($opt_oracle);
-
-  my $result=$oradbh->do('BEGIN hades_scs.hcss_move_data_make_summary(); END;');                                
-  return $result;                                      
-}
-
-
-sub testOracleImportTableEmpty()
-{
-
-  return 1 unless($opt_oracle);
-
-  my $orasth_testempty = $oradbh->prepare("SELECT ( a.n + b.n + c.n + d.n ) from 
-           ( SELECT COUNT(*) as n FROM $orachannel ) a,
-           ( SELECT COUNT(*) as n FROM $orasample ) b,
-           ( SELECT COUNT(*) as n FROM $oraseverity ) c,
-           ( SELECT COUNT(*) as n FROM $orastatus ) d") 
-      or die "Couldn't prepare statement: " . $oradbh->errstr;    
-  
-  my $result=$orasth_testempty->execute() or print "Couldn't execute table empty test statement: " . $pgdbh->errstr;                                 
-  my $success = 1;
-  my @data;
-while (@data = $orasth_testempty->fetchrow_array()) {
-    my $entries= $data[0];
-    print "import tables have  $entries entries \n";
-    if ($entries == 0) {return 1;} 
-      else {return 0;}
-  }
-  
-  return 0;                                      
-}
-
-
-
-
-# sub statusServer()
-# { 
-#     my $server_socket;
-#     my $client_socket;
-#     my $selector;
-# 
-#     unless (defined( $server_socket =
-#                      IO::Socket::INET->new( LocalPort => $opt_sport,
-#                                             Proto     => 'tcp',
-#                                             Listen    => SOMAXCONN ) ))
-#     {
-#         print "ERROR: Cannot start status server!\n";
-#     }
-# 
-#     $selector = new IO::Select( $server_socket );
-# 
-#     while(1) {
-# 
-#         # wait 5 seconds for connections
-#         while (my @file_handles = $selector->can_read( 5 )) {
-# 
-#             foreach my $file_handle (@file_handles) {
-# 
-#                 if($file_handle == $server_socket) {
-# 
-#                     # create a new socket for this transaction
-#                     unless (defined( $client_socket = $server_socket->accept() ))
-#                     {
-#                         print "ERROR: Cannot open socket to send status!\n";
-#                      &exitProgram( 2 );
-#                     }
-# 
-#                     print $client_socket $status;
-# 
-#                     close( $client_socket );
-#                 }
-#             }
-#         }
-# 
-#      if( $ExitCode ne "-1" ){
-#          print "Exit status server thread.\n";
-#          close( $server_socket );
-#          return;
-#      }
-#     }
-# }
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..760db7631d8a83d463a324e5c926890371e8d7d3
--- /dev/null
@@ -0,0 +1 @@
+postgres2ora_dst.pl
\ No newline at end of file
diff --git a/oracle/postgres2ora_dst.pl b/oracle/postgres2ora_dst.pl
new file mode 100755 (executable)
index 0000000..04b0f3e
--- /dev/null
@@ -0,0 +1,765 @@
+#!/usr/bin/perl -w
+###################
+# JAM2016 - cronjob script to transfer EPICS slow control archiver data from postgres to hades oracle 
+# following attempt was based on daq2ora_client.pl and other Perl examples
+# it tries to implement Ilse Koenigs suggested code with DBI methods
+#######
+# V0.1 10-Oct-2016 by JAM( j.adamczewski@gsi.de) - first draft for discussion. Did never run
+# V0.2 11-Oct-2016 by JAM( j.adamczewski@gsi.de) - added oracle option. Bugfixes.
+# V0.3 13-Oct-2016 by JAM( j.adamczewski@gsi.de) - tested with read acccess to both databases
+# V0.4 10-Jan-2017 by JAM - renamed to postgres2ora.pl, exclude passwords from code, check if table is empty
+
+use English;
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+#use Scalar::Util qw(reftype);
+use IO::Socket;
+use IO::Select;
+use FileHandle;
+use Time::Local;
+use DateTime;
+use threads;
+use threads::shared;
+
+use DBI;
+use DBD::ODBC;
+
+#my $cmd_server_port   = 4799;
+#my $cmd_server_prtcl  = 'tcp';
+#my $opt_sport       = 50998;  # open this port for status server
+my $opt_help = 0;
+my $opt_verb = 0;
+my $opt_oracle = 0;
+
+# JAM optionally change account here:
+my $orauser      = 'DAQ_PUB';
+my $orapass      = 'please_give_oracle_password';
+#my $oradatabase  = 'db-hades-test';
+my $oradatabase  = 'db-hades';
+
+# JAM access details for postgres
+my $pguser      = 'report';
+my $pgpass      = 'please_give_postgres_password';
+
+my $pgdatabase  = 'archive';
+my $pghost      = 'lxhaddcs10.gsi.de';
+#'lxhadeb05.gsi.de';
+my $pgport      = '5432';
+
+# JAM real passwords are delivered by command line options now.
+
+
+GetOptions ('h|help'      => \$opt_help,
+           'v|verb'      => \$opt_verb,
+           'o|oracle'    => \$opt_oracle,
+           'opass=s'     => \$orapass,
+           'ppass=s'     => \$pgpass
+         );
+
+if( $opt_help ) {
+    &help();
+    exit(0);
+}
+
+
+
+
+
+# JAM here definition of table names
+my $pgseverity     = 'severity';
+my $oraseverity    = 'hades_scs.pgimport_severity';
+my $pgstatus       = 'status';
+my $orastatus      = 'hades_scs.pgimport_status';
+my $orahcsschannel = 'hades_scs.hcss_import_channel';
+my $orahcsid       = 'hades_scs.hcss_channel';
+my $pgchannel      = 'channel';
+my $pgnummeta      = 'num_metadata';
+my $pgsample       = 'sample';
+my $orasample      = 'hades_scs.pgimport_sample';
+my $orachannel     = 'hades_scs.pgimport_channel';
+
+my $ExitCode : shared = -1;
+my $status : shared = "OK";
+
+#- POSIX signal handlers: see signal(7) or kill(1) for available signals
+foreach my $signal ( qw(HUP INT QUIT ILL ABRT FPE SEGV TERM USR1 USR2) ){
+   $SIG{$signal} = sub { &finishAndExit( $signal ); };
+}
+
+
+my $app_logfile = "/home/hadaq/log/postgres2ora.log"; 
+
+#- Daemonize
+# if($opt_daemon){
+#     open(STDIN,  '>/dev/null');
+#     open(STDOUT, ">$app_logfile") || die "Cannot redirect STDOUT";
+#     open(STDERR, ">&STDOUT") || die "Cannot dup STDERR";
+#     select STDERR; $| = 1; # make unbuffered
+#     select STDOUT; $| = 1; # make unbuffered
+# }
+
+
+# JAM2016 - we do not need statusserver for cronjob
+#-------- Start status server thread
+# threads->new( \&statusServer );
+# TODO if we should work with statusserver/daemon mode later, still need infinite main loop with check of time
+
+
+#-------- need to explicitely set oracle environment if this was started by icinga restarthandler (not-login ssh!)
+$ENV{ORACLE_HOME}='/usr/lib/oracle/12.1/client64';
+$ENV{LD_LIBRARY_PATH}='/usr/lib/oracle/12.1/client64/lib';
+
+#-------- Connect the database
+#$status = "Try to connect to the Oracle Data Base ...";
+print "Try to connect to the Oracle Data Base ...\n" if($opt_verb);
+
+#- Disable autocommit and enable error handling
+#print "database=$oradatabase, user=$orauser,pass=$orapass \n";
+my $oradbh = DBI->connect( "dbi:Oracle:$oradatabase", $orauser, $orapass, {AutoCommit=>0, RaiseError=>1, 'PrintError'=>1}) 
+  or die "Couldn't connect to oracle database: " . DBI->errstr;
+#my $dbh = DBI->connect( "dbi:Oracle:$database", $user,$pass, {AutoCommit=>0});
+print "Oracle Connected!\n" if($opt_verb);
+print Dumper $oradbh;
+
+
+# JAM connect the postgresql here with second handle.
+
+print "Try to connect to the Postgres Data Base ...\n" if($opt_verb);
+my $pgdbh = DBI->connect( "dbi:Pg:dbname=$pgdatabase;host=$pghost;port=$pgport", $pguser, $pgpass, {AutoCommit=>0, RaiseError=>0, 'PrintError'=>1})
+ or die "Couldn't connect to Postgres database: " . DBI->errstr;
+print "Postgres Connected!\n" if($opt_verb);
+print Dumper $pgdbh;
+
+
+################################################################
+# JAM: here we implement all  functions according to ilses plan:
+
+
+# JAM TODO: test if import table is empty here:
+
+&testOracleImportTableEmpty() or die "Oracle import table is not empty!";
+
+#exit(0); 
+# test only connection up to here
+
+# function to get current date in perl.
+my $dt   = DateTime->now - DateTime::Duration->new( days => 1 ); 
+# testing: my $dt   = DateTime->now;
+my $yesterdt   = DateTime->now - DateTime::Duration->new( days => 2 ); ;
+# -> one day before today
+my $impDay      = $dt->ymd;
+my $yesterimpDay      = $yesterdt->ymd;
+#my $impDay      = '2016-11-28';
+#import day ( = yesterday) defined by perl program
+
+#my $impDayBegin = '2016-09-20 00:00:00.000000';
+
+# JAM25-07-2018: import everything since start of magnet service???
+#my $impDayBegin = '2018-07-15 00:00:00.000000';
+
+## original:
+#my $impDayBegin = "$impDay 00:00:00.000000";
+#begin of import day
+#my $impDayEnd   = "$impDay 23:59:59.999999";
+#end of import day
+
+## JAM 29-04-2025- adjust for postgres time shifted without dst:
+my $impDayBeginDST = "$yesterimpDay 23:00:00.000000";
+my $impDayEndDST   = "$impDay 22:59:59.999999";
+
+
+my $impDayBegin = "$impDay 00:00:00.000000";
+#begin of import day
+my $impDayEnd   = "$impDay 23:59:59.999999";
+#end of import day
+
+
+
+print "Got begin:$impDayBegin end:$impDayEnd\n" if($opt_verb);
+
+# define list of channels to import, is filled later:
+my @channelList =();
+# define list of channel last import times to be  filled later:
+my @channelTimes =();
+
+
+# The perl program stores all data read from Postgres in staging tables in Oracle
+# and starts an Oracle job to process the data.
+# 1. Reads full Postgres table SEVERITY and stores all records in Oracle table
+#    PGIMPORT_SEVERITY.
+
+&transferSeverities() or die "Failed to transfer severities\n";
+      
+# 2. Reads full Postgres table STATUS and stores the records in Oracle table
+#    PGIMPORT_SEVERITY.
+
+&transferStatus() or die "Failed to transfer status\n";
+
+
+# 3. Reads the list of active channels (only defined by name) from Oracle table
+#    HCSS_IMPORT_CHANNEL and stores them in memory (see remark A).
+
+&readChannelList() or die "Failed to read channel list\n";
+
+print "After readChannelList, got (0 - $#channelList) channels\n" if ($opt_verb);
+
+die "!!! Import channel list from Oracle is empty! Check last import day!!!! Terminated. \n\n" unless ($#channelList > 0);
+
+# 
+# 4. Then it loops over this list of channels and reads for each channel:
+#   4.1 the channel id and the sampling parameters from Postgres table CHANNEL
+#       and the precision and unit from table NUM_METADATA,
+#   4.2 the data from Postgres table SAMPLE since last import (see remark B)
+#       and stores them in Oracle table PGIMPORT_SAMPLE.
+#       This must be done in larger batches, single read/write are too slow.
+#       (see also remark D)
+#   4.3 Then the channel parameters are stored in the Oracle table
+#       PGIMPORT_CHANNEL together with the the start and end time of the import
+#       day (independing of the sample timestamps, because there might be no data
+#       at all in the import date range).
+
+# global variables to keep the per-channel parameters:
+my $ch_id=0;
+my $ch_name=0;
+my $ch_smplid=0;
+my $ch_smplval=0;
+my $ch_smplper=0;
+my $ch_prec=0;
+my $ch_unit=0;
+
+
+
+
+my $pgsth_channel_id = $pgdbh->prepare("SELECT a.channel_id, a.name, a.smpl_mode_id, a.smpl_val, a.smpl_per,
+             b.prec, b.unit
+        FROM $pgchannel a LEFT OUTER JOIN $pgnummeta b ON (a.channel_id = b.channel_id)
+        WHERE a.name = ? ") 
+      or die "Couldn't prepare channel id statement: " . $pgdbh->errstr;      
+
+
+# arguments: channel_id,  channel_id, lastImpEndtime,  channel_id,
+my $pgsth_get_samples = $pgdbh->prepare("SELECT channel_id,
+           to_char((smpl_time at time zone '-01:00'),'YYYY-MM-DD HH24:MI:SS.US') as smpl_time,
+           severity_id, status_id, num_val, float_val, str_val
+        FROM $pgsample
+        WHERE channel_id = ?
+          AND smpl_time = ( SELECT MAX(smpl_time)
+                              FROM $pgsample
+                              WHERE channel_id = ?
+                                AND  smpl_time  > to_timestamp(  ?  ,'YYYY-MM-DD HH24:MI:SS.US')
+                                AND  smpl_time  < to_timestamp('$impDayBeginDST','YYYY-MM-DD HH24:MI:SS.US') )
+    UNION
+    SELECT channel_id, 
+           to_char((smpl_time at time zone '-01:00'),'YYYY-MM-DD HH24:MI:SS.US') as smpl_time,
+           severity_id, status_id, num_val, float_val, str_val
+        FROM $pgsample
+        WHERE channel_id = ?
+          AND smpl_time >= to_timestamp('$impDayBeginDST','YYYY-MM-DD HH24:MI:SS.US')
+          AND smpl_time <= to_timestamp('$impDayEndDST','YYYY-MM-DD HH24:MI:SS.US') 
+    ORDER BY smpl_time") 
+      or die "Couldn't prepare get sample statement: " . $pgdbh->errstr;        
+      
+
+my $orasth_store_samples;
+my $orasth_store_paras; 
+my $orasth_channel_id;
+my $orasth_check_old_id;
+
+if($opt_oracle){
+
+#JAM2021: need to also get the Oracle ID of existing PV:
+
+$orasth_channel_id = $oradbh->prepare_cached("SELECT channel_id, channel_name
+        FROM $orahcsid 
+        WHERE channel_name = ? ") 
+      or die "Couldn't prepare oracle channel id statement: " . $oradbh->errstr;      
+
+$orasth_check_old_id = $oradbh->prepare_cached("SELECT channel_id
+        FROM $orahcsid 
+        WHERE channel_id = ? ") 
+      or die "Couldn't prepare oracle check channel id statement: " . $oradbh->errstr; 
+
+
+
+# arguments: channelId, smplTime, $severity, $statusId, $numVal, $floatVal, $strVal 
+$orasth_store_samples = $oradbh->prepare_cached("INSERT INTO $orasample 
+               ( channel_id, smpl_time, severity_id, status_id, num_val, float_val, str_val)
+        VALUES ( ? ,
+                 to_timestamp(? , 'YYYY-MM-DD HH24:MI:SS.FF6'),
+                 ? , ? , ? , ? , ? )") 
+      or die "Couldn't prepare store samples statement: " . $oradbh->errstr;    
+      
+
+# arguments:  $channelId, $channelName, $smplModeId, $smplVal, $smplPer, $prec, $unit   
+$orasth_store_paras = $oradbh->prepare_cached("INSERT INTO $orachannel
+               ( channel_id, channel_name, smpl_mode_id, smpl_val, smpl_per, prec, unit, starttime, endtime )
+        VALUES ( ? , ? , ? , ? , ? , ? , ? ,
+                 to_timestamp('$impDayBegin','YYYY-MM-DD HH24:MI:SS.FF6'), to_timestamp('$impDayEnd','YYYY-MM-DD HH24:MI:SS.FF6') )") 
+      or die "Couldn't prepare store parameters statement: " . $oradbh->errstr;     
+
+}      
+      
+#foreach my $channelName(@channelList)
+for my $i (0 .. $#channelList)
+{
+  &transferChannelData($channelList[$i], $channelTimes[$i]) or printf "Failed to transfer channel of name $channelList[$i]\n";
+}
+
+
+
+# 5. Finally the perl program executes the Oracle procedure
+#    hades_scs.hcss_move_data_make_summary to process the import data.
+#    This procedure starts an Oracle job to check the data and to copy new data
+#    into the final tables. After import it starts two other jobs: the first one
+#    generates the run-based summaries while the second one running some hours
+#    later truncates the import tables.
+&processOracleImportedData() or die "Failed to start Oracle jobs\n";
+                                      
+                                    
+
+
+#-------- Finish and disconnect
+&finishAndDisconnect();
+print "Import of postgres2ora finished successfully.\n"; 
+#if ($opt_verb);
+exit(0);
+
+################### END OF MAIN ####################
+
+
+
+
+
+
+
+sub help()
+{
+    print "\n";
+    print << 'EOF';
+postgres2ora.pl
+
+   This script exports slow control data from postgres to oracle
+Usage:
+
+   Command line:  postgres2ora.pl
+   [-h|--help]            : Print this help.
+   [-o|--oracle]          : Really import into Oracle (otherwise just dummy mode)
+   [-opass orapass]       : Specify password for Oracle database
+   [-ppass pgpass]        : Specify password for Posstgres database
+   [-v|--verb]               : More verbose.
+
+Examples:
+
+   Transfer slow control archiver data from postgres to Oracle and be verbose:
+      postgres2ora.pl -v -o 
+
+EOF
+}
+
+sub finishAndDisconnect()
+{
+
+  $pgsth_channel_id->finish() if(defined $pgsth_channel_id);
+  $pgsth_get_samples->finish() if(defined $pgsth_get_samples);
+
+  if($opt_oracle){ 
+    $orasth_store_samples->finish() if(defined $orasth_store_samples);
+    $orasth_store_paras ->finish() if(defined $orasth_store_paras);
+    }
+    
+    if(defined $oradbh){
+       $oradbh->disconnect || die "Failed to disconnect from Oracle\n";
+    }    
+    if(defined $pgdbh){
+       $pgdbh->disconnect || die "Failed to disconnect from Postgres\n";
+    }
+}
+
+sub finishAndExit()
+{
+    # don't allow nested signal handling
+    return if ($ExitCode ne "-1");
+
+    # this will stop the treads, too
+    $ExitCode = shift;
+
+    print "postgres2ora_client.pl exited (signal/exit code: $ExitCode).\n";
+
+    &finishAndDisconnect();
+
+    # wait until all threads ended - don't join the main thread or ourselves
+#    foreach my $thread (threads->list()){
+#        $thread->join()
+#          if ($thread->tid() && !threads::equal( $thread, threads->self() ));
+#    }
+
+    close(STDOUT);
+    close(STDERR);
+
+    exit(1);
+}
+
+
+
+sub transferSeverities()
+{
+my $pgsth_severity = $pgdbh->prepare(" SELECT severity_id, name FROM $pgseverity ORDER BY severity_id") 
+      or die "Couldn't prepare statement: " . $pgdbh->errstr;
+my $orasth_severity;   
+if($opt_oracle)
+{
+  $orasth_severity = $oradbh->prepare_cached("INSERT INTO $oraseverity (severity_id, severity_name) VALUES (?,?)") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;      
+}     
+# get values from postgres:
+  print "get severities\n" if ($opt_verb);
+$pgsth_severity->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;
+my $success = 1;
+my @data;
+while (@data = $pgsth_severity->fetchrow_array()) {
+  my $sid =   $data[0];
+  my $sname = $data[1];
+  print "inserting severities \t$sid  $sname\n" if ($opt_verb);
+  if($opt_oracle)
+    {
+      $success &&= $orasth_severity->execute($sid, $sname);
+    }
+    else
+    {
+      print "    - just pretend!\n" if ($opt_verb);
+    }
+}
+# end while
+if($opt_oracle)
+{
+  my $result = ($success ? $oradbh->commit : $oradbh->rollback);
+  unless ($result) { 
+            die "Couldn't finish transaction: " . $oradbh->errstr; 
+          }
+  $orasth_severity->finish();          
+}        
+$pgsth_severity->finish();
+return $success;
+}
+
+
+sub transferStatus()
+{
+my $pgsth_status = $pgdbh->prepare(" SELECT status_id, name FROM $pgstatus ORDER BY status_id") 
+      or die "Couldn't prepare statement: " . $pgdbh->errstr;
+my $orasth_status;
+
+if($opt_oracle){     
+$orasth_status = $oradbh->prepare_cached("INSERT INTO $orastatus (status_id, status_name) values (?,?)") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;      
+}      
+# get values from postgres:
+  print "get status values\n" if ($opt_verb);
+$pgsth_status->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;;
+my $success = 1;
+my @data;
+while (@data = $pgsth_status->fetchrow_array()) {
+  my $stid =   $data[0];
+  my $stname = $data[1];
+  print "inserting status \t$stid  $stname\n" if ($opt_verb);
+  if($opt_oracle)
+    {
+      $success &&= $orasth_status->execute($stid, $stname);
+  }
+  else
+    {
+      print "    - just pretend!\n" if ($opt_verb);
+    }
+  
+  }
+#end while  
+
+if($opt_oracle)
+  {  
+  my $result = ($success ? $oradbh->commit : $oradbh->rollback);
+  unless ($result) { 
+            die "Couldn't finish transaction: " . $oradbh->errstr 
+          }
+  $orasth_status->finish();
+ } 
+$pgsth_status->finish();
+return $success;
+}
+
+
+sub readChannelList()
+{
+
+my $orasth_channel_list = $oradbh->prepare(" SELECT channel_name,
+           to_char(cast(nvl(imp_endtime,trunc(sysdate)-90) as timestamp),'YYYY-MM-DD HH24:MI:SS.FF6') AS last_imp_endtime
+        FROM $orahcsschannel WHERE active = 1
+          AND ( imp_endtime IS NULL OR imp_endtime < to_date('$impDay','YYYY-MM-DD') )
+        ORDER BY channel_name") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;      
+      
+# get channel names  from oracle:
+print "get channel names\n"if ($opt_verb);
+$orasth_channel_list->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;;
+my $success = 1;
+my @data;
+while (@data = $orasth_channel_list->fetchrow_array()) {
+  my $chname =   $data[0];
+  my $last_imp_endtime = $data[1];
+  print "getting channel \t$chname  with time $last_imp_endtime\n" if ($opt_verb);
+  push @channelList, $chname;
+  push @channelTimes, $last_imp_endtime;
+  }
+  
+$orasth_channel_list->finish();
+return $success;
+}
+
+
+
+sub transferChannelData()
+{
+    my ($currentChannel, $currentTime) = @_;
+    my @data;
+    my $oraid;
+    print "transferChannelData for $currentChannel\n" if ($opt_verb);
+     
+#      4.1 the channel id and the sampling parameters from Postgres table CHANNEL
+#       and the precision and unit from table NUM_METADATA,
+#     a.channel_id, a.name, a.smpl_mode_id, a.smpl_val, a.smpl_per, b.prec, b.unit 
+  $pgsth_channel_id->execute($currentChannel)  or print "Couldn't execute channel id statement: " . $pgdbh->errstr;
+  
+  
+  
+  
+  unless (@data = $pgsth_channel_id->fetchrow_array()){
+       print "Couldn't get channel id from postgres!!!\n " if ($opt_verb);
+       return 1;
+  }
+  $ch_id       =       $data[0];
+  $ch_name     =       $data[1];
+  $ch_smplid   =       $data[2];
+  $ch_smplval  =       $data[3];
+  $ch_smplper  =       $data[4]; 
+  $ch_prec     =       $data[5];   
+  $ch_unit     =       $data[6];
+  
+  
+  print "got id:$ch_id name:$ch_name smplid:$ch_smplid smplper:$ch_smplper prec:$ch_prec unit:$ch_unit  \n" if ($opt_verb);
+  
+  # check here if there is another result of the id select (should not be?)
+  if (@data = $pgsth_channel_id->fetchrow_array()){
+       print "Warning: found duplicate ids1'!!";
+       }
+
+       
+if($opt_oracle)
+  {  
+  # JAM2021: here we have to replace the new postgres PV id by the previous oracle id, if it exists
+  my @orachannelids;
+  $orasth_channel_id->execute($currentChannel)  or die "Couldn't execute oracle channel id statement: " . $oradbh->errstr;
+  
+  if (@orachannelids = $orasth_channel_id->fetchrow_array()){
+       #  here assign the  new id
+       print "Got ora id $orachannelids[0] for PV $orachannelids[1] \n" if ($opt_verb);
+       $oraid=$orachannelids[0];
+    }
+  else
+    {
+        print "Couldn't get channel id for $currentChannel from oracle - assign new id\n " if ($opt_verb);
+        # check here if new id from postgres is already used in ora:
+        my @oracheckids;
+        my $count=0;;
+        my $nid;
+        $nid=$ch_id-1;
+        do{
+            $nid += 1;
+            print "Testing if new id $nid is already used....\n" if ($opt_verb);
+            $orasth_check_old_id->execute($nid)  or die "Couldn't execute oracle check newchannel id statement: " . $oradbh->errstr;
+            $count+=1;
+            die "oracle check id loop not finished after $count increases, nid=$nid !!!" if ($count>1000);
+        }
+        while (@oracheckids = $orasth_check_old_id->fetchrow_array());            
+        # for newly added pvs, we keep the postgres id unless this id is already used in oracle
+        $oraid=$nid;
+        print "Assing new ora id $oraid for PV $orachannelids[1], postgres id was $ch_id \n" if ($opt_verb);
+    }
+  
+  }
+       
+       
+    
+#   4.2 the data from Postgres table SAMPLE since last import (see remark B)
+#       and stores them in Oracle table PGIMPORT_SAMPLE.
+#       This must be done in larger batches, single read/write are too slow.
+#       (see also remark D)
+
+print "Getting samples from postgres...\n" if ($opt_verb);
+# arguments: channel_id,  channel_id, lastImpEndtime,  channel_id,
+$pgsth_get_samples->execute($ch_id, $ch_id, $currentTime, $ch_id) or die "Couldn't execute get samples statement: " . $pgdbh->errstr;;
+
+my $success = 1;
+my @sampdata;
+while (@sampdata = $pgsth_get_samples->fetchrow_array()) {
+# TODO : exit counter?
+# TODO: fetch all rows into variable arrays, then insert to oracle outside loop?
+  
+  
+#  my $channel_id      =       $sampdata[0];
+#  my $smpl_time       =       $sampdata[1];
+#  my $severity_id     =       $sampdata[2];
+#  my $status_id       =       $sampdata[3];
+#  my $num_val         =       $sampdata[4];
+#  my $float_val               =       $sampdata[5];
+#  my $str_val         =       $sampdata[6];
+#  
+# # supress some warnings if certain type is not available:
+#  $num_val = -1 unless $num_val;
+#  $float_val = -1.0 unless $float_val;
+#  $str_val = "nothing" unless $str_val;
+#  
+#print "transfer data - id:$channel_id time:$smpl_time sev_id: $severity_id st_id:$status_id numval: $num_val floatval:$float_val strval:$str_val \n" if ($opt_verb);
+#  # arguments: channelId, smplTime, $severity, $statusId, $numVal, $floatVal, $strVal 
+  
+  if($opt_oracle)
+  {  
+  
+  
+##   print "before orasth_store_samples: $channel_id \n";
+#    $success &&= $orasth_store_samples->execute($channel_id, $smpl_time, $severity_id, $status_id, $num_val, $float_val, $str_val);  
+
+#     $success &&= $orasth_store_samples->execute($sampdata[0],$sampdata[1],$sampdata[2],$sampdata[3],$sampdata[4],$sampdata[5],$sampdata[6]);  
+# JAM2021: use different oracle id for same PV:    
+    $success &&= $orasth_store_samples->execute($oraid,$sampdata[1],$sampdata[2],$sampdata[3],$sampdata[4],$sampdata[5],$sampdata[6]);   
+    
+
+unless( $success){
+      print "ERROR during store samples!";
+    }
+  }
+  else
+    {
+      print "    - just pretend!\n" if ($opt_verb);
+    }
+  
+}
+#end while  
+  
+return $success unless($opt_oracle);
+
+
+
+#print "before orasth_store_paras: $ch_id \n";
+
+#   4.3 Then the channel parameters are stored in the Oracle table
+#       PGIMPORT_CHANNEL together with the the start and end time of the import
+#       day (independing of the sample timestamps, because there might be no data
+#       at all in the import date range)
+
+# arguments:  $channelId, $channelName, $smplModeId, $smplVal, $smplPer, $prec, $unit   $ch_prec, $ch_unit
+
+#$success &&= $orasth_store_paras->execute($ch_id, $ch_name, $ch_smplid, $ch_smplval, $ch_smplper, $ch_prec, $ch_unit);
+$success &&= $orasth_store_paras->execute($oraid, $ch_name, $ch_smplid, $ch_smplval, $ch_smplper, $ch_prec, $ch_unit);
+
+ unless( $success){
+    print "ERROR during store parameters!";
+  }
+
+ # print "success is: $success";
+  
+my $result = ($success ? $oradbh->commit : $oradbh->rollback);
+
+
+
+unless ($result) { 
+            die "Couldn't finish transferChannelData transaction: " . $oradbh->errstr 
+          }
+return $success;
+
+}
+
+
+sub processOracleImportedData()
+{
+
+  return 1 unless($opt_oracle);
+
+  my $result=$oradbh->do('BEGIN hades_scs.hcss_move_data_make_summary(); END;');                                
+  return $result;                                      
+}
+
+
+sub testOracleImportTableEmpty()
+{
+
+  return 1 unless($opt_oracle);
+
+  my $orasth_testempty = $oradbh->prepare("SELECT ( a.n + b.n + c.n + d.n ) from 
+           ( SELECT COUNT(*) as n FROM $orachannel ) a,
+           ( SELECT COUNT(*) as n FROM $orasample ) b,
+           ( SELECT COUNT(*) as n FROM $oraseverity ) c,
+           ( SELECT COUNT(*) as n FROM $orastatus ) d") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;    
+  
+  my $result=$orasth_testempty->execute() or print "Couldn't execute table empty test statement: " . $pgdbh->errstr;                                 
+  my $success = 1;
+  my @data;
+while (@data = $orasth_testempty->fetchrow_array()) {
+    my $entries= $data[0];
+    print "import tables have  $entries entries \n";
+    if ($entries == 0) {return 1;} 
+      else {return 0;}
+  }
+  
+  return 0;                                      
+}
+
+
+
+
+# sub statusServer()
+# { 
+#     my $server_socket;
+#     my $client_socket;
+#     my $selector;
+# 
+#     unless (defined( $server_socket =
+#                      IO::Socket::INET->new( LocalPort => $opt_sport,
+#                                             Proto     => 'tcp',
+#                                             Listen    => SOMAXCONN ) ))
+#     {
+#         print "ERROR: Cannot start status server!\n";
+#     }
+# 
+#     $selector = new IO::Select( $server_socket );
+# 
+#     while(1) {
+# 
+#         # wait 5 seconds for connections
+#         while (my @file_handles = $selector->can_read( 5 )) {
+# 
+#             foreach my $file_handle (@file_handles) {
+# 
+#                 if($file_handle == $server_socket) {
+# 
+#                     # create a new socket for this transaction
+#                     unless (defined( $client_socket = $server_socket->accept() ))
+#                     {
+#                         print "ERROR: Cannot open socket to send status!\n";
+#                      &exitProgram( 2 );
+#                     }
+# 
+#                     print $client_socket $status;
+# 
+#                     close( $client_socket );
+#                 }
+#             }
+#         }
+# 
+#      if( $ExitCode ne "-1" ){
+#          print "Exit status server thread.\n";
+#          close( $server_socket );
+#          return;
+#      }
+#     }
+# }
diff --git a/oracle/postgres2ora_nodst.pl b/oracle/postgres2ora_nodst.pl
new file mode 100755 (executable)
index 0000000..13f1643
--- /dev/null
@@ -0,0 +1,752 @@
+#!/usr/bin/perl -w
+###################
+# JAM2016 - cronjob script to transfer EPICS slow control archiver data from postgres to hades oracle 
+# following attempt was based on daq2ora_client.pl and other Perl examples
+# it tries to implement Ilse Koenigs suggested code with DBI methods
+#######
+# V0.1 10-Oct-2016 by JAM( j.adamczewski@gsi.de) - first draft for discussion. Did never run
+# V0.2 11-Oct-2016 by JAM( j.adamczewski@gsi.de) - added oracle option. Bugfixes.
+# V0.3 13-Oct-2016 by JAM( j.adamczewski@gsi.de) - tested with read acccess to both databases
+# V0.4 10-Jan-2017 by JAM - renamed to postgres2ora.pl, exclude passwords from code, check if table is empty
+
+use English;
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+#use Scalar::Util qw(reftype);
+use IO::Socket;
+use IO::Select;
+use FileHandle;
+use Time::Local;
+use DateTime;
+use threads;
+use threads::shared;
+
+use DBI;
+use DBD::ODBC;
+
+#my $cmd_server_port   = 4799;
+#my $cmd_server_prtcl  = 'tcp';
+#my $opt_sport       = 50998;  # open this port for status server
+my $opt_help = 0;
+my $opt_verb = 0;
+my $opt_oracle = 0;
+
+# JAM optionally change account here:
+my $orauser      = 'DAQ_PUB';
+my $orapass      = 'please_give_oracle_password';
+#my $oradatabase  = 'db-hades-test';
+my $oradatabase  = 'db-hades';
+
+# JAM access details for postgres
+my $pguser      = 'report';
+my $pgpass      = 'please_give_postgres_password';
+
+my $pgdatabase  = 'archive';
+my $pghost      = 'lxhaddcs10.gsi.de';
+#'lxhadeb05.gsi.de';
+my $pgport      = '5432';
+
+# JAM real passwords are delivered by command line options now.
+
+
+GetOptions ('h|help'      => \$opt_help,
+           'v|verb'      => \$opt_verb,
+           'o|oracle'    => \$opt_oracle,
+           'opass=s'     => \$orapass,
+           'ppass=s'     => \$pgpass
+         );
+
+if( $opt_help ) {
+    &help();
+    exit(0);
+}
+
+
+
+
+
+# JAM here definition of table names
+my $pgseverity     = 'severity';
+my $oraseverity    = 'hades_scs.pgimport_severity';
+my $pgstatus       = 'status';
+my $orastatus      = 'hades_scs.pgimport_status';
+my $orahcsschannel = 'hades_scs.hcss_import_channel';
+my $orahcsid       = 'hades_scs.hcss_channel';
+my $pgchannel      = 'channel';
+my $pgnummeta      = 'num_metadata';
+my $pgsample       = 'sample';
+my $orasample      = 'hades_scs.pgimport_sample';
+my $orachannel     = 'hades_scs.pgimport_channel';
+
+my $ExitCode : shared = -1;
+my $status : shared = "OK";
+
+#- POSIX signal handlers: see signal(7) or kill(1) for available signals
+foreach my $signal ( qw(HUP INT QUIT ILL ABRT FPE SEGV TERM USR1 USR2) ){
+   $SIG{$signal} = sub { &finishAndExit( $signal ); };
+}
+
+
+my $app_logfile = "/home/hadaq/log/postgres2ora.log"; 
+
+#- Daemonize
+# if($opt_daemon){
+#     open(STDIN,  '>/dev/null');
+#     open(STDOUT, ">$app_logfile") || die "Cannot redirect STDOUT";
+#     open(STDERR, ">&STDOUT") || die "Cannot dup STDERR";
+#     select STDERR; $| = 1; # make unbuffered
+#     select STDOUT; $| = 1; # make unbuffered
+# }
+
+
+# JAM2016 - we do not need statusserver for cronjob
+#-------- Start status server thread
+# threads->new( \&statusServer );
+# TODO if we should work with statusserver/daemon mode later, still need infinite main loop with check of time
+
+
+#-------- need to explicitely set oracle environment if this was started by icinga restarthandler (not-login ssh!)
+$ENV{ORACLE_HOME}='/usr/lib/oracle/12.1/client64';
+$ENV{LD_LIBRARY_PATH}='/usr/lib/oracle/12.1/client64/lib';
+
+#-------- Connect the database
+#$status = "Try to connect to the Oracle Data Base ...";
+print "Try to connect to the Oracle Data Base ...\n" if($opt_verb);
+
+#- Disable autocommit and enable error handling
+#print "database=$oradatabase, user=$orauser,pass=$orapass \n";
+my $oradbh = DBI->connect( "dbi:Oracle:$oradatabase", $orauser, $orapass, {AutoCommit=>0, RaiseError=>1, 'PrintError'=>1}) 
+  or die "Couldn't connect to oracle database: " . DBI->errstr;
+#my $dbh = DBI->connect( "dbi:Oracle:$database", $user,$pass, {AutoCommit=>0});
+print "Oracle Connected!\n" if($opt_verb);
+print Dumper $oradbh;
+
+
+# JAM connect the postgresql here with second handle.
+
+print "Try to connect to the Postgres Data Base ...\n" if($opt_verb);
+my $pgdbh = DBI->connect( "dbi:Pg:dbname=$pgdatabase;host=$pghost;port=$pgport", $pguser, $pgpass, {AutoCommit=>0, RaiseError=>0, 'PrintError'=>1})
+ or die "Couldn't connect to Postgres database: " . DBI->errstr;
+print "Postgres Connected!\n" if($opt_verb);
+print Dumper $pgdbh;
+
+
+################################################################
+# JAM: here we implement all  functions according to ilses plan:
+
+
+# JAM TODO: test if import table is empty here:
+
+&testOracleImportTableEmpty() or die "Oracle import table is not empty!";
+
+#exit(0); 
+# test only connection up to here
+
+# function to get current date in perl.
+my $dt   = DateTime->now - DateTime::Duration->new( days => 1 ); 
+# -> one day before today
+my $impDay      = $dt->ymd;
+#my $impDay      = '2016-11-28';
+#import day ( = yesterday) defined by perl program
+
+#my $impDayBegin = '2016-09-20 00:00:00.000000';
+
+# JAM25-07-2018: import everything since start of magnet service???
+#my $impDayBegin = '2018-07-15 00:00:00.000000';
+
+my $impDayBegin = "$impDay 00:00:00.000000";
+#begin of import day
+my $impDayEnd   = "$impDay 23:59:59.999999";
+#end of import day
+
+
+
+
+print "Got begin:$impDayBegin end:$impDayEnd\n" if($opt_verb);
+
+# define list of channels to import, is filled later:
+my @channelList =();
+# define list of channel last import times to be  filled later:
+my @channelTimes =();
+
+
+# The perl program stores all data read from Postgres in staging tables in Oracle
+# and starts an Oracle job to process the data.
+# 1. Reads full Postgres table SEVERITY and stores all records in Oracle table
+#    PGIMPORT_SEVERITY.
+
+&transferSeverities() or die "Failed to transfer severities\n";
+      
+# 2. Reads full Postgres table STATUS and stores the records in Oracle table
+#    PGIMPORT_SEVERITY.
+
+&transferStatus() or die "Failed to transfer status\n";
+
+
+# 3. Reads the list of active channels (only defined by name) from Oracle table
+#    HCSS_IMPORT_CHANNEL and stores them in memory (see remark A).
+
+&readChannelList() or die "Failed to read channel list\n";
+
+print "After readChannelList, got (0 - $#channelList) channels\n" if ($opt_verb);
+
+die "!!! Import channel list from Oracle is empty! Check last import day!!!! Terminated. \n\n" unless ($#channelList > 0);
+
+# 
+# 4. Then it loops over this list of channels and reads for each channel:
+#   4.1 the channel id and the sampling parameters from Postgres table CHANNEL
+#       and the precision and unit from table NUM_METADATA,
+#   4.2 the data from Postgres table SAMPLE since last import (see remark B)
+#       and stores them in Oracle table PGIMPORT_SAMPLE.
+#       This must be done in larger batches, single read/write are too slow.
+#       (see also remark D)
+#   4.3 Then the channel parameters are stored in the Oracle table
+#       PGIMPORT_CHANNEL together with the the start and end time of the import
+#       day (independing of the sample timestamps, because there might be no data
+#       at all in the import date range).
+
+# global variables to keep the per-channel parameters:
+my $ch_id=0;
+my $ch_name=0;
+my $ch_smplid=0;
+my $ch_smplval=0;
+my $ch_smplper=0;
+my $ch_prec=0;
+my $ch_unit=0;
+
+
+
+
+my $pgsth_channel_id = $pgdbh->prepare("SELECT a.channel_id, a.name, a.smpl_mode_id, a.smpl_val, a.smpl_per,
+             b.prec, b.unit
+        FROM $pgchannel a LEFT OUTER JOIN $pgnummeta b ON (a.channel_id = b.channel_id)
+        WHERE a.name = ? ") 
+      or die "Couldn't prepare channel id statement: " . $pgdbh->errstr;      
+
+
+# arguments: channel_id,  channel_id, lastImpEndtime,  channel_id,
+my $pgsth_get_samples = $pgdbh->prepare("SELECT channel_id,
+           to_char(smpl_time,'YYYY-MM-DD HH24:MI:SS.US') as smpl_time,
+           severity_id, status_id, num_val, float_val, str_val
+        FROM $pgsample
+        WHERE channel_id = ?
+          AND smpl_time = ( SELECT MAX(smpl_time)
+                              FROM $pgsample
+                              WHERE channel_id = ?
+                                AND smpl_time > to_timestamp(  ?  ,'YYYY-MM-DD HH24:MI:SS.US')
+                                AND smpl_time < to_timestamp('$impDayBegin','YYYY-MM-DD HH24:MI:SS.US') )
+    UNION
+    SELECT channel_id, 
+           to_char(smpl_time,'YYYY-MM-DD HH24:MI:SS.US') as smpl_time,
+           severity_id, status_id, num_val, float_val, str_val
+        FROM $pgsample
+        WHERE channel_id = ?
+          AND smpl_time >= to_timestamp('$impDayBegin','YYYY-MM-DD HH24:MI:SS.US')
+          AND smpl_time <= to_timestamp('$impDayEnd','YYYY-MM-DD HH24:MI:SS.US')
+    ORDER BY smpl_time") 
+      or die "Couldn't prepare get sample statement: " . $pgdbh->errstr;        
+      
+
+my $orasth_store_samples;
+my $orasth_store_paras; 
+my $orasth_channel_id;
+my $orasth_check_old_id;
+
+if($opt_oracle){
+
+#JAM2021: need to also get the Oracle ID of existing PV:
+
+$orasth_channel_id = $oradbh->prepare_cached("SELECT channel_id, channel_name
+        FROM $orahcsid 
+        WHERE channel_name = ? ") 
+      or die "Couldn't prepare oracle channel id statement: " . $oradbh->errstr;      
+
+$orasth_check_old_id = $oradbh->prepare_cached("SELECT channel_id
+        FROM $orahcsid 
+        WHERE channel_id = ? ") 
+      or die "Couldn't prepare oracle check channel id statement: " . $oradbh->errstr; 
+
+
+
+# arguments: channelId, smplTime, $severity, $statusId, $numVal, $floatVal, $strVal 
+$orasth_store_samples = $oradbh->prepare_cached("INSERT INTO $orasample 
+               ( channel_id, smpl_time, severity_id, status_id, num_val, float_val, str_val)
+        VALUES ( ? ,
+                 to_timestamp(? , 'YYYY-MM-DD HH24:MI:SS.FF6'),
+                 ? , ? , ? , ? , ? )") 
+      or die "Couldn't prepare store samples statement: " . $oradbh->errstr;    
+      
+
+# arguments:  $channelId, $channelName, $smplModeId, $smplVal, $smplPer, $prec, $unit   
+$orasth_store_paras = $oradbh->prepare_cached("INSERT INTO $orachannel
+               ( channel_id, channel_name, smpl_mode_id, smpl_val, smpl_per, prec, unit, starttime, endtime )
+        VALUES ( ? , ? , ? , ? , ? , ? , ? ,
+                 to_timestamp('$impDayBegin','YYYY-MM-DD HH24:MI:SS.FF6'), to_timestamp('$impDayEnd','YYYY-MM-DD HH24:MI:SS.FF6') )") 
+      or die "Couldn't prepare store parameters statement: " . $oradbh->errstr;     
+
+}      
+      
+#foreach my $channelName(@channelList)
+for my $i (0 .. $#channelList)
+{
+  &transferChannelData($channelList[$i], $channelTimes[$i]) or printf "Failed to transfer channel of name $channelList[$i]\n";
+}
+
+
+
+# 5. Finally the perl program executes the Oracle procedure
+#    hades_scs.hcss_move_data_make_summary to process the import data.
+#    This procedure starts an Oracle job to check the data and to copy new data
+#    into the final tables. After import it starts two other jobs: the first one
+#    generates the run-based summaries while the second one running some hours
+#    later truncates the import tables.
+&processOracleImportedData() or die "Failed to start Oracle jobs\n";
+                                      
+                                    
+
+
+#-------- Finish and disconnect
+&finishAndDisconnect();
+print "Import of postgres2ora finished successfully.\n"; 
+#if ($opt_verb);
+exit(0);
+
+################### END OF MAIN ####################
+
+
+
+
+
+
+
+sub help()
+{
+    print "\n";
+    print << 'EOF';
+postgres2ora.pl
+
+   This script exports slow control data from postgres to oracle
+Usage:
+
+   Command line:  postgres2ora.pl
+   [-h|--help]            : Print this help.
+   [-o|--oracle]          : Really import into Oracle (otherwise just dummy mode)
+   [-opass orapass]       : Specify password for Oracle database
+   [-ppass pgpass]        : Specify password for Posstgres database
+   [-v|--verb]               : More verbose.
+
+Examples:
+
+   Transfer slow control archiver data from postgres to Oracle and be verbose:
+      postgres2ora.pl -v -o 
+
+EOF
+}
+
+sub finishAndDisconnect()
+{
+
+  $pgsth_channel_id->finish() if(defined $pgsth_channel_id);
+  $pgsth_get_samples->finish() if(defined $pgsth_get_samples);
+
+  if($opt_oracle){ 
+    $orasth_store_samples->finish() if(defined $orasth_store_samples);
+    $orasth_store_paras ->finish() if(defined $orasth_store_paras);
+    }
+    
+    if(defined $oradbh){
+       $oradbh->disconnect || die "Failed to disconnect from Oracle\n";
+    }    
+    if(defined $pgdbh){
+       $pgdbh->disconnect || die "Failed to disconnect from Postgres\n";
+    }
+}
+
+sub finishAndExit()
+{
+    # don't allow nested signal handling
+    return if ($ExitCode ne "-1");
+
+    # this will stop the treads, too
+    $ExitCode = shift;
+
+    print "postgres2ora_client.pl exited (signal/exit code: $ExitCode).\n";
+
+    &finishAndDisconnect();
+
+    # wait until all threads ended - don't join the main thread or ourselves
+#    foreach my $thread (threads->list()){
+#        $thread->join()
+#          if ($thread->tid() && !threads::equal( $thread, threads->self() ));
+#    }
+
+    close(STDOUT);
+    close(STDERR);
+
+    exit(1);
+}
+
+
+
+sub transferSeverities()
+{
+my $pgsth_severity = $pgdbh->prepare(" SELECT severity_id, name FROM $pgseverity ORDER BY severity_id") 
+      or die "Couldn't prepare statement: " . $pgdbh->errstr;
+my $orasth_severity;   
+if($opt_oracle)
+{
+  $orasth_severity = $oradbh->prepare_cached("INSERT INTO $oraseverity (severity_id, severity_name) VALUES (?,?)") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;      
+}     
+# get values from postgres:
+  print "get severities\n" if ($opt_verb);
+$pgsth_severity->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;
+my $success = 1;
+my @data;
+while (@data = $pgsth_severity->fetchrow_array()) {
+  my $sid =   $data[0];
+  my $sname = $data[1];
+  print "inserting severities \t$sid  $sname\n" if ($opt_verb);
+  if($opt_oracle)
+    {
+      $success &&= $orasth_severity->execute($sid, $sname);
+    }
+    else
+    {
+      print "    - just pretend!\n" if ($opt_verb);
+    }
+}
+# end while
+if($opt_oracle)
+{
+  my $result = ($success ? $oradbh->commit : $oradbh->rollback);
+  unless ($result) { 
+            die "Couldn't finish transaction: " . $oradbh->errstr; 
+          }
+  $orasth_severity->finish();          
+}        
+$pgsth_severity->finish();
+return $success;
+}
+
+
+sub transferStatus()
+{
+my $pgsth_status = $pgdbh->prepare(" SELECT status_id, name FROM $pgstatus ORDER BY status_id") 
+      or die "Couldn't prepare statement: " . $pgdbh->errstr;
+my $orasth_status;
+
+if($opt_oracle){     
+$orasth_status = $oradbh->prepare_cached("INSERT INTO $orastatus (status_id, status_name) values (?,?)") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;      
+}      
+# get values from postgres:
+  print "get status values\n" if ($opt_verb);
+$pgsth_status->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;;
+my $success = 1;
+my @data;
+while (@data = $pgsth_status->fetchrow_array()) {
+  my $stid =   $data[0];
+  my $stname = $data[1];
+  print "inserting status \t$stid  $stname\n" if ($opt_verb);
+  if($opt_oracle)
+    {
+      $success &&= $orasth_status->execute($stid, $stname);
+  }
+  else
+    {
+      print "    - just pretend!\n" if ($opt_verb);
+    }
+  
+  }
+#end while  
+
+if($opt_oracle)
+  {  
+  my $result = ($success ? $oradbh->commit : $oradbh->rollback);
+  unless ($result) { 
+            die "Couldn't finish transaction: " . $oradbh->errstr 
+          }
+  $orasth_status->finish();
+ } 
+$pgsth_status->finish();
+return $success;
+}
+
+
+sub readChannelList()
+{
+
+my $orasth_channel_list = $oradbh->prepare(" SELECT channel_name,
+           to_char(cast(nvl(imp_endtime,trunc(sysdate)-90) as timestamp),'YYYY-MM-DD HH24:MI:SS.FF6') AS last_imp_endtime
+        FROM $orahcsschannel WHERE active = 1
+          AND ( imp_endtime IS NULL OR imp_endtime < to_date('$impDay','YYYY-MM-DD') )
+        ORDER BY channel_name") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;      
+      
+# get channel names  from oracle:
+print "get channel names\n"if ($opt_verb);
+$orasth_channel_list->execute()  or die "Couldn't execute statement: " . $pgdbh->errstr;;
+my $success = 1;
+my @data;
+while (@data = $orasth_channel_list->fetchrow_array()) {
+  my $chname =   $data[0];
+  my $last_imp_endtime = $data[1];
+  print "getting channel \t$chname  with time $last_imp_endtime\n" if ($opt_verb);
+  push @channelList, $chname;
+  push @channelTimes, $last_imp_endtime;
+  }
+  
+$orasth_channel_list->finish();
+return $success;
+}
+
+
+
+sub transferChannelData()
+{
+    my ($currentChannel, $currentTime) = @_;
+    my @data;
+    my $oraid;
+    print "transferChannelData for $currentChannel\n" if ($opt_verb);
+     
+#      4.1 the channel id and the sampling parameters from Postgres table CHANNEL
+#       and the precision and unit from table NUM_METADATA,
+#     a.channel_id, a.name, a.smpl_mode_id, a.smpl_val, a.smpl_per, b.prec, b.unit 
+  $pgsth_channel_id->execute($currentChannel)  or print "Couldn't execute channel id statement: " . $pgdbh->errstr;
+  
+  
+  
+  
+  unless (@data = $pgsth_channel_id->fetchrow_array()){
+       print "Couldn't get channel id from postgres!!!\n " if ($opt_verb);
+       return 1;
+  }
+  $ch_id       =       $data[0];
+  $ch_name     =       $data[1];
+  $ch_smplid   =       $data[2];
+  $ch_smplval  =       $data[3];
+  $ch_smplper  =       $data[4]; 
+  $ch_prec     =       $data[5];   
+  $ch_unit     =       $data[6];
+  
+  
+  print "got id:$ch_id name:$ch_name smplid:$ch_smplid smplper:$ch_smplper prec:$ch_prec unit:$ch_unit  \n" if ($opt_verb);
+  
+  # check here if there is another result of the id select (should not be?)
+  if (@data = $pgsth_channel_id->fetchrow_array()){
+       print "Warning: found duplicate ids1'!!";
+       }
+
+       
+if($opt_oracle)
+  {  
+  # JAM2021: here we have to replace the new postgres PV id by the previous oracle id, if it exists
+  my @orachannelids;
+  $orasth_channel_id->execute($currentChannel)  or die "Couldn't execute oracle channel id statement: " . $oradbh->errstr;
+  
+  if (@orachannelids = $orasth_channel_id->fetchrow_array()){
+       #  here assign the  new id
+       print "Got ora id $orachannelids[0] for PV $orachannelids[1] \n" if ($opt_verb);
+       $oraid=$orachannelids[0];
+    }
+  else
+    {
+        print "Couldn't get channel id for $currentChannel from oracle - assign new id\n " if ($opt_verb);
+        # check here if new id from postgres is already used in ora:
+        my @oracheckids;
+        my $count=0;;
+        my $nid;
+        $nid=$ch_id-1;
+        do{
+            $nid += 1;
+            print "Testing if new id $nid is already used....\n" if ($opt_verb);
+            $orasth_check_old_id->execute($nid)  or die "Couldn't execute oracle check newchannel id statement: " . $oradbh->errstr;
+            $count+=1;
+            die "oracle check id loop not finished after $count increases, nid=$nid !!!" if ($count>1000);
+        }
+        while (@oracheckids = $orasth_check_old_id->fetchrow_array());            
+        # for newly added pvs, we keep the postgres id unless this id is already used in oracle
+        $oraid=$nid;
+        print "Assing new ora id $oraid for PV $orachannelids[1], postgres id was $ch_id \n" if ($opt_verb);
+    }
+  
+  }
+       
+       
+    
+#   4.2 the data from Postgres table SAMPLE since last import (see remark B)
+#       and stores them in Oracle table PGIMPORT_SAMPLE.
+#       This must be done in larger batches, single read/write are too slow.
+#       (see also remark D)
+
+print "Getting samples from postgres...\n" if ($opt_verb);
+# arguments: channel_id,  channel_id, lastImpEndtime,  channel_id,
+$pgsth_get_samples->execute($ch_id, $ch_id, $currentTime, $ch_id) or die "Couldn't execute get samples statement: " . $pgdbh->errstr;;
+
+my $success = 1;
+my @sampdata;
+while (@sampdata = $pgsth_get_samples->fetchrow_array()) {
+# TODO : exit counter?
+# TODO: fetch all rows into variable arrays, then insert to oracle outside loop?
+  
+  
+#  my $channel_id      =       $sampdata[0];
+#  my $smpl_time       =       $sampdata[1];
+#  my $severity_id     =       $sampdata[2];
+#  my $status_id       =       $sampdata[3];
+#  my $num_val         =       $sampdata[4];
+#  my $float_val               =       $sampdata[5];
+#  my $str_val         =       $sampdata[6];
+#  
+# # supress some warnings if certain type is not available:
+#  $num_val = -1 unless $num_val;
+#  $float_val = -1.0 unless $float_val;
+#  $str_val = "nothing" unless $str_val;
+#  
+#   print "transfer data - id:$channel_id time:$smpl_time sev_id: $severity_id st_id:$status_id numval: $num_val floatval:$float_val strval:$str_val \n" if ($opt_verb);
+#  # arguments: channelId, smplTime, $severity, $statusId, $numVal, $floatVal, $strVal 
+  
+  if($opt_oracle)
+  {  
+  
+  
+##   print "before orasth_store_samples: $channel_id \n";
+#    $success &&= $orasth_store_samples->execute($channel_id, $smpl_time, $severity_id, $status_id, $num_val, $float_val, $str_val);  
+
+#     $success &&= $orasth_store_samples->execute($sampdata[0],$sampdata[1],$sampdata[2],$sampdata[3],$sampdata[4],$sampdata[5],$sampdata[6]);  
+# JAM2021: use different oracle id for same PV:    
+    $success &&= $orasth_store_samples->execute($oraid,$sampdata[1],$sampdata[2],$sampdata[3],$sampdata[4],$sampdata[5],$sampdata[6]);   
+    
+
+unless( $success){
+      print "ERROR during store samples!";
+    }
+  }
+  else
+    {
+      print "    - just pretend!\n" if ($opt_verb);
+    }
+  
+}
+#end while  
+  
+return $success unless($opt_oracle);
+
+
+
+#print "before orasth_store_paras: $ch_id \n";
+
+#   4.3 Then the channel parameters are stored in the Oracle table
+#       PGIMPORT_CHANNEL together with the the start and end time of the import
+#       day (independing of the sample timestamps, because there might be no data
+#       at all in the import date range)
+
+# arguments:  $channelId, $channelName, $smplModeId, $smplVal, $smplPer, $prec, $unit   $ch_prec, $ch_unit
+
+#$success &&= $orasth_store_paras->execute($ch_id, $ch_name, $ch_smplid, $ch_smplval, $ch_smplper, $ch_prec, $ch_unit);
+$success &&= $orasth_store_paras->execute($oraid, $ch_name, $ch_smplid, $ch_smplval, $ch_smplper, $ch_prec, $ch_unit);
+
+ unless( $success){
+    print "ERROR during store parameters!";
+  }
+
+ # print "success is: $success";
+  
+my $result = ($success ? $oradbh->commit : $oradbh->rollback);
+
+
+
+unless ($result) { 
+            die "Couldn't finish transferChannelData transaction: " . $oradbh->errstr 
+          }
+return $success;
+
+}
+
+
+sub processOracleImportedData()
+{
+
+  return 1 unless($opt_oracle);
+
+  my $result=$oradbh->do('BEGIN hades_scs.hcss_move_data_make_summary(); END;');                                
+  return $result;                                      
+}
+
+
+sub testOracleImportTableEmpty()
+{
+
+  return 1 unless($opt_oracle);
+
+  my $orasth_testempty = $oradbh->prepare("SELECT ( a.n + b.n + c.n + d.n ) from 
+           ( SELECT COUNT(*) as n FROM $orachannel ) a,
+           ( SELECT COUNT(*) as n FROM $orasample ) b,
+           ( SELECT COUNT(*) as n FROM $oraseverity ) c,
+           ( SELECT COUNT(*) as n FROM $orastatus ) d") 
+      or die "Couldn't prepare statement: " . $oradbh->errstr;    
+  
+  my $result=$orasth_testempty->execute() or print "Couldn't execute table empty test statement: " . $pgdbh->errstr;                                 
+  my $success = 1;
+  my @data;
+while (@data = $orasth_testempty->fetchrow_array()) {
+    my $entries= $data[0];
+    print "import tables have  $entries entries \n";
+    if ($entries == 0) {return 1;} 
+      else {return 0;}
+  }
+  
+  return 0;                                      
+}
+
+
+
+
+# sub statusServer()
+# { 
+#     my $server_socket;
+#     my $client_socket;
+#     my $selector;
+# 
+#     unless (defined( $server_socket =
+#                      IO::Socket::INET->new( LocalPort => $opt_sport,
+#                                             Proto     => 'tcp',
+#                                             Listen    => SOMAXCONN ) ))
+#     {
+#         print "ERROR: Cannot start status server!\n";
+#     }
+# 
+#     $selector = new IO::Select( $server_socket );
+# 
+#     while(1) {
+# 
+#         # wait 5 seconds for connections
+#         while (my @file_handles = $selector->can_read( 5 )) {
+# 
+#             foreach my $file_handle (@file_handles) {
+# 
+#                 if($file_handle == $server_socket) {
+# 
+#                     # create a new socket for this transaction
+#                     unless (defined( $client_socket = $server_socket->accept() ))
+#                     {
+#                         print "ERROR: Cannot open socket to send status!\n";
+#                      &exitProgram( 2 );
+#                     }
+# 
+#                     print $client_socket $status;
+# 
+#                     close( $client_socket );
+#                 }
+#             }
+#         }
+# 
+#      if( $ExitCode ne "-1" ){
+#          print "Exit status server thread.\n";
+#          close( $server_socket );
+#          return;
+#      }
+#     }
+# }
index 3c1a9c8306e0654fd5988535673334a60c1e68fd..454c9a7be39df43e23dd47b1260c77cf1a9569fc 100755 (executable)
@@ -5,6 +5,7 @@
 # v0.1b on 9-dec-2020 for beamtime feb21 JAM
 # v0.1c on 10-jan-2022 for feb22 JAM
 # v0.1d on 5-oct-2023 for feb24 JAM
+# 24-04-2025 for apr25 SSP - runBegin set to 26-04-2025 06:00:00 to count only data with magnet turned on
 
 use English;
 use strict;
@@ -106,13 +107,13 @@ print "Oracle Connected!\n" if($opt_verb);
 
 
 
-my $summary_file = "/home/hadaq/oper/oraruns/runs_sep24.txt";
-my $latest_file  = "/home/hadaq/oper/oraruns/current_sep24.txt";
+my $summary_file = "/home/hadaq/oper/oraruns/runs_apr25.txt";
+my $latest_file  = "/home/hadaq/oper/oraruns/current_apr25.txt";
 
 
 #exit(0); 
 # test only connection up to here
-my $beamtime = 'FEB24';
+my $beamtime = 'APR25';
 my $runtype = 'BEAM';
 
 
@@ -136,7 +137,7 @@ my $runtype = 'BEAM';
 
 # this one is for testing
 #my $runBegin = '2019-02-20 00:00:00';
-my $runBegin = '2024-01-01 00:00:00';
+my $runBegin = '2025-04-26 06:00:00';
 # default is begin of beam time with real beam
 # will be replaced by last timestamp from summary file.
 
index 2206ecc8f7c1c365ce207e49d55a6233c1008e3d..26206d43b8a000466e527eb990cfc99666713539 100755 (executable)
@@ -6,60 +6,84 @@
 # JAM 08-01-24 for feb24
 # SSP 01-03-24 for feb24 Au+Au part
 # SSP 04-03-24 for feb24 official values
+# JAM 16-04-25 for apr25
+# SSP 24-04-25 for apr25 official values feb24 scaled
+# SSP 28-04-25 for apr25 add individual energy ranges
+
+####### CONFIGURATION #######
+EarlyStart=1745640000 # 26-APR-2025 06:00
+BeamtimeStart=1745820000 # 28-APR-2025 06:00
+BeamtimeEnd=1746424800 # 05-MAY-2025 06:00
+PlotStart=$((BeamtimeStart - 3*86400)) # Three days before the start of the beamtime
+PlotEnd=$((BeamtimeEnd + 86400)) # One day after the end of the beamtime
+AuAu800Start=$((EarlyStart)) # At the early start of the beamtime
+AuAu800End=1745992800 # 30-APR-2025 08:00
+AuAu600Start=$((AuAu800End)) # At the end of the AuAu 800A MeV period
+AuAu600End=$((BeamtimeEnd - 3*86400))
+AuAu400Start=$((AuAu600End)) # At the end of the AuAu 600A MeV period
+AuAu400End=$((BeamtimeEnd - 86400*4/3))
+AuAu200Start=$((AuAu400End)) # At the end of the AuAu 400A MeV period
+AuAu200End=$((BeamtimeEnd))
 
-StartCC=1707282000 # 07-FEB-2024 06:00
-EndCC=1707454800 # 09-FEB-2024 06:00
-StartAuAu=1709182800 # 29-FEB-2024 06:00
-EndAuAu=1711170000 # 23-MAR-2024 06:00
+# Proposal: 2 billion events C+C @ 800MeV on 2 days -> Increased to 3.030 billion events to adjust for the high rates run without magnetic field which cannot be used for physics analyses
+# Proposal: 3 billion events Au+Au @ 800 and 600MeV each and 0.94 billion events Au+Au @ 400 and 200MeV each on 23 days
+# Feb24: Official decision for Au+Au: Anticipated events: Ideally: 16 billion total, Approved: 12 billion
+# Apr25: Officially 7 days beam => apr25 / feb24 = 7 / 23 = 30.434783% => Scaled feb24 values: Ideally: 4.8695652 billion, Approved: 3.6521739 billion
+# Apr25: Actually 9 days beam => apr25 / feb24 = 9 / 23 = 39.130434% => Scaled feb24 values: Ideally: 6.2608696 billion, Approved: 4.6956521 billion
 
-MEventsAnticipatedCCMin=2930
-MEventsAnticipatedCCMax=3130
-MEventsAnticipatedAuAuMin=10000
-MEventsAnticipatedAuAuMax=14000
-MEventsProposedAuAuMin=14000
-MEventsProposedAuAuMax=18000
+MEventsAnticipatedMin=3900
+MEventsAnticipatedMax=5500
+MEventsProposedMin=5500
+MEventsProposedMax=7000
 
-MEventsMax=$((((MEventsAnticipatedCCMax + MEventsProposedAuAuMax + 500) / 1000) * 1000))
+MEventsMax=$((((MEventsProposedMax + 500) / 1000) * 1000))
 
+####### DATA #######
 cat << EOF > /tmp/beam_trend_approved.txt
-# timestamp real propaganda
-$(date -d @${StartCC}   "+%Y-%m-%d %H:%M:%S") 0 0
-$(date -d @${EndCC}     "+%Y-%m-%d %H:%M:%S") ${MEventsAnticipatedCCMin} ${MEventsAnticipatedCCMax}
-$(date -d @${StartAuAu} "+%Y-%m-%d %H:%M:%S") ${MEventsAnticipatedCCMin} ${MEventsAnticipatedCCMax}
-$(date -d @${EndAuAu}   "+%Y-%m-%d %H:%M:%S") $((MEventsAnticipatedCCMin + MEventsAnticipatedAuAuMin)) $((MEventsAnticipatedCCMax + MEventsAnticipatedAuAuMax))
+$(date -d @${EarlyStart}  "+%Y-%m-%d %H:%M:%S") 0 0
+$(date -d @${BeamtimeEnd} "+%Y-%m-%d %H:%M:%S") $((MEventsAnticipatedMin)) $((MEventsAnticipatedMax))
 EOF
 
 cat << EOF > /tmp/beam_trend_proposal.txt
-# timestamp real propaganda
-$(date -d @${StartAuAu} "+%Y-%m-%d %H:%M:%S") ${MEventsAnticipatedCCMax} ${MEventsAnticipatedCCMax}
-$(date -d @${EndAuAu}   "+%Y-%m-%d %H:%M:%S") $((MEventsAnticipatedCCMax + MEventsProposedAuAuMin)) $((MEventsAnticipatedCCMax + MEventsProposedAuAuMax))
+$(date -d @${EarlyStart}  "+%Y-%m-%d %H:%M:%S") 0 0
+$(date -d @${BeamtimeEnd} "+%Y-%m-%d %H:%M:%S") $((MEventsProposedMin)) $((MEventsProposedMax))
 EOF
 
-# 1.6 million per day nominal + 10% due to PT2
-# TODO: adjust expected rates, different for first period and second
-# Proposal: 2 billion events C+C @ 800MeV on 2 days -> Increased to 3.030 billion events to adjust for the high rates run without magnetic field which cannot be used for physics analyses
-# Proposal: 3 billion events Au+Au @ 800 and 600MeV each and 0.94 billion events Au+Au @ 400 and 200MeV each on 23 days
-# Official decision for Au+Au: Anticipated events: Ideally: 16 billion total, Approved: 12 billion
-
 cat << EOF > /tmp/scheduled_breaks.txt
-# timestamp real propaganda
-$(date -d @$((StartCC - 7*86400)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # One week before the start of C+C
-$(date -d @$((StartCC - 1))       "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the start of C+C
-$(date -d @$((StartCC))           "+%Y-%m-%d %H:%M:%S")             0 0 # At the start of C+C
-$(date -d @$((EndCC - 1))         "+%Y-%m-%d %H:%M:%S")             0 0 # Directly before the end of C+C
-$(date -d @$((EndCC))             "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the end of C+C
-$(date -d @$((StartAuAu - 1))     "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the start of Au+Au
-$(date -d @$((StartAuAu))         "+%Y-%m-%d %H:%M:%S")             0 0 # At the start of Au+Au
-$(date -d @$((EndAuAu - 1))       "+%Y-%m-%d %H:%M:%S")             0 0 # Directly before the end of Au+Au
-$(date -d @$((EndAuAu))           "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the end of Au+Au
-$(date -d @$((EndAuAu + 7*86400)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # One week after the end of Au+Au
+$(date -d @$((PlotStart - 86400)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # One day before the start of the plot
+$(date -d @$((EarlyStart - 1))    "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the early start of the beamtime
+$(date -d @$((EarlyStart))        "+%Y-%m-%d %H:%M:%S")             0 0 # At the early start of the beamtime
+$(date -d @$((BeamtimeEnd - 1))   "+%Y-%m-%d %H:%M:%S")             0 0 # Directly before the end of the beamtime
+$(date -d @$((BeamtimeEnd))       "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the end of the beamtime
+$(date -d @$((PlotEnd + 86400))   "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # One day after the end of the plot
+EOF
+
+cat << EOF > /tmp/scheduled_start.txt
+$(date -d @$((EarlyStart))        "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the early start of the beamtime
+$(date -d @$((BeamtimeStart - 1)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the start of the beamtime
 EOF
 
-cat << EOF > /tmp/magnet_failure.txt
-2024-03-04 13:50:00                         ${MEventsMax} 0 # At the magnet failure
-$(date -d @${EndAuAu} "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # End of beamtime - Unfortunately
+cat << EOF > /tmp/auau800.txt
+$(date -d @$((AuAu800Start))   "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the start of the AuAu 800A MeV period
+$(date -d @$((AuAu800End - 1)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the end of the AuAu 800A MeV period
 EOF
 
+cat << EOF > /tmp/auau600.txt
+$(date -d @$((AuAu600Start))   "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the start of the AuAu 600A MeV period
+$(date -d @$((AuAu600End - 1)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the end of the AuAu 600A MeV period
+EOF
+
+cat << EOF > /tmp/auau400.txt
+$(date -d @$((AuAu400Start))   "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the start of the AuAu 400A MeV period
+$(date -d @$((AuAu400End - 1)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the end of the AuAu 400A MeV period
+EOF
+
+cat << EOF > /tmp/auau200.txt
+$(date -d @$((AuAu200Start))   "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # At the start of the AuAu 200A MeV period
+$(date -d @$((AuAu200End - 1)) "+%Y-%m-%d %H:%M:%S") ${MEventsMax} 0 # Directly before the end of the AuAu 200A MeV period
+EOF
+
+####### PLOTTING #######
 gnuplot -p << ENDS
 
 set term png size 800,500 truecolor font "serif,13"
@@ -69,19 +93,13 @@ set tmargin 1
 set rmargin 1.6
 set lmargin 9
 
-set key at $((StartCC - 1*86400)),20300 left top vertical width -2 heigh 0.5 box opaque
-#set title "HADES Accumulated Statistics 2024"
-set xlabel "Feb/Mar 2024"
+set key at $((PlotStart + (PlotEnd - PlotStart)*5/100*62/100)),$((MEventsMax*95/100)) left top vertical width -2 height 0.8 box opaque
+#set title "HADES Accumulated Statistics 2025"
+set xlabel "Apr/May 2025"
 set ylabel "Million Events" offset 1
 #set y2label "Recorded Data [Gbyte]"
 #set y2tics
 #set ytics nomirror
-set style line 1 lt rgb "#000000" lw 3
-set style line 2 lt rgb "#aaaaaa" lw 0
-set style line 3 lt rgb "#5ce000" lw 0
-set style line 4 lt rgb "#0000e0" lw 0
-set style line 5 lt rgb "#e00000" lw 0
-set style fill transparent solid 0.4 noborder #lc "#5ce000"
 set yrange [0:${MEventsMax}]
 
 set xdata time
@@ -89,18 +107,27 @@ set timefmt "%Y-%m-%d %H:%M:%S"
 set format x "%d"
 #set timefmt "%H:%M:%S"
 #set format x "%H:%M"
-set xrange [$((StartCC - 2*86400)):$((EndAuAu))]
-set xtics 2*3600*24
+set xrange [${PlotStart}:${PlotEnd}]
+set xtics 3600*24
+
+set style fill transparent solid 0.4 noborder
 
-plot '/tmp/scheduled_breaks.txt' using 1.2:3:4 title 'Scheduled Breaks' ls 2 w filledcu, \
-     '/tmp/beam_trend_approved.txt' using 1.2:3:4 title 'Anticipated Events' ls 3 w filledcu, \
-     '/tmp/beam_trend_proposal.txt' using 1.2:3:4 title 'Proposed Events' ls 4 w filledcu, \
-     '/tmp/magnet_failure.txt' using 1.2:3:4 title 'HADES Magnet Failure' ls 5 w filledcu, \
-     '/home/hadaq/oper/oraruns/runs_feb24.txt' using 2.3:(\$6/1000) title 'Recorded Events' ls 1 with lines
+plot '/tmp/scheduled_breaks.txt' using 1.2:3:4 title 'Scheduled Breaks' with filledcurves fillcolor rgb "#aaaaaa", \
+     '/tmp/scheduled_start.txt' using 1.2:3:4 notitle with filledcurves fillcolor rgb "#aaaaaa" fillstyle transparent pattern 4 noborder, \
+     '/tmp/auau800.txt' using 1.2:3:4 title 'Au+Au @ 800A MeV' with filledcurves fillcolor rgb "#e00000" fillstyle transparent solid 0.15 noborder, \
+     '/tmp/auau600.txt' using 1.2:3:4 title 'Au+Au @ 600A MeV' with filledcurves fillcolor rgb "#e07000" fillstyle transparent solid 0.15 noborder, \
+     '/tmp/auau400.txt' using 1.2:3:4 title 'Au+Au @ 400A MeV' with filledcurves fillcolor rgb "#e0e000" fillstyle transparent solid 0.15 noborder, \
+     '/tmp/auau200.txt' using 1.2:3:4 title 'Au+Au @ 200A MeV' with filledcurves fillcolor rgb "#70e000" fillstyle transparent solid 0.15 noborder, \
+     '/tmp/beam_trend_approved.txt' using 1.2:3:4 title 'Anticipated Events' with filledcurves fillcolor rgb "#5ce000", \
+     '/tmp/beam_trend_proposal.txt' using 1.2:3:4 title 'Proposed Events' with filledcurves fillcolor rgb "#0000e0", \
+     '/home/hadaq/oper/oraruns/runs_apr25.txt' using 2.3:(\$6/1000) title 'Recorded Events' with lines linecolor rgb "#000000" linewidth 3
 
 ENDS
 
 scp /tmp/runstats.png hades33:/home/hadaq/trbsoft/daq/hmon/files/runstatscompare.png
-#scp /tmp/runstats.png lxpool:/u/webhades/web-docs/media/logbook/feb24/
-scp /tmp/runstats.png lxi098:/u/webhades/web-docs/media/logbook/feb24/
-#scp /tmp/runstats.png lxi001:/u/webhades/web-docs/onlineMon/feb22/
+#scp /tmp/runstats.png lxpool:/u/webhades/web-docs/media/logbook/apr25/
+scp /tmp/runstats.png lxi098:/u/webhades/web-docs/media/logbook/apr25/
+#scp /tmp/runstats.png lxi098:/u/webhades/web-docs/onlineMon/apr25/images/runstats.png
+#scp /tmp/runstats.png lxi001:/u/webhades/web-docs/onlineMon/apr25/
+
+rm -f /tmp/scheduled_breaks.txt /tmp/scheduled_start.txt /tmp/beam_trend_approved.txt /tmp/beam_trend_proposal.txt /tmp/auau800.txt /tmp/auau600.txt /tmp/auau400.txt /tmp/auau200.txt /tmp/runstats.png
index 381f81d4a64e8a601728921067d730abd1fb70a0..5600166041ea97ed7275f07ea42c712ea07a7b14 100755 (executable)
@@ -1,6 +1,6 @@
 export PERL5LIB="$HOME/trbsoft/daqtools/perllibs"
 cd ~/trbsoft/daq/start
-
+current_threshold=$1
 #~/trbsoft/daqtools/tools/padiwa.pl 0xfe76 0 invert 0xffff
 #~/trbsoft/daqtools/tools/padiwa.pl 0xfe76 1 invert 0xffff
 echo  current_thresholds 
index 16fda612e7daf2b83e07d9c481e340982dced798..5c9633069da9bf83861a85be864dcfb348c63aab 100644 (file)
@@ -24,6 +24,13 @@ trbcmd w 0x5002 0xe011 0x1fe  #invert 8 channels
 trbcmd w 0x5003 0xe011 0x0  #dont invert 8 channels 
 trbcmd w 0x5004 0xe011 0x1fe  #invert 8 channels 
 
+# new bit file dirich5d1_20250428_8chan_wide_trigout_inv_stretch1.bit !  
+# It can stretch the triger signal command below
+trbcmd w 0x5004 0xe010 0x04  # stretch to 40ns the output signal, no-invert
+#trbcmd w 0x5004 0xe010 0x14  # stretch to 40ns the output signal, invert ! Example 0x04 -> 0x14 (1 does invert)
+
+
 # set the LV of preamp of DiRich5d1
 # 0xff about 2 times smaller then 0x00 !
 # Important! After changing it new threshold scan is needed !! 
index 97ac3e5752974547eacf7e8d927ab2d607875588..1cb4aecbdd1fbbf4cf427796e4650de2aedf64a8 100644 (file)
@@ -1,40 +1,40 @@
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  0 threshold: 0x8c49, uid: 0
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  1 threshold: 0x7ab5, uid: 0
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  2 threshold: 0x7aad, uid: 0
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  3 threshold: 0x7859, uid: 0
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  4 threshold: 0x7cb3, uid: 0
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  5 threshold: 0x7e69, uid: 0
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  6 threshold: 0x809f, uid: 0
-2025/04/14 14:09:59 endpoint: 0x5000, chain: 00, channel:  7 threshold: 0x848b, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  0 threshold: 0x6e09, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  1 threshold: 0x6e50, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  2 threshold: 0x706b, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  3 threshold: 0x6f32, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  4 threshold: 0x6fcf, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  5 threshold: 0x6f80, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  6 threshold: 0x6ff9, uid: 0
-2025/04/14 14:10:13 endpoint: 0x5001, chain: 00, channel:  7 threshold: 0x6ac7, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  0 threshold: 0x79ed, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  1 threshold: 0x74e3, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  2 threshold: 0x72af, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  3 threshold: 0x737d, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  4 threshold: 0x73bb, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  5 threshold: 0x735b, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  6 threshold: 0x7319, uid: 0
-2025/04/14 14:10:28 endpoint: 0x5002, chain: 00, channel:  7 threshold: 0x7481, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  0 threshold: 0x6db5, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  1 threshold: 0x7022, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  2 threshold: 0x6fdd, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  3 threshold: 0x7009, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  4 threshold: 0x7008, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  5 threshold: 0x6fbc, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  6 threshold: 0x7022, uid: 0
-2025/04/14 14:10:42 endpoint: 0x5003, chain: 00, channel:  7 threshold: 0x6af3, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  0 threshold: 0x7695, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  1 threshold: 0x75d5, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  2 threshold: 0x7547, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  3 threshold: 0x7547, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  4 threshold: 0x75d1, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  5 threshold: 0x7575, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  6 threshold: 0x74e3, uid: 0
-2025/04/14 14:10:56 endpoint: 0x5004, chain: 00, channel:  7 threshold: 0x77d5, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  0 threshold: 0x9725, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  1 threshold: 0x84e9, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  2 threshold: 0x84af, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  3 threshold: 0x825b, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  4 threshold: 0x86c7, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  5 threshold: 0x887d, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  6 threshold: 0x8a5d, uid: 0
+2025/04/27 17:09:29 endpoint: 0x5000, chain: 00, channel:  7 threshold: 0x8ecd, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  0 threshold: 0x7706, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  1 threshold: 0x780d, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  2 threshold: 0x7a52, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  3 threshold: 0x7944, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  4 threshold: 0x79e1, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  5 threshold: 0x7971, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  6 threshold: 0x79db, uid: 0
+2025/04/27 17:09:44 endpoint: 0x5001, chain: 00, channel:  7 threshold: 0x737a, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  0 threshold: 0x84dd, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  1 threshold: 0x7e1d, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  2 threshold: 0x7bcd, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  3 threshold: 0x7cb1, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  4 threshold: 0x7ced, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  5 threshold: 0x7c89, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  6 threshold: 0x7c55, uid: 0
+2025/04/27 17:09:58 endpoint: 0x5002, chain: 00, channel:  7 threshold: 0x7e0f, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  0 threshold: 0x75eb, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  1 threshold: 0x78d3, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  2 threshold: 0x78ac, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  3 threshold: 0x78f1, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  4 threshold: 0x7902, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  5 threshold: 0x78a1, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  6 threshold: 0x78df, uid: 0
+2025/04/27 17:10:12 endpoint: 0x5003, chain: 00, channel:  7 threshold: 0x7244, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  0 threshold: 0x7e43, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  1 threshold: 0x7cd1, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  2 threshold: 0x7fa0, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  3 threshold: 0x7c33, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  4 threshold: 0x7b73, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  5 threshold: 0x7d5b, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  6 threshold: 0x7c65, uid: 0
+2025/04/27 17:10:26 endpoint: 0x5004, chain: 00, channel:  7 threshold: 0x8649, uid: 0
index 2a5c74a01ac4f52473c8fb33207eab5b0d1c877f..692981d6cedcfd39aa33cee4069168cfca25089f 100755 (executable)
@@ -32,8 +32,8 @@ my $env = Shell::GetEnv->new( 'bash', "source epics" );
 my $epics = $env->{envs}{'EPICS_HOME'}.'/base/bin/linux-x86_64/';
 
 
-system($epics."caput HAD:FWALL:HV:pwonoff_G7 1")    if                   $sys eq 'fwall'  && $state eq 'on';
-system($epics."caput HAD:FWALL:HV:pwonoff_G7 0")    if ($sys eq 'all' || $sys eq 'fwall') && $state eq 'off';
+system($epics."caput HAD:FWALL:HV:pwonoff_G7 1")    if                   $sys eq 'fwall'  && $state eq 'on';
+system($epics."caput HAD:FWALL:HV:pwonoff_G7 0")    if ($sys eq 'all' || $sys eq 'fwall') && $state eq 'off';
 
 system($epics."caput HAD:TOFHV:pwonoff_G1 1")       if                   $sys eq 'tof'  && $state eq 'on';
 system($epics."caput HAD:TOFHV:pwonoff_G2 1")       if                   $sys eq 'tof'  && $state eq 'on';
@@ -79,3 +79,32 @@ system($epics."caput HAD:MDC:HV:spare:12:pwonoff 0")            if ($sys eq 'all
 system($epics."caput HAD:MDC:HV:positive:5:pwonoff 0")          if ($sys eq 'all' || $sys eq 'start') && $state eq 'off';
 system($epics."caput HAD:MDC:HV:positive:6:pwonoff 0")          if ($sys eq 'all' || $sys eq 'start') && $state eq 'off';
 
+
+
+if (($sys eq 'all' || $sys eq 'fwall') && $state eq 'off') {
+  my @channels;
+  my $s;
+
+  for(my $i = 1; $i <= 144; $i++) {
+    next if ($i == 66 || $i == 67 || $i == 78 || $i == 79);
+    $s = "HAD:FWALL:HV:S$i:pwonoff";
+    push(@channels,"$s");
+    }
+
+  for(my $i = 145; $i <= 208; $i++) {
+    $s = "HAD:FWALL:HV:M$i:pwonoff";
+    push(@channels,"$s");
+    }
+
+  for(my $i = 211; $i <= 302; $i++) {
+    next if ($i == 218 || $i == 219 || $i == 220 || $i == 230);
+    next if ($i == 283 || $i == 293 || $i == 294 || $i == 295);
+    $s = "HAD:FWALL:HV:L$i:pwonoff";
+    push(@channels,"$s");
+    }
+    
+    
+  foreach my $c (@channels) {
+    system($epics."caput $c 0");
+    }
+  }