]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
some adjustments to Hmon scripts
authorhadaq <jan@lxhadeb07>
Sat, 23 Mar 2019 13:02:25 +0000 (14:02 +0100)
committerhadaq <jan@lxhadeb07>
Sat, 23 Mar 2019 13:02:25 +0000 (14:02 +0100)
hmon/QA.pm
hmon/hmon_dutyfactor.pl
hmon/hmon_endpoints.pl
hmon/permanent/hmon_ecalhv.pl
hmon/permanent/hmon_fwhv.pl
hmon/permanent/hmon_mdchv.pl
hmon/permanent/hmon_richIsobutan.pl
hmon/permanent/hmon_rpchv.pl
hmon/permanent/hmon_tofhv.pl

index 3f1220c4ae978901d0a4c4c4154a5455be38a31a..81807a7e924d8a047f810d2cded51d67adbe840c 100644 (file)
@@ -97,17 +97,15 @@ our @Eventsbroken     = (.5,2,5);
 our @MdcTokenMissLimits = (10,50,100);
 our @MdcNominalHV = (1750,1770,1900,2150);
 our $MdcHVOffsetLimits = [[5,10,55],[5,10,55],[5,10,55],[10,110,125]];
-our @EcalHvLimits = (326,325,320);
-our @RpcHvLimits = (12,12,11);
-our @TofHvLimits = (768,760,759);
+our @EcalHvLimits = (493,325,320);
+our @RpcHvLimits = (12,12,12);
+our @TofHvLimits = (766,760,759);
+our @FwHvLimits = (280,250,200);
 our @TdcCalibrationInterval = (320000,450000,600000);   
 our @TdcCalibrationTemperature = (5,7,10);    
     
 our @PionLvCurrLimits = (4,5,6);
 
-our $MdcHvOff = 0;
-our $RichHvOff = 0;
-our $MagnetOff = 1;
 
 our $PadiwaECalNumber = 84;
 our @PadiwaEcalLimits    = (0, 1, 2);
@@ -116,6 +114,17 @@ our @LimitTriggerPerSpill = (1000, 0, 0);
 our $AcceleratorCycle = 7;
 use constant {CTSAddress => 0x0003};
 
+###############################################################################
+#  Switched off systems
+###############################################################################
+our $MdcHvOff = 0;
+our $RichHvOff = 0;
+our $TofHvOff = 0;
+our $RpcHvOff = 0;
+our $FwHvOff = 0;
+our $MagnetOff = 1;
+
+
 ###############################################################################
 #  Missing Boards
 ###############################################################################
