]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
status trb84, mt
authorHadaq <hadaq@hades39.gsi.de>
Wed, 28 Sep 2016 13:50:49 +0000 (15:50 +0200)
committerHadaq <hadaq@hades39.gsi.de>
Wed, 28 Sep 2016 13:50:49 +0000 (15:50 +0200)
base/serials_dirich.db
base/serials_trb3.db
tools/determine_noiseband_dirich.pl
users/gsi_ee_trb84/Go4AutoSave.root
users/gsi_ee_trb84/TdcEventBuilder.xml
users/gsi_ee_trb84/db/addresses_dirich.db
users/gsi_ee_trb84/db/addresses_trb3.db
users/gsi_ee_trb84/first.C
users/gsi_ee_trb84/first.C_old
users/gsi_ee_trb84/second.C
users/gsi_ee_trb84/startup.sh

index 45a176da5483dd3bea26254537e4bd5a663ae0f5..172c428b5e350acc6e554e01376f1764510866a9 100644 (file)
@@ -10,3 +10,4 @@
 0005   0xdc000007122daa28
 0006   0x2d00000711e46b28
 0007   0x5800000711e42b28
+0008   0x85000007122da928
index 822dd88c012bee258e96ae3876fff95eecf26abb..176aeddc6f45d13c6990d421f373d05ab8f355f2 100644 (file)
    1735        0xc2000006ea597828
 
 
-
-# concentrator/combiner
-   100000      0xca00000712ac3228
-   
index f469a90ff830f41c250b798fe476d94e7f844877..cbbbbef121509d481fa1caab0a9d8831fdda4985 100755 (executable)
@@ -9,12 +9,12 @@ my $dirich = 0x1204;
 my $throffset = 0xa000;
 my $monitor = 0xdfc0;
 
-my $last_channel = 31;
+my $last_channel = 5;
 
-my $default_threshold = 0x4000;
+my $default_threshold = 0x3000;
 
 #my $absolute_max_threshold = 0x8000;
-my $absolute_min_threshold = 0x2000;
+my $absolute_min_threshold = 0x1000;
 
 my @res; my $res; my $rh_res;
 
index 4fb59b1ab99fa90caa92938fbada29b8a146be1e..5a1b518e31135360fd4e7a3ae5e44a50f90c0a2e 100644 (file)
Binary files a/users/gsi_ee_trb84/Go4AutoSave.root and b/users/gsi_ee_trb84/Go4AutoSave.root differ
index e4273be1bd99923bd2d65fd3245dfd851d60a917..e1bd0fb4f40cc6681f7c27ca9deaf0ea46af38ed 100644 (file)
@@ -120,7 +120,7 @@ When starting analysis from the go4 gui, one should specify stream server with p
        <OutputPort name="Output0" url="mbs://Stream:6789?iter=hadaq_iter&subid=0x1f"/>
 
        <!--  this is example of HLD file storage - local and RFIO -->
-       <OutputPort name="Output1" url="hld:///d/pulser.hld?maxsize=2000"/>
+       <OutputPort name="Output1" url="hld:///d/trashcan/pulser.hld?maxsize=2000"/>
        <!--OutputPort name="Output1" url="hld:///linev/path/dabc.hld?maxsize=1900&rfio"/-->
 
        <DoShmControl value="false"/>  
index 68c6df1009cdb398cd0bc9b8532dac3ba55ee753..6613a19c7dfb04e45d60262ca13622b30beed1ae 100644 (file)
@@ -10,4 +10,5 @@
 0x1205             0005     1
 0x1206             0006     1
 0x1207             0007     1
+0x1208             0008     1
 
index dd2a312c063b012f7cb58927a87a618e3a5cf914..a480b5f1fb46d10b1a338018993129521c34ba1e 100644 (file)
@@ -32,6 +32,3 @@
 0x1583            158     3
 0x8158     158            5
 
-
-# concentrator/combiner
-0x8300    10000   0
index 081b5b6d082cc0b12b63fa8689c8caddda7e1212..d805e1d8ed919cee5169cbc03c5740f532ceb5b9 100644 (file)
@@ -1,24 +1,25 @@
 // this is example for
 
