]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
current status, mt
authorhadaq <M.Traxler@gsi.de>
Tue, 26 May 2015 00:37:36 +0000 (02:37 +0200)
committerhadaq <M.Traxler@gsi.de>
Tue, 26 May 2015 00:37:36 +0000 (02:37 +0200)
users/gsi_dirc/EventBuilder.xml
users/gsi_dirc/check_ping.pl
users/gsi_dirc/dmon_config.pl
users/gsi_dirc/first.C
users/gsi_dirc/start_readout.pl
users/gsi_dirc/startup.sh

index ba6595a2c79636db05a1ca2cd3cbfc8ed9ac917f..96efa09b33ac8a63d17104e375ff28010c49281c 100644 (file)
@@ -109,6 +109,12 @@ store data in lmd files.
 
      <Module name="Term" class="hadaq::TerminalModule" period="0.3" clear="true"/>
 
+     <!-- shmem control config -->
+     <Observer name="shm">
+       <DoShmControl value="true"/>
+       <NodeId value="1"/>
+     </Observer>
+
   </Context>
 
   <!--Context name="*">
index cc336631a10250c46c6297150b39f5fcf95754e0..883ab67e1ffabe45a5ed6f8b40979dfdbd0809da 100755 (executable)
@@ -4,32 +4,50 @@ use warnings;
 use strict;
 use Parallel::ForkManager;
 use Net::Ping;
+use Getopt::Long;
+
+my $power;
+my $help;
+
+my $result = GetOptions (
+    "h|help"          => \$help,
+    "p|powercycle"    => \$power,
+    );
+
 
 my @trbs = (56, 72, 99, 73, 74, 104, 97, 83, 89, 111, 13, 77, 57);
 
 my $map = {
- 0 => { trb =>  72, sys => "MCP 00"},
- 1 => { trb =>  99, sys => "MCP 01"},
- 2 => { trb =>  73, sys => "MCP 02"},
- 3 => { trb =>  74, sys => "MCP 03"},
- 4 => { trb => 104, sys => "MCP 04"},
- 5 => { trb =>  97, sys => "TOF 1"},
- 6 => { trb =>  83, sys => "TOF 2"},
- 7 => { trb =>  89, sys => "HODO"},
- 8 => { trb => 111, sys => "FLASH"},
- 9 => { trb =>  13, sys => "DISC1"},
- 10 => { trb =>  77, sys => "DISC2"},
- 11 => { trb =>  57, sys => "AUX"},
--1 => { trb =>  56, sys => "CTS"},
+ 0  =>  { trb =>  72, sys => "MCP 00" },
+ 1  =>  { trb =>  99, sys => "MCP 01" },
+ 2  =>  { trb =>  73, sys => "MCP 02" },
+ 3  =>  { trb =>  74, sys => "MCP 03" },
+ 4  =>  { trb => 104, sys => "MCP 04" },
+ 5  =>  { trb =>  97, sys => "TOF 1"  },
+ 6  =>  { trb =>  83, sys => "TOF 2"  },
+ 7  =>  { trb =>  89, sys => "HODO"   },
+ 8  =>  { trb => 111, sys => "FLASH"  },
+ 9  =>  { trb =>  13, sys => "DISC1"  },
+ 10 =>  { trb =>  77, sys => "DISC2"  },
+ 11 =>  { trb =>  57, sys => "AUX"    },
+-1  =>  { trb =>  56, sys => "CTS"    },
 };
 
-
 my $MAX_PROCESSES=50;
 my $pm = Parallel::ForkManager->new($MAX_PROCESSES);
 
