]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
update hmon scripts
authorhadaq <jan@lxhadeb07>
Tue, 1 Feb 2022 23:12:43 +0000 (00:12 +0100)
committerhadaq <jan@lxhadeb07>
Tue, 1 Feb 2022 23:12:43 +0000 (00:12 +0100)
26 files changed:
hmon/QA.pm
hmon/ecal_drawing.htm
hmon/getebjson.pm
hmon/getrootjson.pm [new file with mode: 0755]
hmon/hmon_boxmon.pl
hmon/hmon_eb_rate.pl
hmon/hmon_endpoints.pl
hmon/hmon_micro.pl [changed mode: 0755->0644]
hmon/hmon_rate2.pl
hmon/hmon_spill.pl
hmon/hmon_startrate.pl
hmon/hmon_triggerratio.pl [new file with mode: 0755]
hmon/index.cgi
hmon/monitor.cgi
hmon/old/hmon_dutyfactor.pl
hmon/old/hmon_startrate.pl
hmon/permanent/hmon_archiver.pl
hmon/permanent/hmon_frpchv.pl
hmon/permanent/hmon_itofhv.pl [changed mode: 0644->0755]
hmon/permanent/hmon_mdchv.pl
hmon/permanent/hmon_mdcpressure.pl
hmon/permanent/hmon_richIsobutan.pl
hmon/permanent/hmon_spillmon.pl
hmon/start.sh
hmon/stop.sh
hmon/styles.css