-#include <stdlib.h>
 
 void first()
 {
-  //base::ProcMgr::instance()->SetRawAnalysis(true);
-    base::ProcMgr::instance()->SetTriggeredAnalysis(true);
+   //base::ProcMgr::instance()->SetRawAnalysis(true);
+   base::ProcMgr::instance()->SetTriggeredAnalysis(true);
 
    // all new instances get this value
    base::ProcMgr::instance()->SetHistFilling(4);
 
+   // configure bubbles
+   hadaq::TdcProcessor::SetBubbleMode(3, 18);
+
    // this limits used for liner calibrations when nothing else is available
    hadaq::TdcMessage::SetFineLimits(31, 491);
 
    // default channel numbers and edges mask
-   hadaq::TrbProcessor::SetDefaults(33, 2);
+   hadaq::TrbProcessor::SetDefaults(5, 1);
 
    // [min..max] range for TDC ids
-   //hadaq::TrbProcessor::SetTDCRange(0x610, 0x613);
-   hadaq::TrbProcessor::SetTDCRange(0x1130, 0x1603);
+   hadaq::TrbProcessor::SetTDCRange(0x1200, 0x12FF);
 
    // [min..max] range for HUB ids
    hadaq::TrbProcessor::SetHUBRange(0x8000, 0x8fff);
@@ -30,14 +31,17 @@ void first()
    const char* calname = getenv("CALNAME");
    if ((calname==0) || (*calname==0)) calname = "test_";
    const char* calmode = getenv("CALMODE");
-   int cnt = (calmode && *calmode) ? atoi(calmode) : 100000;
+   int cnt = (calmode && *calmode) ? atoi(calmode) : 10000;
+   cnt=100000;
    const char* caltrig = getenv("CALTRIG");
    unsigned trig = (caltrig && *caltrig) ? atoi(caltrig) : 0x1;
    const char* uset = getenv("USETEMP");
    unsigned use_temp = 0; // 0x80000000;
    if ((uset!=0) && (*uset!=0) && (strcmp(uset,"1")==0)) use_temp = 0x80000000;
 
-   printf("HLD configure calibration calfile:%s  cnt:%d trig:%X temp:%X\n", calname, cnt, trig, use_temp);
+   printf("TDC CALIBRATION MODE %d\n", cnt);
+
+   //printf("HLD configure calibration calfile:%s  cnt:%d trig:%X temp:%X\n", calname, cnt, trig, use_temp);
 
    // first parameter if filename  prefix for calibration files
    //     and calibration mode (empty string - no file I/O)
@@ -55,7 +59,7 @@ void first()
    // new hadaq::HldFilter(0x1);
 
    // create ROOT file store
-   // base::ProcMgr::instance()->CreateStore("td.root");
+   base::ProcMgr::instance()->CreateStore("td.root");
 
    // 0 - disable store
    // 1 - std::vector<hadaq::TdcMessageExt> - includes original TDC message
@@ -82,101 +86,24 @@ extern "C" void after_create(hadaq::HldProcessor* hld)
       hadaq::TrbProcessor* trb = hld->GetTRB(k);
       if (trb==0) continue;
       printf("Configure %s!\n", trb->GetName());
-      trb->SetPrintErrors(10);
+      trb->SetPrintErrors(100);
    }
 
