my @all_boards =();
my @mdc_boards =(0x8015,0x8016,
# ###MDC Concentrator
- 0x1000,0x1001,0x1002,0x1003,0x1004,
- 0x1010,0x1011,0x1012,0x1013,0x1014,
- 0x1020,0x1021,0x1022,0x1023,0x1024,
- 0x1030,0x1031,0x1032,0x1033,0x1034,
- 0x1040,0x1041,0x1042,0x1043,0x1044,
- 0x1050,0x1051,0x1052,0x1053,0x1054,
+# 0x1000,0x1001,0x1002,0x1003,0x1004,
+# 0x1010,0x1011,0x1012,0x1013,0x1014,
+# 0x1020,0x1021,0x1022,0x1023,0x1024,
+# 0x1030,0x1031,0x1032,0x1033,0x1034,
+# 0x1040,0x1041,0x1042,0x1043,0x1044,
+# 0x1050,0x1051,0x1052,0x1053,0x1054,
0x1100,0x1101,0x1102,0x1103,0x1104,
0x1110,0x1111,0x1112,0x1113,0x1114,
0x1120,0x1121,0x1122,0x1123,0x1124,
###
);
- foreach my $p (0..3) {
- foreach my $s (0..5) {
- foreach my $m (0..15) {
- next if($p==0 && $m >=14);
- my $address = 0x2000 + $p*0x100 + $s*0x10 + $m;
- push (@mdc_boards, $address);
- }
- }
- }
+push(@mdc_boards,(0x8500, 0x8501, 0x8502, 0x8503, 0x8504, 0x8510, 0x8511, 0x8512, 0x8513, 0x8520, 0x8521, 0x8522, 0x8523, 0x8530, 0x8531, 0x8532, 0x8533, 0x8540, 0x8541, 0x8542, 0x8543, 0x8550, 0x8551, 0x8552, 0x8553, 0x8554)); #MDC 1/2 hubs
+
+#push(@mdc_boards,( 0x8e00, 0xa000, 0xa001, 0x8e01, 0xa010, 0xa011, 0xa012, 0x8e02, 0xa020, 0xa021, 0xa022, 0x8e03, 0xa030, 0xa031, 0x8e04, 0xa040, 0xa041, 0x8e05, 0xa050, 0xa051, 0x8e06, 0xa060, 0xa061, 0xa062, 0x8e07, 0xa070, 0xa071, 0xa072, 0x8e08, 0xa080, 0xa081, 0x8e09, 0xa090, 0xa091, 0x8e0a, 0xa0a0, 0xa0a1, 0xa0a2, 0x8e0b, 0xa0b0, 0xa0b1, 0x8e0c, 0xa0c0, 0xa0c1, 0xa0c2, 0x8e0d, 0xa0d0, 0xa0d1, 0x8e10, 0xa100, 0xa101, 0x8e11, 0xa110, 0xa111, 0xa112, 0x8e12, 0xa120, 0xa121, 0xa122, 0x8e13, 0xa130, 0xa131, 0x8e14, 0xa140, 0xa141, 0x8e15, 0xa150, 0xa151, 0x8e16, 0xa160, 0xa161, 0xa162, 0x8e17, 0xa170, 0xa171, 0xa172, 0x8e18, 0xa180, 0xa181, 0x8e19, 0xa190, 0xa191, 0x8e1a, 0xa1a0, 0xa1a1, 0xa1a2, 0x8e1b, 0xa1b0, 0xa1b1, 0x8e1c, 0xa1c0, 0xa1c1, 0xa1c2, 0x8e1d, 0xa1d0, 0xa1d1, 0x8e20, 0xa200, 0xa201, 0x8e21, 0xa210, 0xa211, 0xa212, 0x8e22, 0xa220, 0xa221, 0xa222, 0x8e23, 0xa230, 0xa231, 0x8e24, 0xa240, 0xa241, 0x8e25, 0xa250, 0xa251, 0x8e26, 0xa260, 0xa261, 0xa262, 0x8e27, 0xa270, 0xa271, 0xa272, 0x8e28, 0xa280, 0xa281, 0x8e29, 0xa290, 0xa291, 0x8e2a, 0xa2a0, 0xa2a1, 0xa2a2, 0x8e2b, 0xa2b0, 0xa2b1, 0x8e2c, 0xa2c0, 0xa2c1, 0xa2c2, 0x8e2d, 0xa2d0, 0xa2d1, 0x8e30, 0xa300, 0xa301, 0x8e31, 0xa310, 0xa311, 0xa312, 0x8e32, 0xa320, 0xa321, 0xa322, 0x8e33, 0xa330, 0xa331, 0x8e34, 0xa340, 0xa341, 0x8e35, 0xa350, 0xa351, 0x8e36, 0xa360, 0xa361, 0xa362, 0x8e37, 0xa370, 0xa371, 0xa372, 0x8e38, 0xa380, 0xa381, 0x8e39, 0xa390, 0xa391, 0x8e3a, 0xa3a0, 0xa3a1, 0xa3a2, 0x8e3b, 0xa3b0, 0xa3b1, 0x8e3c, 0xa3c0, 0xa3c1, 0xa3c2, 0x8e3d, 0xa3d0, 0xa3d1, 0x8e40, 0xa400, 0xa401, 0x8e41, 0xa410, 0xa411, 0xa412, 0x8e42, 0xa420, 0xa421, 0xa422, 0x8e43, 0xa430, 0xa431, 0x8e44, 0xa440, 0xa441, 0x8e45, 0xa450, 0xa451, 0x8e46, 0xa460, 0xa461, 0xa462, 0x8e47, 0xa470, 0xa471, 0xa472, 0x8e48, 0xa480, 0xa481, 0x8e49, 0xa490, 0xa491, 0x8e4a, 0xa4a0, 0xa4a1, 0xa4a2, 0x8e4b, 0xa4b0, 0xa4b1, 0x8e4c, 0xa4c0, 0xa4c1, 0xa4c2, 0x8e4d, 0xa4d0, 0xa4d1, 0x8e50, 0xa500, 0xa501, 0x8e51, 0xa510, 0xa511, 0xa512, 0x8e52, 0xa520, 0xa521, 0xa522, 0x8e53, 0xa530, 0xa531, 0x8e54, 0xa540, 0xa541, 0x8e55, 0xa550, 0xa551, 0x8e56, 0xa560, 0xa561, 0xa562, 0x8e57, 0xa570, 0xa571, 0xa572, 0x8e58, 0xa580, 0xa581, 0x8e59, 0xa590, 0xa591, 0x8e5a, 0xa5a0, 0xa5a1, 0xa5a2, 0x8e5b, 0xa5b0, 0xa5b1, 0x8e5c, 0xa5c0, 0xa5c1, 0xa5c2, 0x8e5d, 0xa5d0, 0xa5d1)); #MDC I
+
+push(@mdc_boards,( 0x8e60, 0xa600, 0xa601, 0x8e61, 0xa610, 0xa611, 0x8e62, 0xa620, 0xa621, 0x8e63, 0xa630, 0xa631, 0x8e64, 0xa640, 0xa641, 0x8e65, 0xa650, 0xa651, 0x8e66, 0xa660, 0xa661, 0x8e67, 0xa670, 0xa671, 0x8e68, 0xa680, 0xa681, 0x8e69, 0xa690, 0xa691, 0x8e6a, 0xa6a0, 0xa6a1, 0x8e6b, 0xa6b0, 0xa6b1, 0x8e6c, 0xa6c0, 0xa6c1, 0x8e6d, 0xa6d0, 0xa6d1, 0x8e6e, 0xa6e0, 0xa6e1, 0xa6e2, 0x8e6f, 0xa6f0, 0xa6f1, 0xa6f2, 0x8e70, 0xa700, 0xa701, 0x8e71, 0xa710, 0xa711, 0x8e72, 0xa720, 0xa721, 0x8e73, 0xa730, 0xa731, 0x8e74, 0xa740, 0xa741, 0x8e75, 0xa750, 0xa751, 0x8e76, 0xa760, 0xa761, 0x8e77, 0xa770, 0xa771, 0x8e78, 0xa780, 0xa781, 0x8e79, 0xa790, 0xa791, 0x8e7a, 0xa7a0, 0xa7a1, 0x8e7b, 0xa7b0, 0xa7b1, 0x8e7c, 0xa7c0, 0xa7c1, 0x8e7d, 0xa7d0, 0xa7d1, 0x8e7e, 0xa7e0, 0xa7e1, 0xa7e2, 0x8e7f, 0xa7f0, 0xa7f1, 0xa7f2, 0x8e80, 0xa800, 0xa801, 0x8e81, 0xa810, 0xa811, 0x8e82, 0xa820, 0xa821, 0x8e83, 0xa830, 0xa831, 0x8e84, 0xa840, 0xa841, 0x8e85, 0xa850, 0xa851, 0x8e86, 0xa860, 0xa861, 0x8e87, 0xa870, 0xa871, 0x8e88, 0xa880, 0xa881, 0x8e89, 0xa890, 0xa891, 0x8e8a, 0xa8a0, 0xa8a1, 0x8e8b, 0xa8b0, 0xa8b1, 0x8e8c, 0xa8c0, 0xa8c1, 0x8e8d, 0xa8d0, 0xa8d1, 0x8e8e, 0xa8e0, 0xa8e1, 0xa8e2, 0x8e8f, 0xa8f0, 0xa8f1, 0xa8f2, 0x8e90, 0xa900, 0xa901, 0x8e91, 0xa910, 0xa911, 0x8e92, 0xa920, 0xa921, 0x8e93, 0xa930, 0xa931, 0x8e94, 0xa940, 0xa941, 0x8e95, 0xa950, 0xa951, 0x8e96, 0xa960, 0xa961, 0x8e97, 0xa970, 0xa971, 0x8e98, 0xa980, 0xa981, 0x8e99, 0xa990, 0xa991, 0x8e9a, 0xa9a0, 0xa9a1, 0x8e9b, 0xa9b0, 0xa9b1, 0x8e9c, 0xa9c0, 0xa9c1, 0x8e9d, 0xa9d0, 0xa9d1, 0x8e9e, 0xa9e0, 0xa9e1, 0xa9e2, 0x8e9f, 0xa9f0, 0xa9f1, 0xa9f2, 0x8ea0, 0xaa00, 0xaa01, 0x8ea1, 0xaa10, 0xaa11, 0x8ea2, 0xaa20, 0xaa21, 0x8ea3, 0xaa30, 0xaa31, 0x8ea4, 0xaa40, 0xaa41, 0x8ea5, 0xaa50, 0xaa51, 0x8ea6, 0xaa60, 0xaa61, 0x8ea7, 0xaa70, 0xaa71, 0x8ea8, 0xaa80, 0xaa81, 0x8ea9, 0xaa90, 0xaa91, 0x8eaa, 0xaaa0, 0xaaa1, 0x8eab, 0xaab0, 0xaab1, 0x8eac, 0xaac0, 0xaac1, 0x8ead, 0xaad0, 0xaad1, 0x8eae, 0xaae0, 0xaae1, 0xaae2, 0x8eaf, 0xaaf0, 0xaaf1, 0xaaf2, 0x8eb0, 0xab00, 0xab01, 0x8eb1, 0xab10, 0xab11, 0x8eb2, 0xab20, 0xab21, 0x8eb3, 0xab30, 0xab31, 0x8eb4, 0xab40, 0xab41, 0x8eb5, 0xab50, 0xab51, 0x8eb6, 0xab60, 0xab61, 0x8eb7, 0xab70, 0xab71, 0x8eb8, 0xab80, 0xab81, 0x8eb9, 0xab90, 0xab91, 0x8eba, 0xaba0, 0xaba1, 0x8ebb, 0xabb0, 0xabb1, 0x8ebc, 0xabc0, 0xabc1, 0x8ebd, 0xabd0, 0xabd1, 0x8ebe, 0xabe0, 0xabe1, 0xabe2, 0x8ebf, 0xabf0, 0xabf1, 0xabf2)); #MDC II
+
+#old planes 3/4
+# foreach my $p (2..3) {
+# foreach my $s (0..5) {
+# foreach my $m (0..15) {
+# next if($p==0 && $m >=14);
+# my $address = 0x2000 + $p*0x100 + $s*0x10 + $m;
+# push (@mdc_boards, $address);
+# }
+# }
+# }
- foreach my $mdc_sec (@QA::mdc_chambers_removed) {
- foreach my $m (0..15) {
- next if($mdc_sec<0x10 && $m >=14);
- my $address = 0x2000 + $mdc_sec*0x10 + $m;
- push (@QA::mdc_boards_removed, $address);
- }
- }
+
+
+# foreach my $mdc_sec (@QA::mdc_chambers_removed) {
+# foreach my $m (0..15) {
+# next if($mdc_sec<0x10 && $m >=14);
+# my $address = 0x2000 + $mdc_sec*0x10 + $m;
+# push (@QA::mdc_boards_removed, $address);
+# }
+# }
my @rich_boards =(0x8017,0x8018,
0x83c0,0x83c1,0x83c2,0x83c3,0x83c4,0x83c5,0x83c6,0x83c7,0x83c8,0x83c9,0x83ca,0x83cb,
# 0x8900,0x3800,0x3801,
# 0x8910,0x3810,0x3811,
#Start TRB3sc
- 0x8880,
- 0x5000,0x5001,0x5002,0x5003,0x5004, #0x5005,0x5006,0x5007,
+# 0x8880,
+# 0x5000,0x5001,0x5002,0x5003,0x5004, #0x5005,0x5006,0x5007,
#Hodo TRB3
# 0x8890,0x5010,0x5011, #0x5012,
#Trigger
QA::WriteQALog($flog,"endp","mdc",$waittime,$qastate,$title,$value,$longtext);
if($qastate > 60) {
$longtext =~ s/\<br\>//g;
+ $longtext =~ s/\(/\\\\\(/g;
+ $longtext =~ s/\)/\\\\\)/g;
system("logger -p local1.info -t DAQ Endp \\<E\\> $longtext") unless (($timecnt->{mdc}++)%$loggerperiod);
}
else {$timecnt->{mdc} = 0;}
$qastate = QA::GetQAState('below',$num_rich_missing,@QA::RichEndpMissingLimits);
-# $qastate = QA::NOTE if $num_rich_missing > 900;
- if($qastate > 60) {
+ $qastate = QA::NOTE if $QA::RichOff; #$num_rich_missing > 900;
+ if($qastate > 60) {
+ $rich_longtext =~ s/\(/\\\(/g;
+ $rich_longtext =~ s/\)/\\\)/g;
system("logger -p local1.info -t DAQ Endp \\<E\\> $rich_longtext") unless (($timecnt->{rich}++)%$loggerperiod);
}
else {$timecnt->{rich} = 0;}
QA::WriteQALog($flog,"endp","tof",$waittime,$qastate,
$tof_title,$tof_value,$tof_longtext);
if($qastate > 60) {
+ $tof_longtext =~ s/\(/\\\(/g;
+ $tof_longtext =~ s/\)/\\\)/g;
system("logger -p local1.info -t DAQ Endp \\<E\\> $tof_longtext") unless (($timecnt->{tof}++)%$loggerperiod);
}
else {$timecnt->{tof} = 0;}
QA::WriteQALog($flog,"endp","rpc",$waittime,$qastate,
$rpc_title,$rpc_value,$rpc_longtext);
if($qastate > 60) {
+ $rpc_longtext =~ s/\(/\\\(/g;
+ $rpc_longtext =~ s/\)/\\\)/g;
system("logger -p local1.info -t DAQ Endp \\<E\\> $rpc_longtext") unless (($timecnt->{rpc}++)%$loggerperiod);
}
QA::WriteQALog($flog,"endp","other",$waittime,$qastate,
$other_title,$other_value,$other_longtext);
if($qastate > 60) {
+ $other_longtext =~ s/\(/\\\(/g;
+ $other_longtext =~ s/\)/\\\)/g;
system("logger -p local1.info -t DAQ Endp \\<E\\> $other_longtext") unless (($timecnt->{oth}++)%$loggerperiod);
}
else {$timecnt->{oth} = 0;}
--- /dev/null
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+use Data::Dumper;
+use Data::TreeDumper;
+use Hmon;
+use QA;
+use HPlot;
+use lib '.';
+use lib '/home/hadaq/trbsoft/hades_mdc_settings/scripts';
+use MDC;
+use MDCPower;
+use Time::HiRes qw(usleep time);
+use List::Util qw[min max];
+
+use HADES::TrbNet;
+
+#$ENV{DAQOPSERVER} = 'localhost:40';
+trb_init_ports() or die trb_strerror();
+
+
+
+HPlot::PlotInit({
+ name => "MDCVoltSet",
+ file => "files/MDCVoltSet",
+ title => "Voltage Settings",
+ entries => 48,
+ curves => 30,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Hitrate",
+ sizex => 610,
+ sizey => 510,
+ nokey => 1,
+ buffer => 0,
+ ymin => 29.5,
+ ymax => -0.5,
+ xmin => -0.5,
+ xmax => 47.5,
+ #cbmax => "100<*<1E7",
+ #cbmin => 0,
+ noinit => 1,
+ additional => "set format y \"%02o\";set ytics (0,5,8,13,16,21,24,29);set xtics('0' 0,'2' 6, '4' 12,'6' 18,'8' 24,'A' 30, 'C' 36, 'E' 42);",
+ showvalues => 0, }
+ );
+
+HPlot::PlotInit({
+ name => "MDCPowerBoardCurrents",
+ file => "files/MDCPowerBoardCurrents",
+ title => "MDC Powerboard Currents",
+ entries => 4,
+ curves => 30,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Current",
+ sizex => 310,
+ sizey => 510,
+ nokey => 1,
+ buffer => 0,
+ ymin => 29.5,
+ ymax => -0.5,
+ xmin => -0.5,
+ xmax => 3.5,
+ #cbmax => "100<*<1E7",
+ #cbmin => 0,
+ noinit => 1,
+ additional => "set format y \"%02o\";set ytics (0,5,8,13,16,21,24,29);set xtics(0,1,2,3);",
+ showvalues => 3, }
+ );
+
+HPlot::PlotInit({
+ name => "MDCPowerBoardTemp",
+ file => "files/MDCPowerBoardTemp",
+ title => "MDC Powerboard Temperatures",
+ entries => 4,
+ curves => 30,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Temperature",
+ sizex => 310,
+ sizey => 510,
+ nokey => 1,
+ buffer => 0,
+ ymin => 29.5,
+ ymax => -0.5,
+ xmin => -0.5,
+ xmax => 3.5,
+ #cbmax => "100<*<1E7",
+ #cbmin => 0,
+ noinit => 1,
+ additional => "set format y \"%02o\";set ytics (0,5,8,13,16,21,24,29);set xtics(0,1,2,3);",
+ showvalues => 2, }
+ );
+
+HPlot::PlotInit({
+ name => "MDCPowerBoardVoltages",
+ file => "files/MDCPowerBoardVoltage",
+ title => "MDC Powerboard Voltages",
+ entries => 4,
+ curves => 30,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Input Voltage",
+ sizex => 310,
+ sizey => 510,
+ nokey => 1,
+ buffer => 0,
+ ymin => 29.5,
+ ymax => -0.5,
+ xmin => -0.5,
+ xmax => 3.5,
+ #cbmax => "100<*<1E7",
+ #cbmin => 0,
+ noinit => 1,
+ additional => "set format y \"%02o\";set ytics (0,5,8,13,16,21,24,29);set xtics(0,1,2,3);",
+ showvalues => 2, }
+ );
+
+my $str = Hmon::MakeTitle(8, 11, "MDC Voltage Settings",0);
+$str .= qq@<img src="%ADDPNG files/MDCVoltSet.png%" type="image/png"><br>\n@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("MDCNewVoltSet",$str);
+
+$str = Hmon::MakeTitle(12, 11, "MDC Powerboard Current / Voltage / Temperature",0);
+$str .= qq@<img src="%ADDPNG files/MDCPowerBoardCurrents.png%" type="image/png">\n@;
+$str .= qq@<img src="%ADDPNG files/MDCPowerBoardVoltage.png%" type="image/png">\n@;
+$str .= qq@<img src="%ADDPNG files/MDCPowerBoardTemp.png%" type="image/png"><br>\n@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("MDCNewPowerBoards",$str);
+
+while (1) {
+ HPlot::PlotClear('MDCVoltSet');
+ HPlot::PlotClear('MDCPowerBoardCurrents');
+ HPlot::PlotClear('MDCPowerBoardVoltages');
+ HPlot::PlotClear('MDCPowerBoardTemp');
+
+ my $data;
+ for my $p (0..1) {
+ for my $s (0..5) {
+ $data->{$p}{$s} = eval(`cd ~/trbsoft/hades_mdc_settings/scripts;./powerboard_status.pl -p $p -s $s -r`);
+ my $ypos = 8*$p+$s;
+ for my $b (0..15) {
+ my ($host,$board,$outp) = MDC::get_power_output(MDC::get_address($p,$s,$b,5));
+ next if $board == -1;
+ next if $outp == -1;
+ my $xpos = $b*3;
+ my $val0 = $data->{$p}{$s}[$board]{adjust}[$outp][0]||"NaN";
+ my $val1 = $data->{$p}{$s}[$board]{adjust}[$outp][1]||"NaN";
+ HPlot::PlotFill('MDCVoltSet',$val0,$xpos,$ypos);
+ HPlot::PlotFill('MDCVoltSet',$val1,$xpos+1,$ypos);
+ }
+ HPlot::PlotFill('MDCPowerBoardCurrents',$data->{$p}{$s}[0]{curr}||"NaN",0,$ypos);
+ HPlot::PlotFill('MDCPowerBoardCurrents',$data->{$p}{$s}[1]{curr}||"NaN",1,$ypos);
+ HPlot::PlotFill('MDCPowerBoardCurrents',$data->{$p}{$s}[2]{curr}||"NaN",2,$ypos);
+ HPlot::PlotFill('MDCPowerBoardCurrents',$data->{$p}{$s}[3]{curr}||"NaN",3,$ypos);
+
+ HPlot::PlotFill('MDCPowerBoardVoltages',$data->{$p}{$s}[0]{vin}||"NaN",0,$ypos);
+ HPlot::PlotFill('MDCPowerBoardVoltages',$data->{$p}{$s}[1]{vin}||"NaN",1,$ypos);
+ HPlot::PlotFill('MDCPowerBoardVoltages',$data->{$p}{$s}[2]{vin}||"NaN",2,$ypos);
+ HPlot::PlotFill('MDCPowerBoardVoltages',$data->{$p}{$s}[3]{vin}||"NaN",3,$ypos);
+
+ HPlot::PlotFill('MDCPowerBoardTemp',$data->{$p}{$s}[0]{temp}||"NaN",0,$ypos);
+ HPlot::PlotFill('MDCPowerBoardTemp',$data->{$p}{$s}[1]{temp}||"NaN",1,$ypos);
+ HPlot::PlotFill('MDCPowerBoardTemp',$data->{$p}{$s}[2]{temp}||"NaN",2,$ypos);
+ HPlot::PlotFill('MDCPowerBoardTemp',$data->{$p}{$s}[3]{temp}||"NaN",3,$ypos);
+ }
+ }
+
+ HPlot::PlotDraw('MDCVoltSet');
+ HPlot::PlotDraw('MDCPowerBoardCurrents');
+ HPlot::PlotDraw('MDCPowerBoardVoltages');
+ HPlot::PlotDraw('MDCPowerBoardTemp');
+ sleep 60;
+ }
+