index 7514953eb54756e3e56f038d22ba88a72ecc3868..d6c247213031f89c3a4613cb1c96367734ea52da 100644 (file)
@@ -44,15 +44,15 @@ our $entries->{'cats'} = ["main",
 # Order of entries in each cat
 $entries->{'main'}    = ['time', 'rate','beamabort','up','spillcount'];
 $entries->{'daq'}     = ['trbnet', 'timeouts', 'busy','readout','outofsync'];
-$entries->{'trg'}     = ['spill', 'accepted', 'source','pt1rate',  'start']; #, 
+$entries->{'trg'}     = ['spill', 'accepted', 'source','pt1rate',  'start']; 
 $entries->{'rate'}    = ['pt1','pt2','pt3','pt7','pt8'];
-$entries->{'server'}  = ['fill', 'cpu', 'icinga', 'pwrsup', 'onlineqa'];
+$entries->{'server'}  = ['fill', 'cpu', '', '', 'onlineqa']; #icinga, pwrsup
 $entries->{'eb'}      = ['run', 'rate','bytes', 'lostevt', 'errbits'];
 $entries->{'mdc'}     = ['token', 'blocked', 'temp', 'linkqual', 'voltage'];
 $entries->{'endp'}    = ['mdc','rich', 'tof', 'rpc', 'other'];
-$entries->{'feeerr'}  = ['feeerr','trginp','trgqual','',''];
+$entries->{'feeerr'}  = ['feeerr','trginp','trgqual','rpc',''];
 $entries->{'rich'}    = ['temp','LV','bkpl','isob','richthr'];
-$entries->{'padiwa'}  = ['ecal','start','itof','hodo',''];
+$entries->{'padiwa'}  = ['ecal','start','itof','hodo','sts'];
 $entries->{'hv'}      = ['richhv','ecalhv','rpchv','fwhv','tofhv'];
 $entries->{'hv2'}     = ['mdchv','stshv','frpchv','starthv','itofhv'];
 $entries->{'misc'}    = ['irq','calib','magnet','env','sequencer'];
@@ -81,22 +81,22 @@ our $QAServer = "hades33";
 
 our @FeeErrLimits     = (0, 5, 10);
 our @MdcOepLimits     = (372, 372-1, 372-3);
-our @MdcVoltageLimits = (50, 70, 100);
+our @MdcVoltageLimits = (60, 90, 100);
 our @MdcLockLimits    = (0, 3, 5);
 our @MdcTempLimits    = (75, 80, 85);
 our @EcalTempLimits    = (55, 60, 65);
 our @StartTempLimits    = (55, 60, 65);
 our @ItofTempLimits    = (55, 60, 65);
-our @RichInnerTempLimits = (34,34.5,35);
+our @RichInnerTempLimits = (34.3,35.2,36);
 our @TrgErrLimits     = (100, 1000, 10000);
 our @CPULimits        = (95, 100, 100);
 our @TimeoutLimits    = (0, 0, 1);
-our @TimeoutLimitsOnlyRICHMDC = (0, 20, 30);
+our @TimeoutLimitsOnlyRICHMDC = (0, 3, 4);
 our @LinkErrLimits     = (50, 500, 1000);
-our @MdcEndpMissingLimits   =  (0, 3, 5);  #!!! Oh dear.
+our @MdcEndpMissingLimits   =  (0, 2, 3);  #!!! Oh dear.
 our @RichEndpMissingLimits   = (0, 3, 4);
 our @TofEndpMissingLimits   = (0, 0, 0);
-our @RpcEndpMissingLimits   = (0, 0, 1);
+our @RpcEndpMissingLimits   = (0, 0, 0);
 our @OtherEndpMissingLimits   = (0, 0, 0);
 our @EBDeltaRateLimits = (0.1, 0.2, 0.3); # as a ratio compared to the rate
 our $TrgCheckPolarity = 1;
@@ -108,7 +108,7 @@ our @EcalHvLimits = (493,325,320);
 our @RpcHvLimits = (12,12,12);
 our @TofHvLimits = (764,760,759);
 our @FwHvLimits = (280,250,200);
-our @FrpcHvLimits = (5.5,3.9,0); #kV 5.6 -> std. / 4 -> idle
+our @FrpcHvLimits = (5.39,3.9,0); #kV 5.6 -> std. / 4 -> idle
 our @ItofHvLimits = (29,28,0);
 
 our @TdcCalibrationInterval = (320000,450000,600000);   
@@ -118,16 +118,19 @@ our @PionLvCurrLimits = (4,5,6);
 
 
 our $PadiwaEcalNumber = 105;
-our @PadiwaEcalLimits    = (5, 10, 20);
+our @PadiwaEcalLimits    = (1, 4, 7);
 
 our $PadiwaItofNumber = 18;
-our @PadiwaItofLimits    = (0, 0, 1);
+our @PadiwaItofLimits    = (0, 0, 0);
 
 our $PadiwaStartNumber = 12;
-our @PadiwaStartLimits    = (0, 0, 1);
+our @PadiwaStartLimits    = (0, 0, 0);
+
+our $PadiwaHodoNumber = 2;
+our @PadiwaHodoLimits    = (0, 0, 0);
 
 our @LimitTriggerPerSpill = (1000, 0, 0);
-our $AcceleratorCycle = 7;
+our $AcceleratorCycle = 2;
 use constant {CTSAddress => 0x0003};
 
 ###############################################################################
@@ -135,17 +138,18 @@ use constant {CTSAddress => 0x0003};
 ###############################################################################
 our $MdcHvOff = 0;
 our $RichHvOff = 0;
+our $RichGasOff = 0;
 our $TofHvOff = 0;
 our $RpcHvOff = 0;
 our $FwHvOff = 1;
 our $MagnetOff = 1;
 our $StsHvOff = 0;
 our $StartHvOff = 1;
-our $ItofHvOff = 1;
+our $ItofHvOff = 0;
 our $FrpcHvOff = 0;
 our $EcalHvOff = 0;
 
-our $QAServerOff = 1;
+our $QAServerOff = 0;
 
 ###############################################################################
 #  Missing Boards
@@ -310,6 +314,7 @@ sub SciNotation {
   return "0" if $v == 0;
 #   print $v."\n";
   if(abs($v) >= 1) {
+    return  sprintf("%.1f", $v) if (abs($v) < 10) ;
     return  sprintf("%i", $v) if (abs($v) < 1000) ;
     return  sprintf("%.1fk", $v / 1000.) if (abs($v) < 20000) ;
     return  sprintf("%ik", $v / 1000.) if (abs($v) < 1E6) ;
index 838f360d9f2e001dbe45a5d09e852850cfc75a11..d788f6334160dbff4fb0e28a8dcebcdfc9460719 100644 (file)
@@ -1770,28 +1770,26 @@ function updatedata(d) {
    resetColor();   
             
    var trbs = [
-                [ ["0x6013",1,0,0], ["0x6013",2,1,1], ["0x6013",3,2,2], ["0x6013",4,3,3], ["0x6013",5,4,4]
-                //["0x6025",14,14,14], ["0x6025",9,15,15], ["0x6041",3,22,22], ["0x6041",7,23,23]
-                ],
-                //["0x6051",1,0,23], ["0x6045",25,0,23], ["0x6011",49,0,23], ["0x6014",73,0,23], ["0x6042",97,0,23], ["0x6015",121,0,23], ["0x6026",145,0,18] ], //sector 0
+                [ []
+                ], //sector 0
                 
                 
-                [ //["0x6013",1,0,0], ["0x6013",2,1,1], ["0x6013",3,2,2], ["0x6013",4,3,3], ["0x6013",5,4,4],
-                  ["0x6013",6,8,8], ["0x6013",7,5,5], ["0x6013",8,6,6], ["0x6013",9,7,7], ["0x6013",10,16,16],
-                  ["0x6013",11,9,9], ["0x6013",12,10,10], ["0x6013",13,11,11], ["0x6013",14,17,17], ["0x6013",15,18,18], ["0x6013",16,19,19], ["0x6013",17,20,20],
-                  ["0x6013",18,12,12], ["0x6013",19,13,13], ["0x6013",20,14,14], ["0x6013",21,15,15], ["0x6013",22,21,21], ["0x6013",23,22,22], ["0x6013",24,23,23],
-                  ["0x6014",25,0,0], ["0x6014",26,1,1], ["0x6014",27,2,2], ["0x6014",28,3,3], ["0x6014",29,4,4], ["0x6012",30,0,0], ["0x6012",31,1,1], ["0x6012",32,2,2], ["0x6012",33,3,3],
-                  ["0x6014",34,8,8], ["0x6014",35,9,9], ["0x6014",36,5,5], ["0x6014",37,6,6], ["0x6014",38,7,7], ["0x6012",39,4,4], ["0x6012",40,5,5], ["0x6012",41,6,6], ["0x6012",42,7,7],
-                  ["0x6014",43,10,10], ["0x6014",44,11,11], ["0x6014",45,12,12], ["0x6014",46,13,13], ["0x6012",47,8,8], ["0x6012",48,9,9], ["0x6012",49,10,10], ["0x6012",50,11,11], ["0x6012",51,12,12],
-                  ["0x6014",52,16,16], ["0x6014",53,17,17], ["0x6014",54,18,18], ["0x6014",55,14,14], ["0x6014",56,15,15], ["0x6012",57,13,13], ["0x6012",58,14,14], ["0x6012",59,15,15], ["0x6012",60,16,16], ["0x6012",61,17,17], ["0x6012",62,18,18],
-                  ["0x6014",63,19,19], ["0x6014",64,20,20], ["0x6014",65,21,21], ["0x6014",66,22,22], ["0x6014",67,23,23], ["0x6015",68,23,23], ["0x6012",69,19,19], ["0x6012",70,20,20], ["0x6012",71,21,21], ["0x6012",72,22,22], ["0x6012",73,23,23],
-                  ["0x6015",74,22,22], ["0x6015",75,21,21], ["0x6015",76,20,20], ["0x6015",77,19,19], ["0x6015",78,18,18], ["0x6015",79,17,17], ["0x6015",80,16,16], ["0x6011",81,0,0], ["0x6011",82,1,1], ["0x6011",83,2,2], ["0x6011",84,3,3], ["0x6011",85,4,4], ["0x6011",86,5,5],
-                  ["0x6015",87,15,15], ["0x6015",88,14,14], ["0x6015",89,13,13], ["0x6015",90,12,12], ["0x6015",91,11,11], ["0x6015",92,10,10], ["0x6011",93,8,8], ["0x6011",94,9,9], ["0x6011",95,10,10], ["0x6011",96,11,11], ["0x6011",97,12,12], ["0x6011",98,13,13], ["0x6011",99,14,14],
-                  ["0x6015",100,7,7], ["0x6015",101,6,6], ["0x6015",102,5,5], ["0x6015",103,4,4], ["0x6015",104,3,3], ["0x6015",105,2,2], ["0x6015",106,1,1], ["0x6011",107,16,16], ["0x6011",108,17,17], ["0x6011",109,18,18], ["0x6011",110,19,19], ["0x6011",111,20,20], ["0x6011",112,21,21], ["0x6011",113,22,22], ["0x6011",114,23,23],
-                  ["0x6015",115,0,0], ["0x6016",116,0,0], ["0x6016",117,1,1], ["0x6016",118,2,2], ["0x6016",119,3,3], ["0x6016",120,4,4], ["0x6016",121,5,5], ["0x6016",122,6,6], ["0x6010",123,0,0], ["0x6010",124,1,1], ["0x6010",125,2,2], ["0x6010",126,3,3], ["0x6010",127,4,4], ["0x6010",128,5,5], ["0x6010",129,6,6],
-                  ["0x6016",130,8,8], ["0x6016",131,9,9], ["0x6016",132,10,10], ["0x6016",133,11,11], ["0x6016",134,12,12], ["0x6016",135,13,13], ["0x6016",136,14,14], ["0x6016",137,15,15], ["0x6016",138,7,7], ["0x6010",139,7,7], ["0x6010",140,8,8], ["0x6010",141,9,9], ["0x6010",142,10,10], ["0x6010",143,11,11], ["0x6010",144,12,12], ["0x6010",145,13,13], ["0x6010",146,14,14],
-                  ["0x6016",147,16,16], ["0x6016",148,17,17], ["0x6016",149,18,18], ["0x6016",150,19,19], ["0x6016",151,20,20], ["0x6016",152,21,21], ["0x6016",153,22,22], ["0x6016",154,23,23], ["0x6010",155,16,16], ["0x6010",156,17,17], ["0x6010",157,18,18], ["0x6010",158,19,19], ["0x6010",159,20,20], ["0x6010",160,21,21], ["0x6010",161,22,22], ["0x6010",162,23,23], ["0x6010",163,15,15]
-                ], //sector1  
+                [ ["0x6013",1,16,16], ["0x6013",2,19,19], ["0x6013",3,6,6], ["0x6013",4,1,1], ["0x6013",5,4,4],
+                  ["0x6013",6,7,7], ["0x6013",7,8,8], ["0x6013",8,11,11], ["0x6013",9,14,14], ["0x6013",10,9,9],
+                  ["0x6013",11,12,12], ["0x6013",12,15,15], ["0x6013",13,0,0], ["0x6013",14,3,3], ["0x6013",15,22,22], ["0x6013",16,17,17], ["0x6013",17,20,20],
+                  ["0x6013",18,23,23], ["0x6013",19,18,18], ["0x6013",20,21,21], ["0x6013",21,10,10], ["0x6013",22,13,13], ["0x6013",23,2,2], ["0x6013",24,5,5],
+                  ["0x6014",25,2,2], ["0x6014",26,10,10], ["0x6014",27,13,13], ["0x6014",28,1,1], ["0x6014",29,15,15], ["0x6012",30,2,2], ["0x6012",31,13,13], ["0x6012",32,18,18], ["0x6012",33,21,21],
+                  ["0x6014",34,22,22], ["0x6014",35,17,17], ["0x6014",36,20,20], ["0x6014",37,23,23], ["0x6014",38,4,4], ["0x6012",39,20,20], ["0x6012",40,7,7], ["0x6012",41,10,10], ["0x6012",42,5,5],
+                  ["0x6014",43,3,3], ["0x6014",44,6,6], ["0x6014",45,0,0], ["0x6014",46,7,7], ["0x6012",47,15,15], ["0x6012",48,16,16], ["0x6012",49,0,0], ["0x6012",50,22,22], ["0x6012",51,17,17],
+                  ["0x6014",52,18,18], ["0x6014",53,8,8], ["0x6014",54,11,11], ["0x6014",55,14,14], ["0x6014",56,9,9], ["0x6012",57,23,23], ["0x6012",58,8,8], ["0x6012",59,11,11], ["0x6012",60,14,14], ["0x6012",61,9,9], ["0x6012",62,12,12],
+                  ["0x6014",63,12,12], ["0x6014",64,21,21], ["0x6014",65,16,16], ["0x6014",66,19,19], ["0x6014",67,5,5], ["0x6015",68,5,5], ["0x6012",69,19,19], ["0x6012",70,3,3], ["0x6012",71,6,6], ["0x6012",72,1,1], ["0x6012",73,4,4],
+                  ["0x6015",74,21,21], ["0x6015",75,6,6], ["0x6015",76,14,14], ["0x6015",77,22,22], ["0x6015",78,7,7], ["0x6015",79,15,15], ["0x6015",80,23,23], ["0x6011",81,21,21], ["0x6011",82,6,6], ["0x6011",83,14,14], ["0x6011",84,22,22], ["0x6011",85,7,7], ["0x6011",86,15,15],
+                  ["0x6015",87,3,3], ["0x6015",88,11,11], ["0x6015",89,19,19], ["0x6015",90,4,4], ["0x6015",91,12,12], ["0x6015",92,20,20], ["0x6011",93,18,18], ["0x6011",94,3,3], ["0x6011",95,11,11], ["0x6011",96,19,19], ["0x6011",97,4,4], ["0x6011",98,12,12], ["0x6011",99,20,20],
+                  ["0x6015",100,0,0], ["0x6015",101,8,8], ["0x6015",102,16,16], ["0x6015",103,1,1], ["0x6015",104,9,9], ["0x6015",105,17,17], ["0x6015",106,2,2], ["0x6011",107,0,0], ["0x6011",108,8,8], ["0x6011",109,16,16], ["0x6011",110,1,1], ["0x6011",111,9,9], ["0x6011",112,17,17], ["0x6011",113,2,2], ["0x6011",114,10,10],
+                  ["0x6015",115,18,18], ["0x6016",116,6,6], ["0x6016",117,14,14], ["0x6016",118,22,22], ["0x6016",119,7,7], ["0x6016",120,15,15], ["0x6016",121,23,23], ["0x6016",122,18,18], ["0x6010",123,21,21], ["0x6010",124,6,6], ["0x6010",125,14,14], ["0x6010",126,22,22], ["0x6010",127,7,7], ["0x6010",128,15,15], ["0x6010",129,23,23],
+                  ["0x6016",130,21,21], ["0x6016",131,3,3], ["0x6016",132,11,11], ["0x6016",133,19,19], ["0x6016",134,4,4], ["0x6016",135,12,12], ["0x6016",136,20,20], ["0x6016",137,5,5], ["0x6016",138,13,13], ["0x6010",139,3,3], ["0x6010",140,11,11], ["0x6010",141,19,19], ["0x6010",142,4,4], ["0x6010",143,12,12], ["0x6010",144,20,20], ["0x6010",145,5,5], ["0x6010",146,13,13],
+                  ["0x6016",147,0,0], ["0x6016",148,8,8], ["0x6016",149,16,16], ["0x6016",150,1,1], ["0x6016",151,9,9], ["0x6016",152,17,17], ["0x6016",153,2,2], ["0x6016",154,10,10], ["0x6010",155,0,0], ["0x6010",156,8,8], ["0x6010",157,16,16], ["0x6010",158,1,1], ["0x6010",159,9,9], ["0x6010",160,17,17], ["0x6010",161,2,2], ["0x6010",162,10,10], ["0x6010",163,18,18]
+                ], //sector1, Note: update new cabeling (12.2021) 
             
                 [ ["0x6023",1,0,0], ["0x6023",2,1,1], ["0x6023",3,2,2], ["0x6023",4,3,3], ["0x6023",5,4,4], 
                   ["0x6023",6,8,8], ["0x6023",7,5,5], ["0x6023",8,6,6], ["0x6023",9,7,7], ["0x6023",10,16,16], 
@@ -1810,8 +1808,22 @@ function updatedata(d) {
                   ["0x6026",147,16,16], ["0x6026",148,17,17], ["0x6026",149,18,18], ["0x6026",150,19,19], ["0x6026",151,20,20], ["0x6026",152,21,21], ["0x6026",153,22,22], ["0x6026",154,23,23], ["0x6020",155,16,16], ["0x6020",156,17,17], ["0x6020",157,18,18], ["0x6020",158,19,19], ["0x6020",159,20,20], ["0x6020",160,21,21], ["0x6020",161,22,22], ["0x6020",162,23,23], ["0x6020",163,15,15]
                 ], //sector 2
              
-                [ [] 
-                ], //sector 3  
+                [ ["0x6033",1,16,16], ["0x6033",2,19,19], ["0x6033",3,6,6], ["0x6033",4,1,1], ["0x6033",5,4,4],
+                  ["0x6033",6,7,7], ["0x6033",7,8,8], ["0x6033",8,11,11], ["0x6033",9,14,14], ["0x6033",10,9,9],
+                  ["0x6033",11,12,12], ["0x6033",12,15,15], ["0x6033",13,0,0], ["0x6033",14,3,3], ["0x6033",15,22,22], ["0x6033",16,17,17], ["0x6033",17,20,20],
+                  ["0x6033",18,23,23], ["0x6033",19,18,18], ["0x6033",20,21,21], ["0x6033",21,10,10], ["0x6033",22,13,13], ["0x6033",23,2,2], ["0x6033",24,5,5],
+                  ["0x6034",25,2,2], ["0x6034",26,10,10], ["0x6034",27,13,13], ["0x6034",28,1,1], ["0x6034",29,15,15], ["0x6032",30,2,2], ["0x6032",31,13,13], ["0x6032",32,18,18], ["0x6032",33,21,21],
+                  ["0x6034",34,22,22], ["0x6034",35,17,17], ["0x6034",36,20,20], ["0x6034",37,23,23], ["0x6034",38,4,4], ["0x6032",39,20,20], ["0x6032",40,7,7], ["0x6032",41,10,10], ["0x6032",42,5,5],
+                  ["0x6034",43,3,3], ["0x6034",44,6,6], ["0x6034",45,0,0], ["0x6034",46,7,7], ["0x6032",47,15,15], ["0x6032",48,16,16], ["0x6032",49,0,0], ["0x6032",50,22,22], ["0x6032",51,17,17],
+                  ["0x6034",52,18,18], ["0x6034",53,8,8], ["0x6034",54,11,11], ["0x6034",55,14,14], ["0x6034",56,9,9], ["0x6032",57,23,23], ["0x6032",58,8,8], ["0x6032",59,11,11], ["0x6032",60,14,14], ["0x6032",61,9,9], ["0x6032",62,12,12],
+                  ["0x6034",63,12,12], ["0x6034",64,21,21], ["0x6034",65,16,16], ["0x6034",66,19,19], ["0x6034",67,5,5], ["0x6035",68,5,5], ["0x6032",69,19,19], ["0x6032",70,3,3], ["0x6032",71,6,6], ["0x6032",72,1,1], ["0x6032",73,4,4],
+                  ["0x6035",74,21,21], ["0x6035",75,6,6], ["0x6035",76,14,14], ["0x6035",77,22,22], ["0x6035",78,7,7], ["0x6035",79,15,15], ["0x6035",80,23,23], ["0x6031",81,21,21], ["0x6031",82,6,6], ["0x6031",83,14,14], ["0x6031",84,22,22], ["0x6031",85,7,7], ["0x6031",86,15,15],
+                  ["0x6035",87,3,3], ["0x6035",88,11,11], ["0x6035",89,19,19], ["0x6035",90,4,4], ["0x6035",91,12,12], ["0x6035",92,20,20], ["0x6031",93,18,18], ["0x6031",94,3,3], ["0x6031",95,11,11], ["0x6031",96,19,19], ["0x6031",97,4,4], ["0x6031",98,12,12], ["0x6031",99,20,20],
+                  ["0x6035",100,0,0], ["0x6035",101,8,8], ["0x6035",102,16,16], ["0x6035",103,1,1], ["0x6035",104,9,9], ["0x6035",105,17,17], ["0x6035",106,2,2], ["0x6031",107,0,0], ["0x6031",108,8,8], ["0x6031",109,16,16], ["0x6031",110,1,1], ["0x6031",111,9,9], ["0x6031",112,17,17], ["0x6031",113,2,2], ["0x6031",114,10,10],
+                  ["0x6035",115,18,18], ["0x6036",116,6,6], ["0x6036",117,14,14], ["0x6036",118,22,22], ["0x6036",119,7,7], ["0x6036",120,15,15], ["0x6036",121,23,23], ["0x6036",122,18,18], ["0x6030",123,21,21], ["0x6030",124,6,6], ["0x6030",125,14,14], ["0x6030",126,22,22], ["0x6030",127,7,7], ["0x6030",128,15,15], ["0x6030",129,23,23],
+                  ["0x6036",130,21,21], ["0x6036",131,3,3], ["0x6036",132,11,11], ["0x6036",133,19,19], ["0x6036",134,4,4], ["0x6036",135,12,12], ["0x6036",136,20,20], ["0x6036",137,5,5], ["0x6036",138,13,13], ["0x6030",139,3,3], ["0x6030",140,11,11], ["0x6030",141,19,19], ["0x6030",142,4,4], ["0x6030",143,12,12], ["0x6030",144,20,20], ["0x6030",145,5,5], ["0x6030",146,13,13],
+                  ["0x6036",147,0,0], ["0x6036",148,8,8], ["0x6036",149,16,16], ["0x6036",150,1,1], ["0x6036",151,9,9], ["0x6036",152,17,17], ["0x6036",153,2,2], ["0x6036",154,10,10], ["0x6030",155,0,0], ["0x6030",156,8,8], ["0x6030",157,16,16], ["0x6030",158,1,1], ["0x6030",159,9,9], ["0x6030",160,17,17], ["0x6030",161,2,2], ["0x6030",162,10,10], ["0x6030",163,18,18] 
+                ], //sector 3, Note: update new cabeling (12.2021)  
             
                 [ ["0x6045",1,16,16], ["0x6045",2,17,17], ["0x6045",3,18,18], ["0x6045",4,19,19], ["0x6045",5,20,20],
                   ["0x6045",6,8,8], ["0x6045",7,21,21], ["0x6045",8,22,22], ["0x6045",9,23,23], ["0x6045",10,0,0],
@@ -1830,22 +1842,23 @@ function updatedata(d) {
                   ["0x6046",147,0,0], ["0x6046",148,1,1], ["0x6046",149,2,2], ["0x6046",150,3,3], ["0x6046",151,4,4], ["0x6046",152,5,5], ["0x6046",153,6,6], ["0x6046",154,7,7], ["0x6040",155,0,0], ["0x6040",156,1,1], ["0x6040",157,2,2], ["0x6040",158,3,3], ["0x6040",159,4,4], ["0x6040",160,5,5], ["0x6040",161,6,6], ["0x6040",162,7,7], ["0x6040",163,15,15]
                 ], //sector 4
             
-                [ ["0x6056",1,16,16], ["0x6056",2,17,17], ["0x6056",3,18,18], ["0x6056",4,19,19], ["0x6056",5,20,20],
-                  ["0x6056",6,8,8], ["0x6056",7,21,21], ["0x6056",8,22,22], ["0x6056",9,23,23], ["0x6056",10,0,0],
-                  ["0x6056",11,9,9], ["0x6056",12,10,10], ["0x6056",13,11,11], ["0x6056",14,1,1], ["0x6056",15,2,2], ["0x6056",16,3,3], ["0x6056",17,4,4],
-                  ["0x6056",18,12,12], ["0x6056",19,13,13], ["0x6056",20,14,14], ["0x6056",21,15,15], ["0x6056",22,5,5], ["0x6056",23,6,6], ["0x6056",24,7,7],
-                  ["0x6055",25,16,16], ["0x6055",26,17,17], ["0x6055",27,18,18], ["0x6055",28,19,19], ["0x6055",29,20,20], ["0x6052",30,16,16], ["0x6052",31,17,17], ["0x6052",32,18,18], ["0x6052",33,19,19],
-                  ["0x6055",34,8,8], ["0x6055",35,9,9], ["0x6055",36,21,21], ["0x6055",37,22,22], ["0x6055",38,23,23], ["0x6052",39,20,20], ["0x6052",40,21,21], ["0x6052",41,22,22], ["0x6052",42,23,23],
-                  ["0x6055",43,10,10], ["0x6055",44,11,11], ["0x6055",45,12,12], ["0x6055",46,13,13], ["0x6052",47,0,0], ["0x6052",48,1,1], ["0x6052",49,2,2], ["0x6052",50,3,3], ["0x6052",51,4,4],
-                  ["0x6055",52,0,0], ["0x6055",53,1,1], ["0x6055",54,2,2], ["0x6055",55,14,14], ["0x6055",56,15,15], ["0x6052",57,5,5], ["0x6052",58,6,6], ["0x6052",59,7,7], ["0x6052",60,8,8], ["0x6052",61,9,9], ["0x6052",62,10,10],
-                  ["0x6055",63,3,3], ["0x6055",64,4,4], ["0x6055",65,5,5], ["0x6055",66,6,6], ["0x6055",67,7,7], ["0x6052",68,16,16], ["0x6052",69,11,11], ["0x6052",70,12,12], ["0x6052",71,13,13], ["0x6052",72,14,14], ["0x6052",73,15,15],
-                  ["0x6054",74,17,17], ["0x6054",75,18,18], ["0x6054",76,19,19], ["0x6054",77,20,20], ["0x6054",78,21,21], ["0x6054",79,22,22], ["0x6054",80,23,23], ["0x6051",81,16,16], ["0x6051",82,17,17], ["0x6051",83,18,18], ["0x6051",84,19,19], ["0x6051",85,20,20], ["0x6051",86,21,21],
-                  ["0x6054",87,8,8], ["0x6054",88,9,9], ["0x6054",89,10,10], ["0x6054",90,11,11], ["0x6054",91,12,12], ["0x6054",92,13,13], ["0x6051",93,9,9], ["0x6051",94,9,9], ["0x6051",95,10,10], ["0x6051",96,11,11], ["0x6051",97,12,12], ["0x6051",98,13,13], ["0x6051",99,14,14],
-                  ["0x6054",100,0,0], ["0x6054",101,1,1], ["0x6054",102,2,2], ["0x6054",103,3,3], ["0x6054",104,4,4], ["0x6054",105,5,5], ["0x6054",106,6,6], ["0x6051",107,0,0], ["0x6051",108,1,1], ["0x6051",109,2,2], ["0x6051",110,3,3], ["0x6051",111,4,4], ["0x6051",112,5,5], ["0x6051",113,6,6], ["0x6051",114,7,7],
-                  ["0x6054",115,7,7], ["0x6053",116,16,16], ["0x6053",117,17,17], ["0x6053",118,18,18], ["0x6053",119,19,19], ["0x6053",120,20,20], ["0x6053",121,21,21], ["0x6053",122,22,22], ["0x6050",123,16,16], ["0x6050",124,17,17], ["0x6050",125,18,18], ["0x6050",126,19,19], ["0x6050",127,20,20], ["0x6050",128,21,21], ["0x6050",129,22,22],
-                  ["0x6053",130,8,8], ["0x6053",131,9,9], ["0x6053",132,10,10], ["0x6053",133,11,11], ["0x6053",134,12,12], ["0x6053",135,13,13], ["0x6053",136,14,14], ["0x6053",137,15,15], ["0x6053",138,23,23], ["0x6050",139,23,23], ["0x6050",140,8,8], ["0x6050",141,9,9], ["0x6050",142,10,10], ["0x6050",143,11,11], ["0x6050",144,12,12], ["0x6050",145,13,13], ["0x6050",146,14,14],
-                  ["0x6053",147,0,0], ["0x6053",148,1,1], ["0x6053",149,2,2], ["0x6053",150,3,3], ["0x6053",151,4,4], ["0x6053",152,5,5], ["0x6053",153,6,6], ["0x6053",154,7,7], ["0x6050",155,0,0], ["0x6050",156,1,1], ["0x6050",157,2,2], ["0x6050",158,3,3], ["0x6050",159,4,4], ["0x6050",160,5,5], ["0x6050",161,6,6], ["0x6050",162,7,7], ["0x6050",163,15,15]
-                ] //sector 5
+                [ ["0x6056",1,16,16], ["0x6056",2,19,19], ["0x6056",3,6,6], ["0x6056",4,1,1], ["0x6056",5,4,4],
+                  ["0x6056",6,7,7], ["0x6056",7,8,8], ["0x6056",8,11,11], ["0x6056",9,14,14], ["0x6056",10,9,9],
+                  ["0x6056",11,12,12], ["0x6056",12,15,15], ["0x6056",13,0,0], ["0x6056",14,3,3], ["0x6056",15,22,22], ["0x6056",16,17,17], ["0x6056",17,20,20],
+                  ["0x6056",18,23,23], ["0x6056",19,18,18], ["0x6056",20,21,21], ["0x6056",21,10,10], ["0x6056",22,13,13], ["0x6056",23,2,2], ["0x6056",24,5,5],
+                  ["0x6055",25,2,2], ["0x6055",26,10,10], ["0x6055",27,13,13], ["0x6055",28,1,1], ["0x6055",29,15,15], ["0x6052",30,2,2], ["0x6052",31,13,13], ["0x6052",32,18,18], ["0x6052",33,21,21],
+                  ["0x6055",34,22,22], ["0x6055",35,17,17], ["0x6055",36,20,20], ["0x6055",37,23,23], ["0x6055",38,4,4], ["0x6052",39,20,20], ["0x6052",40,7,7], ["0x6052",41,10,10], ["0x6052",42,5,5],
+                  ["0x6055",43,3,3], ["0x6055",44,6,6], ["0x6055",45,0,0], ["0x6055",46,7,7], ["0x6052",47,15,15], ["0x6052",48,16,16], ["0x6052",49,0,0], ["0x6052",50,22,22], ["0x6052",51,17,17],
+                  ["0x6055",52,18,18], ["0x6055",53,8,8], ["0x6055",54,11,11], ["0x6055",55,14,14], ["0x6055",56,9,9], ["0x6052",57,23,23], ["0x6052",58,8,8], ["0x6052",59,11,11], ["0x6052",60,14,14], ["0x6052",61,9,9], ["0x6052",62,12,12],
+                  ["0x6055",63,12,12], ["0x6055",64,21,21], ["0x6055",65,16,16], ["0x6055",66,19,19], ["0x6055",67,5,5], ["0x6054",68,5,5], ["0x6052",69,19,19], ["0x6052",70,3,3], ["0x6052",71,6,6], ["0x6052",72,1,1], ["0x6052",73,4,4],
+                  ["0x6054",74,21,21], ["0x6054",75,6,6], ["0x6054",76,14,14], ["0x6054",77,22,22], ["0x6054",78,7,7], ["0x6054",79,15,15], ["0x6054",80,23,23], ["0x6051",81,21,21], ["0x6051",82,6,6], ["0x6051",83,14,14], ["0x6051",84,22,22], ["0x6051",85,7,7], ["0x6051",86,15,15],
+                  ["0x6054",87,3,3], ["0x6054",88,11,11], ["0x6054",89,19,19], ["0x6054",90,4,4], ["0x6054",91,12,12], ["0x6054",92,20,20], ["0x6051",93,18,18], ["0x6051",94,3,3], ["0x6051",95,11,11], ["0x6051",96,19,19], ["0x6051",97,4,4], ["0x6051",98,12,12], ["0x6051",99,20,20],
+                  ["0x6054",100,0,0], ["0x6054",101,8,8], ["0x6054",102,16,16], ["0x6054",103,1,1], ["0x6054",104,9,9], ["0x6054",105,17,17], ["0x6054",106,2,2], ["0x6051",107,0,0], ["0x6051",108,8,8], ["0x6051",109,16,16], ["0x6051",110,1,1], ["0x6051",111,9,9], ["0x6051",112,17,17], ["0x6051",113,2,2], ["0x6051",114,10,10],
+                  ["0x6054",115,18,18], ["0x6053",116,6,6], ["0x6053",117,14,14], ["0x6053",118,22,22], ["0x6053",119,7,7], ["0x6053",120,15,15], ["0x6053",121,23,23], ["0x6053",122,18,18], ["0x6050",123,21,21], ["0x6050",124,6,6], ["0x6050",125,14,14], ["0x6050",126,22,22], ["0x6050",127,7,7], ["0x6050",128,15,15], ["0x6050",129,23,23],
+                  ["0x6053",130,21,21], ["0x6053",131,3,3], ["0x6053",132,11,11], ["0x6053",133,19,19], ["0x6053",134,4,4], ["0x6053",135,12,12], ["0x6053",136,20,20], ["0x6053",137,5,5], ["0x6053",138,13,13], ["0x6050",139,3,3], ["0x6050",140,11,11], ["0x6050",141,19,19], ["0x6050",142,4,4], ["0x6050",143,12,12], ["0x6050",144,20,20], ["0x6050",145,5,5], ["0x6050",146,13,13],
+                  ["0x6053",147,0,0], ["0x6053",148,8,8], ["0x6053",149,16,16], ["0x6053",150,1,1], ["0x6053",151,9,9], ["0x6053",152,17,17], ["0x6053",153,2,2], ["0x6053",154,10,10], ["0x6050",155,0,0], ["0x6050",156,8,8], ["0x6050",157,16,16], ["0x6050",158,1,1], ["0x6050",159,9,9], ["0x6050",160,17,17], ["0x6050",161,2,2], ["0x6050",162,10,10], ["0x6050",163,18,18]
+                ] //sector 5, Note: new installed sector with new cabeling (12.2021)
+                
               ];
                
    for (var i=0;i<trbs.length;i++){ //sectors
index 3917e805bbb70dc4fb1f8151a202db2c0a06db5f..1eab5f5cb6386758c3049a7d803d0e425f3309ab 100644 (file)
@@ -1,6 +1,9 @@
 #!/usr/bin/perl -w
 
 #Gets json files from EB, changes them to Hashes instead of arrays of names, and changes times to timestamps
+#adds array with all full names (_fullnames)
+#adds hash with names -> full names (_allnames)
+
 
 use strict;
 use warnings;
@@ -11,22 +14,32 @@ use Try::Tiny;
 use DateTime;
 use DateTime::Format::ISO8601;
 
+
+
 sub hashify {
-  my $d = $_[0];
+  my $d  = $_[0];     #current object
+  my $fn = $_[1].'/'; #full name
+  my $data = $_[2];   #global object
+  
   if ($d->{'_childs'}) {
-    my $i = 0;
     for my $c (0 .. scalar @{$d->{'_childs'}}) {
-      foreach my $k (keys %{$d->{'_childs'}[$i]}) {
-        $d->{$d->{'_childs'}[$i]{'_name'}}{$k} = $d->{'_childs'}[$i]{$k};
+      my $name = $d->{'_childs'}[$c]{'_name'};
+      next unless $name;
+      $d->{$name}{'_fullname'} = $fn.$name;
+      push(@{$data->{'_fullnames'}}, $fn.$name);    
+      $data->{'_allnames'}{$name} = $fn.$name;    
+      foreach my $k (keys %{$d->{'_childs'}[$c]}) {
+        if($k ne '_dabc_hist' && $k ne '_after_request' && $k ne '_make_request') {
+          $d->{$name}{$k} = $d->{'_childs'}[$c]{$k};
+          }
         if($k eq 'time') {
-          my $dt = DateTime::Format::ISO8601->parse_datetime($d->{$d->{'_childs'}[$i]{'_name'}}{$k});
-          $d->{$d->{'_childs'}[$i]{'_name'}}{$k} = $dt->epoch();
+          my $dt = DateTime::Format::ISO8601->parse_datetime($d->{$name}{$k});
+          $d->{$name}{$k} = $dt->epoch();
           }
-        if($k eq '_childs') {
-          hashify($d->{$d->{'_childs'}[$i]{'_name'}});
+        elsif($k eq '_childs') {
+          hashify($d->{$name},$fn.$name,$data);
           }
         }
-      $i++;
       }
     delete ($d->{'_childs'});
     }
@@ -35,10 +48,12 @@ sub hashify {
 
 sub getjsonhash {
   my ($src, $name) = @_;
-  my $baseurl;
+  my $baseurl = "invalid";
   if($src eq 'rawmon') {$baseurl = 'http://lxhadeb12:8090/';}
   if($src eq 'ebmon')  {$baseurl = 'http://lxhadeb12:8090/';}
   if($src eq 'eb')     {$baseurl = 'http://lxhadeb12:8099/';}
+  if($src eq 'calib')      {$baseurl = 'http://hadesp66:8092/';}
+  if($src eq 'calibtest')  {$baseurl = 'http://hadesp63:8097/';}
 
   my $rawdata = get ($baseurl.$name);
 
@@ -51,7 +66,7 @@ sub getjsonhash {
     } 
    
 
-  hashify($data);
+  hashify($data,'',$data);
   return $data;
   }
     
diff --git a/hmon/getrootjson.pm b/hmon/getrootjson.pm
new file mode 100755 (executable)
index 0000000..544d7fb
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use LWP::Simple qw(get);
+use JSON qw( decode_json encode_json ); 
+use Data::Dumper;
+use CGI qw(:standard);
+
+
+sub getroothist {
+  my ($src, $name) = @_;
+  
+  my $baseurl = "invalid";
+  if($src eq 'rawmon') {$baseurl = 'http://lxhadeb12:8090';}
+  if($src eq 'ebmon')  {$baseurl = 'http://lxhadeb12:8090';}
+  if($src eq 'eb')     {$baseurl = 'http://lxhadeb07:8099';}
+  if($src eq 'calib')      {$baseurl = 'http://hadesp66:8092';}
+  if($src eq 'calibtest')  {$baseurl = 'http://hadesp63:8097';}
+
+
+
+  my $rawdata = get ($baseurl.$name."/get.json");
+
+  my $data;
+  
+  if (defined $rawdata) {
+    $data = decode_json($rawdata);
+
+    foreach my $s ('xlabels', 'ylabels', 'zlabels') {  
+    if ($data->{$s}) {
+      my @labels = split(',',$data->{$s});
+      $data->{$s} = \@labels;
+      }
+    }
+
+      
+    if($data->{'_kind'} eq 'ROOT.TH1D')   {
+      $data->{"underflow"} = $data->{bins}[3];
+      $data->{"overflow"}  = $data->{bins}[-1];
+      @{$data->{"bins"}} = splice(@{$data->{"bins"}},4,-1);
+      }
+
+    if($data->{'_kind'} eq 'ROOT.TH2D')   {
+      my $d;
+      foreach my $x (1..$data->{nbins1}) {
+        foreach my $y (1..$data->{nbins2}) {
+          $d->[$x-1][$y-1] = $data->{bins}[6+$x+$y*($data->{nbins1}+2)];
+          }
+        }
+    #   foreach my $x (1..$data->{nbins1}) {    
+    #     $data->{underflow}{x}[$x] = $data->{bins}[7+$x];
+    #     $data->{overflow}{x}[$x]  = $data->{bins}[-($data->{nbins1}+$x-2)];
+    #     }
+        
+      $data->{bins} = $d;
+      }
+    return $data;
+    }
+  }  
+  
+
+
+1;
index 4cb22f9827b51fb89f2a4fb7aac6ac456cde8d4b..6b08ee7ad05a29d72067bebf72b734b0f7b9a55d 100755 (executable)
@@ -12,30 +12,34 @@ use Time::HiRes qw(usleep time);
 use List::Util qw[min max sum];
 
 
-my $old;
-my $oldtime = time();
-my $time = time();
+my $oldtb;
 my $diff;
 my $iter = 0;
+my $vdiff;
 
 trb_init_ports() or die trb_strerror();
 
 my $regs = [[128,129,130,131,132,133],[136,137,138,139,141,142],[500,501,502,503,504,505],[176,177,178,179,180,181],[192,193,194,195,196,197],[600,601,602,603,604,605],[700,701,702,703,704,705]];
 
 while (1) {
-  my $o;
-     $o = trb_register_read_mem(0x10,0x9000,0,224);
+  
+  my $tb = trb_registertime_read_mem(0x10,0x9000,0,224);
 
-  if (defined $old) {
-    foreach my $b (keys %$o) {
+  my $inspill = $tb->{0x10}{value}[0x5d] >> 31;
+
+  if (defined $oldtb) {
+    foreach my $b (keys %$tb) {
+      my $tdiff = $tb->{$b}{time}[0] - ($oldtb->{$b}{time}[0]||0);
+      $tdiff += 2**16 if ($tdiff <= 0);
+      $tdiff = ($tdiff * 16 / 1E6) || 1;
       for my $v (0..223) {
-        my $tdiff = time() - $oldtime;
-        my $vdiff = ($o->{$b}->[$v]&0xffffff) - ($old->{$b}->[$v]&0xffffff);
-        if ($vdiff < 0) { $vdiff += 2**24;}
-        $diff->{$b}->[$v] = $vdiff/($tdiff||1);
+        $vdiff = ($tb->{$b}{value}[$v]&0xffffff) - ($oldtb->{$b}{value}[$v]&0xffffff);
+        $vdiff += 2**24 if ($vdiff < 0);
+        $diff->{$b}->[$v] = $vdiff/$tdiff;
         }
-      }  
-
+      }
+      
+      
     $diff->{0x10}[500] = $diff->{0x10}[$regs->[0][0]] + $diff->{0x10}[$regs->[1][0]];
     $diff->{0x10}[501] = $diff->{0x10}[$regs->[0][1]] + $diff->{0x10}[$regs->[1][1]];
     $diff->{0x10}[502] = $diff->{0x10}[$regs->[0][2]] + $diff->{0x10}[$regs->[1][2]];
@@ -56,7 +60,10 @@ while (1) {
     $diff->{0x10}[703] = $diff->{0x10}[$regs->[4][3]] / ($diff->{0x10}[$regs->[2][3]]||1) * 100;
     $diff->{0x10}[704] = $diff->{0x10}[$regs->[4][4]] / ($diff->{0x10}[$regs->[2][4]]||1) * 100;
     $diff->{0x10}[705] = $diff->{0x10}[$regs->[4][5]] / ($diff->{0x10}[$regs->[2][5]]||1) * 100;    
-        
+    
+    $diff->{0x10}[800] = sum(@{$diff->{0x10}}[56..63]) + sum(@{$diff->{0x10}}[72..79]); #sum from start
+# print Dumper @{$diff->{0x10}}[56..63];
+    
     
     my $str  = Hmon::MakeTitle(8, 8, "Coincidences",1);
     $str .= "<table style=\"margin:auto;\"><tr><th style=\"width:80px\">TOF<th style=\"width:80px\">RPC<th style=\"width:80px\">Sum<th style=\"width:80px\">iTOF<th style=\"width:80px\">Coincidences<th style=\"width:80px\">Coin %<th style=\"width:80px\">Coin/TOFRPC";
@@ -70,23 +77,24 @@ while (1) {
       }
     $str .= "</table><br>";
     
-    $str .= "<p>iTOF/TofRpc coincidence, mult 2<br>";
-    $str .= QA::SciNotation($diff->{0x10}[209]);
+    $str .= box("iTOF/TofRpc coincidence, mult 2",240). box(QA::SciNotation($diff->{0x10}[209]))."<br/>";
 
-    $str .= "<p>M2/Veto";
-    $str .= box(QA::SciNotation($diff->{0x10}[80]))."  ".box(QA::SciNotation($diff->{0x10}[25]))."  ".box(QA::SciNotation($diff->{0x10}[80]/$diff->{0x10}[25]||1));
     
+    $str .= box("M2/Veto")." ".box(QA::SciNotation($diff->{0x10}[80]))."  ".box(QA::SciNotation($diff->{0x10}[25]))."  ".box(QA::SciNotation($diff->{0x10}[80]/($diff->{0x10}[25]||1)))."<br/>";
+    $str .= box("M2/Start")." ".box(QA::SciNotation($diff->{0x10}[80]))."  ".box(QA::SciNotation($diff->{0x10}[800]))."  ".box(QA::SciNotation($diff->{0x10}[80]/($diff->{0x10}[800]||1)))."<br/>";
+    
+    $str .= "<div style=\"width:320px;display:inline-block;background:lightgreen;\">in spill</div>" if $inspill;
+
     
     $str .= Hmon::MakeFooter();
     Hmon::WriteFile("Triggerbox",$str);
     }
-    
-  $oldtime = time();
-  $old = $o;  
+  $oldtb = $tb;     
   usleep(500000);
   }
 
 
 sub box {
-  return "<div style=\"width:80px;display:inline-block;\">$_[0]</div>";
+  my $w = $_[1] || 80;
+  return "<div style=\"width:".$w."px;display:inline-block;\">$_[0]</div>";
        }
index 7dfc4e248c07b21b491e2afa262ee3c5bf8d5451..ccf0e9c291c1f6a7bd57790a6ae722df158d504f 100755 (executable)
@@ -20,7 +20,7 @@ my $offset = 2;
 my $last_rate_endp = 0;
 my $opt_addr = 3;    #CTS 
 my $error_ctr = 0;
-my $error_limit = 1;
+my $error_limit = 3;
 
 my $opt_debug =1;
 
index b0d8d2f47242158d268922b61538b41a1f29c527..99012e3e854f7d767e4c58e533000fee17fd2f1d 100755 (executable)
@@ -273,7 +273,7 @@ while(1) {
 
     my $qastate = QA::GetQAState('below',$num_mdc_missing,@QA::MdcEndpMissingLimits);
        $qastate = QA::ERROR  if $samechamberboards;
-       $qastate = QA::ERROR  if $mdcmissingtime > 250;
+       $qastate = QA::ERROR  if $mdcmissingtime > 360;
        $longtext .= "<br>Few boards missing, but for a long time. Better do a restart." if $mdcmissingtime > 1800;
        
     Hmon::Speak('mdcmissonce',"$num_mdc_missing MDC Frontends missing") if($qastate > 60 && $qastate < QA::ERROR );
old mode 100755 (executable)
new mode 100644 (file)
index 38fb3d5350fc7dfc298ef041444041b198e14506..cf832d8a7cd458721a08de2bd3a7771555b06ad6 100755 (executable)
@@ -39,7 +39,9 @@ sub getCorrectedValue {
 while (1) {
   my $rh_rate;
   $rh_rate = trb_register_read_mem(0x0003, 0xa001, 0, 0xff) or sleep 5 and next;
-
+  my $spillsignal = trb_register_read(0x10,0x905d);
+     $spillsignal = $spillsignal->{0x10} >> 31;
+  
   my %store;
   foreach my $board (sort {$a <=> $b} keys %$rh_rate) {
     my $ctr = 0xa001;
@@ -137,7 +139,8 @@ while (1) {
   my $oos;
   
   #Out of spill?
-  if($store{0xa02c} < 50) {
+#   if($store{0xa02c} < 50) {
+  if(!$spillsignal){
     for my $b (0xa029, 0xa02a, 0xa02b, 0xa024, 0xa009, 0xa03c, 0xa037, 0xa02c, 0xa028, 0xa025, 0xa026) {
       $offset->{$b} = ($offset->{$b}||0) + (($store{$b}||0) - ($offset->{$b}||0))/10;
       }
index 307c836d96bff43838ef625a323c8c932ea9437d..deb18699783bb474b5d35fd2582e37011c49a157 100755 (executable)
@@ -21,7 +21,7 @@ my $events = 0;
 my $spilllength = 0;
 my $lastres = 0;
 my $midlastres = 0;
-my $outofspill = 0;
+my $lastspillsignal = 0;
 my @spills;
 my $spillavgshort = 0;
 my $spillavglong = 0;
@@ -67,6 +67,8 @@ while (1) {
     $evtrate = 0 if $iter%2==0;
     my $trbneterr = 0;
     my $rh_result = trb_register_read(QA::CTSAddress, 0xa002) or $trbneterr = 1; #sleep 5 and next;
+    my $spillsignal = trb_register_read(0x10,0x905d);
+       $spillsignal = $spillsignal->{0x10} >> 31;
     my $stopped  = trb_register_read(0x3,0xa0c0) or sleep 5 and next;  
     $stopped = ($stopped->{3} || 0) & 0x400;
 
@@ -80,8 +82,8 @@ while (1) {
 #  my $spillcount = 0;
 #  my $inspill = 0;
 
-    $lastspill = $outofspill;
-    $outofspill = ($rh_result->{QA::CTSAddress} || 0) & 0x10;
+    $lastspill = $outofspill;
+    $outofspill = ($rh_result->{QA::CTSAddress} || 0) & 0x10;
     $spilllength++ if $iter%2==0; #if($outofspill);
     $rh_result = trb_register_read(0x0002, 0x01) or $trbneterr = 1; #sleep 5 and next;
 
@@ -105,7 +107,7 @@ while (1) {
        
        
 
-       if ($outofspill && !$lastspill) {
+       if (!$spillsignal && $lastspillsignal) {
            $spillcount++;
            push(@spills, $events);
            shift(@spills) if scalar @spills > 50;
@@ -145,7 +147,7 @@ while (1) {
 #                  Hmon::Speak('nobeam', "No beam");
 #                 }
               my $prefix = get ($url_prefix);
-             print Dumper $prefix;
+#            print Dumper $prefix;
              $prefix = "--" unless defined $prefix;            
               if(($prefix =~ '-1') || ($prefix =~ 'be')) {
                 Hmon::Speak('nobeam', "No beam") unless $opt_debug>0;
@@ -153,7 +155,7 @@ while (1) {
                 
               }
        }
-
+  $lastspillsignal = $spillsignal;
        $qashort = sprintf(" %i ", $evtrate);
        $qastate = QA::OK;
        
index 992397c57152e0b4527de47a54608ce9a0b6d976..6229b50c4f55ace6f429fba21d792c3be19a4b19 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
 
 use warnings;
 use strict;
@@ -403,19 +403,38 @@ my $trbnet_endpoint_offset = 0x5000; #20480
 # Spill variables
 my @totalDetectorHitsX_0;
 my @totalDetectorHitsY_0;
+my @totalDetectorHitsX_1;
+my @totalDetectorHitsY_1;
 my $spillThreshold = 1000; # threshold of rate in detector signaling the End of the Spill
 my $samplesPerSecond =10;
 
 my @lastspills_x_0;
 my @lastspills_y_0;
+my @lastspills_x_1;
+my @lastspills_y_1;
+
 
 my $time_x_0 = 0;
 my $time_y_0 = 0;
+my $time_x_1 = 0;
+my $time_y_1 = 0;
 
 my $empties_x_0 = 0;
 my $empties_y_0 = 0;
+my $empties_x_1 = 0;
+my $empties_y_1 = 0;
+
+
 my($max_x_0, $duty_x_0, $total_x_0, $spillmin_x_0, $spillmax_x_0, $spillavg_x_0, $flucqual_x_0, $offtime_x_0, $length_x_0, $spillEnds_x_0) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0);
 my($max_y_0, $duty_y_0, $total_y_0, $spillmin_y_0, $spillmax_y_0, $spillavg_y_0, $flucqual_y_0, $offtime_y_0, $length_y_0, $spillEnds_y_0) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0);
+
+my($max_x_1, $duty_x_1, $total_x_1, $spillmin_x_1, $spillmax_x_1, $spillavg_x_1, $flucqual_x_1, $offtime_x_1, $length_x_1, $spillEnds_x_1) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0);
+my($max_y_1, $duty_y_1, $total_y_1, $spillmin_y_1, $spillmax_y_1, $spillavg_y_1, $flucqual_y_1, $offtime_y_1, $length_y_1, $spillEnds_y_1) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0);
+
+my $maxTotalX;
+my $maxTotalY;
+
+
 my ($lastinspill,$inspill,$spillends) = (0,0,0);
 
 HPlot::PlotDrawFork('StartSpillSumX_0');
@@ -824,6 +843,18 @@ while(1) {
             shift(@totalDetectorHitsY_0) if scalar @totalDetectorHitsY_0 > 2000;
             $empties_y_0++ if ($sum_y_0 < 1000);
             
+            
+#             added W.K 01.02.22
+            push(@totalDetectorHitsX_1, $sum_x_1);
+            shift(@totalDetectorHitsX_1) if scalar @totalDetectorHitsX_1 > 2000; # makes sure that the array does not get huge. after 200 seconds of no beam, the last entries start to fall off 
+            $empties_x_1++ if ($sum_x_1 < 1000);
+            push(@totalDetectorHitsY_1, $sum_y_1);
+            shift(@totalDetectorHitsY_1) if scalar @totalDetectorHitsY_1 > 2000;
+            $empties_y_1++ if ($sum_y_1 < 1000);
+#             end added
+            
+            
+            
             my $sp = trb_register_read(0x10,0x905d); # check it
             $inspill = ($sp->{0x10} >> 31) & 1;
             $spillends = $inspill == 0 && $lastinspill == 1;
@@ -831,29 +862,60 @@ while(1) {
             if($spillends){
                 ($max_x_0, $duty_x_0, $total_x_0, $spillmin_x_0, $spillmax_x_0, $spillavg_x_0, $flucqual_x_0, $offtime_x_0, $length_x_0, $time_x_0, $empties_x_0, $spillEnds_x_0) = spillAnalysisACCSIG(\@totalDetectorHitsX_0, \@lastspills_x_0, $time_x_0, $empties_x_0);
                 
+                $maxTotalX= calculateMaximumRate(\@totalDetectorHitsX_0,\@totalDetectorHitsX_1);
+                $maxTotalY= calculateMaximumRate(\@totalDetectorHitsY_0,\@totalDetectorHitsY_1);
+                
                 @totalDetectorHitsX_0 = ();
                 
                 ($max_y_0, $duty_y_0, $total_y_0, $spillmin_y_0, $spillmax_y_0, $spillavg_y_0, $flucqual_y_0, $offtime_y_0, $length_y_0,$time_y_0, $empties_y_0, $spillEnds_y_0) = spillAnalysisACCSIG(\@totalDetectorHitsY_0, \@lastspills_y_0, $time_y_0, $empties_y_0);
                 
                 @totalDetectorHitsY_0 = ();
+                
+#                 added W.K. 01.2.22 to include values of whole detector in plots
+                ($max_x_1, $duty_x_1, $total_x_1, $spillmin_x_1, $spillmax_x_1, $spillavg_x_1, $flucqual_x_1, $offtime_x_1, $length_x_1, $time_x_1, $empties_x_1, $spillEnds_x_1) = spillAnalysisACCSIG(\@totalDetectorHitsX_1, \@lastspills_x_1, $time_x_1, $empties_x_1);
+                
+                @totalDetectorHitsX_1 = ();
+                
+                ($max_y_1, $duty_y_1, $total_y_1, $spillmin_y_1, $spillmax_y_1, $spillavg_y_1, $flucqual_y_1, $offtime_y_1, $length_y_1,$time_y_1, $empties_y_1, $spillEnds_y_1) = spillAnalysisACCSIG(\@totalDetectorHitsY_1, \@lastspills_y_1, $time_y_1, $empties_y_1);
+                
+                @totalDetectorHitsY_1 = ();
+
+# end added
+                
+                
+                
             }
             
             if($spillends){
                 # Start X
+#                 HPlot::PlotAdd("StartDutyFactorX_0", $duty_x_0,0);
+#                 HPlot::PlotAdd("StartSpillPeakX_0", $max_x_0,0);
+#                 HPlot::PlotAdd("StartSpillSumX_0", $total_x_0,0);
+                
+#                 changed W.K 01.02.22 max_x and total_x for whole detector
                 HPlot::PlotAdd("StartDutyFactorX_0", $duty_x_0,0);
-                HPlot::PlotAdd("StartSpillPeakX_0", $max_x_0,0);
-                HPlot::PlotAdd("StartSpillSumX_0", $total_x_0,0);
+                HPlot::PlotAdd("StartSpillPeakX_0", $maxTotalX,0);
+                HPlot::PlotAdd("StartSpillSumX_0", $total_x_0+$total_x_1,0);
+#                 end changed
                 
                 $str  = Hmon::MakeTitle(8, 19, "StartSpillShapeAnalysisX_0",1);
                 $str .= qq@<img width="600" src="%ADDPNG files/StartRateX_histbar.png%" type="image/png"><br>\n@;
                 $str .= qq@<img src="%ADDPNG files/StartDutyFactorX_0.png%" type="image/png"><br\>\n@;
                 $str .= qq@<img src="%ADDPNG files/StartSpillSumX_0.png%" type="image/png"><br\>\n@;
                 $str .= qq@<img src="%ADDPNG files/StartSpillPeakX_0.png%" type="image/png"><br\>\n@;
-                $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation($total_x_0);
+#                 $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation($total_x_0);
+                
+#                 changed W.K. 01.02.22 total spill sum total_x=total_x_1+total_x_0 
+                $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation( $maxTotalX);
+# end changed
+                
                 $str .= "<td>Last Duty<td>".sprintf("%0.3f",$duty_x_0);
                 $str .= "<tr><td>Last Duration<td>".$length_x_0;
                 $str .= "<td>Last Break<td>".$offtime_x_0." s";
-                $str .= "<tr><td>Last Max<td>".QA::SciNotation($max_x_0)." Hz (100ms)";
+#                 $str .= "<tr><td>Last Max<td>".QA::SciNotation($max_x_0)." Hz (100ms)";
+#                 changed W.K. 01.02.22 total max_x = max_x_0+max_x_1
+                $str .= "<tr><td>Last Max<td>".QA::SciNotation($maxTotalY)." Hz (100ms)";
+# end changed
                 $str .= "<td>Spill Fluctuation<td>".QA::SciNotation($spillmin_x_0)." - ".QA::SciNotation($spillmax_x_0)."<br>∅ ".QA::SciNotation($spillavg_x_0)." (".QA::SciNotation($flucqual_x_0).")";
                 $str .= "</table>";
                 $str .= Hmon::MakeFooter();
@@ -864,20 +926,36 @@ while(1) {
                 HPlot::PlotDrawFork('StartDutyFactorX_0');
                 
                 # Start Y
+#                 HPlot::PlotAdd("StartDutyFactorY_0", $duty_y_0,0);
+#                 HPlot::PlotAdd("StartSpillPeakY_0", $max_y_0,0);
+#                 HPlot::PlotAdd("StartSpillSumY_0", $total_y_0,0);
+#                 changed W.K 01.02.22
                 HPlot::PlotAdd("StartDutyFactorY_0", $duty_y_0,0);
-                HPlot::PlotAdd("StartSpillPeakY_0", $max_y_0,0);
-                HPlot::PlotAdd("StartSpillSumY_0", $total_y_0,0);
+                HPlot::PlotAdd("StartSpillPeakY_0",$maxTotalY,0);
+                HPlot::PlotAdd("StartSpillSumY_0", $total_y_0+$total_y_1,0);
+#                 end changed
+
+
+
                 
                 $str  = Hmon::MakeTitle(8, 19, "StartSpillShapeAnalysisY_0",1);
                 $str .= qq@<img width="600" src="%ADDPNG files/StartRateY_histbar.png%" type="image/png"><br>\n@;
                 $str .= qq@<img src="%ADDPNG files/StartDutyFactorY_0.png%" type="image/png"><br\>\n@;
                 $str .= qq@<img src="%ADDPNG files/StartSpillSumY_0.png%" type="image/png"><br\>\n@;
                 $str .= qq@<img src="%ADDPNG files/StartSpillPeakY_0.png%" type="image/png"><br\>\n@;
-                $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation($total_x_0);
+#                 $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation($total_x_0);
+
+#                 changed W.K. 01.02.22
+                $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation($maxTotalY);
+#                end changed
+
                 $str .= "<td>Last Duty<td>".sprintf("%0.3f",$duty_y_0);
                 $str .= "<tr><td>Last Duration<td>".$length_y_0;
                 $str .= "<td>Last Break<td>".$offtime_y_0." s";
-                $str .= "<tr><td>Last Max<td>".QA::SciNotation($max_y_0)." Hz (100ms)";
+#                 $str .= "<tr><td>Last Max<td>".QA::SciNotation($max_y_0)." Hz (100ms)";
+#                 changed W.K. 01.02.22
+                $str .= "<tr><td>Last Max<td>".QA::SciNotation($maxTotalY)." Hz (100ms)";
+# end changed
                 $str .= "<td>Spill Fluctuation<td>".QA::SciNotation($spillmin_y_0)." - ".QA::SciNotation($spillmax_y_0)."<br>∅ ".QA::SciNotation($spillavg_y_0)." (".QA::SciNotation($flucqual_y_0).")";
                 $str .= "</table>";
                 $str .= Hmon::MakeFooter();
@@ -1044,3 +1122,39 @@ sub spillAnalysisACCSIG{
 #     $lastinspill = $inspill;
 #     return (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
 }
+
+sub calculateMaximumRate{
+    my ($totalDetectorHitsReference_firstHalf,$totalDetectorHitsReference_secondHalf)=@_;
+    my @totalDetectorHitsFirstHalf = @{$totalDetectorHitsReference_firstHalf};
+    my @totalDetectorHitsSecondHalf = @{$totalDetectorHitsReference_secondHalf};
+    my $maximumRate =0;
+    
+    my $lengthOfArray=0;
+
+    my @sumOfTotalDetectorHits;
+    
+    my $lengthOfArrayFirstHalf = scalar @totalDetectorHitsFirstHalf;
+    my $lengthOfArraySecondHalf = scalar @totalDetectorHitsSecondHalf;
+     
+    if ($lengthOfArraySecondHalf == $lengthOfArrayFirstHalf && $lengthOfArraySecondHalf>0 ){
+          $lengthOfArray =   $lengthOfArrayFirstHalf;
+        for my $i (0..$lengthOfArray){
+            $sumOfTotalDetectorHits[$i]=0;     
+        }
+        for my $i (0..$lengthOfArray){
+            $sumOfTotalDetectorHits[$i]= $totalDetectorHitsFirstHalf[$i]+ $totalDetectorHitsSecondHalf[$i];     
+        }
+
+        $maximumRate = max(@sumOfTotalDetectorHits);
+        
+    }
+    
+    return $maximumRate;
+    
+
+}
+
+
+
+
+
diff --git a/hmon/hmon_triggerratio.pl b/hmon/hmon_triggerratio.pl
new file mode 100755 (executable)
index 0000000..2e74321
--- /dev/null
@@ -0,0 +1,140 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+use Data::Dumper;
+use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Time::HiRes qw(usleep time);
+use List::Util qw[min max sum];
+
+my $STARTRATELIMIT = 50000;
+my $UPPERLIMIT = 0.03;
+my $oldtb;
+my $diff;
+my $iter = 0;
+my $vdiff;
+
+HPlot::PlotInit({
+    name    => "M2StartRatio",
+    file    => "files/M2StartRatio",
+    entries => 1000,
+    type    => HPlot::TYPE_HISTORY,
+    output  => HPlot::OUT_PNG,
+    xlabel  => "Time",
+    ylabel  => "Ratio",
+    sizex   => 950,
+    sizey   => 330,
+    ymin    => -0.001,
+    ymax    => "$UPPERLIMIT"."1",
+    xscale  => 5,
+    curves  => 2,
+    buffer  => 1,
+    nokey   => 1,
+    dots    => 1,
+    storable => 1,
+    });   
+
+HPlot::PlotInit({
+    name    => "M2Rate",
+    file    => "files/M2Rate",
+    entries => 1000,
+    type    => HPlot::TYPE_HISTORY,
+    output  => HPlot::OUT_PNG,
+    xlabel  => "Time",
+    ylabel  => "Rate",
+    sizex   => 950,
+    sizey   => 330,
+    ymin    => -0.001,
+    ymax    => "1E5<*",
+    xscale  => 5,
+    curves  => 2,
+    buffer  => 1,
+    nokey   => 1,
+#     dots    => 1,
+    storable => 1,
+    });       
+    
+my $str  = Hmon::MakeTitle(12, 7, "M2 / Start Ratio",0);
+   $str .= qq@<img src="%ADDPNG files/M2StartRatio.png%" type="image/png"><br>\n@;
+   $str .= Hmon::MakeFooter();
+   Hmon::WriteFile("M2StartRatio",$str);
+    
+   $str  = Hmon::MakeTitle(12, 7, "M2 Rate",0);
+   $str .= qq@<img src="%ADDPNG files/M2Rate.png%" type="image/png"><br>\n@;
+   $str .= Hmon::MakeFooter();
+   Hmon::WriteFile("M2Rate",$str);        
+    
+trb_init_ports() or die trb_strerror();
+
+
+while (1) {
+  my $tb = trb_registertime_read_mem(0x10,0x9000,0,224);
+
+  my $inspill = $tb->{0x10}{value}[0x5d] >> 31;
+
+  if (defined $oldtb) {
+    foreach my $b (keys %$tb) {
+      my $tdiff = $tb->{$b}{time}[0] - ($oldtb->{$b}{time}[0]||0);
+      $tdiff += 2**16 if ($tdiff <= 0);
+      $tdiff = ($tdiff * 16 / 1E6) || 1;
+      for my $v (0..223) {
+        $vdiff = ($tb->{$b}{value}[$v]&0xffffff) - ($oldtb->{$b}{value}[$v]&0xffffff);
+        $vdiff += 2**24 if ($vdiff < 0);
+        $diff->{$b}->[$v] = $vdiff/$tdiff;
+        }
+      }
+  
+    my $start = sum(@{$diff->{0x10}}[56..63]) + sum(@{$diff->{0x10}}[72..79]); #sum from start
+    my $m2    = $diff->{0x10}[0x50];
+
+    my $ratio = $m2/($start||1);
+    if  ($start <= $STARTRATELIMIT || !$inspill) {
+      HPlot::PlotAdd("M2StartRatio",0,1);
+      HPlot::PlotAdd("M2StartRatio","NaN",0)
+      }
+    elsif     ($ratio >= $UPPERLIMIT) {
+      HPlot::PlotAdd("M2StartRatio",$UPPERLIMIT,1);
+      HPlot::PlotAdd("M2StartRatio","NaN",0)
+      }
+    
+    else {
+      HPlot::PlotAdd("M2StartRatio","NaN",1);
+      HPlot::PlotAdd("M2StartRatio",$ratio,0)
+      }
+
+      
+    if  (!$inspill) {
+      HPlot::PlotAdd("M2Rate",0,1);
+      HPlot::PlotAdd("M2Rate","NaN",0)
+      }
+#     elsif     ($ratio >= $UPPERLIMIT) {
+#       HPlot::PlotAdd("M2StartRatio",$UPPERLIMIT,1);
+#       HPlot::PlotAdd("M2StartRatio","NaN",0)
+#       }
+    else {
+      HPlot::PlotAdd("M2Rate","NaN",1);
+      HPlot::PlotAdd("M2Rate",$m2,0)
+      }
+      
+      
+    if($iter++ == 5){
+      HPlot::PlotDrawFork("M2StartRatio");
+      HPlot::PlotDrawFork("M2Rate");
+      $iter = 0;
+      }
+    }
+    
+  $oldtb = $tb;
+  usleep(200000);
+  }
+
+
+sub box {
+  my $w = $_[1] || 80;
+  return "<div style=\"width:".$w."px;display:inline-block;\">$_[0]</div>";
+       }
index c580ccdce5698c6024fa3314ae112e04c5223439..4169801ddaafbe7643c3f318dde22bee53316a68 100755 (executable)
@@ -38,34 +38,35 @@ function openwin(url) {
 </ul></div>
 
 <div class="linkbox" style="float:right"><h4>Documents</h4><ul>
-<li><a href="phonenumbers.jpg">Phone Numbers</a>
+<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/hadesoperator.pdf" style="color:#d33">Operator manual</a>
 <li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/networkaddresses.pdf">DAQ FEE Addresses</a>
-<li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/qadocu.pdf">QA manual</a>
-<li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/hadesoperator.pdf">Operator manual</a>
+<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/HadesNotes.pdf">Drawings and Notes from the Logbook</a>
+<li><a href="phonenumbers.jpg">Phone Numbers</a>
 <li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.form_selection">Beamtime Logbook</a></li>
 <li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hshiftcrews2.form_select">Shift Crew</a></li>
-<li class="outdated"><a href="/mon/daqoperatornotes.pdf">DAQ Operator Notes</a>
+<li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/qadocu.pdf">QA manual</a>
 </div>
 
+<div class="linkbox" style="width:730px;"><h4>Operator Monitor - the "must-have" windows</h4><ul>
+<li style="width:600px;"><a href="monitor.cgi?1-window-QA">Main Screen 0</a> Tactical Overview
+<li style="width:600px;"><a href="monitor.cgi?1-window9x27-busyhist-eventratelong-eventrateshort-StartBars">Main Screen 1</a> Eventrate & Busy
+<li style="width:600px;"><a href="monitor.cgi?1-window8x26-busy-DutyFactor-Pt3AcceptRatio-EvtsPerSpill-StartCountSpill">Main Screen 2</a> Spill Info
+<li style="width:600px;"><a href="monitor.cgi?1-window14x14-EBSummary-hldlast-CTSRates">Main Screen 3</a> EBs</li>
+<li style="width:600px;"><a href="monitor.cgi?2-window18x16-EcalSimpleRate-RpcRate-StsRate-TofRate-ItofRate-StartRateSimple-FrpcRate">Main Screen 4</a> Tof Rpc STS Ecal iTOF fRPC Start rates</li>
+<li style="width:600px;"><a href="monitor.cgi?2-window13x16-StartRateNumbers-HodoRate-ItofRateNumbers">Main Screen 5</a> Positional map for Start Veto iTOF</li>
+</ul></div>
+
 <div class="linkbox" style="clear:both;width:730px;"><h4>Other Ressources</h4><ul>
 <li><a href="/qaweb">QA Plots (web-based)</a>
 <li><a href="files/qa.htm">QA Plots (updated every 5 minutes)</a></li>
 <li><a href="files/vertex.htm">Vertex Plots (updated after each file)</a></li>
-<li class="outdated"><a href="../spillmon/?browser=no&monitoring=1000&layout=grid4x4&items=[%22EventBuilder/Run/HLD/HLD_HitsFast%22,%22EventBuilder/Run/HLD/HLD_HitsSlow%22,%22EventBuilder/Run/HLD/HLD_TrendX%22,%22EventBuilder/Run/HLD/HLD_TrendY%22,%22EventBuilder/Run/HLD/HLD_BeamX%22,%22EventBuilder/Run/HLD/HLD_BeamY%22,%22EventBuilder/Run/HLD/HLD_VETO_Patt%22,%22EventBuilder/Run/HLD/HLD_QSlow%22,%22EventBuilder/Run/HLD/HLD_HALO_Patt%22,%22EventBuilder/Run/HLD/HLD_XHALOSlow%22,%22EventBuilder/Run/HLD/HLD_YHALOSlow%22,%22EventBuilder/Run/HLD/HLD_LastSpill_Q_factor%22]">Beam Properties</a></li>
+<!--<li class="outdated"><a href="../spillmon/?browser=no&monitoring=1000&layout=grid4x4&items=[%22EventBuilder/Run/HLD/HLD_HitsFast%22,%22EventBuilder/Run/HLD/HLD_HitsSlow%22,%22EventBuilder/Run/HLD/HLD_TrendX%22,%22EventBuilder/Run/HLD/HLD_TrendY%22,%22EventBuilder/Run/HLD/HLD_BeamX%22,%22EventBuilder/Run/HLD/HLD_BeamY%22,%22EventBuilder/Run/HLD/HLD_VETO_Patt%22,%22EventBuilder/Run/HLD/HLD_QSlow%22,%22EventBuilder/Run/HLD/HLD_HALO_Patt%22,%22EventBuilder/Run/HLD/HLD_XHALOSlow%22,%22EventBuilder/Run/HLD/HLD_YHALOSlow%22,%22EventBuilder/Run/HLD/HLD_LastSpill_Q_factor%22]">Beam Properties</a></li>-->
 <li class="outdated"><a href="http://lxhadeb06/icinga">Icinga Server Monitoring (local access only)</a>
 <li><a href="/calib">Calibration Monitor</a>
 <li><a href="../munin">Munin Server Monitoring</a></li>
 <li style="width:600px;"><a href="archive/?C=M;O=D">Archive of Hmon Windows (updated every 10 minutes)</a></li>
 </ul></div>
 
-<div class="linkbox" style="width:730px;"><h4>Operator Monitor - the "must-have" windows</h4><ul>
-<li style="width:600px;"><a href="monitor.cgi?1-window-QA">Main Screen 0</a> Tactical Overview
-<li style="width:600px;"><a href="monitor.cgi?1-window9x27-busyhist-eventratelong-eventrateshort-StartBars">Main Screen 1</a> Eventrate & Busy
-<li style="width:600px;"><a href="monitor.cgi?1-window8x26-busy-DutyFactor-Pt3AcceptRatio-EvtsPerSpill-StartCountSpill">Main Screen 2</a> Spill Info
-<li style="width:600px;"><a href="monitor.cgi?1-window14x14-EBSummary-hldlast-CTSRates">Main Screen 3</a> EBs</li>
-<li style="width:600px;"><a href="monitor.cgi?2-window18x16-EcalSimpleRate-RpcRate-StsRate-TofRate-ItofRate-StartRateSimple-FrpcRate">Main Screen 4</a> Tof Rpc STS Ecal iTOF fRPC Start rates</li>
-<li style="width:600px;"><a href="monitor.cgi?2-window13x16-StartRateNumbers-HodoRate-ItofRateNumbers">Main Screen 5</a> Positional map for Start Veto iTOF</li>
-</ul></div>
 
 <div class="linkbox" style="clear:both"><h4>DAQ Network</h4><ul>
 <li><a href="monitor.cgi?1-window-hubmon">Hub Monitor</a></li>
@@ -77,10 +78,11 @@ function openwin(url) {
 
 <div class="linkbox" style="float:right"><h4>Trigger</h4><ul>
 <li><a href="monitor.cgi?1-window-CTSRates">Rates on CTS Trigger I/O</a></li>
+<li><a href="monitor.cgi?1-window-Triggerbox">Trigger rates by sector and detector</a></li>
 <li><a href="monitor.cgi?1-window-eventrateshort">Eventrate histogram (10s)</a></li>
 <li><a href="monitor.cgi?1-window-eventrate">Eventrate histogram (60s)</a></li>
 <li><a href="monitor.cgi?5-window-eventratelong">Eventrate histogram (10m)</a></li>
-<li class="outdated"><a href="monitor.cgi?10-window-StartCountSpill">Start counts per spill</a></li>
+<li><a href="monitor.cgi?10-window-StartCountSpill">Start counts per spill</a></li>
 <li><a href="monitor.cgi?10-window-Pt3AcceptRatio">Ratio of accepted PT3 per spill</a></li>
 <li><a href="monitor.cgi?10-window-EvtsPerSpill">Recorded events per spill</a></li>
 <!--<li><a href="monitor.cgi?5-window-Vetohist">Veto hit count histograms</a></li>-->
@@ -105,13 +107,16 @@ function openwin(url) {
  </ul></div> -->
 
 <div class="linkbox" style="float:left"><h4>Start</h4><ul>
-<li class="outdated"><a href="monitor.cgi?1-window-StartRate">Rates for all Start / Veto (histo)</a></li>
+<!-- <li class="outdated"><a href="monitor.cgi?1-window-StartRate">Rates for all Start / Veto (histo)</a></li>
 <li class="outdated"><a href="monitor.cgi?1-window-StartRateBars">Rates for all Start / Veto (histo,bargraph)</a></li>
 <li class="outdated"><a href="monitor.cgi?1-window-StartBars">Rates for all Start / Veto (bargraph) </a></li>
 <li class="outdated"><a href="monitor.cgi?1-window-VetoHalo">Rates for Veto &amp; HALO</a></li>
 <li><a href="monitor.cgi?1-window12x8-StartRateSimple-HodoRate">Beam Position</a></li>
-<li class="outdated"><a href="monitor.cgi?1-window-SpillStructure">Spill Structure from Start</a></li>
-<li class="outdated"><a href="monitor.cgi?1-StartRateBars-StartBars-StartPosition-VetoHalo-ForwardQuartz">Beam Summary</a></li>
+<li class="outdated"><a href="monitor.cgi?1-window-SpillStructure">Spill Structure from Start</a></li>  -->
+<li><a href="monitor.cgi?6-StartRateNumbers-StartPosition-StartPositionRMS">Start position</a></li>
+<li><a href="monitor.cgi?6-StartSpillShapeAnalysisX_0-StartSpillShapeAnalysisY_0">Spill Structure from Start</a></li>
+<li><a href="monitor.cgi?6-StartRateX_histbar-StartRateY_histbar">Start rate (histbar)</a></li>
+<!-- <li class="outdated"><a href="monitor.cgi?1-StartRateBars-StartBars-StartPosition-VetoHalo-ForwardQuartz">Beam Summary</a></li> -->
 </ul></div>
 
 <div class="linkbox" style="float:right"><h4>ECal</h4><ul>
@@ -167,6 +172,13 @@ function openwin(url) {
 <li><a href="/daqtools/tools/beamabort.pl">Beam Abort</a></li>
 </ul></div>
 
+<div class="linkbox" style="float:left"><h4>Beam</h4><ul>
+<li><a href="monitor.cgi?2-window13x21-QFactor-MicroSpillStructure">QFactor & Micro Structure</a></li>
+<li><a href="monitor.cgi?2-window-StarX_spill">Spill Macro Structure</a></li>
+<li><a href="monitor.cgi?1-StartRateNumbers-StartPosition-ItofRateNumbers-StartPositionRMS-HodoRate-QFactor-CTSRates-MicroSpillStructure-StartSpillShapeAnalysisY_0">Beam plots collection similar to HKR</a></li>
+
+</ul></div>
+
 
 $;
 
@@ -175,7 +187,7 @@ print "<h3 style=\"clear:both;padding-top:30px;\">All available options</h3><ul
 my @o = qx(ls -1 files/*.htt);
 foreach my $a (@o) {
   if ($a =~ m%files/(\w+).htt%) {
-    print "<li><a href=\"monitor.cgi?2-window-$1\">$1</a></li>\n";</li>
+    print "<li><a href=\"monitor.cgi?6-window-$1\">$1</a></li>\n";</li>
                }
        }
 print "</ul><br>\n";
@@ -186,20 +198,13 @@ print qq$
 To select the information you want to have, specify any number of the options listed below, separated with '-' after the \"monitor.cgi?\".<p/>
 <ul><li>The first option for monitor.cgi may be a number specifying the update rate in seconds.</li>
 <li>The first or second option may be \"window\" to open the information in a pop-up with no toolbars and proper sizes. Note that only the first information box is used to determine the size - i.e. if there are two boxes to be shown, you  have to resize the window by hand. One remark: to work properly, you have to set all dom.disable_window_open* options in about:config to false.</li>
-<li>Everything is tested in the latest version (5 and above, not 2 or 3!) of the Firefox browser - there will be no support for any other kind of html-viewer.</li>
-</ul>
-<h5>Hints</h5>
-<ul><li>Window background will turn red if no update is possible. </li>
-<li>If you see a message "Server Error", press F5. </li>
-<li>If you want to stop updating, press Esc. </li>
-<li>To restart updating, press F5.</li>
-<li>Zoom in and out with Ctrl++ and Ctrl+-, normal zoom with Ctrl+0.</li>
 </ul>
 
 <h5>Examples</h5>
-<ul><li><a href="monitor.cgi?logfile-busy">monitor.cgi?logfile-busy</a></li>
-<li><a href="monitor.cgi?2-PTrates-busy">monitor.cgi?PTrates-busy</a></li>
-<li><a href="monitor.cgi?10-window-MDCRates">monitor.cgi?10-MDCRates</a></li>
+<ul><li><a href="monitor.cgi?10-window-logfile">monitor.cgi?window-logfile</a> Opens a box in a new window</li>
+<li><a href="monitor.cgi?2-PTrates-busy">monitor.cgi?PTrates-busy</a> Opens a tab with 2 boxes</li>
+<li><a href="monitor.cgi?10-window-MDCRates">monitor.cgi?10-MDCRates</a> Opens a tab with 2 boxes and updates every 10 seconds</li>
+<li><a href="monitor.cgi?2-window13x16-StartRateNumbers-HodoRate-ItofRateNumbers">monitor.cgi?2-window13x16-StartRateNumbers-HodoRate-ItofRateNumbers</a> Opens a window with the given size, manually adjusted to the size of the included boxes</li>
 </ul>
 
 </body>
index 174430b45a31af88eeebb0a0a29e7fa0176029b0..d625e625ce4db9e1fcb6fb65ac69772b9ab6e12a 100755 (executable)
@@ -57,7 +57,7 @@ my @args = split('-',$ENV{'QUERY_STRING'});
     }
   else {
     document.write("Can't open pop-up window. Please disable pop-up blocker. Starting monitor inline...");
-    setTimeout('window.location.href = "$newurl"',1000);
+    setTimeout('window.location.href = "$newurl"',2000);
     }
 </script>
 #;
index a222b7b3fccec27339e42eb25d2810e43de9c8a6..a371bfca4e0a0bb64e1e075d0b0fe15d353ebf3b 100644 (file)
@@ -89,15 +89,16 @@ my $iter = 0;
 
 while(1) {
 
-  my $o = trb_registertime_read_mem(0xfe74,0xc000,0,49);
+  my $o = trb_registertime_read_mem(0xfe76,0xdfc0,0,24);
   
 #Just the usual calculation of differences on counters & normalization based on time between reads.
   if (defined $old) {
     foreach my $b (keys %$o) {
+      next if ($b > 0x5003);
       my $tdiff = $o->{$b}{time}->[0] - ($oldtime->{$b}||0);
          $tdiff += 2**16 if $tdiff < 0;
          $tdiff *= 16;
-      for my $v (0..16) {
+      for my $v (0..23) {
         my $vdiff = ($o->{$b}{value}[$v]&0xfffffff) - ($old->{$b}{value}[$v]&0xfffffff);
            $vdiff += 2**28 if $vdiff < 0;
         $diff->{$b}[$v] = $vdiff/($tdiff||1E6)*1E6;
@@ -108,9 +109,11 @@ while(1) {
       
 #sum strips & store    
     my $sum = 0;
-    for my $c (1..47) {
+    for my $c (1..23) {
       $sum += $diff->{0x5000}[$c] if ($diff->{0x5000}[$c]);
       $sum += $diff->{0x5001}[$c] if ($diff->{0x5001}[$c]);
+      $sum += $diff->{0x5002}[$c] if ($diff->{0x5002}[$c]);
+      $sum += $diff->{0x5003}[$c] if ($diff->{0x5003}[$c]);
       }
       
 # $sum = $dummy[$iter++];    #You can't do that on stage
@@ -141,9 +144,9 @@ while(1) {
       HPlot::PlotAdd("DutyFactor",$duty,0);
       HPlot::PlotAdd("SpillSum",  $total,0);
       HPlot::PlotAdd("SpillPeak", $max,0);
-      HPlot::PlotDraw('DutyFactor');
-      HPlot::PlotDraw('SpillSum');
-      HPlot::PlotDraw('SpillPeak');
+      HPlot::PlotDrawFork('DutyFactor');
+      HPlot::PlotDrawFork('SpillSum');
+      HPlot::PlotDrawFork('SpillPeak');
       
       my $length = sprintf("%0.1f s (%i samples)",time()-$time,$samples);
       my $offtime = $empties/(1E6/$sampletime);
index 0967d07e94c4626b428338322959818dd2bbdd3c..56e6d5a9576ec334bd5188eaeb5cb1b07ec0da67 100755 (executable)
@@ -36,7 +36,7 @@ HPlot::PlotInit({
 HPlot::PlotInit({
     name    => "StartRateXhistbar",
     file    => "files/StartRateXhistbar",
-    entries => 200,
+    entries => 2000,
     type    => HPlot::TYPE_BARGRAPH,
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7","8","9","10","11"],
@@ -45,7 +45,7 @@ HPlot::PlotInit({
     sizex   => 950,
     sizey   => 330,
     xmin    => 0,
-    xmax    => 200,
+    xmax    => 2000,
     ymin    => "0",
     ymax    => "100<*",
     curves  => 12,
index e124c9a0412ab1b14e8eda2709f3f211f79c12ce..c31356b1a514bbd539e7be4e2898992491bb57c9 100755 (executable)
@@ -55,7 +55,7 @@ my $time;
 
 while(1) {
   my $filetype = get("http://lxhadeb12:8099/Master/BNET/RunPrefix/get.json?field=%22value%22");
-  if ($filetype =~ /be/ || $filetype =~ /co/ || ($ARGV[0] && $ARGV[0] eq 'once')) {
+  if ($filetype =~ /be/ || $filetype =~ /co/ || ($ARGV[0] && $ARGV[0] eq 'once') || time() < 1646477522) {
 
 
     $time = strftime("%Y%m%d%H%M",localtime());
index 4731d1c326b4f3616861d7d78e34aedd8155bc41..f0d1899ade4701d74efc8e17dbebf70288e3febd 100755 (executable)
@@ -32,6 +32,8 @@ Perl2Epics::Connect("fRPC_Temp" ,"HAD:fRPC:heater:T");
 
 print "Connected.\n";
 
+my $temperature=0;
+
 while(1) {
 
   my $data = Perl2Epics::GetAll();
@@ -49,7 +51,7 @@ while(1) {
     , $data->{"fRPC4_I"}->{val}/1e6 || 0
   );  
   
-  my $temperature = $data->{"fRPC_Temp"}->{val} || 0;
+     $temperature = $data->{"fRPC_Temp"}->{val} if $data->{"fRPC_Temp"}->{val} < 80;
   my $temperature_s = sprintf("%.1f",$temperature);
   
   my $max_V = max(@V);
old mode 100644 (file)
new mode 100755 (executable)
index 6db8d2bbb900390c40f04a2f6409c085ad3fb640..4019a2c42b16a4b54d67c33eabf30c996e63e230 100755 (executable)
@@ -26,6 +26,7 @@ if(!$connect_status) {
 my $currenterr = 0;
 my $currenterrtimer = 0;
 my $spikeString = "";
+my @errortimer = ();
 
 ###########
 #Change 3 for-loops to include all four planes again!
@@ -181,9 +182,12 @@ while(1) {
 #  my $logString = strftime("%Y.%m.%d %H:%M:%S",localtime())."\t";
   my @mdcHvMin;
   my @mdcHvMax;
+  my @qastate_chamber;
   my $qastate = QA::OK;
+  my $chamberswitherror = 0;
   for my $p (1..4) {
     for my $s (1..6) {
+      my $chamnum = ($p-1)*6+$s-1;
       for my $i (0..1) {
         my $volt = $data->{"$p-$s-$i-V"}->{val};
         my $current = $data->{"$p-$s-$i-I"}->{val};
@@ -193,24 +197,43 @@ while(1) {
         if(! defined $mdcHvMax[$p] || $mdcHvMax[$p] < $volt) {
           $mdcHvMax[$p] = $volt;
           }
-#       if($p>2) {
-#      $logString .= " ".$volt." ".$current."  ";
-#      }
-       if($current > 90.0 || (!($p == 2 && $s == 4) &  $current > 80.0) ) {
-                $spikeString .= "P$p S$s F/C $i: HV = ".$volt." , I = ".$current."  -  ".localtime()."\n"; 
-         $currenterr++;
-         }
+
+        if($current > 90.0 || (!($p == 2 && $s == 4) && $current > 80.0) ) {
+          $spikeString .= "P$p S$s F/C $i: HV = ".$volt." , I = ".$current."  -  ".localtime()."\n"; 
+          $currenterr++;
+          }
+        }
+        
+      my $ch_qastate   = QA::OK;
+      my $chamberHVmin = min($data->{"$p-$s-0-V"}->{val},$data->{"$p-$s-1-V"}->{val});
+      
+      if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][0]) {$qastate = max($qastate,QA::WARN);}
+      if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][1]) {$qastate = max($qastate,QA::WARN_2);}
+      if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][2]) {$qastate = max($qastate,QA::ERROR);}
+      
+      if ($ch_qastate >= QA::WARN_2) {
+        $errortimer[$chamnum]++;
+        $ch_qastate = QA::ERROR  if $errortimer[$chamnum] > 220 ;
+        $ch_qastate = QA::WARN_2 if $errortimer[$chamnum] <= 220 ;
+        $chamberswitherror++     if $errortimer[$chamnum] > 10 ;
+        }
+      else {
+        $errortimer[$chamnum] = 0;
         }
+      push(@qastate_chamber,$ch_qastate);
+        
       }
-    if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits->[$p-1][0]) {$qastate = max($qastate,QA::WARN);}
-    if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits->[$p-1][1]) {$qastate = max($qastate,QA::WARN_2);}
-    if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits->[$p-1][2]) {$qastate = max($qastate,QA::ERROR);}
-    if($mdcHvMin[$p] < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][0]) {$qastate = max($qastate,QA::WARN);}
-    if($mdcHvMin[$p] < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][1]) {$qastate = max($qastate,QA::WARN_2);}
-    if($mdcHvMin[$p] < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][2]) {$qastate = max($qastate,QA::ERROR);}
+      if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits->[$p-1][0]) {$qastate = max($qastate,QA::WARN);}
+      if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits->[$p-1][1]) {$qastate = max($qastate,QA::WARN_2);}
+      if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits->[$p-1][2]) {$qastate = max($qastate,QA::ERROR);}
+
     }
+  $qastate = max($qastate,@qastate_chamber);  
+  $qastate = max($qastate,($chamberswitherror>1)?QA::ERROR:QA::OK);
   $qastate = min($qastate,$QA::MdcHvOff?QA::NOTE:200);    
+  
+  
   my $value    = 
 sprintf("%.1f/%.1f/%.1f/%.1f",$mdcHvMin[1]/1000.,$mdcHvMin[2]/1000.,$mdcHvMin[3]/1000.,$mdcHvMin[4]/1000.);
   my $longtext = sprintf("MDC high voltage in all four planes".
index b3e176dc06f7a5d40e5f81cf237f054033ec0939..111364f7acf81c61f323a5254eb5f20d6b22a87f 100755 (executable)
@@ -27,13 +27,13 @@ HPlot::PlotInit({
     entries => 1000,
     type    => HPlot::TYPE_HISTORY,
     output  => HPlot::OUT_PNG,
-    titles  => ["low vacuum [mbar]"],
+    titles  => ["low vacuum [1E-7 mbar]"],
     xlabel  => "Minutes",
     ylabel  => "",
     sizex   => 600,
     sizey   => 250,
-    ymin    => "94",
-    ymax    => "100",
+    ymin    => "60",
+    ymax    => "150",
     curves  => 1,
     xscale  => 6,
     buffer  => 1,
@@ -49,8 +49,8 @@ HPlot::PlotInit({
     titles  => ["high vacuum [1E-7 mbar]",],
     xlabel  => "Minutes",
     ylabel  => "",
-    ymin    => "*<3",
-    ymax    => "3.4<*",
+    ymin    => "*<3",
+    ymax    => "3.4<*",
     sizex   => 600,
     sizey   => 250,
     curves  => 1,
@@ -261,8 +261,9 @@ Perl2Epics::Connect("coolingWaterTemp","HAD:MDC:cooling:air:temp");
 Perl2Epics::Connect("p1CO2","HAD:MDC:GAS:CO2:concentration:average");
 Perl2Epics::Connect("p2CO2","HAD:MDC:GAS:CO2:concentration2:average");
 
-Perl2Epics::Connect("Vachigh","HAD:VAC:tpg366-1:ch1");
-Perl2Epics::Connect("Vaclow" ,"HAD:VAC:tpg366-1:ch2");
+Perl2Epics::Connect("Vachigh","HAD:VAC:tpg366-1:ch4");
+Perl2Epics::Connect("Vaclow" ,"HAD:VAC:tpg366-1:ch1");
+Perl2Epics::Connect("Gate" ,"HAD:VAC:beamlineGate");
 
 print "Connected.\n";
 
@@ -370,7 +371,7 @@ while(1) {
       }
     }
     
-  HPlot::PlotAdd("VacuumLow",$data->{"Vaclow"}->{val},0);  
+  HPlot::PlotAdd("VacuumLow",$data->{"Vaclow"}->{val}*1E7,0);  
   HPlot::PlotAdd("VacuumHigh",$data->{"Vachigh"}->{val}*1E7,0);  
   HPlot::PlotDraw("VacuumLow");  
   HPlot::PlotDraw("VacuumHigh");  
@@ -378,8 +379,14 @@ while(1) {
   $str = Hmon::MakeTitle(8,12,"Vacuum",0);
   $str .= qq@<img src="%ADDPNG files/VacuumHigh.png%" type="image/png">\n@;
   $str .= qq@<img src="%ADDPNG files/VacuumLow.png%" type="image/png"><br>@;
-  $str .= sprintf("Low Vacuum %.2f mbar</br>",$data->{"Vaclow"}->{val});
-  $str .= sprintf("High Vacuum %.2fE-7 mbar",$data->{"Vachigh"}->{val}*1E7);
+  $str .= sprintf("Low Vacuum %.2fE-7 mbar</br>",$data->{"Vaclow"}->{val}*1E7);
+  $str .= sprintf("High Vacuum %.2fE-7 mbar</br>",$data->{"Vachigh"}->{val}*1E7);
+  $str .= "Beamline Gate ";
+  
+  $str .= "OPEN" if ($data->{"Gate"}->{val}==1);
+  $str .= "CLOSED" if ($data->{"Gate"}->{val}==2);
+  $str .= "undefined" if ($data->{"Gate"}->{val}==0);
+  
   $str .= Hmon::MakeFooter();
   Hmon::WriteFile("Vacuum",$str);  
     
index 775b6a2b2c8c23ab54b280f6cb20a54eb3456101..fb6ec77f367110966d17d0ef86e6ea1cbc607be5 100755 (executable)
@@ -168,11 +168,12 @@ while(1) {
   $qastate = QA::WARN_2  if (($IsobPress < 0.9) || ($IsobO2 >300.0) || ($IsobRefR < 70.0));
   $qastate = QA::ERROR_2 if (($IsobPress > 2.0) || ($IsobPress < 0.7) || ($IsobO2 > 800.0) || ($IsobRefR < 50.0));
   $qastate = min(QA::WARN_2,$qastate) if $QA::RichHvOff;
+  $qastate = QA::NOTE    if $QA::RichGasOff;
 
   if( $timer % 4 == 0) {
     $value    = sprintf("%.1f|%.0f|%.0f",$IsobPress,$IsobO2,$IsobRefR);
     $longtext = sprintf("isobutan pressure : %.2f bar | O2 concentration: %.1f ppm <br>|Isobutanoutput ratio: %.2f | Scales: %.1fkg / %.1fkg",$IsobPress,$IsobO2,$IsobRefR,$IsobScale0,$IsobScale1);
-    QA::WriteQALog($flog,"rich","isob",30,$qastate,"Gas",$value,$longtext);
+    QA::WriteQALog($flog,"rich","isob",30,$qastate,"Gas".($QA::RichGasOff?" OFF":""),$value,$longtext);
   }
 
   if( $timer % 10 == 0) {
index 975135691118a9c2533ec1a3841f0606a7e071e4..1d72358e8b26fd11d188d9eca540ad0b52c2cb54 100755 (executable)
@@ -14,7 +14,7 @@ use List::Util qw[min max];
 use Encode qw(encode from_to);
 use JSON::XS;
 
-my $MINRATE = 1000; #minimum counts in 42ms
+my $MINRATE = 5000; #minimum counts in 42ms
 my $BINWIDTH = 20; # µs bin width
 my $BINPERMEAN = 2100; #bins per read number set
 
@@ -32,10 +32,10 @@ HPlot::PlotInit({
     titles  => [],
     xlabel  => "Time [s] (".($BINWIDTH*$BINPERMEAN/1000)." ms binning)",
     ylabel  => "QFactor",
-    sizex   => 970,
-    sizey   => 320,
+    sizex   => 950,
+    sizey   => 280,
     ymin    => "0.95",
-    ymax    => "20.05",
+    ymax    => "10.05",
 #    ymax    => "1.05<*",
     curves  => 2,
     xscale  => 23.81,
@@ -53,7 +53,7 @@ HPlot::PlotInit({
     titles  => [],
     xlabel  => "Time [ms] (".($BINWIDTH)." µs binning)",
     ylabel  => "MicroRate",
-    sizex   => 970,
+    sizex   => 950,
     sizey   => 330,
     ymin    => "0",
     curves  => 1,
@@ -73,7 +73,7 @@ HPlot::PlotInit({
     titles  => [],
     xlabel  => "Time [ms] (".($BINWIDTH)." µs binning)",
     ylabel  => "MicroRate",
-    sizex   => 970,
+    sizex   => 950,
     sizey   => 330,
     ymin    => "0",
     curves  => 1,
@@ -86,12 +86,12 @@ HPlot::PlotInit({
 
 
 
-my $str  = Hmon::MakeTitle(13, 7, "Beam QFactor",0);
+my $str  = Hmon::MakeTitle(12, 6, "Beam QFactor",0);
 $str .= qq@<img src="%ADDPNG files/QFactor.png%" type="image/png">\n@;
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("QFactor",$str);
 
-$str  = Hmon::MakeTitle(13, 14, "Spill micro-structure",0);
+$str  = Hmon::MakeTitle(12, 14, "Spill micro-structure",0);
 $str .= qq@<img src="%ADDPNG files/MicroRate.png%" type="image/png"><br>\n@;
 $str .= qq@<img src="%ADDPNG files/MicroRate10ms.png%" type="image/png"><br>\n@;
 $str .= Hmon::MakeFooter();
@@ -100,6 +100,8 @@ Hmon::WriteFile("MicroSpillStructure",$str);
 
 trb_init_ports() or die trb_strerror();
 
+trb_register_write(0xffff,0xb805,30000); #50000 = 1s offset to spill start
+
 my $round = 0;
 while(1) {
 
@@ -124,13 +126,13 @@ while(1) {
 #           print $total."\n";
         $mean = $total / $BINPERMEAN;
         my $qfactor = $maxbin / ($mean||1);
-        HPlot::PlotAdd('QFactor',$qfactor,0) if($total >= $MINRATE && $qfactor < 20);
+        HPlot::PlotAdd('QFactor',$qfactor,0) if($total >= $MINRATE && $qfactor < 10);
         HPlot::PlotAdd('QFactor',"NaN",0)    if($total <  $MINRATE);
-        HPlot::PlotAdd('QFactor',"NaN",0)       if($qfactor >= 20);
+        HPlot::PlotAdd('QFactor',"NaN",0)    if($total >= $MINRATE && $qfactor >= 10);
 
-        HPlot::PlotAdd('QFactor',"NaN",1) if($total >= $MINRATE && $qfactor < 20);
+        HPlot::PlotAdd('QFactor',"NaN",1) if($total >= $MINRATE && $qfactor < 10);
         HPlot::PlotAdd('QFactor',1,1)     if($total <  $MINRATE);
-        HPlot::PlotAdd('QFactor',20,1)    if($qfactor >= 20);
+        HPlot::PlotAdd('QFactor',10,1)    if($total >= $MINRATE && $qfactor >= 10);
 
         }
       }
index 6bdf4074000a7488e2659e3f58dbca64cdbfc7a5..e5621a779517d2ab5ea4cfc348e49a1a90168cf2 100755 (executable)
@@ -45,7 +45,7 @@ mkdir -p `pwd`/pion
 
 pkill -f "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/pics"
 sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/pics `pwd`/qa
-
+sshfs -o allow_other hadaq@hades66:/home/hades-qa/online/5.34.38/feb22/vertex/pics `pwd`/vertex
 # sshfs -o allow_other hadaq@lxhadeb06p:/data01/tmp/ `pwd`/pion
 
 pkill -f "sshfs -o allow_other hadaq@hadesp63:/home/hadaq/local/tdcmon/dabc/cal"
index bd29db2b78f800c96ffd817249dbeb2846df2379..ba2289f5711ed1998252885a8c55a7109625a0f2 100755 (executable)
@@ -4,8 +4,8 @@ echo "  <Hmon>    Killing all sub-processes..."
 
 pkill -f "\./hmon_.+\.pl" 2>/dev/null 1>/dev/null
 pkill -f "sh -c \./hmon_.*\.sh"
-pkill -f "/usr/bin/perl \./speakdaemon.pl"
-pkill -f "/usr/bin/perl \./hmon_.*\.sh"
+pkill -f "/usr/bin/perl -w \./speakdaemon.pl"
+pkill -f "/usr/bin/perl -w \./hmon_.*\.sh"
 pkill -f "hmon_tail -n"
 #pkill -f "hmon_ssh"  # don't do that for a normal daq-restart
 
index 6cf2b70cbf1035b5954b81cf24566eefa90ce726..bbf8ffa074dcaa62f8e4fcf95b176695e793711a 100644 (file)
@@ -9,8 +9,8 @@ body {
 
 body>div>div {
   float:left;
-  margin: 0px 3px 5px 0;
-  padding: 0 0 0 0 ;
+  margin: 0px 3px 0px 0;
+  padding: 0 0 10px 0 ;
   border: 1px solid #777;
   border-width:0 1px 1px 1px;
   text-align:center;