-   unsigned firsttdc = 0;
-
    for (unsigned k=0;k<hld->NumberOfTDC();k++) {
       hadaq::TdcProcessor* tdc = hld->GetTDC(k);
       if (tdc==0) continue;
 
-      if (firsttdc == 0) firsttdc = tdc->GetID();
-
       printf("Configure %s!\n", tdc->GetName());
 
-      // try to build abs time difference between 0 channels
-      if (tdc->GetID() != firsttdc)
-         tdc->SetRefChannel(0, 0, (0x70000 | firsttdc), 6000,  -20., 20.);
-
-      /*
-      tdc->SetRefChannel(1,6, 0xffff, 6000, -20, 20); // trigger
-      tdc->SetRefChannel(2,1, 0xffff, 6000, -20, 20); // TOT
-      tdc->SetRefChannel(6,1, 0xffff, 6000, -20, 20);  // TOT
-
-      tdc->SetRefChannel(5,1, 0xffff, 6000, -20, 20); // LED DIFF
+      // tdc->SetUseLastHit(true);
 
-      */
+      // tdc->SetStoreEnabled();
+      for (unsigned nch=2;nch<tdc->NumChannels();nch++)
+        tdc->SetRefChannel(nch, nch-2, 0xffff, 20000,  -10., 10.);
 
-      //tdc->SetRefChannel(14,16, 0xffff, 6000, -20, 20); // TOT
-      //tdc->SetRefChannel(16,14, 0xffff, 6000, -20, 20); // TOT
+      tdc->SetRefChannel(1, tdc->NumChannels() -1 , 0xffff, 20000,  -10., 10.);
 
-      //tdc->SetRefChannel(16,0, 0xffff, 6000, -20, 20); // TOT
-      //tdc->SetRefChannel(14,0, 0xffff, 6000, -20, 20); // TOT
-                 //tdc->SetRefChannel(16,14, 0xffff, 6000, -20, 20); // TOT
       
-      /*
-      tdc->SetRefChannel(27,32, 0xffff, 6000, -20, 20); // TOT
-      tdc->SetRefChannel(28,27, 0xffff, 6000, -20, 20); // TOT
-      tdc->SetRefChannel(32,28, 0xffff, 6000, -20, 20);  // TOT
-      */
-      //      tdc->SetRefChannel(11,1, 0xffff, 6000, -20, 20); // LED DIFF
-      //tdc->SetRefChannel(2,1, 0xffff, 6000, -20, 20); // LED DIFF
-      //tdc->SetRefChannel(12,2, 0xffff, 6000, -20, 20); // LED DIFF
-      tdc->SetUseLastHit(false);
-      
-      if (tdc->GetID() == 0x1130) {
-       //      tdc->SetRefChannel(31,1, 0x1130, 6000, -20, 20); // LED DIFF
-       //tdc->SetRefChannel(32,2, 0x1130, 6000, -20, 20); // LED DIFF
-       //tdc->SetRefChannel(1,2, 0x1130, 6000, -20, 20); // LED DIFF
-       //tdc->SetRefChannel(2,31, 0x1130, 6000, -20, 20); // LED DIFF
-      }
-
-      /*
-      if (tdc->GetID() == 0x1580) {
-       tdc->SetRefChannel(31,1, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(32,2, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel( 1,2, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(2,31, 0x1580, 20000, -20, 20); // LED DIFF
-      }
-      */
-
-      /*
-      if (tdc->GetID() == 0x1580) {
-       tdc->SetRefChannel(21,17, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(22,18, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(17,18, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(18,21, 0x1580, 20000, -20, 20); // LED DIFF
-      }
-      */
-      
-      if (tdc->GetID() == 0x1580) {
-       //      tdc->SetRefChannel(9,11, 0x1580, 20000, -20, 20); // LED DIFF
-       //      tdc->SetRefChannel(11,9, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(17,21, 0x1580, 20000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(18,17, 0x1580, 20000, -20, 20); // LED DIFF
-      }
-
-
-      if (tdc->GetID() == 0x1133) {
-       //tdc->SetRefChannel(1,0, 0x1133, 6000, -200, -100); // LED DIFF
-       tdc->SetRefChannel(1,31, 0x1130, 6000, -20, 20); // LED DIFF
-       tdc->SetRefChannel(11,1, 0x1133, 6000, -20, 20); // LED DIFF
-      }
-       //tdc->SetRefChannel(31,27, 0xffff, 6000, -20, 20); // LED DIFF
-      
-
-      // tdc->SetRefChannel(1, 0, 0xffff, 6000,  -160., -100.);
-
-      // if (tdc->GetID() != firsttdc)
-      //   tdc->SetDoubleRefChannel(1, (firsttdc << 16) | 1,  6000,  -30., 30., 0, 0, 0);
-
-      // tdc->SetUseLastHit(true);
-      //for (unsigned nch=1;nch<tdc->NumChannels();nch++) {
-    //     double shift = 0;
-    //     if (nch % 2 == 0) shift = 100.;
-    //     tdc->SetRefChannel(nch, 0, 0xffff, 6000,  shift, shift + 60);
-     // }
    }
 }
 