index f89478560934879a34a91ba01759a609a17f41d7..c22325f874878f1ad8f1c7213c4b70d5c47d4ca0 100755 (executable)
@@ -118,9 +118,9 @@ while(1) {
 
 #end of spill 
     my $lastsum = 0;
-    for my $c (1..5) { $lastsum += $store[-$c]//0;}
+    for my $c (1..15) { $lastsum += $store[-$c]//0;}
 
-    if($lastsum < 100*5*$SPS && ($store[-6]//0) > 100*$SPS) {
+    if($lastsum < 100*15*$SPS && ($store[-16]//0) > 100*$SPS) {
     
       my $total   = sum(@store)/$SPS;
       my $max     = max(@store);
index 9d8e172b250bf56a5cbceb06f2bd836d764536f0..77dcc42b938e263b7eef7d62f0a20b7f0dc70ecc 100755 (executable)
@@ -260,17 +260,21 @@ while(1) {
     if ($num_rich_missing > 0) {$rich_longtext = "Endp @sorted_rich_results missing"}; 
     if ($num_rich_mistake > 0) {$rich_longtext .= " Endp @{$rich_results[4]} not known";} 
 
-    $qastate = QA::GetQAState('below',$num_rich_missing,@QA::RichEndpMissingLimits);
-    Hmon::Speak('richmissonce',"$num_rich_missing Rich Frontends missing") if($qastate > 60 && $qastate < QA::ERROR );
-    Hmon::Speak('richmiss',"$num_rich_missing Rich Frontends missing") if($qastate >= QA::ERROR );
     
-    
-    QA::WriteQALog($flog,"endp","rich",$waittime,$qastate,
-                  $rich_title,$rich_value,$rich_longtext);
     if($qastate > 60) {
       system("logger -p local1.info -t DAQ Endp \\<E\\> $rich_longtext") unless (($timecnt->{rich}++)%$loggerperiod);
       }    
     else {$timecnt->{rich} = 0;}
+    
+    
+    
+    $qastate = QA::GetQAState('below',$num_rich_missing,@QA::RichEndpMissingLimits);
+    Hmon::Speak('richmissonce',"$num_rich_missing Rich Frontends missing") if($qastate > 60 && $qastate < QA::ERROR );
+    Hmon::Speak('richmiss',"$num_rich_missing Rich Frontends missing") if($qastate >= QA::ERROR );
+    
+    
+    if($num_rich_missing > 20) {$rich_longtext = $num_rich_missing." boards missing";}
+    QA::WriteQALog($flog,"endp","rich",$waittime,$qastate, $rich_title,$rich_value,$rich_longtext);
 
 
     ###tof
index 90a497b6fd5565008b09d27c832831a9633d443c..a0d3022b2460b8df95e21bb8b719674adbea2d8a 100755 (executable)
@@ -16,7 +16,7 @@ use HPlot;
 my $flog = QA::OpenQAFile();
 my @colors = ("#333333","#00ff00","#ff0000","#0000ff","#dddd00","#dd00dd");
 
-
+my $TOTALCHANS = 652;
 
 for my $i (0..5) {
   HPlot::PlotInit( {
@@ -177,7 +177,7 @@ while(1) {
         for(my $j = 0; $j<=167; $j++) {
         my $cnt = ($i*168)+$j;
         if ($i==1 or $i==2 or $i==4 or $i==5){
-            if (abs($data->{"U$cnt"}->{val})>1000 and $data->{"I$cnt"}->{val}>50) {$ChnlsOn++;}
+            if (abs($data->{"U$cnt"}->{val}//0)>1000 and ($data->{"I$cnt"}->{val}//0)>50) {$ChnlsOn++;}
             }
         }
     }
@@ -190,17 +190,17 @@ while(1) {
 
     if ($ChnlsOn == 0) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-    } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
+    } elsif ($ChnlsOn < $TOTALCHANS and $ChnlsOn >= 642) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } elsif ($ChnlsOn < 642) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-    } elsif ($ChnlsOn > 652) {
+    } elsif ($ChnlsOn > $TOTALCHANS) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } else {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     }    
         $str .= "$ChnlsOn";
-        $str .= "/652)</p></div>";
+        $str .= "/$TOTALCHANS)</p></div>";
     
     $str .= "</div>\n\n";
     
@@ -226,17 +226,17 @@ while(1) {
 
     if ($ChnlsOn == 0) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-    } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
+    } elsif ($ChnlsOn < $TOTALCHANS and $ChnlsOn >= 642) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } elsif ($ChnlsOn < 642) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-    } elsif ($ChnlsOn > 652) {
+    } elsif ($ChnlsOn > $TOTALCHANS) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } else {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     }    
         $str .= "$ChnlsOn";
-        $str .= "/652)</p></div>";
+        $str .= "/$TOTALCHANS)</p></div>";
     
     $str .= "</div>\n\n";
     
@@ -265,17 +265,17 @@ while(1) {
 
     if ($ChnlsOn == 0) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-    } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
+    } elsif ($ChnlsOn < $TOTALCHANS and $ChnlsOn >= 642) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } elsif ($ChnlsOn < 642) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-    } elsif ($ChnlsOn > 652) {
+    } elsif ($ChnlsOn > $TOTALCHANS) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } else {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     }    
         $str .= "$ChnlsOn";
-        $str .= "/652)</p></div>";
+        $str .= "/$TOTALCHANS)</p></div>";
     
     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
     
@@ -305,17 +305,17 @@ while(1) {
 
     if ($ChnlsOn == 0) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-    } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
+    } elsif ($ChnlsOn < $TOTALCHANS and $ChnlsOn >= 642) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } elsif ($ChnlsOn < 642) {
         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-    } elsif ($ChnlsOn > 652) {
+    } elsif ($ChnlsOn > $TOTALCHANS) {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     } else {
         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
     }    
         $str .= "$ChnlsOn";
-        $str .= "/652)</p></div>";
+        $str .= "/$TOTALCHANS)</p></div>";
     
     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
     