+$pm->run_on_finish(
+    sub { my ($pid, $exit_code, $ident) = @_;
+#        print "** $ident just got out of the pool ".
+#            "with PID $pid and exit code: $exit_code\n";
+    }
+    );
+
+
 #my $p = Net::Ping->new();
 
 foreach my $ct (keys $map) {
+    my $success = 0;
     #my $num = sprintf "%3.3d", $ct;
     my $trbnum= $map->{$ct}->{trb};
     my $num = sprintf "%3.3d", $trbnum;
@@ -39,8 +57,7 @@ foreach my $ct (keys $map) {
     #my $r = $p->ping($host,1);
     my $c= "ping -W1 -c1 $host";
 
-    my $pid = $pm->start and next;
-
+    my $pid = $pm->start("$trbnum") and next;
 
     #my $p = Net::Ping->new("udp", 1);
     #my $r = $p->ping("192.168.0.56");
@@ -54,13 +71,18 @@ foreach my $ct (keys $map) {
     printf "$sysnum  $host  %-8s ", $system;
     if (grep /64 bytes/, $r) {
        print "is alive.\n";
+       $success = 1;
     }
     else {
        print "is not alive.\n";
    }
 
-    $pm->finish; # Terminates the child process
+    my $str = "jhhj";
+    $pm->finish($success, \$str); # Terminates the child process
 }
 
 $pm->wait_all_children;
 #$p->close();
+
+
+
index b21019e7cd80571c6b79f965bd57153c00f7e8d6..4fd8720617bd3dc22a25218ba991b930d67674e3 100755 (executable)
@@ -81,8 +81,8 @@ UserDirectory => '/home/hadaq/trbsoft/daqtools/users/gsi_dirc/',
 HeatmapDirc => {
   # upper limit for high end of color scale
 #  max_count_uclamp => 100000000,
-  max_count_uclamp =>5000,
-#  max_count_uclamp => 500,
+#  max_count_uclamp =>10000,
+  max_count_uclamp => 5000,
   # lower limit for high end of color scale
   max_count_lclamp => 10,
   
index c3cf2c5a4006b3326655495fd83aa8e089f3e673..070a0d3cc6a147970a75a45810f71c6f663ef50b 100644 (file)
 void first()
 {
-   // analysis will work as triggerred -
-   // after each event all data should be processed and flushed
-   base::ProcMgr::instance()->SetTriggeredAnalysis();
 
+   base::ProcMgr::instance()->SetRawAnalysis(true);
+
+   // this limits used for liner calibrations when nothing else is available
    hadaq::TdcMessage::SetFineLimits(31, 421);
 
+   // default channel numbers and edges mask
+   hadaq::TrbProcessor::SetDefaults(33, 0x2);
+
    hadaq::HldProcessor* hld = new hadaq::HldProcessor();
 
-   // Following levels of histograms filling are supported
-   //  0 - none
-   //  1 - only basic statistic from TRB
-   //  2 - generic statistic over TDC channels
-   //  3 - basic per-channel histograms with IDs
-   //  4 - per-channel histograms with references
-   // trb3->SetHistFilling(4);
-
-   // Load calibrations for ALL TDCs
-   /// trb3->LoadCalibrations("/data.local1/padiwa/new_");
-
-   // calculate and write calibrations at the end of the run
-   //trb3->SetWriteCalibrations("/data.local1/padiwa/new_");
-
-   // enable automatic calibrations of the channels
-   //trb3->SetAutoCalibrations(100000);
-
-
-   hadaq::TrbProcessor* trb3 = new hadaq::TrbProcessor(0x8000, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0010, 0x0011, 0x0012, 0x0013);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8001, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0110, 0x0111, 0x0112, 0x0113);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8002, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0210, 0x0211, 0x0212, 0x0213);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8003, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0310, 0x0311, 0x0312, 0x0313);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8004, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0410, 0x0411, 0x0412, 0x0413);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8005, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0510, 0x0511, 0x0512, 0x0513);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8006, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0610, 0x0611, 0x0612, 0x0613);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8007, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0710, 0x0711, 0x0712, 0x0713);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8008, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0810, 0x0811, 0x0812, 0x0813);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8009, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x0910, 0x0911, 0x0912, 0x0913);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8010, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1010, 0x1011, 0x1012, 0x1013);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8011, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1110, 0x1111, 0x1112, 0x1113);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8012, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1210, 0x1211, 0x1212, 0x1213);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8013, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1310, 0x1311, 0x1312, 0x1313);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8014, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1410, 0x1411, 0x1412, 0x1413);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8015, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1510, 0x1511, 0x1512, 0x1513);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8016, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1610, 0x1611, 0x1612, 0x1613);
-   // trb3->SetWriteCalibrations("calibr_");
-   //trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8017, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1710, 0x1711, 0x1712, 0x1713);
-   // trb3->SetWriteCalibrations("calibr_");
-   //trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8018, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1810, 0x1811, 0x1812, 0x1813);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8019, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x1910, 0x1911, 0x1912, 0x1913);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8020, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x2010, 0x2011, 0x2012, 0x2013);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   trb3 = new hadaq::TrbProcessor(0x8021, hld);
-   trb3->SetHistFilling(2);
-   trb3->CreateTDC(0x2110, 0x2111, 0x2112, 0x2113);
-   // trb3->SetWriteCalibrations("calibr_");
-   // trb3->LoadCalibrations("calibr_");
-
-   // indicate if raw data should be printed
-   hld->SetPrintRawData(false);
-
-
-   // method set window for all TRBs/TDCs
-   // hld->SetTriggerWindow(-4e-7, -0.2e-7);
-
-   // uncomment these line to enable store of all TDC data in the tree
-   // hld->SetStoreEnabled(true);
-
-   // create store - typically done in second.C, should be called only once
-   // base::ProcMgr::instance()->CreateStore("file.root");
+   // About time calibration - there are two possibilities
+   // 1) automatic calibration after N hits in every enabled channel.
+   //     Just use SetAutoCalibrations method for this
+   // 2) generate calibration on base of provided data and than use it later statically for analysis
+   //     Than one makes special run with SetWriteCalibrations() enabled.
+   //     Later one reuse such calibrations enabling only LoadCalibrations() call
+
+   hadaq::TrbProcessor* trb3_1 = new hadaq::TrbProcessor(0x8000, hld);
+   trb3_1->SetHistFilling(4);
+   trb3_1->SetCrossProcess(true);
+   trb3_1->CreateTDC(0x2000, 0x2001, 0x2002, 0x20003);
+   // enable automatic calibration, specify required number of hits in each channel
+   //trb3_1->SetAutoCalibrations(80000);
+   // calculate and write static calibration at the end of the run
+   //trb3_1->SetWriteCalibrations("run1");
+   trb3_1->LoadCalibrations("run1");
+
+   hadaq::TrbProcessor* trb3_2 = new hadaq::TrbProcessor(0x800b, hld);
+   trb3_2->SetHistFilling(4);
+   trb3_2->SetCrossProcess(true);
+   trb3_2->CreateTDC(0x202c, 0x202d, 0x202e, 0x202f);
+   //trb3_2->SetAutoCalibrations(80000);
+   //trb3_2->SetWriteCalibrations("run1");
+   trb3_2->LoadCalibrations("run1");
+
+   // this is array with available TDCs ids
+   int tdcmap[8] = { 0x2000, 0x2001, 0x2002, 0x2003, 0x202c, 0x202d, 0x202e, 0x202f };
+
+   // TDC subevent header id
+
+   for (int cnt=0;cnt<8;cnt++) {
+
+      hadaq::TdcProcessor* tdc = hld->FindTDC(tdcmap[cnt]);
+      if (tdc==0) continue;
+
+      // specify reference channel
+      //tdc->SetRefChannel(0, 0, 0x202c, 20000,  9597E6., 9603E6., true);
+      tdc->SetRefChannel(0, 0, 0x2001, 20000,  -100., 100., true);
+      //tdc->SetRefChannel(3, 1, 0xffff, 20000,  -10., 10., true);
+      //      continue;
+
+      //tdc->SetRefChannel(4, 2, 0xffff, 20000,  -10., 10., true);
+//      tdc->SetRefChannel(6, 4, 0xc010, 20000,  -20., 20., true);
+//      tdc->SetRefChannel(7, 5, 0xc010, 20000,  -20., 20., true);
+//      tdc->SetRefChannel(8, 0, 0xc010, 20000,  -90., 80., true);
+//      tdc->SetRefChannel(9, 0, 0xc010, 20000,  -200., 200., true);
+
+//      continue;
+
+
+      if (cnt==1) {
+         // specify reference channel from other TDC
+       //tdc->SetRefChannel(0, 0, 0xc000, 20000,  -30., 30., true);
+       tdc->SetRefChannel(0, 0, 0x2000, 20000,  -20., 20., true);
+         //tdc->SetRefChannel(6, 6, 0xc000, 20000,  -20., 20., true);
+       tdc->SetRefChannel(7, 7, 0x2000, 20000,  -20., 20., true);
+      }
+
+      if (tdc==4) 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);
+
+      // When enabled, time of last hit will be used for reference calculations
+      // tdc->SetUseLastHit(true);
+
+   }
 
 }