index bdf1358d96e6661c15f2b91c0a1fe7945712156f..43ef3d1b97fc3a46e35f99da0705dea05b585187 100644 (file)
+// this is example for
+
+#include <stdlib.h>
+
 void first()
 {
+  //base::ProcMgr::instance()->SetRawAnalysis(true);
+    base::ProcMgr::instance()->SetTriggeredAnalysis(true);
 
-   base::ProcMgr::instance()->SetRawAnalysis(true);
+   // all new instances get this value
+   base::ProcMgr::instance()->SetHistFilling(4);
 
    // this limits used for liner calibrations when nothing else is available
-   hadaq::TdcMessage::SetFineLimits(31, 470);
+   hadaq::TdcMessage::SetFineLimits(31, 491);
 
    // default channel numbers and edges mask
-   hadaq::TrbProcessor::SetDefaults(65, 0x1);
-   //   hadaq::TrbProcessor::SetDefaults(49, 0x2);
-
-
-   hadaq::HldProcessor* hld = new hadaq::HldProcessor();
-
-   // 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(0xc001, hld);
-   trb3_1->SetHistFilling(4);
-   trb3_1->SetCrossProcess(false);
-   trb3_1->CreateTDC(0x0840);
-   // enable automatic calibration, specify required number of hits in each channel
-   trb3_1->SetAutoCalibrations(100000);
-   // 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(0x8000, hld);
-   trb3_2->SetHistFilling(4);
-   trb3_2->SetCrossProcess(true);
-   trb3_2->CreateTDC(0x0610, 0x0611, 0x0612, 0x0613);
-   trb3_2->SetAutoCalibrations(100000);
-   // trb3_2->SetWriteCalibrations("run1");
-   //trb3_2->LoadCalibrations("run1");
-   
-   // this is array with available TDCs ids
-   int tdcmap[4] = { 0x0610, 0x0611, 0x0612, 0x0613 };
-
-   // TDC subevent header id
-
-   for (int cnt=0;cnt<4;cnt++) {
-
-      hadaq::TdcProcessor* tdc = hld->FindTDC(tdcmap[cnt]);
-      //if (tdc==0) continue;
-
-      // specify reference channel
-      //tdc->SetRefChannel(0, 0, 0x202c, 20000,  9597E6., 9603E6., true);
-      // if(cnt==0) {
-      //tdc->SetRefChannel(1, 0, 0xffff, 4000,  -500., 500., true);
-      //tdc->SetRefChannel(2, 6, 0xffff, 10000,  -50., 50., true);
-      //      tdc->SetRefChannel(3, 1, 0x0610, 10000,  -50., 50., true);
-      if (cnt==0) {
-       tdc->SetRefChannel(1, 0, 0xffff, 10000,  -50., 50., true);
-       tdc->SetRefChannel(2, 0, 0xffff, 10000,  -50., 50., true);
-
-       tdc->SetRefChannel(5, 1, 0xffff, 10000,  -50., 50., true);
-
-       tdc->SetRefChannel(6, 2, 0xffff, 10000,  -50., 50., true);
-      }
+   hadaq::TrbProcessor::SetDefaults(33, 2);
 
-      //tdc->SetRefChannel(6, 2, 0x0610, 10000,  -50., 50., true);
-       //tdc->SetRefChannel(46, 46, 0xffff, 4000,  -50., 50., true);
+   // [min..max] range for TDC ids
+   //hadaq::TrbProcessor::SetTDCRange(0x610, 0x613);
+   hadaq::TrbProcessor::SetTDCRange(0x0000, 0x1fff);
 
+   // [min..max] range for HUB ids
+   hadaq::TrbProcessor::SetHUBRange(0x8000, 0x8fff);
 
-        //      } else {
-        //         tdc->SetRefChannel(46, 0, 0xffff, 40000,  -300., 100., true);
-        //      }
-      
-      //tdc->SetRefChannel(3, 1, 0xffff, 20000,  -10., 10., true);
-      //      continue;
+   // when first argument true - TRB/TDC will be created on-the-fly
+   // second parameter is function name, called after elements are created
+   hadaq::HldProcessor* hld = new hadaq::HldProcessor(true, "after_create");
 
-      //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);
+   const char* calname = getenv("CALNAME");
+   if ((calname==0) || (*calname==0)) calname = "test_";
+   const char* calmode = getenv("CALMODE");
+   int cnt = (calmode && *calmode) ? atoi(calmode) : 100000;
+   const char* caltrig = getenv("CALTRIG");
+   unsigned trig = (caltrig && *caltrig) ? atoi(caltrig) : 0x1;
+   const char* uset = getenv("USETEMP");
+   unsigned use_temp = 0; // 0x80000000;
+   if ((uset!=0) && (*uset!=0) && (strcmp(uset,"1")==0)) use_temp = 0x80000000;
 
-//      continue;
+   printf("HLD configure calibration calfile:%s  cnt:%d trig:%X temp:%X\n", calname, cnt, trig, use_temp);
 
+   // first parameter if filename  prefix for calibration files
+   //     and calibration mode (empty string - no file I/O)
+   // second parameter is hits count for autocalibration
+   //     0 - only load calibration
+   //    -1 - accumulate data and store calibrations only at the end
+   //    >0 - automatic calibration after N hits in each active channel
+   // third parameter is trigger type mask used for calibration
+   //   (1 << 0xD) - special 0XD trigger with internal pulser, used also for TOT calibration
+   //    0x3FFF - all kinds of trigger types will be used for calibration (excluding 0xE and 0xF)
+   //   0x80000000 in mask enables usage of temperature correction
+   hld->ConfigureCalibration(calname, cnt, (1 << trig) | use_temp);
 
-      if (cnt==1) {
-       tdc->SetRefChannel(0, 0, 0x0610, 10000,  -50., 50., true);
-         // 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);
-      }
+   // only accept trigger type 0x1 when storing file
+   // new hadaq::HldFilter(0x1);
 
-      if (cnt==2) {
-       tdc->SetRefChannel(0, 0, 0x0610, 10000,  -50., 50., true);
-      }
+   // create ROOT file store
+   // base::ProcMgr::instance()->CreateStore("td.root");
 
-      if (cnt==3) {
-       tdc->SetRefChannel(0, 0, 0x0610, 10000,  -50., 50., true);
-      }
+   // 0 - disable store
+   // 1 - std::vector<hadaq::TdcMessageExt> - includes original TDC message
+   // 2 - std::vector<hadaq::MessageFloat>  - compact form, without channel 0, stamp as float (relative to ch0)
+   // 3 - std::vector<hadaq::MessageDouble> - compact form, with channel 0, absolute time stamp as double
+   base::ProcMgr::instance()->SetStoreKind(2);
+
+
+   // when configured as output in DABC, one specifies:
+   // <OutputPort name="Output2" url="stream://file.root?maxsize=5000&kind=3"/>
+
+
+}
 
+// extern "C" required by DABC to find function from compiled code
 
-      //if (cnt>1) continue;
+extern "C" void after_create(hadaq::HldProcessor* hld)
+{
+   printf("Called after all sub-components are created\n");
+
+   if (hld==0) return;
+
+   for (unsigned k=0;k<hld->NumberOfTRB();k++) {
+      hadaq::TrbProcessor* trb = hld->GetTRB(k);
+      if (trb==0) continue;
+      printf("Configure %s!\n", trb->GetName());
+      trb->SetPrintErrors(10);
+   }
+
+   unsigned firsttdc = 0;
+
+   for (unsigned k=0;k<hld->NumberOfTDC();k++) {
+      hadaq::TdcProcessor* tdc = hld->GetTDC(k);
+      if (tdc==0) continue;
 
-      // specify reference channel
+      if (firsttdc == 0) firsttdc = tdc->GetID();
+
+      printf("Configure %s!\n", tdc->GetName());
+
+      // try to build abs time difference between 0 channels
+      if (tdc->GetID() != firsttdc)
+         tdc->SetRefChannel(0, 0, (0x70000 | firsttdc), 6000,  -20., 20.);
 
       /*
-      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);
+      tdc->SetRefChannel(1,6, 0xffff, 6000, -20, 20); // trigger
+      tdc->SetRefChannel(2,1, 0xffff, 6000, -20, 20); // TOT
+      tdc->SetRefChannel(6,1, 0xffff, 6000, -20, 20);  // TOT
+
+      tdc->SetRefChannel(5,1, 0xffff, 6000, -20, 20); // LED DIFF
+
       */
 
-      // for old FPGA code one should have epoch for each hit, no longer necessary
-      // tdc->SetEveryEpoch(true);
+      //tdc->SetRefChannel(14,16, 0xffff, 6000, -20, 20); // TOT
+      //tdc->SetRefChannel(16,14, 0xffff, 6000, -20, 20); // TOT
 
-      // When enabled, time of last hit will be used for reference calculations
-      // tdc->SetUseLastHit(true);
+      //tdc->SetRefChannel(16,0, 0xffff, 6000, -20, 20); // TOT
+      //tdc->SetRefChannel(14,0, 0xffff, 6000, -20, 20); // TOT
+                 //tdc->SetRefChannel(16,14, 0xffff, 6000, -20, 20); // TOT
+      
+      /*
+      tdc->SetRefChannel(27,32, 0xffff, 6000, -20, 20); // TOT
+      tdc->SetRefChannel(28,27, 0xffff, 6000, -20, 20); // TOT
+      tdc->SetRefChannel(32,28, 0xffff, 6000, -20, 20);  // TOT
+      */
+      //      tdc->SetRefChannel(11,1, 0xffff, 6000, -20, 20); // LED DIFF
+      //tdc->SetRefChannel(2,1, 0xffff, 6000, -20, 20); // LED DIFF
+      //tdc->SetRefChannel(12,2, 0xffff, 6000, -20, 20); // LED DIFF
+      tdc->SetUseLastHit(false);
+      
+      if (tdc->GetID() == 0x1130) {
+       //      tdc->SetRefChannel(31,1, 0x1130, 6000, -20, 20); // LED DIFF
+       //tdc->SetRefChannel(32,2, 0x1130, 6000, -20, 20); // LED DIFF
+       //tdc->SetRefChannel(1,2, 0x1130, 6000, -20, 20); // LED DIFF
+       //tdc->SetRefChannel(2,31, 0x1130, 6000, -20, 20); // LED DIFF
+      }
 
-   }
+      /*
+      if (tdc->GetID() == 0x1580) {
+       tdc->SetRefChannel(31,1, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(32,2, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel( 1,2, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(2,31, 0x1580, 20000, -20, 20); // LED DIFF
+      }
+      */
 
-}
+      /*
+      if (tdc->GetID() == 0x1580) {
+       tdc->SetRefChannel(21,17, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(22,18, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(17,18, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(18,21, 0x1580, 20000, -20, 20); // LED DIFF
+      }
+      */
+      
+      if (tdc->GetID() == 0x1580) {
+       //      tdc->SetRefChannel(9,11, 0x1580, 20000, -20, 20); // LED DIFF
+       //      tdc->SetRefChannel(11,9, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(17,21, 0x1580, 20000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(18,17, 0x1580, 20000, -20, 20); // LED DIFF
+      }
+
+
+      if (tdc->GetID() == 0x1133) {
+       //tdc->SetRefChannel(1,0, 0x1133, 6000, -200, -100); // LED DIFF
+       tdc->SetRefChannel(1,31, 0x1130, 6000, -20, 20); // LED DIFF
+       tdc->SetRefChannel(11,1, 0x1133, 6000, -20, 20); // LED DIFF
+      }
+       //tdc->SetRefChannel(31,27, 0xffff, 6000, -20, 20); // LED DIFF
+      
 
+      // tdc->SetRefChannel(1, 0, 0xffff, 6000,  -160., -100.);
+
+      // if (tdc->GetID() != firsttdc)
+      //   tdc->SetDoubleRefChannel(1, (firsttdc << 16) | 1,  6000,  -30., 30., 0, 0, 0);
+
+      // tdc->SetUseLastHit(true);
+      //for (unsigned nch=1;nch<tdc->NumChannels();nch++) {
+    //     double shift = 0;
+    //     if (nch % 2 == 0) shift = 100.;
+    //     tdc->SetRefChannel(nch, 0, 0xffff, 6000,  shift, shift + 60);
+     // }
+   }
+}
 
 
index 3a38078c4088a526f7d8d4827e06b4dfa0d612a8..71fdcc54bdad2fe9f8a65d8c236f3c0ce2c13a2c 100644 (file)
@@ -104,8 +104,6 @@ class SecondProc : public base::EventProc {
         
         FillH1(hDif1, (fHits[1][0] - fHits[2][0]) );
          FillH1(hDif2, (fHits[1][1] - fHits[2][1]) );
-        
-        
 
          return true;
       }