@@ -341,8 +341,8 @@ while(1) {
   
 
    my $qastate = QA::OK;
-   my $value = sprintf("%i/652",$ChnlsOn);
-   my $longtext = sprintf("HV channels On: %i/652",$ChnlsOn);
+   my $value = sprintf("%i/$TOTALCHANS",$ChnlsOn);
+   my $longtext = sprintf("HV channels On: %i/$TOTALCHANS",$ChnlsOn);
 
  $qastate = QA::GetQAState('above', $ChnlsOn, @QA::EcalHvLimits);   
 if ($ChnlsOn == 0){
@@ -350,7 +350,7 @@ if ($ChnlsOn == 0){
  
  $str = "";
    if($timer%8 == 0) {
-     if ($ChnlsOn>0 and $ChnlsOn<652) {
+     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 or $i==3 or $i==5 or $i==6){
             for(my $j = 1; $j<=168; $j++) {
@@ -362,8 +362,8 @@ if ($ChnlsOn == 0){
             }
         }
     }
-#        $value    = sprintf("%i/652",$ChnlsOn);
-       $longtext = sprintf("HV channels On: %i/652<br>Check the current and voltage monitoring plots!<br>%s",$ChnlsOn,$str);
+#        $value    = sprintf("%i/$TOTALCHANS",$ChnlsOn);
+       $longtext = sprintf("HV channels On: %i/$TOTALCHANS<br>Check the current and voltage monitoring plots!<br>%s",$ChnlsOn,$str);
      } 
      elsif($ChnlsOn==0) {
        $value    = sprintf("HV is OFF");
@@ -409,5 +409,5 @@ if ($ChnlsOn == 0){
             }
     }
 
-  usleep(250000);
+  usleep(2500000);
   }
index 7635e41f92e19df655de120673df8f77edc0614e..6c99a3cfb8e72da49c44f50a501cd09382c6b66c 100755 (executable)
@@ -14,374 +14,87 @@ use HADES::TrbNet;
 use HPlot;
 
 my $flog = QA::OpenQAFile();
-my @colors = ("#333333","#00ff00","#ff0000","#0000ff","#dddd00","#dd00dd");
-
-
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#     name    => "EcalCurr$i",
-#     file    => "files/EcalCurr$i",
-#     entries => 168,
-#     type    => HPlot::TYPE_BARGRAPH,
-#     output  => HPlot::OUT_PNG,
-#     titles  => [sprintf("Sector %i - current",$i+1)],
-#     xlabel  => "Module number",
-#     ylabel  => "uA",
-#     sizex   => 430,
-#     sizey   => 190,
-#     xmin    => 0,
-#     xmax    => 168,
-#     ymin    => 0,
-#     ymax    => 1600,
-#     curves  => 1,
-#     countup => 1,
-#     xscale  => 1,
-#     nokey   => 0,
-#     buffer  => 1,
-#     bargap => 0.4,
-#     curvewidth => 1,});
-#     }
-#     
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#     name    => "EcalVolt$i",
-#     file    => "files/EcalVolt$i",
-#     entries => 168,
-#     type    => HPlot::TYPE_BARGRAPH,
-#     output  => HPlot::OUT_PNG,
-#     titles  => [sprintf("Sector %i - voltage",$i+1)],
-#     xlabel  => "Module number",
-#     ylabel  => "V",
-#     sizex   => 430,
-#     sizey   => 190,
-#     xmin    => 0,
-#     xmax    => 168,
-#     ymin    => 0,
-#     ymax    => 2500,
-#     curves  => 1,
-#     countup => 1,
-#     xscale  => 1,
-#     nokey   => 0,
-#     buffer  => 1,
-#     bargap => 0.4,
-#     curvewidth => 1,});
-#     }
-# 
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#   name    => "EcalVMap$i",
-#   file    => "files/EcalVMap$i",
-#   title   => "",
-#   entries => 17,
-#   curves  => 15,
-#   type    => HPlot::TYPE_HEATMAP,
-#   output  => HPlot::OUT_PNG,
-#   zlabel  => "Voltage [V]",
-#   titles  => ["Voltage [V]"],
-#   sizex   => 255,
-#   sizey   => 200,
-#   nokey   => 0,
-#   buffer  => 1,
-#   xmin    => -0.5,
-#   xmax    => 16.5,
-#   ymin    => -0.5,
-#   ymax    => 14.5,
-#   cbmax   => "1.1<*<2500",
-#   cbmin   => "0.1<*<0.9",
-#   noinit  => 0,
-#   showvalues => 0, });
-#   }
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#   name    => "EcalCMap$i",
-#   file    => "files/EcalCMap$i",
-#   title   => "",
-#   entries => 17,
-#   curves  => 15,
-#   type    => HPlot::TYPE_HEATMAP,
-#   output  => HPlot::OUT_PNG,
-#   zlabel  => "Current [uA]",
-#   titles  => ["Current [uA]"],
-#   sizex   => 255,
-#   sizey   => 200,
-#   nokey   => 0,
-#   buffer  => 1,
-#   xmin    => -0.5,
-#   xmax    => 16.5,
-#   ymin    => -0.5,
-#   ymax    => 14.5,
-#   cbmax   => "1.1<*<2000",
-#   cbmin   => "0.1<*<0.9",
-#   noinit  => 0,
-#   showvalues => 0, });
-#   }
-# 
 
 my $timer=0;
-my $str = "";
 my $s="";
+my @channels;
+my $minvolt;
+
+for(my $i = 1; $i <= 144; $i++) {
+  next if ($i == 66 || $i == 67 || $i == 78 || $i == 79);
+  $s = "HAD:FWHV:S$i:vmon";
+  Perl2Epics::Connect("VS$i",$s);
+  push(@channels,"VS$i");
+  $minvolt->{"VS$i"} = 990;
+  }
 
-#for(my $i = 1; $i <=6; $i++) {
-#  for(my $j = 1; $j<=2; $j++) {
-#    my $cnt = (($i-1)*2)+$j-1;
-#    $s = sprintf("HAD:RPC:HV:S%i:L%i:imon",$i,$j);
-#    Perl2Epics::Connect("I$cnt",$s);
-#    $s = sprintf("HAD:RPC:HV:S%i:L%i:vmon",$i,$j);
-#    Perl2Epics::Connect("U$cnt",$s);
-#  }
-#}
+for(my $i = 145; $i <= 208; $i++) {
+  $s = "HAD:FWHV:M$i:vmon";
+  Perl2Epics::Connect("VM$i",$s);
+  push(@channels,"VM$i");
+  $minvolt->{"VM$i"} = 1300;
+  }
 
+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:FWHV:L$i:vmon";
+  Perl2Epics::Connect("VL$i",$s);
+  push(@channels,"VL$i");
+  $minvolt->{"VL$i"} = 1400;
+  }
+  
+  
 
 print "Connected.\n";
 
 #OVERCURRENT variables
-my $overcurrent_flag = 0;
-my $OVERCURRENT_YELLOW = 200;
-my $OVERCURRENT_RED = 300;
-
-my $OVERCURRENT_period = 3;
-my $overcurrent_alarm_flag = 0;
-my $current_average = 0;
-my $current_sum = 0;
+# my $overcurrent_flag = 0;
+# my $OVERCURRENT_YELLOW = 200;
+# my $OVERCURRENT_RED = 300;
 
-my $errortimer = 0;
+# my $OVERCURRENT_period = 3;
+# my $overcurrent_alarm_flag = 0;
+# my $current_average = 0;
+# my $current_sum = 0;
 
-# my @mod_tab=(0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 0, 0, 0, 0, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 0, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 0, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163);
-# 
-# my @x_tab=(10, 9, 8, 7, 6, 10, 9, 8, 7, 6, 11, 10, 9, 8, 7, 6, 5, 11, 10, 9, 8, 7, 6, 5, 12, 11, 10, 9, 8, 7, 6, 5, 4, 12, 11, 10, 9, 8, 7, 6, 5, 4, 12, 11, 10, 9, 8, 7, 6, 5, 4, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
-# 
-# my @y_tab=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14);
+# my $errortimer = 0;
 
 
-my @i_integrated=(0,0,0,0,0,0,0,0,0,0,0,0);
+my @i_integrated=(0,0,0,0,0,0,0,0,0,0,0,0);
 my $ChnlsOn = 0;
+my $cnt;
 
 while(1) {
-  my $min_v = -1E5;
-  my $max_v =  1E5;
-  my $min_i = -1E5;
-  my $max_i =  1E5;
- # my $data = Perl2Epics::GetAll();
 
+  my $data = Perl2Epics::GetAll();
+  my $str = "";
+
+  $ChnlsOn=0;
+  foreach my $c (@channels) {
+    if( $data->{$c}->{val} >= $minvolt->{$c}) {
+      $ChnlsOn++;
+      }
+    else {
+      $str .= "$c off. ";
+      }
+    } 
   
- # for(my $i = 0; $i <=5; $i++) {
- #       for(my $j = 0; $j<=1; $j++) {
- #         my $cnt = ($i*2)+$j;
- #           $i_integrated[$cnt]=$i_integrated[$cnt]+$data->{"I$cnt"}->{val};
- #       }
- #   }
+
+  my $qastate = QA::OK;
+  my $value = sprintf("%i/%i",$ChnlsOn, scalar @channels);
   
+  if(scalar @channels - $ChnlsOn > 20) {$str = "";}
   
-#   $str = Hmon::MakeTitle(11, 18, "ECAL HV - Current", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n";
-#     
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr0.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr5.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr1.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr4.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr2.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr3.png%" type="image/png"><br>\n@;
-# 
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVCurr", $str);
-# 
-#    
-#    
-#   $str = Hmon::MakeTitle(11, 18, "ECAL HV - Voltage", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n";
-#     
-#      
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt0.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt5.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt1.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt4.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt2.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt3.png%" type="image/png"><br>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVVolt", $str);
-# 
-#  
-#  
-#  
-#  
-#   $str = Hmon::MakeTitle(10, 13, "ECAL HV - Voltage Map", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
-#     
-#      
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap0.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap1.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap2.png%" type="image/png"></td>\n</tr>\n@;
-#   
-#      $str .= "<tr><td>Sector 4</td>\n<td>Sector 5</td>\n<td>Sector 6</td>\n</tr>\n<tr>\n";
-# 
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap3.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap4.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap5.png%" type="image/png"></td>\n</tr>\n</table>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVVMap", $str);
-# 
-#  
-#  
-#   $str = Hmon::MakeTitle(10, 13, "ECAL HV - Current Map", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
-#     
-#      
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap0.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap1.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap2.png%" type="image/png"></td>\n</tr>\n@;
-#   
-#      $str .= "<tr><td>Sector 4</td>\n<td>Sector 5</td>\n<td>Sector 6</td>\n</tr>\n<tr>\n";
-# 
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap3.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap4.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap5.png%" type="image/png"></td>\n</tr>\n</table>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVCMap", $str);
-
-  $timer++;
-
-   my $qastate = QA::NOTE;
-   my $value = sprintf("Work in progress");
-   my $longtext = sprintf("Work in progress");
-
-   #$qastate = QA::GetQAState('above', 12, @QA::RpcHvLimits);   
-   #if ($ChnlsOn == 0){
-   #$qastate = QA::NOTE;}
+  my $longtext = sprintf("HV channels On: %i/%i<br>%s",$ChnlsOn, scalar @channels,$str);
 
