]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
status after sucessful beamtime, mt
authorhadaq <M.Traxler@gsi.de>
Mon, 3 Aug 2015 14:55:30 +0000 (16:55 +0200)
committerhadaq <M.Traxler@gsi.de>
Mon, 3 Aug 2015 14:55:30 +0000 (16:55 +0200)
21 files changed:
dmon/scripts/dmon_evtbnetmem.pl
dmon/scripts/dmon_qa.pl
thresholds/logger_threshold.conf
thresholds/run_thresh_on_system.pl
thresholds/thresholds_automatic.pl
thresholds/thresholds_compare_dirc.pl
users/gsi_dirc/EventBuilderNew.xml
users/gsi_dirc/addresses_trb3.db
users/gsi_dirc/dmon_config.pl
users/gsi_dirc/first.C
users/gsi_dirc/padiwa_led_off.pl
users/gsi_dirc/prepare_padiwas_invert_leds.pl
users/gsi_dirc/register_config_tdc.db
users/gsi_dirc/register_configgbe.db
users/gsi_dirc/register_configgbe_ip.db
users/gsi_dirc/start_readout.pl [deleted file]
users/gsi_dirc/startup.sh
users/gsi_dirc/trb_power_cycle
users/gsi_dirc/trbreset_loop.pl
web/cts_gui
web/httpi

index 93d9c82dbe0595da50174278575e69cbe4095f12..881d7945379fd2c7e08dcd0e3ff51721c2ac4ed1 100755 (executable)
@@ -12,6 +12,10 @@ use lib "../perllibs/";
 use List::Util qw[min max];
 use Dmon;
 use Data::Dumper;
+use LWP::Simple;
+
+# please change to 1 if you use the "old"-eventbuilder, 0 for dabc
+my $old_eb = 0;
 
 my %config = Dmon::StartUp();
 
@@ -27,14 +31,27 @@ my $shm_string = $config{EvtbNetmem}->{shm_string};
 my $eb_shm = "/dev/shm/daq_evtbuild$shm_string.shm";
 my $nm_shm = "/dev/shm/daq_netmem$shm_string.shm";
 
+my $url = "http://localhost:8090/EventBuilder/Terminal/Output/value/get.json";
 