@@ -116,5 +114,5 @@ void second()
 {
   //new SecondProc("A", "TDC_1133");
   //new SecondProc("A", "TDC_1580");
-  new SecondProc("A", "TDC_1202");
+  new SecondProc("A", "TDC_1207");
 }
index d7bc2869dbb1400675c88fa11ee8523d4fd5c3b2..ef5c93a33803ae1a22931beb575640425f69026a 100755 (executable)
@@ -32,6 +32,7 @@ sleep 1;
 ##################################################
 merge_serial_address.pl $DAQ_TOOLS_PATH/base/serials_trb3.db $USER_DIR/db/addresses_trb3.db
 merge_serial_address.pl $DAQ_TOOLS_PATH/base/serials_dirich.db $USER_DIR/db/addresses_dirich.db
+merge_serial_address.pl $DAQ_TOOLS_PATH/base/serials_dirich_concentrator.db $USER_DIR/db/addresses_dirich_concentrator.db
 
 
 #echo "disable port 6 on hub 0x8841"
@@ -49,7 +50,7 @@ loadregisterdb.pl db/register_configtdc.db
 echo "TDC settings end"
 
 # setup central FPGA - enable peripherial signals
-#switchport.pl 0x8840 5 off
+#switchport.pl 0x8841 6 off
 
 
 