+  $qastate = QA::GetQAState('above', $ChnlsOn, @QA::FwHvLimits);   
+  if ($ChnlsOn == 0){ $qastate = QA::WARN_2;}
+  if ($QA::FwHvOff == 1) { $qastate = QA::NOTE;}
 
- $str = "";
-   if($timer%8 == 0) {
-       QA::WriteQALog($flog,"misc","fwhv",30,$qastate,"FWALL HV",$value,$longtext);
-
-  
-   }
   
+  QA::WriteQALog($flog,"misc","fwhv",30,$qastate,"FW HV",$value,$longtext);
 
-#     for (my $i = 0; $i <= 5;$i++){
-#       if($i==1 or $i==2 or $i==4 or $i==5){
-#         for (my $j = 0; $j<=167; $j++) {
-#         my $cnt = ($i*168)+$j;
-#         HPlot::PlotAdd("EcalCurr$i",$data->{"I$cnt"}->{val}||-1,);
-#         HPlot::PlotAdd("EcalVolt$i",$data->{"U$cnt"}->{val}||-1,);
-#       }
-# 
-#         for(my $j=254;$j>=0;$j--){
-#         my $cnt =-1;
-#         if($mod_tab[$j]!=0){
-#             $cnt=($i*168)+$mod_tab[$j]-1;
-#             HPlot::PlotAdd("EcalVMap$i",$data->{"U$cnt"}->{val}||-1,$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             HPlot::PlotAdd("EcalCMap$i",$data->{"I$cnt"}->{val}||-1,$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             }
-#         if($mod_tab[$j]==0){
-#             HPlot::PlotAdd("EcalVMap$i",$data->{"U$cnt"}->{val}||'NaN',$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             HPlot::PlotAdd("EcalCMap$i",$data->{"I$cnt"}->{val}||'NaN',$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             }
-#         }
-#         
-#         
-#         }
-#     }
-#     
-#     
-#     #print Dumper $data;
-#     if($timer%8 == 0) {
-#         for (my $i = 0; $i <= 5;$i++){
-#             HPlot::PlotDraw("EcalCurr$i");
-#             HPlot::PlotDraw("EcalVolt$i");
-#             HPlot::PlotDraw("EcalVMap$i");
-#             HPlot::PlotDraw("EcalCMap$i");
-#             }
-#     }
-  usleep(250000);
+  
+  usleep(2500000);
   }