-while (1) {
+my $content;
+my $number_of_events;
+my $number_of_bytes;
+my $eb_data;
+my $nm_data;
 
+while (1) {
 
+if(!$old_eb) {
+    $content = get $url;
+    next if(!defined $content);
+    ($number_of_events) = $content =~ /Events:(.*?)Rate/;
+    ($number_of_bytes)  = $content =~ /Data:(.*?)Rate/;
+}
+else {
+    $eb_data = slurp_shm($eb_shm);
+    $nm_data = slurp_shm($nm_shm);
+}  
 
-  my $eb_data = slurp_shm($eb_shm);
-  my $nm_data = slurp_shm($nm_shm);
-  
 #   print "evtbuid keys: \n".join(" ",sort keys %$eb_data)."\n\n"; 
 #   print "netmem  keys: \n".join(" ",sort keys %$nm_data)."\n\n"; 
 #  #evtbuid keys: 
@@ -52,22 +69,48 @@ while (1) {
 #   print "nm data:\n";
 #   print Dumper $nm_data;
  
-  eval{ 
+eval{ 
     my $status = Dmon::OK;
-       $status = Dmon::ERROR unless defined $eb_data->{evtsComplete};
+    if($old_eb) {
+       $status = Dmon::ERROR unless defined $eb_data->{evtsComplete};
+    }
+    else {
+       $status = Dmon::ERROR unless defined $number_of_events;
+    }
     my $title  = "EvtsComplete";
-    my $value = Dmon::SciNotation($eb_data->{evtsComplete});
+
+    my $value;
+    if($old_eb) {
+       $value = Dmon::SciNotation($eb_data->{evtsComplete});
+    }
+    else {
+       $value = $number_of_events;
+    }
+
     my $longtext = "See plot";
     Dmon::WriteQALog($config{flog},"evtbnetmem",5,$status,$title,$value,$longtext,'');
-  };
-  eval{ 
+};
+eval{ 
     my $status = Dmon::OK;
-       $status = Dmon::ERROR unless defined $eb_data->{bytesWritten};
+
+    if($old_eb) {
+       $status = Dmon::ERROR unless defined $eb_data->{bytesWritten};
+    }
+    else {
+       $status = Dmon::ERROR unless defined $number_of_bytes;
+    }
+
     my $title  = "BytesWritten";
-    my $value = Dmon::SciNotation($eb_data->{bytesWritten});
+    my $value;
+    if($old_eb) {
+       $value = Dmon::SciNotation($number_of_bytes);
+    }
+    else {
+       $value = $number_of_bytes;
+    }
     my $longtext = "See plot";
     Dmon::WriteQALog($config{flog},"eb2",5,$status,$title,$value,$longtext,'');
-  };
+};
 #   eval{ 
 #     my $status = Dmon::OK;
 #     my $title  = "NetmemStatus";
@@ -75,27 +118,27 @@ while (1) {
 #     my $longtext = "See plot";
 #     Dmon::WriteQALog($config{flog},"eb3",5,$status,$title,$value,$longtext,'');
 #   };
-  sleep(1);
+sleep(1);
 }
 
 sub slurp_shm {
-  
-  my $infile = shift;
-  open (INFILE, "<", $infile) or return;
-  binmode (INFILE);
-  
-  my $data = {};
-  while (1) {
-    my $string;
-    my $rawval;
-    read (INFILE, $string, 32) or last;
-    ($string) = $string =~ m/^([\w]+)/;
-    last unless ($string);
-    read (INFILE, $rawval   ,  8) or last;
-    my $number = unpack("L",pack("a8",$rawval));
+    
+    my $infile = shift;
+    open (INFILE, "<", $infile) or return;
+    binmode (INFILE);
+    
+    my $data = {};
+    while (1) {
+       my $string;
+       my $rawval;
+       read (INFILE, $string, 32) or last;
+       ($string) = $string =~ m/^([\w]+)/;
+       last unless ($string);
+       read (INFILE, $rawval   ,  8) or last;
+       my $number = unpack("L",pack("a8",$rawval));
 #     printf("%20s : %16d (0x%016X) \n",$string,$number,$number);
-    $data->{$string}=$number;
-  }
-  close(INFILE);
-  return $data;
+       $data->{$string}=$number;
+    }
+    close(INFILE);
+    return $data;
 }
index e31cd41cd05069173012b36469a93855364c3bde..b2cd613b7434e6a53ceaabb78caf4ec7e77816a8 100755 (executable)
@@ -41,7 +41,7 @@ while($a = <FLOG>) {
   if($readlines++ > 10000) {
     $readlines = 0;
     close(FLOG);
-    system "cat " . Dmon::DMONDIR . "/qalog >> " . $config{UserDirectory} . "/qalog_persist";
+    system "cat " . Dmon::DMONDIR . "/qalog >> " . $config{qalog_persistDirectory} . "/qalog_persist";
     open(FL,">".Dmon::DMONDIR."/qalog");
     close(FL);
     open(FLOG, "tail -F ".Dmon::DMONDIR."/qalog|");
index e5b200cbe4bfafdaa7c055fb5718df29437fa2b0..0bdd71e2b54cf5e1c990de38581ec9483bfcb15a 100644 (file)
@@ -1,4 +1,4 @@
-log4perl.logger.padiwa_threshold=DEBUG, A1
+log4perl.logger.padiwa_threshold=ERROR, A1
 log4perl.appender.A1=Log::Dispatch::File
 log4perl.appender.A1.filename=padiwa_threshold.log
 log4perl.appender.A1.mode=append
index a6ce0a49d92873a35fd182d3a8c8c3725b5ae04b..2018d0daad04910ff392d4e914169e4f43692652 100755 (executable)
@@ -19,8 +19,10 @@ my $opt_offset = 0;
 my $opt_polarity = 0;
 my $opt_32channel = 0;
 my $opt_finetune = false;
+my $opt_sequential = false;
 my $opt_verb;
 my $tool = "./thresholds_automatic.pl";
+#my $tool = "./thresholds_automatic_jan.pl";
 
 GetOptions ('h|help'        => \$opt_help,
             'e|endpoints=s' => \@opt_endpoints,
@@ -29,6 +31,7 @@ GetOptions ('h|help'        => \$opt_help,
             'p|polarity=i'  => \$opt_polarity,
             '32|32channel'  => \$opt_32channel,
             'f|finetune'    => \$opt_finetune,
+            's|sequential'    => \$opt_sequential,
             't|tool=s'      => \$tool,
             'v|verb'        => \$opt_verb);
 
@@ -71,6 +74,14 @@ foreach my $endpoint (@$endpoints) {
     my $endpoint = sprintf("0x%04x", $endpoint);
     $command = "$tool -e $endpoint -o $opt_offset -c $chain -p $opt_polarity $opt_32channel $opt_finetune";
     print "command: $command\n";
+
+    if($opt_sequential) {
+       my $kill_command = "./write_thresholds.pl padiwa_threshold_results_20150625_14_21_all.log -o -10000";
+       qx($kill_command);
+       qx($command);
+       next;
+    }
+
     my $pid = fork();
     if($pid==0) { #child
       my $res = qx($command);
@@ -145,6 +156,7 @@ example:
 run_threshold_on_system.pl --endpoints=0x301-0x308,0x310..0x315,0x380 --chains=0..3 --offset=4 --polarity=0
 will run for endpoints 0x301-0x308 and 0x310-0x315 and 0x380 for all chains (0..3)
 
+read the code....
 
 EOF
 
index 58bcb47a4acf65bf5620a48b171e10183a9af370..8088d18f141d3c1dc02a5d651d8153ed7cd2eeeb 100755 (executable)
@@ -34,9 +34,9 @@ my @valid_interval = (0x5000, 0xc000);
 my $interval_step = ($valid_interval[1] - $valid_interval[0])/2;
 my $start_value = int ( ($valid_interval[1] + $valid_interval[0])/2 );
 
-my $sleep_time = 0.2;
+my $sleep_time = 0.3;
 my $accepted_dark_rate = 10;
-my $number_of_iterations = 30; # at least 15 are recommended
+my $number_of_iterations = 40; # at least 15 are recommended
 
 my $endpoint = 0x0303;
 my $mode = "padiwa";
@@ -468,6 +468,7 @@ currently only mode "padiwa" is implemented.
 
 polarity: tells what the status of bit 32 is, when the thresholds are set to 0
 32channel: when set the tool assums a TDC with 32 channels, leading and trailing channels use two channels
+finetune: tries to optimize the thresholds beginning with the current ones
 
 EOF
 
index e5d5db4fc62cc255ddf7f815ccc1deb67e6a1db6..51e0b9859cc1b1bd2df6737b323dfcdb36f88781 100755 (executable)
@@ -68,6 +68,10 @@ sub readSettings {
     (my $ep, my $chain, my $channel, my $thresh, my $uid) = 
       $cl =~ /endpoint:\s+(\w+), chain:\s+(\d+), channel:\s+(\d+) threshold:\s+(\w+), uid: (\w+)/;
     next unless defined $ep;
+    if( length($thresh) >=8) {
+       #print $thresh;
+       $thresh = 0xffffff;
+    }
     $thresholds{hex($ep) .":". (int($channel)+ 16* int($chain)+1 )} = hex $thresh;
   }
 
@@ -373,4 +377,4 @@ sub kilomega {
   } else {
     return sprintf("%d",$val);
   }
-}
\ No newline at end of file
+}
index c9637a36c97338414d0ac7f1b45ebb8622dca1f6..d480d15afb714e456bd890dedea61ba62d78faf8 100644 (file)
@@ -60,23 +60,30 @@ When starting analysis from the go4 gui, one should specify stream server with p
        <NumBuffers value="1000"/>
     </MemoryPool>
 
+    <Thread name="UdpThread1" class="dabc::SocketThread" affinity="+0"/>
+
     <Module name="Combiner" class="hadaq::CombinerModule">    
         <!-- these parameters will force to create inputs/oputputs of module -->
-       <NumInputs value="13"/>
+       <NumInputs value="10"/>
        <NumOutputs value="2"/>
 
        <InputPort name="Input0"  url="hadaq://host:49999" thread="UdpThread1"/>
-       <InputPort name="Input1"  url="hadaq://host:50000" thread="UdpThread2"/>
-       <InputPort name="Input2"  url="hadaq://host:50001" thread="UdpThread3"/>
-       <InputPort name="Input3"  url="hadaq://host:50002" thread="UdpThread4"/>
+       <InputPort name="Input1"  url="hadaq://host:50000" thread="UdpThread1"/>
+       <InputPort name="Input2"  url="hadaq://host:50001" thread="UdpThread1"/>
+       <InputPort name="Input3"  url="hadaq://host:50002" thread="UdpThread1"/>
        <InputPort name="Input4"  url="hadaq://host:50003" thread="UdpThread1"/>
-       <InputPort name="Input5"  url="hadaq://host:50004" thread="UdpThread2"/>
-       <InputPort name="Input6"  url="hadaq://host:50005" thread="UdpThread3"/>
-       <InputPort name="Input7"  url="hadaq://host:50006" thread="UdpThread4"/>
+       <InputPort name="Input5"  url="hadaq://host:50004" thread="UdpThread1"/>
+       <InputPort name="Input6"  url="hadaq://host:50005" thread="UdpThread1"/>
+       <InputPort name="Input7"  url="hadaq://host:50006" thread="UdpThread1"/>
        <InputPort name="Input8"  url="hadaq://host:50007" thread="UdpThread1"/>
-       <InputPort name="Input9"  url="hadaq://host:50008" thread="UdpThread2"/>
-       <InputPort name="Input10" url="hadaq://host:50009" thread="UdpThread3"/>
-       <InputPort name="Input11" url="hadaq://host:50010" thread="UdpThread4"/>
+       <InputPort name="Input9"  url="hadaq://host:50008" thread="UdpThread1"/>
+
+
+       <InputPort name="Input7"  url="hadaq://host:50008" thread="UdpThread1"/>
+
+       <InputPort name="Input9"  url="hadaq://host:50008" thread="UdpThread1"/>
+       <InputPort name="Input10" url="hadaq://host:50009" thread="UdpThread1"/>
+       <InputPort name="Input11" url="hadaq://host:50010" thread="UdpThread1"/>
        <InputPort name="Input12" url="hadaq://host:50011" thread="UdpThread1"/>
 
        <InputPort name="Input13" url="hadaq://host:50013" thread="UdpThread2"/>
@@ -90,12 +97,12 @@ When starting analysis from the go4 gui, one should specify stream server with p
        <InputPort name="Input21" url="hadaq://host:50021" thread="UdpThread2"/>
        <InputPort name="Input22" url="hadaq://host:50022" thread="UdpThread3"/>
 
-       <InputPort name="Input*" queue="30" urlopt="udpbuf=200000&mtu=64512&flush=2&observer=false&debug"/>
+       <InputPort name="Input*" queue="100" urlopt="udpbuf=200000&mtu=64512&flush=0.1&observer=false&maxloop=10"/>
 
        <!--  this is stream server for online monitoring, normally always on -->
        <OutputPort name="Output0" url="mbs://Stream:6789?iter=hadaq_iter&subid=0x1f"/>
 
-       <OutputPort name="Output1" url="hld:///d/may2015/dabc.hld?maxsize=1500"/>
+       <OutputPort name="Output1" url="hld:///d/june2015/dabc.hld?maxsize=1500"/>
 
 
        <!--  this is example of HLD file storage - local -->
index fe452f4a4d42e85ad4e945f994a11b5c309641fe..b5b9d6008a4cf2fcab369500ddbda9025a57d1e3 100644 (file)
 0x8005     97     5
 
 # MCP-TOF-BACK 2
-0x2018     83     0
-0x2019     83     1
-0x201a     83     2
-0x201b     83     3
-0x8006     83     5
+0x2018     59     0
+0x2019     59     1
+0x201a     59     2
+0x201b     59     3
+0x8006     59     5
 
 # HODO
 0x201c     89     0
@@ -68,7 +68,9 @@
 0x201f     89     3
 0x8007     89     5
 
-# FLASH
+
+
+# FLASH ,not used
 0x2020    111     0
 0x2021    111     1
 0x2022    111     2
@@ -76,7 +78,7 @@
 0x8008    111     5
 
 
-# DISC-DIRC
+# DISC-DIRC, not used
 
 0x2024    13      0
 0x2025    13      1
 0x202a    77      2
 0x202b    77      3
 0x800a    77      5
-#AUX
+
+
+#AUX , not used
 0x202c    57      0
 0x202d    57      1
 0x202e    57      2
 0x202f    57      3
-0x800b    57      5
+0x8008    57      5
index 4fd8720617bd3dc22a25218ba991b930d67674e3..89c0b5d12de1be9cb986b6f958cedc73cf845d23 100755 (executable)
@@ -7,15 +7,16 @@ activeScripts => [['time','ping','-','-','daqop'],
                   ['beamintensity','beammonitors','-','-','-'],
                   ['trgrate','datarate','deadtime','-','-'],
                   ['padiwatemp','padiwaonline','-','-','-'],
-                  ['heatmapdirc','heatmapflash','heatmapdiscdirc','-','-'],
+                  ['heatmapdirc','-','-','-','-'],
+#                  ['heatmapdirc','heatmapdirc_zoom','-','-','-'],
                   ['evtbnetmem','eb2','eb3','-','-'],
                   ],
                   
 #Names to be shown in left column of Overview (max 4 letters!)
 qaNames => ['sys','main','beam','rate','Pdwa','Heat','EB'],                  
 
-#Expected number of FPGAs in system
-NumberOfFpga => 58,
+#Expected number of FPGAs in system (50 minus two switchport blocks of MCP-TOF 1/2
+NumberOfFpga => 48,
 NumberOfPadiwa => 87,
 
 #The address of the individual boards
@@ -25,20 +26,20 @@ PadiwaBroadcastAddress => 0xfe4c,
 PadiwaTrbAddresses => [0x2000,0x2001,0x2002,0x2003,0x2004,0x2005,0x2006,0x2007,
                        0x2008,0x2009,0x200a,0x200b,0x200c,0x200d,0x200e,0x200f,
                        0x2010,0x2011,0x2012,0x2013,0x2014,0x2015,0x2016,0x2018,
-                       0x2019,0x201a,0x201c,0x2024,0x2025,0x2026,0x2027,0x2028],
+                       0x2019,0x201a,0x201c,0x201d],
 PadiwaChainMask =>    [0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,
-                       0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,
+                       0x0006,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,
                        0x0007,0x0007,0x0007,0x0007,0x0001,0x0003,0x0003,0x0001,
-                       0x0003,0x0003,0x0003,0x0007,0x0007,0x0007,0x0007,0x0007],
+                       0x0003,0x0003,0x0001,0x0003],
                        
 #0x2020,0x2023, no padiwa
 #,0x201d,0x201e,0x201f off
 #0x2029,0x202a,0x202b,0x202c,0x202d,0x202e,0x202f
-OtherTrbAddresses => [0x7999,0x2020,0x2023,0x202c,0x202d],
+OtherTrbAddresses => [0x7999,0x202c,0x202d],
 
 
 
-HubTrbAddresses =>  [0x8100,0x8101,0x8102,0x8103,0x8000,0X8001,0x8002,0x8003,0x8004,0x8005,0x8006,0x8007,0x8008,0x8009,0x800a,0x800b],
+HubTrbAddresses =>  [0x8100,0x8101,0x8102,0x8103,0x8000,0X8001,0x8002,0x8003,0x8004,0x8005,0x8006,0x8007,0x8008],
 
                     
 #Addresses of all TDCs. Either single or broadcast addresses
@@ -52,12 +53,10 @@ TrbIP => [
     "192.168.0.74",
     "192.168.0.104",
     "192.168.0.97",
-    "192.168.0.83",
+    "192.168.0.59",
     "192.168.0.89",
-    "192.168.0.111",
-    "192.168.0.13",
-    "192.168.0.77",
-    "192.168.0.56"
+    "192.168.0.57",
+    "192.168.10.56"
 ],
 
 #Channel to read spill intensity from. Give limit for off-spill detection
@@ -67,7 +66,7 @@ SpillThreshold => 50,
 
 #Name detectors 
 BeamDetectorsTrb  => [0x202c,0x202c,0x202c,0x2014,0x2018],
-BeamDetectorsChan => [0xc001,0xc005,0xc003,0xc001,0xc001],
+BeamDetectorsChan => [0xc001,0xc003,0xc002,0xc001,0xc001],
 BeamDetectorsName => ['Trig1','Trig2','Laser1','MCP1','MCP2'],
 #BeamDetectorsTrb  => [0x0110, 0x0110, 0x0111,0x0110,0x0111,0x0110,0x0113,0x0111,0x0110],
 #BeamDetectorsChan => [0xc001, 0xc003, 0xc001,0xc009,0xc005,0xc00b,0xc009,0xc009,0xc005],
@@ -81,8 +80,9 @@ UserDirectory => '/home/hadaq/trbsoft/daqtools/users/gsi_dirc/',
 HeatmapDirc => {
   # upper limit for high end of color scale
 #  max_count_uclamp => 100000000,
-#  max_count_uclamp =>10000,
+#  max_count_uclamp =>500,
   max_count_uclamp => 5000,
+#  max_count_uclamp => 10000,
   # lower limit for high end of color scale
   max_count_lclamp => 10,
   
@@ -94,9 +94,11 @@ HeatmapDirc => {
   normalization_inertia => 3 
 },
 
-HeatmapFlash => {
+HeatmapDircZoom => {
   # upper limit for high end of color scale
-  max_count_uclamp => 200000,
+#  max_count_uclamp => 100000000,
+#  max_count_uclamp =>500,
+  max_count_uclamp => 5000,
   # lower limit for high end of color scale
   max_count_lclamp => 10,
   
@@ -108,22 +110,8 @@ HeatmapFlash => {
   normalization_inertia => 3 
 },
 
-HeatmapDiscDirc => {
-  # upper limit for high end of color scale
-  max_count_uclamp => 100000,
-##  max_count_uclamp => 100,
-  # lower limit for high end of color scale
-  max_count_lclamp => 30,
-  
-  # when set to 1 normalization of color scale is instantaneous,
-  # when set to 0, normalization has "inertia"
-  instant_normalization => 1,
-  
-  # the inertia of the adaption of the color scale in the unit of 1/(gliding average weight)
-  normalization_inertia => 3 
-},
-
 EvtbNetmem => {
   shm_string => "test"
-}
+},
 
+qalog_persistDirectory => '/d/logs/'
index 070a0d3cc6a147970a75a45810f71c6f663ef50b..d306a55adcea0dd1693221e9ab24645fc5ea5254 100644 (file)
@@ -48,7 +48,9 @@ void first()
 
       // specify reference channel
       //tdc->SetRefChannel(0, 0, 0x202c, 20000,  9597E6., 9603E6., true);
-      tdc->SetRefChannel(0, 0, 0x2001, 20000,  -100., 100., true);
+      if(cnt==0) {
+       tdc->SetRefChannel(0, 0, 0x2001, 20000,  -100., 100., true);
+      }
       //tdc->SetRefChannel(3, 1, 0xffff, 20000,  -10., 10., true);
       //      continue;
 
@@ -69,15 +71,17 @@ void first()
        tdc->SetRefChannel(7, 7, 0x2000, 20000,  -20., 20., true);
       }
 
-      if (tdc==4) continue;
+      if (cnt>1) continue;
 
       // specify reference channel
+
+      /*
       tdc->SetRefChannel(0, 0, 0x202d, 20000,  -100., 100., true);
       tdc->SetRefChannel(1, 0, 0xffff, 20000,  -800., 800., true);
       tdc->SetRefChannel(2, 0, 0xffff, 20000,  -200., 200., true);
       tdc->SetRefChannel(3, 0, 0xffff, 20000,  -200., 200., true);
       tdc->SetRefChannel(4, 0, 0xffff, 20000,  -200., 200., true);
-
+      */
 
       // for old FPGA code one should have epoch for each hit, no longer necessary
       // tdc->SetEveryEpoch(true);
index e53fb20baeba08f3a37f0e36f5988201a60a2531..742e2ec065c2d52d941d02c70b51a2602e16cf63 100755 (executable)
@@ -7,22 +7,30 @@ use Parallel::ForkManager;
 my $MAX_PROCESSES=50;
 my $pm = Parallel::ForkManager->new($MAX_PROCESSES);
 
-my @pad0 =(0x2000,0x2001,0x2004,0x2007,0x2009,0x200a,0x200c,0x200f,0x2011,0x2012,0x2013);
-my @pad1 =(0x2000,0x2004,0x2005,0x2006,0x2007,0x2008,0x2009,0x200e);
-my @pad2 =(0x2004,0x2006,0x2008,0x2009,0x200a,0x200e,0x2010);
+my @pad0 =(0x2000 .. 0x2013);
+my @pad1 =(0x2000 .. 0x2013);
+my @pad2 =(0x2000 .. 0x2013);
+
+#my @pad0 =(0x2000,0x2001,0x2004,0x2007,0x2009,0x200a,0x200c,0x200f,0x2011,0x2012,0x2013);
+#my @pad1 =(0x2000,0x2004,0x2005,0x2006,0x2007,0x2008,0x2009,0x200e);
+#my @pad2 =(0x2004,0x2006,0x2008,0x2009,0x200a,0x200e,0x2010);
 
 
 foreach my $b (@pad0) {
     my $pid = $pm->start and next;
-    my $c = sprintf("../../tools/padiwa.pl 0x%04x 0 led 0x10 >/dev/null",$b);
+    my $c = sprintf("../../tools/padiwa.pl 0x%04x 0 ledoff >/dev/null",$b);
+    #print "$c\n";
     system($c);
+    #my $r = qx($c);
+    #print $r;
     $pm->finish;
   }
 $pm->wait_all_children;
-
+#print "next\n";
 foreach my $b (@pad1) {
     my $pid = $pm->start and next;
-    my $c = sprintf("../../tools/padiwa.pl 0x%04x 1 led 0x10 >/dev/null",$b);
+    my $c = sprintf("../../tools/padiwa.pl 0x%04x 1 ledoff >/dev/null",$b);
+    #print $c;
     system($c);
     $pm->finish;
   }
@@ -30,7 +38,7 @@ $pm->wait_all_children;
 
 foreach my $b (@pad2) {
     my $pid = $pm->start and next;
-    my $c = sprintf("../../tools/padiwa.pl 0x%04x 2 led 0x10 >/dev/null",$b);
+    my $c = sprintf("../../tools/padiwa.pl 0x%04x 2 ledoff >/dev/null",$b);
     system($c);
     $pm->finish;
 }  
index db0fc1e2e5dbc4ffd49ef19647629823bce055c7..3d9291d6fd8b963ee0b5e6370c1c7fe7b1adfbfb 100755 (executable)
@@ -5,6 +5,7 @@ use warnings;
 
 use Parallel::ForkManager;
 use Getopt::Long;
+use Data::Dumper;
 
 my $help;
 my $opt_invert;
@@ -34,7 +35,7 @@ my $endpoints = get_ranges(\@opt_endpoints);
 my $chains    = get_ranges(\@opt_chains);
 
 
-my $MAX_PROCESSES = 100;
+my $MAX_PROCESSES = 40;
 my $pm = Parallel::ForkManager->new($MAX_PROCESSES);
 
 #my $padiwa_invert_setting = "0xffff";
@@ -43,11 +44,13 @@ my $str_endpoints= join " ", @opt_endpoints;
 
 print "current padiwa range: $str_endpoints\n";
 
-print "\tsetting padiwa invert-setting to $opt_invert ";
+print "\tsetting padiwa invert-setting to $opt_invert: ";
+
 execute_command("invert $opt_invert");
 $pm->wait_all_children;
 print "\n";
 
+
 #print "result of invert\n";
 #execute_command("invert", "verbose");
 #exit
@@ -71,13 +74,18 @@ if($opt_stretch) {
     print "\n";
 }
 
-
+#sleep 2;
 exit;
 
 sub execute_command {
 
   (my $padiwa_command, my $verbosity) = @_;
 
+  #print Dumper $endpoints;
+  if(!@$endpoints) {
+      print "\nattention: no enpoints selected. Not doing anything!\n";
+      die;
+  }
   foreach my $cur_endpoint (@$endpoints) {
     my $pid = $pm->start and next;
     $cur_endpoint = sprintf "0x%4x", $cur_endpoint;
@@ -87,6 +95,8 @@ sub execute_command {
       my $c="/home/hadaq/trbsoft/daqtools/padiwa.pl $cur_endpoint $chain $padiwa_command";
       if (!$verbosity) { $c.= " >/dev/null" };
       #print $c . "\n";
+      #$c="/home/hadaq/trbsoft/daqtools/padiwa.pl  $cur_endpoint $chain temp";
+      #print "$c\n";
       my $res = qx($c); die "could not execute command $c" if $?;
       if($verbosity) { print "$res"; }
     }
index 8a78e0c91de0b604baef40d30efd23745f5f935f..aa79059215d6e48927415769eec0c977df937587 100644 (file)
 # Hub  # Type #  lower 32 channels   #  upper 32 channels  # 
 #################################################################
 
+# Broken (lost config) Padiwa
+  0x2008   0         0xffff0000           0x0000ffff
+
 # FLASH
-  0x2021   0         0x00000000           0x00000000
-  0x2022   0         0x00000000           0x00000000
+# 0x2021   0         0x00000000           0x00000000
+# 0x2022   0         0x00000000           0x00000000
 
 # TOF1
   0x2014   0         0x0000ffff           0x00000000
   0x2015   0         0xffffffff           0x00000000
   0x2016   0         0xffffffff           0x00000000
-  0x2017   0         0x0000ffff           0x00000000
+# 0x2017   0         0x0000ffff           0x00000000
 
 # TOF2
 
   0x2018   0         0x0000ffff           0x00000000
   0x2019   0         0xffffffff           0x00000000
   0x201a   0         0xffffffff           0x00000000
-  0x201b   0         0x00000000           0x00000000
+# 0x201b   0         0x00000000           0x00000000
 
 # #Hodo
 
-  0x201c   0         0xffffffff           0x00000000
-  0x201d   0         0x00000000           0x00000000
+  0x201c   0         0x0000005f           0x00000000
+  0x201d   0         0xffffffff           0x00000000
   0x201e   0         0x00000000           0x00000000
   0x201f   0         0x00000000           0x00000000
 
 # EDD
-  0x202b   0         0x00000000           0x00000000
+# 0x202b   0         0x00000000           0x00000000
 
 #DISC-DIRC
-  0x2026   0         0xfffffff           0x0000ffff
+# 0x2026   0         0xffffffff           0x0000ffff
 
 # AUX
   0x202c   0         0xffffffff           0x00000000
index 5589179f80184125858106f90d4b2ce09147b850..9e3e766264b109fc9981a56bc999d146ebf90204 100755 (executable)
@@ -21,9 +21,9 @@
  0x8006     0     0x8006    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
  0x8007     0     0x8007    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
  0x8008     0     0x8008    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
- 0x8009     0     0x8009    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
- 0x800a     0     0x800a    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
- 0x800b     0     0x800b    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
+# 0x8009     0     0x8009    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
+# 0x800a     0     0x800a    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
+# 0x800b     0     0x800b    0x00020001   0x00030064     0x1DE8       0x578         1          1           1            1                0x0 
 # 0x8012     0     0x8012    0x00020001   0x00030064     0x1DE8       0x578         1          0           1            1                0x0 
 # 0x8013     0     0x8013    0x00020001   0x00030064     0x1DE8       0x578         1          0           1            1                0x0 
 # 0x8014     0     0x8014    0x00020001   0x00030064     0x1DE8       0x578         1          0           1            1                0x0 
index e665b273b5a3295b2796957679b90565ee1df2b3..5906c4e278f4f9ded6ca3c56a4cc9662e4f94b9b 100755 (executable)
@@ -28,7 +28,7 @@
 # Hub    #  Type  #     C0     #     C1     #     C2     #     C3     #     C4     #     C5     #     C6     #     C7     #     C8     #
 ########################################################################################################################################
 
- 0x7999        0   0x1e04f330    0x000e      0xc0a80003      0xc34f     0xdead7fff     0x001b   0xc0a80000      0xc350     0x0578
+ 0x7999        0   0x7a0b83ca    0x0cc4      0xc0a80a03      0xc34f     0xdead7fff     0x001b   0xc0a80000      0xc350     0x0578
  0x8000        0   0x1e04f330    0x000e      0xc0a80003      0xc350     0xdead8000     0x001b   0xc0a80001      0xc351     0x0578
  0x8001        0   0x1e04f330    0x000e      0xc0a80003      0xc351     0xdead8001     0x001b   0xc0a80002      0xc352     0x0578
  0x8002        0   0x1e04f330    0x000e      0xc0a80003      0xc352     0xdead8002     0x001b   0xc0a80003      0xc353     0x0578
@@ -38,9 +38,9 @@
  0x8006        0   0x1e04f330    0x000e      0xc0a80003      0xc356     0xdead8006     0x001b   0xc0a80007      0xc357     0x0578
  0x8007        0   0x1e04f330    0x000e      0xc0a80003      0xc357     0xdead8007     0x001b   0xc0a80008      0xc358     0x0578
  0x8008        0   0x1e04f330    0x000e      0xc0a80003      0xc358     0xdead8008     0x001b   0xc0a80009      0xc359     0x0578
- 0x8009        0   0x1e04f330    0x000e      0xc0a80003      0xc359     0xdead8009     0x001b   0xc0a8000a      0xc35a     0x0578
- 0x800a        0   0x1e04f330    0x000e      0xc0a80003      0xc35a     0xdead800a     0x001b   0xc0a8000b      0xc35b     0x0578
- 0x800b        0   0x1e04f330    0x000e      0xc0a80003      0xc35b     0xdead800b     0x001b   0xc0a8000c      0xc35c     0x0578
+# 0x8009        0   0x1e04f330    0x000e      0xc0a80003      0xc359     0xdead8009     0x001b   0xc0a8000a      0xc35a     0x0578
+# 0x800a        0   0x1e04f330    0x000e      0xc0a80003      0xc35a     0xdead800a     0x001b   0xc0a8000b      0xc35b     0x0578
+# 0x800b        0   0x1e04f330    0x000e      0xc0a80003      0xc35b     0xdead800b     0x001b   0xc0a8000c      0xc35c     0x0578
 
 #  0x7999        0   0x1e04f330    0x000e      0xc0a80002      0xc350     0xdead8000     0x001b   0xc0a80000      0xc350     0x0578
 #  0x8000        0   0x1e04f330    0x000e      0xc0a80002      0xc351     0xdead8001     0x001b   0xc0a80001      0xc351     0x0578
diff --git a/users/gsi_dirc/start_readout.pl b/users/gsi_dirc/start_readout.pl
deleted file mode 100755 (executable)
index b415dcd..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Getopt::Long;
-
-my $help = "";
-my $dataPath = "/d/may2015/";
-my $label = "test";
-my $time = -1;
-my $name = "cc";
-my $dabc;
-my $c;
-
-my $result = GetOptions (
-    "h|help"    => \$help,
-    "d|dabc"    => \$dabc,
-    "t|time=i"  => \$time,
-    "l|label=s" => \$label,
-    "n|filename=s" => \$name,
-    "p|path=s"  => \$dataPath
-    );
-
-if($help) {
-    print "Usage: start_readout.pl <time>\n\n";
-    print "-h --help\tPrints the usage manual\n";
-    print "-t --time\tDefine length of time in seconds for data taking (Default = -1)\n";
-    print "-d --dabc\trun dabc instead of old (has no name) eventbuilder\n";
-    print "-n --filename\tuse the following prefix, limited to two character for old EB\n";
-    print "\t\tFor unlimited data taking define <time> as -1.\n";
-    print "-l --label\tDefine label for the daq_evtbuild and daq_netmem processes (Default = test)\n";
-    print "-p --path\tDefine path for saving data (Default = ~/trbsoft/data\)\n";
-    print "\n";
-    exit;
-}
-
-
-$c=qq|pkill -f "daq_evtbuild -S $label"|; qx($c); # if any, kill existing daq_evtbuild
-$c=qq|pkill -f "daq_netmem -S $label"|;   qx($c); # if any, kill existing daq_netmem
-
-
-if(defined $dabc) {
-    $c=qq|pkill -f "dabc_exe"|;
-    qx($c);
-    
-    $c=qq|perl -p -e 's/dabc.hld/$name.hld/' EventBuilderNew.xml > EventBuilder_autogenerated.xml|;
-    qx($c);
-
-    $c=qq|urxvt -geometry 80x27-0+0 -e bash -c 'dabc_exe EventBuilder_autogenerated.xml; sleep 10'|;
-    system("$c &");
-
-}
-else {
-
-    $c=qq|xterm -geometry 122x15-0+0 -e bash -c 'daq_evtbuild -S $label -m 13 -x $name --filesize 1536 -d file -o $dataPath'|;
-    #$c=qq|xterm -geometry 122x16-0+0 -e bash -c 'daq_evtbuild -S $label -m 23 -x $name -d file -o $dataPath'|;
-    #print $c;
-
-    system("$c &");
-
-    sleep 1;
-    $c=qq"xterm -geometry 82x45-0+210 -e bash -c 'daq_netmem -S $label -m 13 -i UDP:127.0.0.1:49999 -i UDP:127.0.0.1:50000 -i UDP:127.0.0.1:50001 -i UDP:127.0.0.1:50002 -i UDP:127.0.0.1:50003 -i UDP:127.0.0.1:50004 -i UDP:127.0.0.1:50005 -i UDP:127.0.0.1:50006 -i UDP:127.0.0.1:50007 -i UDP:127.0.0.1:50008 -i UDP:127.0.0.1:50009 -i UDP:127.0.0.1:50010 -i UDP:127.0.0.1:50011'";
-
-
-    #$c=qq"xterm -geometry 82x44-0+234 -e bash -c 'daq_netmem -S $label -m 23 -i UDP:127.0.0.1:50000 -i UDP:127.0.0.1:50001 -i UDP:127.0.0.1:50002 -i UDP:127.0.0.1:50003 -i UDP:127.0.0.1:50004 -i UDP:127.0.0.1:50005 -i UDP:127.0.0.1:50006 -i UDP:127.0.0.1:50007 -i UDP:127.0.0.1:50008 -i UDP:127.0.0.1:50009 -i UDP:127.0.0.1:50010 -i UDP:127.0.0.1:50011 -i UDP:127.0.0.1:50012 -i UDP:127.0.0.1:50013 -i UDP:127.0.0.1:50014 -i UDP:127.0.0.1:50015 -i UDP:127.0.0.1:50016 -i UDP:127.0.0.1:50017 -i UDP:127.0.0.1:50018 -i UDP:127.0.0.1:50019 -i UDP:127.0.0.1:50020 -i UDP:127.0.0.1:50021 -i UDP:127.0.0.1:50022; sleep 2'";
-
-    #$c=qq"xterm -geometry 82x17-0+210 -e bash -c 'daq_netmem -S $label -m 2 -i UDP:127.0.0.1:50000 -i UDP:127.0.0.1:50002'";
-    system("$c &");
-
-    print "Saving data to $dataPath\n";
-}
-
-if($time == -1) {
-    print "Data taking will run until manual quit with Ctrl+C\n\n";
-}
-else {
-    print "Data taking will run for $time seconds.\n\n";
-    sleep $time;
-    $c=qq|pkill -f "daq_evtbuild -S $label"|; qx($c);
-    $c=qq|pkill -f "daq_netmem -S $label"|;   qx($c);
-}
index 95d0e4583777e2522549ae0992d8ce4c1a8dd337..c6bce670420cecb1980498a09afea81909329f74 100755 (executable)
@@ -2,7 +2,9 @@
 
 export PATH=$PATH:~/trbsoft/daqtools/users/gsi_dirc
 
-check_ping.pl
+#trbcmd reset
+check_ping.pl --reboot
+rc=$?; if [[ $rc != 0 ]]; then echo "exit from startup as not all boards are up"; exit $rc; fi
 
 export TRB3_SERVER=trb056:26000 
 export TRBNETDPID=$(pgrep trbnetd)
@@ -19,7 +21,6 @@ export DAQOPSERVER=localhost:56
 
 trbreset_loop.pl
 
-
 ##################################################
 ## Set addresses
 ##################################################
@@ -48,50 +49,43 @@ trbcmd w 0xfe4c 0xc800 0x00002000 ## TDC-Control-Register, RTniceM
 #trbcmd w 0xfe4c 0xc800 0x00000001 ## logic analyser control register
 #trbcmd w 0xfe4c 0xc800 0x00001001 ## 2014-10-02 disable the "triggered mode"
 
-trbcmd w 0xfe4c 0xc801 0x80c600c6 ##  triggerwindow +/-990ns ;5ns granularity
-#trbcmd w 0xfe4c 0xc801 0x801e001e ##  triggerwindow +/-150ns ;5ns granularity
+trbcmd w 0xfe4c 0xc801 0x801e0046 ##  triggerwindow -350...+150ns ;5ns granularity
+#trbcmd w 0xfe4c 0xc801 0x80c600c6 ##  triggerwindow +/-990ns ;5ns granularity
+#trbcmd w 0xfe4c 0xc801 0x8000001e ##  triggerwindow +/-150ns ;5ns granularity
 
 # Default TDC-channel enable for all channels
 trbcmd w 0xfe4c 0xc802 0xffffffff ## channel 01-32 enable
 trbcmd w 0xfe4c 0xc803 0x0000ffff ## channel 33-64 enable
 trbcmd w 0xfe4c 0xc804 0x0000007c ## data transfer limit
 
+# TOFs time windows
+trbcmd w 0x2014 0xc801 0x8000008c
+trbcmd w 0x2015 0xc801 0x8000008c
+trbcmd w 0x2016 0xc801 0x8000008c
+trbcmd w 0x2018 0xc801 0x8000008c
+trbcmd w 0x2019 0xc801 0x8000008c
+trbcmd w 0x201a 0xc801 0x8000008c
+trbcmd w 0x201c 0xc801 0x8000008c
+trbcmd w 0x201d 0xc801 0x8000008c
+
 
 # special Matthias TDCs
-trbcmd clearbit 0xfe48 0xc800 0x2000 ## clear bit to reset the epoch and coarse counters
-trbcmd w 0xfe48 0xc800 0x00002000 ## Triggered mode
-trbcmd w 0xfe48 0xc801 0x80c600c6 ##  triggerwindow +/-990ns ;5ns granularity
-trbcmd w 0xfe48 0xc802 0xffffffff ## channel 01-32 enable
-trbcmd w 0xfe48 0xc803 0xffffffff ## channel 33-64 enable
-trbcmd w 0xfe48 0xc804 0x0000007c ## data transfer limit
+#trbcmd clearbit 0xfe48 0xc800 0x2000 ## clear bit to reset the epoch and coarse counters
+#trbcmd w 0xfe48 0xc800 0x00002000 ## Triggered mode
+#trbcmd w 0xfe48 0xc801 0x80c600c6 ##  triggerwindow +/-990ns ;5ns granularity
+#trbcmd w 0xfe48 0xc802 0xffffffff ## channel 01-32 enable
+#trbcmd w 0xfe48 0xc803 0xffffffff ## channel 33-64 enable
+#trbcmd w 0xfe48 0xc804 0x0000007c ## data transfer limit
 
 # special settings for barrel 
 #trbcmd w 0x2000 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2001 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2002 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2003 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2004 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2005 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2006 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2007 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2008 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2009 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x200a 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x200b 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x200c 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x200d 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x200e 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x200f 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2010 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2011 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2012 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
-#trbcmd w 0x2013 0xc801 0x8018004b ##  triggerwindow -375ns ... 120ns ;5ns granularity
 
 
 # AUX TDCs
 trbcmd clearbit 0xfe4a 0xc800 0x2000 ## clear bit to reset the epoch and coarse counters
 trbcmd w 0xfe4a 0xc800 0x00002000 ## Triggered mode
-trbcmd w 0xfe4a 0xc801 0x80c600c6 ##  triggerwindow +/-990ns ;5ns granularity
+trbcmd w 0xfe4a 0xc801 0x801e0046 ##  triggerwindow -350...+150ns ;5ns granularity
+#trbcmd w 0xfe4a 0xc801 0x80c600c6 ##  triggerwindow +/-990ns ;5ns granularity
 trbcmd w 0xfe4a 0xc802 0x00000000 ## channel 33-64 enable
 trbcmd w 0x202c 0xc802 0xffffffff ## channel 01-32 enable
 trbcmd w 0x202d 0xc802 0xffffffff ## channel 01-32 enable
@@ -102,21 +96,6 @@ trbcmd w 0xfe4a 0xc804 0x0000007c ## data transfer limit
 
 ~/trbsoft/daqtools/tools/loadregisterdb.pl register_config_tdc.db
 
-# disable unused TDCs
-# turn off two unused TDCs in FLASH
-switchport.pl 0x8008 1 off
-switchport.pl 0x8008 2 off
-
-# turn off two unused TDCs in HODO
-switchport.pl 0x8007 1 off
-switchport.pl 0x8007 2 off
-switchport.pl 0x8007 3 off
-
-# turn off two unused TDCs in TOF1
-switchport.pl 0x8005 3 off
-
-# turn off two unused TDCs in TOF1
-switchport.pl 0x8006 3 off
 
 echo -n "- number of trb endpoints in the system after turning off unused tdcs: "
 trbcmd i 0xffff | wc -l
@@ -136,21 +115,30 @@ trbcmd i 0xffff | wc -l
 #20150522 Jan comment
 ~/trbsoft/daqtools/padiwa.pl 0xfe4c 0 time > /dev/null;~/trbsoft/daqtools/padiwa.pl 0xfe4c 1 time > /dev/null; ~/trbsoft/daqtools/padiwa.pl 0xfe4c 2 time > /dev/null
 
+
 # Barrel DIRC
 # enable stretch prepare_padiwas_invert_leds.pl --endpoints=0x2000-0x2013 --chains=0..2 --invert=0xffff --stretch=0xffff
-prepare_padiwas_invert_leds.pl --endpoints=0x2000-0x2013 --chains=0..2 --invert=0xffff 
-#padiwa_led_off.pl
+
+prepare_padiwas_invert_leds.pl --endpoints=0x2000..0x2013 --chains=0..2 --invert=0xffff 
+padiwa_led_off.pl
 
 # Beam
 prepare_padiwas_invert_leds.pl --endpoints=0x2014-0x201f --chains=0..2 --invert=0xffff
 
-# DISC-DIRC
-prepare_padiwas_invert_leds.pl --endpoints=0x2024-0x202b --chains=0..2 --invert=0xffff
+
+# disable unused TDCs
+# turn off two unused TDCs in HODO
+
+# turn off two unused TDCs in TOF1
+switchport.pl 0x8005 3 off
+
+# turn off two unused TDCs in TOF1
+switchport.pl 0x8006 3 off
+
 
 # timeouts
 trbcmd w 0xfffe 0xc5 0x800050ff
 
-
 # divert TDC inputs to the CTS for trigger
 #echo "- divert TDC inputs to the CTS for trigger";
 # trbcmd setbit 0xfe4c 0xcf00 0x1 
@@ -164,28 +152,41 @@ cd ~/trbsoft/daqtools/thresholds/
 
 ## 2015 ./load_thresh_mcptof.sh  1500 1500 1500 1500 
 
+## Barrel DIRC
+#./write_thresholds.pl ~/trbsoft/daqtools/users/gsi_dirc/thresh/201505101447.thr -o 600 >> /dev/null # 1.5mV at plug
+#./write_thresholds.pl padiwa_threshold_results_20150511_2.log -o 400 > /dev/null # 1mV at plug
+# for stretch ./write_thresholds.pl padiwa_threshold_results_20150516_high_stretch_CS.log -o 400 > /dev/null # 1mV at plug
+#20150521
+#./write_thresholds.pl padiwa_threshold_results_20150516_high_nostretch_CS.log -o 200 > /dev/null 
+#./write_thresholds.pl padiwa_threshold_results_20150521_high_nostretch_CS.log -o 200 > /dev/null 
+echo "write barrel dirc thresholds"
+
+#./write_thresholds.pl padiwa_threshold_results_sequential_2015_06_25_offset_40_a.log -o 160
+#./write_thresholds.pl padiwa_threshold_results_sequential_2015_06_27_offset_40_a.log -o 160
+./write_thresholds.pl padiwa_threshold_results_sequential_2015_07_04_offset_40_a.log -o 160
+
+sleep 2
+
+echo "write mcp and scitil thresholds"
 #MCP-TOF, SciTils
 ./write_thresholds.pl mcptof_mcpout_zero.log -o 0 >> /dev/null # =10 mV before amp
 ./write_thresholds.pl mcptof_pixels_zero.log -o 0 >> /dev/null # =10 mV before amp
-./write_thresholds.pl mcptof_scitil_zero.log -o 0 >> /dev/null # =10 mV before amp
+./write_thresholds.pl mcptof_scitil_noatt_zero.log -o 0 >> /dev/null # =10 mV before amp
 ./write_thresholds.pl mcptof_hodo_zero.log -o 0 >> /dev/null # =7 mV before amp
-./write_thresholds.pl mcptof_mcpout_zero.log -o 1500 >> /dev/null # =10 mV before amp
+./write_thresholds.pl mcptof_chanmerge_mcpnoamp_zero.log -o 0 >> /dev/null # =7 mV before amp
+sleep 2
+./write_thresholds.pl mcptof_mcpout_zero.log -o 400 >> /dev/null # =10 mV before amp
 ./write_thresholds.pl mcptof_pixels_zero.log -o 1500 >> /dev/null # =10 mV before amp
-./write_thresholds.pl mcptof_scitil_zero.log -o 1500 >> /dev/null # =10 mV before amp
+./write_thresholds.pl mcptof_scitil_noatt_zero.log -o 400 >> /dev/null # =10 mV before amp
 ./write_thresholds.pl mcptof_hodo_zero.log -o 1000 >> /dev/null # =7 mV before amp
+./write_thresholds.pl mcptof_chanmerge_mcpnoamp_zero.log -o 400 >> /dev/null # =7 mV before amp
 
 
-
-## Barrel DIRC
-#./write_thresholds.pl ~/trbsoft/daqtools/users/gsi_dirc/thresh/201505101447.thr -o 600 >> /dev/null # 1.5mV at plug
-#./write_thresholds.pl padiwa_threshold_results_20150511_2.log -o 400 > /dev/null # 1mV at plug
-# for stretch ./write_thresholds.pl padiwa_threshold_results_20150516_high_stretch_CS.log -o 400 > /dev/null # 1mV at plug
-#20150521
-./write_thresholds.pl padiwa_threshold_results_20150516_high_nostretch_CS.log -o 200 > /dev/null 
-#./write_thresholds.pl padiwa_threshold_results_20150521_high_nostretch_CS.log -o 200 > /dev/null 
-./padiwa_led_off_MT.sh > /dev/null
+#echo "led off"
+#./padiwa_led_off_MT.sh > /dev/null
 #20150524 kill noisy pixel by setting 0xffff threshold
-./write_thresholds.pl padiwa_killPix.log > /dev/null 
+# 20150625 - disable kill # echo "turn off noisy pixel"
+#./write_thresholds.pl padiwa_killPix.log > /dev/null 
 
 
 cd -
@@ -200,8 +201,12 @@ trbcmd w 0x7999 0xa150 0x0001869f
 #trbcmd setbit 0x7999 0xa101 0x2
 
 # enable multiplexer 0
-trbcmd setbit 0x7999 0xa101 0x10
+trbcmd setbit 0x7999 0xa101 0x30
 
 trbcmd w 0x7999 0xa150 0x270f  #1kHz pulser
 trbcmd w 0x7999 0xa151 0x05f5e100  #1Hz pulser
 trbcmd loadbit 0x7999 0xa158 0x00000f00 0x00000d00  #Pulser 1 is calibration
+
+
+# disable all triggers
+#trbcmd setbit 0x7999 0xa00c 0x80000000
index d6f5b4a9a567f96a843f1ff16a5845bbd4efce35..9d12636efa40f155eebe5c2d7121835c56965e74 100755 (executable)
@@ -3,7 +3,7 @@ VXI11=~/vxi/vxi11_cmd
 echo "current power state: $($VXI11 trbpower OUTPUT:STATE\?)"
 $VXI11 trbpower "OUTPUT:STATE OFF"
 echo "current power state: $($VXI11 trbpower OUTPUT:STATE\?)"
-sleep 2;
+sleep 10;
 $VXI11 trbpower "OUTPUT:STATE ON"
 echo "current power state: $($VXI11 trbpower OUTPUT:STATE\?)"
 
index 36c295af81cf058071b09421e49373106026e935..fa4e29740b32e09fa588e7b33c072c8c218f3986 100755 (executable)
@@ -4,9 +4,7 @@ use strict;
 use warnings;
 
 ### Change THIS!
-##js my $required_endpoints = 65;
-my $required_endpoints = 35;
-
+my $required_endpoints = 50;
 
 
 my $max_counter = 10;
@@ -14,8 +12,7 @@ my $counter = 0;
 my $number = 0;
 
 
-#js while (($number != 65) || ($counter > $max_counter)) {
-while (($number != 35) || ($counter > $max_counter)) {
+while (($number != $required_endpoints) || ($counter > $max_counter)) {
     my $c; my $res;
 
     $counter++;
@@ -27,4 +24,5 @@ while (($number != 35) || ($counter > $max_counter)) {
     print "- number of trb endpoints in the system: $res";
     ($number) = $res =~ /(\d+)/;
     print "number of enpoints smaller than $required_endpoints, so try next reset!\n" if ($number <$required_endpoints);
+    exit;
 }
index 03069dddecd4a461ad6b6ab2782d9aeb15006f45..45aa134a897a4f66f23bd8ed49fb7ff6fc450150 100755 (executable)
@@ -48,18 +48,17 @@ Setups up running enviroment for the CTS gui and start webserver.
 
 --log          Log trigger rates into file specified. If "Number," is prefixed,
                the stated number of monitoring cycles is skipped between each write.
---quiet        Don't print monitored values to stdout
+--quiet        Do not print monitored values to stdout
 --port         Port number of the webserver
 --noopenxterm  By default, the CTS monitoring results are displayed in an
                additional XTerm window. Use this open to prevent an output.
 --endpoint     CTS TrbNet Endpoint. Default: endpoint defined in CtsConfig.pm
 EOFHELP
 
-   exit(0);
+exit(0);
 }
 
 
-
 # Gather and check parameters
    my $host = 'localhost';
    my $port = 1234;
@@ -114,8 +113,9 @@ EOFHELP
    }
 
 # Setup shared memory
-#   print "Trying to kill processes 'cts' and 'dhttpi'\n";
-#   system 'pkill "^(cts|dhttpi)$"';
+   print "Trying to kill processes 'cts' and 'dhttpi'\n";
+   system 'pkill dhttpi';
+   system 'pkill "^(cts|dhttpi)$"';
 
    print "\n\nTry to map monitoring files to shared memory (if it failes, no harm
    is done. Only the HDD has to work a little bit more)\n";
index c25464d1390c61b686a9962080a6bd9728ac870b..fe55653c5dfe2c5feb5a840e181795ec36e6f68b 100755 (executable)
--- a/web/httpi
+++ b/web/httpi
@@ -86,7 +86,7 @@ $VERSION = "1.7 (Demonic/Linux)";
         "bin" => "application/octet-stream");
 
 # comment in to enable logs
-$logfile = "./access.log";
+#$logfile = "./access.log";
 $path = "./htdocs";
 $sockaddr = 'S n a4 x8';