+
+
+
index 40661555a32028e239bf39b53e59a01bcc3439f6..b415dcd7358152cdd6cdd0a258f84aedd24c051d 100755 (executable)
@@ -39,11 +39,13 @@ $c=qq|pkill -f "daq_netmem -S $label"|;   qx($c); # if any, kill existing daq_ne
 
 
 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'|;
+    $c=qq|urxvt -geometry 80x27-0+0 -e bash -c 'dabc_exe EventBuilder_autogenerated.xml; sleep 10'|;
     system("$c &");
 
 }
index 9d8657c11a97fdd15b824218c8884ab531e3f2c4..95d0e4583777e2522549ae0992d8ce4c1a8dd337 100755 (executable)
@@ -17,10 +17,8 @@ fi
 export DAQOPSERVER=localhost:56
 #export DAQOPSERVER=localhost
 
-trbcmd reset
+trbreset_loop.pl
 
-echo -n "- number of trb endpoints in the system: "
-trbcmd i 0xffff | wc -l
 
 ##################################################
 ## Set addresses
@@ -44,7 +42,7 @@ trbcmd w 0xff7f 0x830e 0x10
 
 # standard TDCs
 trbcmd clearbit 0xfe4c 0xc800 0x2000 ## clear bit to reset the epoch and coarse counters
-trbcmd w 0xfe4c 0xc800 0x00002000 ## Triggered mode
+trbcmd w 0xfe4c 0xc800 0x00002000 ## TDC-Control-Register, RTniceM
 #trbcmd w 0xfe4c 0xc800 0x00003000 ## Triggerless   mode
 #trbcmd w 0xfe4c 0xc801 0x000f0005 ## trigger window enable & trigger window width
 #trbcmd w 0xfe4c 0xc800 0x00000001 ## logic analyser control register
@@ -67,6 +65,28 @@ 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
@@ -164,6 +184,9 @@ cd ~/trbsoft/daqtools/thresholds/
 ./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
+#20150524 kill noisy pixel by setting 0xffff threshold
+./write_thresholds.pl padiwa_killPix.log > /dev/null 
+
 
 cd -