index 27e8cbb0e4cc7e1cd3a3be1e45c198b486e9f986..4ca880f15ac6cc1e9891309f17b7f19c8242800f 100755 (executable)
@@ -213,10 +213,14 @@ while(1) {
   $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 = "MDC high voltage in all four planes".
-                 "<br>Minimum [V]: ".$mdcHvMin[1]." / ".$mdcHvMin[2]." / ".$mdcHvMin[3]." / ".$mdcHvMin[4].
-                 "<br>Maximum [V]: ".$mdcHvMax[1]." / ".$mdcHvMax[2]." / ".$mdcHvMax[3]." / ".$mdcHvMax[4].
-                 "<br>Nominal [V]: ".$QA::MdcNominalHV[0]." / ".$QA::MdcNominalHV[1]." / ".$QA::MdcNominalHV[2]." / ".$QA::MdcNominalHV[3];
+  my $longtext = sprintf("MDC high voltage in all four planes".
+                 "<br>Minimum [V]: %i / %i / %i / %i".
+                 "<br>Maximum [V]: %i / %i / %i / %i".
+                 "<br>Nominal [V]: %i / %i / %i / %i",
+                 $mdcHvMin[1],$mdcHvMin[2],$mdcHvMin[3],$mdcHvMin[4],
+                 $mdcHvMax[1],$mdcHvMax[2],$mdcHvMax[3],$mdcHvMax[4],
+                 $QA::MdcNominalHV[0],$QA::MdcNominalHV[1],$QA::MdcNominalHV[2],$QA::MdcNominalHV[3]
+                 );
   QA::WriteQALog($flog,"hv","mdchv",10,$qastate,"MDC HV",$value,$longtext);  
 
 #   print Dumper $QA::MdcHVOffsetLimits;
index 94c385748ec6461ad804f424dc22ffd2c7a06304..057f1a04e88d25a4cb7841a027397d82a60044d4 100755 (executable)
@@ -92,7 +92,9 @@ my $plotScale = {
     storable => 1,
     buffer  => 1,
     colors  => ["#00ff00","#ff0000"],
-    additional => "set offsets 0,0,2.5,2.5"
+    additional => "set offsets 0,0,2.5,5.0\n
+                   set obj 1 rect from -61, 0 to 1, 40 fc rgb '#ff7b00' behind\n
+                   set obj 2 rect from -61, 0 to 1, 37 fc rgb '#ff0000' behind\n"
 };
 HPlot::PlotInit($plotScale);
 
index fa7939431811674012a95704fc9acca9fff7ee6c..43e01a3eef6139eb78dc4d1455e33101926c6a17 100755 (executable)
@@ -17,109 +17,6 @@ my $flog = QA::OpenQAFile();
 my @colors = ("#333333","#00ff00","#ff0000","#0000ff","#dddd00","#dd00dd");
 
 
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#     name    => "EcalCurr$i",
-#     file    => "files/EcalCurr$i",
-#     entries => 168,
-#     type    => HPlot::TYPE_BARGRAPH,
-#     output  => HPlot::OUT_PNG,
-#     titles  => [sprintf("Sector %i - current",$i+1)],
-#     xlabel  => "Module number",
-#     ylabel  => "uA",
-#     sizex   => 430,
-#     sizey   => 190,
-#     xmin    => 0,
-#     xmax    => 168,
-#     ymin    => 0,
-#     ymax    => 1600,
-#     curves  => 1,
-#     countup => 1,
-#     xscale  => 1,
-#     nokey   => 0,
-#     buffer  => 1,
-#     bargap => 0.4,
-#     curvewidth => 1,});
-#     }
-#     
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#     name    => "EcalVolt$i",
-#     file    => "files/EcalVolt$i",
-#     entries => 168,
-#     type    => HPlot::TYPE_BARGRAPH,
-#     output  => HPlot::OUT_PNG,
-#     titles  => [sprintf("Sector %i - voltage",$i+1)],
-#     xlabel  => "Module number",
-#     ylabel  => "V",
-#     sizex   => 430,
-#     sizey   => 190,
-#     xmin    => 0,
-#     xmax    => 168,
-#     ymin    => 0,
-#     ymax    => 2500,
-#     curves  => 1,
-#     countup => 1,
-#     xscale  => 1,
-#     nokey   => 0,
-#     buffer  => 1,
-#     bargap => 0.4,
-#     curvewidth => 1,});
-#     }
-# 
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#   name    => "EcalVMap$i",
-#   file    => "files/EcalVMap$i",
-#   title   => "",
-#   entries => 17,
-#   curves  => 15,
-#   type    => HPlot::TYPE_HEATMAP,
-#   output  => HPlot::OUT_PNG,
-#   zlabel  => "Voltage [V]",
-#   titles  => ["Voltage [V]"],
-#   sizex   => 255,
-#   sizey   => 200,
-#   nokey   => 0,
-#   buffer  => 1,
-#   xmin    => -0.5,
-#   xmax    => 16.5,
-#   ymin    => -0.5,
-#   ymax    => 14.5,
-#   cbmax   => "1.1<*<2500",
-#   cbmin   => "0.1<*<0.9",
-#   noinit  => 0,
-#   showvalues => 0, });
-#   }
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#   name    => "EcalCMap$i",
-#   file    => "files/EcalCMap$i",
-#   title   => "",
-#   entries => 17,
-#   curves  => 15,
-#   type    => HPlot::TYPE_HEATMAP,
-#   output  => HPlot::OUT_PNG,
-#   zlabel  => "Current [uA]",
-#   titles  => ["Current [uA]"],
-#   sizex   => 255,
-#   sizey   => 200,
-#   nokey   => 0,
-#   buffer  => 1,
-#   xmin    => -0.5,
-#   xmax    => 16.5,
-#   ymin    => -0.5,
-#   ymax    => 14.5,
-#   cbmax   => "1.1<*<2000",
-#   cbmin   => "0.1<*<0.9",
-#   noinit  => 0,
-#   showvalues => 0, });
-#   }
-# 
-
 my $timer=0;
 my $str = "";
 my $s="";
@@ -149,12 +46,6 @@ my $current_sum = 0;
 
 my $errortimer = 0;
 
-# my @mod_tab=(0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 0, 0, 0, 0, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 0, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 0, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163);
-# 
-# my @x_tab=(10, 9, 8, 7, 6, 10, 9, 8, 7, 6, 11, 10, 9, 8, 7, 6, 5, 11, 10, 9, 8, 7, 6, 5, 12, 11, 10, 9, 8, 7, 6, 5, 4, 12, 11, 10, 9, 8, 7, 6, 5, 4, 12, 11, 10, 9, 8, 7, 6, 5, 4, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
-# 
-# my @y_tab=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14);
-
 
 my @i_integrated=(0,0,0,0,0,0,0,0,0,0,0,0);
 my $ChnlsOn = 0;
@@ -176,166 +67,14 @@ while(1) {
         }
     }
   