@@ -79,7 +80,10 @@ echo "TDC settings end"
 #trbcmd setbit 0xc840 0xa101 0x200   #enable input at CTS
 
 # set correct timeout: off for channel 0, 1, 2sec for 2
-#trbcmd w 0xfffe 0xc5 0x50ff
+trbcmd w 0xfffe 0xc5 0x50ff
+
+#Dirich-Concentrator: enable reference time from RJ45
+trbcmd loadbit 0x8300 0xd580 0x6 0x6
 
 echo "pulser"
 # pulser #0 to 10 kHz
@@ -94,14 +98,14 @@ echo "pulser enable"
 # pulser enable
 #trbcmd setbit 0xc001 0xa101 0x1
 
-trbcmd clearbit 0x1130 0xc801 0x80000000 # disable window
+#trbcmd clearbit 0x1130 0xc801 0x80000000 # disable window
 #trbcmd w 0x1130 0xc802 0xffff0000 # enable upper 16 channels for padiwa
-trbcmd w 0x1580 0xc802 0xffffffff # enable upper 16 channels for padiwa
+#trbcmd w 0x1580 0xc802 0xffffffff # enable upper 16 channels for padiwa
 
 
 cd ~/trbsoft/daqtools/xml-db
 ./put.pl Readout 0xfe51 SetMaxEventSize 500
-cd -
+cd $USER_DIR
 
 trbcmd w 0xfe51 0xdf80 0xffffffff # enable monitor counters