-  
-#   $str = Hmon::MakeTitle(11, 18, "ECAL HV - Current", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n";
-#     
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr0.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr5.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr1.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr4.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr2.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr3.png%" type="image/png"><br>\n@;
-# 
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVCurr", $str);
-# 
-#    
-#    
-#   $str = Hmon::MakeTitle(11, 18, "ECAL HV - Voltage", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n";
-#     
-#      
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt0.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt5.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt1.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt4.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt2.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt3.png%" type="image/png"><br>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVVolt", $str);
-# 
-#  
-#  
-#  
-#  
-#   $str = Hmon::MakeTitle(10, 13, "ECAL HV - Voltage Map", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
-#     
-#      
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap0.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap1.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap2.png%" type="image/png"></td>\n</tr>\n@;
-#   
-#      $str .= "<tr><td>Sector 4</td>\n<td>Sector 5</td>\n<td>Sector 6</td>\n</tr>\n<tr>\n";
-# 
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap3.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap4.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap5.png%" type="image/png"></td>\n</tr>\n</table>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVVMap", $str);
-# 
-#  
-#  
-#   $str = Hmon::MakeTitle(10, 13, "ECAL HV - Current Map", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
-#     
-#      
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap0.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap1.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap2.png%" type="image/png"></td>\n</tr>\n@;
-#   
-#      $str .= "<tr><td>Sector 4</td>\n<td>Sector 5</td>\n<td>Sector 6</td>\n</tr>\n<tr>\n";
-# 
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap3.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap4.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap5.png%" type="image/png"></td>\n</tr>\n</table>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVCMap", $str);
+
    my $qastate = QA::OK;
    my $value = sprintf("%i/12",$ChnlsOn);
    my $longtext = sprintf("HV channels On: %i/12",$ChnlsOn);
 
    $qastate = QA::GetQAState('above', $ChnlsOn, @QA::RpcHvLimits);   
-   if ($ChnlsOn == 0){
-    $qastate = QA::NOTE;}
+   if ($ChnlsOn == 0){ $qastate = QA::WARN_2;}
+   if ($QA::RpcHvOff == 1) { $qastate = QA::NOTE;}
 
 $timer++;
 
@@ -377,41 +116,5 @@ $timer++;
 
  }
   
-
-#     for (my $i = 0; $i <= 5;$i++){
-#       if($i==1 or $i==2 or $i==4 or $i==5){
-#         for (my $j = 0; $j<=167; $j++) {
-#         my $cnt = ($i*168)+$j;
-#         HPlot::PlotAdd("EcalCurr$i",$data->{"I$cnt"}->{val}||-1,);
-#         HPlot::PlotAdd("EcalVolt$i",$data->{"U$cnt"}->{val}||-1,);
-#       }
-# 
-#         for(my $j=254;$j>=0;$j--){
-#         my $cnt =-1;
-#         if($mod_tab[$j]!=0){
-#             $cnt=($i*168)+$mod_tab[$j]-1;
-#             HPlot::PlotAdd("EcalVMap$i",$data->{"U$cnt"}->{val}||-1,$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             HPlot::PlotAdd("EcalCMap$i",$data->{"I$cnt"}->{val}||-1,$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             }
-#         if($mod_tab[$j]==0){
-#             HPlot::PlotAdd("EcalVMap$i",$data->{"U$cnt"}->{val}||'NaN',$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             HPlot::PlotAdd("EcalCMap$i",$data->{"I$cnt"}->{val}||'NaN',$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             }
-#         }
-#         
-#         
-#         }
-#     }
-#     
-#     
-#     #print Dumper $data;
-#     if($timer%8 == 0) {
-#         for (my $i = 0; $i <= 5;$i++){
-#             HPlot::PlotDraw("EcalCurr$i");
-#             HPlot::PlotDraw("EcalVolt$i");
-#             HPlot::PlotDraw("EcalVMap$i");
-#             HPlot::PlotDraw("EcalCMap$i");
-#             }
-#     }
-  usleep(250000);
+  usleep(2500000);
   }
index 3fa20be74745e4b95216b8d91cdccc26d3c672aa..7ff8677a012ec6eb239c1b7f1f24f78ad6a02df8 100755 (executable)
@@ -17,109 +17,6 @@ my $flog = QA::OpenQAFile();
 my @colors = ("#333333","#00ff00","#ff0000","#0000ff","#dddd00","#dd00dd");
 
 
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#     name    => "EcalCurr$i",
-#     file    => "files/EcalCurr$i",
-#     entries => 168,
-#     type    => HPlot::TYPE_BARGRAPH,
-#     output  => HPlot::OUT_PNG,
-#     titles  => [sprintf("Sector %i - current",$i+1)],
-#     xlabel  => "Module number",
-#     ylabel  => "uA",
-#     sizex   => 430,
-#     sizey   => 190,
-#     xmin    => 0,
-#     xmax    => 168,
-#     ymin    => 0,
-#     ymax    => 1600,
-#     curves  => 1,
-#     countup => 1,
-#     xscale  => 1,
-#     nokey   => 0,
-#     buffer  => 1,
-#     bargap => 0.4,
-#     curvewidth => 1,});
-#     }
-#     
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#     name    => "EcalVolt$i",
-#     file    => "files/EcalVolt$i",
-#     entries => 168,
-#     type    => HPlot::TYPE_BARGRAPH,
-#     output  => HPlot::OUT_PNG,
-#     titles  => [sprintf("Sector %i - voltage",$i+1)],
-#     xlabel  => "Module number",
-#     ylabel  => "V",
-#     sizex   => 430,
-#     sizey   => 190,
-#     xmin    => 0,
-#     xmax    => 168,
-#     ymin    => 0,
-#     ymax    => 2500,
-#     curves  => 1,
-#     countup => 1,
-#     xscale  => 1,
-#     nokey   => 0,
-#     buffer  => 1,
-#     bargap => 0.4,
-#     curvewidth => 1,});
-#     }
-# 
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#   name    => "EcalVMap$i",
-#   file    => "files/EcalVMap$i",
-#   title   => "",
-#   entries => 17,
-#   curves  => 15,
-#   type    => HPlot::TYPE_HEATMAP,
-#   output  => HPlot::OUT_PNG,
-#   zlabel  => "Voltage [V]",
-#   titles  => ["Voltage [V]"],
-#   sizex   => 255,
-#   sizey   => 200,
-#   nokey   => 0,
-#   buffer  => 1,
-#   xmin    => -0.5,
-#   xmax    => 16.5,
-#   ymin    => -0.5,
-#   ymax    => 14.5,
-#   cbmax   => "1.1<*<2500",
-#   cbmin   => "0.1<*<0.9",
-#   noinit  => 0,
-#   showvalues => 0, });
-#   }
-# 
-# for my $i (0..5) {
-#   HPlot::PlotInit( {
-#   name    => "EcalCMap$i",
-#   file    => "files/EcalCMap$i",
-#   title   => "",
-#   entries => 17,
-#   curves  => 15,
-#   type    => HPlot::TYPE_HEATMAP,
-#   output  => HPlot::OUT_PNG,
-#   zlabel  => "Current [uA]",
-#   titles  => ["Current [uA]"],
-#   sizex   => 255,
-#   sizey   => 200,
-#   nokey   => 0,
-#   buffer  => 1,
-#   xmin    => -0.5,
-#   xmax    => 16.5,
-#   ymin    => -0.5,
-#   ymax    => 14.5,
-#   cbmax   => "1.1<*<2000",
-#   cbmin   => "0.1<*<0.9",
-#   noinit  => 0,
-#   showvalues => 0, });
-#   }
-# 
-
 
 my $timer = 0;
 my $str = "";
@@ -164,12 +61,6 @@ my $current_sum = 0;
 
 my $errortimer = 0;
 
-# my @mod_tab=(0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 0, 0, 0, 0, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 0, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 0, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163);
-# 
-# my @x_tab=(10, 9, 8, 7, 6, 10, 9, 8, 7, 6, 11, 10, 9, 8, 7, 6, 5, 11, 10, 9, 8, 7, 6, 5, 12, 11, 10, 9, 8, 7, 6, 5, 4, 12, 11, 10, 9, 8, 7, 6, 5, 4, 12, 11, 10, 9, 8, 7, 6, 5, 4, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
-# 
-# my @y_tab=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14);
-
 
 
 
@@ -191,160 +82,6 @@ while(1) {
       }
     }
   }
-  
-  
-#   $str = Hmon::MakeTitle(11, 18, "ECAL HV - Current", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n";
-#     
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr0.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr5.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr1.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr4.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr2.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalCurr3.png%" type="image/png"><br>\n@;
-# 
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVCurr", $str);
-# 
-#    
-#    
-#   $str = Hmon::MakeTitle(11, 18, "ECAL HV - Voltage", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n";
-#     
-#      
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt0.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt5.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt1.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt4.png%" type="image/png">\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt2.png%" type="image/png"><br>\n@;
-#      $str .= qq@<img src="%ADDPNG files/EcalVolt3.png%" type="image/png"><br>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVVolt", $str);
-# 
-#  
-#  
-#  
-#  
-#   $str = Hmon::MakeTitle(10, 13, "ECAL HV - Voltage Map", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
-#     
-#      
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap0.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap1.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap2.png%" type="image/png"></td>\n</tr>\n@;
-#   
-#      $str .= "<tr><td>Sector 4</td>\n<td>Sector 5</td>\n<td>Sector 6</td>\n</tr>\n<tr>\n";
-# 
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap3.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap4.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalVMap5.png%" type="image/png"></td>\n</tr>\n</table>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVVMap", $str);
-# 
-#  
-#  
-#   $str = Hmon::MakeTitle(10, 13, "ECAL HV - Current Map", 1, "");
-#   $str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
-# 
-#   $str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
-# 
-#     if ($ChnlsOn == 0) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\" title=\"channels off\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels off  (";
-#     } elsif ($ChnlsOn < 652 and $ChnlsOn >= 642) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: orange;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn < 642) {
-#         $str .= "<div><div class=\"redbutton\" style=\"float:left;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } elsif ($ChnlsOn > 652) {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left; background-color: #ffcc00;\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     } else {
-#         $str .= "<div><div class=\"greenbutton\" style=\"float:left\"></div><p style=\"text-align:left;position: relative; left: 10px;top: 6px;\"> Channels on   (";
-#     }    
-#         $str .= "$ChnlsOn";
-#         $str .= "/652)</p></div>";
-#     
-#     $str .= "</div>\n\n<table>\n<tr><td>Sector 1</td>\n<td>Sector 2</td>\n<td>Sector 3</td>\n</tr>\n<tr>";
-#     
-#      
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap0.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap1.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap2.png%" type="image/png"></td>\n</tr>\n@;
-#   
-#      $str .= "<tr><td>Sector 4</td>\n<td>Sector 5</td>\n<td>Sector 6</td>\n</tr>\n<tr>\n";
-# 
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap3.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap4.png%" type="image/png"></td>\n@;
-#      $str .= qq@<td><img src="%ADDPNG files/EcalCMap5.png%" type="image/png"></td>\n</tr>\n</table>\n@;
-#    
-#    
-#    $str .= Hmon::MakeFooter();
-#  $str .= "</body>";
-#  $str .= "</html>";
-#    Hmon::WriteFile("EcalHVCMap", $str);
 
    
   $timer++;
@@ -355,8 +92,9 @@ while(1) {
    my $longtext = sprintf("HV channels On: %i/768",$ChnlsOn);
 
  $qastate = QA::GetQAState('above', $ChnlsOn, @QA::TofHvLimits);   
-if ($ChnlsOn == 0){
-    $qastate = QA::NOTE;}
+   if ($ChnlsOn == 0){ $qastate = QA::WARN_2;}
+   if ($QA::TofHvOff == 1) { $qastate = QA::NOTE;}
+
  
  $str = "";
    if($timer%8 == 0) {
@@ -407,41 +145,6 @@ if ($ChnlsOn == 0){
    }
   
 
-#     for (my $i = 0; $i <= 5;$i++){
-#       if($i==1 or $i==2 or $i==4 or $i==5){
-#         for (my $j = 0; $j<=167; $j++) {
-#         my $cnt = ($i*168)+$j;
-#         HPlot::PlotAdd("EcalCurr$i",$data->{"I$cnt"}->{val}||-1,);
-#         HPlot::PlotAdd("EcalVolt$i",$data->{"U$cnt"}->{val}||-1,);
-#       }
-# 
-#         for(my $j=254;$j>=0;$j--){
-#         my $cnt =-1;
-#         if($mod_tab[$j]!=0){
-#             $cnt=($i*168)+$mod_tab[$j]-1;
-#             HPlot::PlotAdd("EcalVMap$i",$data->{"U$cnt"}->{val}||-1,$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             HPlot::PlotAdd("EcalCMap$i",$data->{"I$cnt"}->{val}||-1,$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             }
-#         if($mod_tab[$j]==0){
-#             HPlot::PlotAdd("EcalVMap$i",$data->{"U$cnt"}->{val}||'NaN',$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             HPlot::PlotAdd("EcalCMap$i",$data->{"I$cnt"}->{val}||'NaN',$y_tab[$j],$x_tab[$mod_tab[$j]-1]);
-#             }
-#         }
-#         
-#         
-#         }
-#     }
-#     
-#     
-#     #print Dumper $data;
-#     if($timer%8 == 0) {
-#         for (my $i = 0; $i <= 5;$i++){
-#             HPlot::PlotDraw("EcalCurr$i");
-#             HPlot::PlotDraw("EcalVolt$i");
-#             HPlot::PlotDraw("EcalVMap$i");
-#             HPlot::PlotDraw("EcalCMap$i");
-#             }
-#     }
 
-  usleep(250000);
+  usleep(2500000);
   }