[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

software summary



Dear Peter and Cenap,

I wrote a note describing three of my programs that
may be useful to other people while I am away.  The
note is attached to this message or you can find it
at pc3608:/data/clayton/note27Jun03.txt
The programs described are an FADC display, a simple
compressor analysis that reads MIDAS files directly,
and a new compressor control program.

In case there is a problem, I do intend to occasionally
check e-mail over the next few weeks.

Regards,
Steven

27 June 2003
Steven Clayton
*************************************************************************
FADC display program:
pc3608:/data/clayton/analysis/fadc-disp

Running ./build creates a shared library fadc.so, which can be read in
a ROOT session.

Sample session:
--------------------
[data@pc3608 fadc-disp]$ root
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   3.04/02  18 December 2002   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.68, Dec 12 2002
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L fadc.so 
root [1] TFadcDisplay *fadc = new TFadcDisplay
Enter Scale Factor: 5
root [2] fadc->ProcessFile("/data/run00590.mid")
---------------------

Enter any character besides q and s to step through the events.
Enter q to quit.
Enter s to change the verticle scale factor.

Other files can be looked at with fadc->ProcessFile(filename).
It is not necessary to create a new TFadcDisplay object each time.

*************************************************************************

*************************************************************************
Compressor analysis program which reads Midas files directly.
pc3608:/data/clayton/companalysis
The executable is objects/mucaproot

This analysis fills some very basic histograms from compressor data.
It is a stripped-down version of the newanalysis.

Sample session to look at some basic histograms:
-----------------------
[data@pc3608 objects]$ ./mucaproot
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   3.04/02  18 December 2002   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.68, Dec 12 2002
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] TCompAnalysis *compana = new TCompAnalysis
root [1] compana->ProcessFile("/data/run00590.mid", 100)
...

root [2] hCompWires0->Draw()
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [3] hCompWires1->Draw()
root [4] hCompTime0->Draw()
root [5] hCompTime1->Draw() 
root [6] hFpgaHit0->Draw()
root [7] hFpgaTimeError0->Draw()
root [8] 
-----------------------

The ROOT session should be terminated and a new one started to look
at a different file.

*************************************************************************

*************************************************************************
Compressor Control program
pc3608:/data/clayton/compressor
The executable is objects/comproot

This is based on the C-code to control the compressors from run6
(the old code is in the directory old), but there are several improvements
on the old version.  The main improvement is the implementation of
hardware readback of the compressor parameters.  It is still necessary
to keep track of the parameters in a text file so that the compressors
do not have to be queried every time comproot is restarted.  There is a
public member function to read the data from hardware which must be
invoked explicitly by the user.  The mask settings readback is not yet
working properly and should not be used.  Please see the header file,
TCompressor.h, for a listing with comments of the functions available.

The advantage of working in a ROOT framework is the C-interpreter, such
that recompilation is not necessary for every change.

Sample session:
[data@pc3608 objects]$ pwd
/data/clayton/compressor/objects
[data@pc3608 objects]$ ./comproot
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   3.04/02  18 December 2002   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.68, Dec 12 2002
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] TCompressor *comp0 = new TCompressor
root [1] comp0->Connect(0);  // connect to ePC1 (correct serial cable must be connected)
root [2] comp0->ShowParam(); // not read from hardware at this point, just from file
   Fri Jun 27 14:42:49 2003
Compressors Started.    Clock: External
      Mode       Threshold     Rate   Level
     0 1 2 3   0   1   2   3   (All)  (All)
00:  N N N N  255 255 255 255   17     40
01:  N N N N  255 255 255 255   16     41
02:  N N N N  255 255 255 255   15     42
03:  N N N N  255 255 255 255   14     43
04:  N N N N  255 255 255 255   13     44
05:  N N N N  255 255 255 255   12     45
06:  N N N N  140 140 140 140   11     46
07:  N N N N  140 140 140 140   10     47
08:  N N N N  140 140 140 140    0     48
09:  N N N N  140 140 140 140    0     49
10:  N N N N  140 140 140 140    0     50
11:  N N N N  140 140 140 140    0     51
12:  N N N N  140 140 140 140    0     52
13:  N N N N  140 140 140 140    0     53
root [3] comp0->ReadAllParam()
...
   Fri Jun 27 14:44:08 2003
Compressors Started.    Clock: External
      Mode       Threshold     Rate   Level
     0 1 2 3   0   1   2   3   (All)  (All)
00:  N N N N  255 255 255 255   23     40
01:  N N N N  255 255 255 255   22     41
02:  N N N N  255 255 255 255   21     42
03:  N N N N  255 255 255 255   20     43
04:  N N N N  255 255 255 255   19     44
05:  N N N N  255 255 255 255   18     45
06:  N N N N  140 140 140 140   17     46
07:  N N N N  140 140 140 140   16     47
08:  N N N N  140 140 140 140   15     48
09:  N N N N  140 140 140 140   14     49
10:  N N N N  140 140 140 140   13     50
11:  N N N N  140 140 140 140   12     51
12:  N N N N  140 140 140 140   13     52
13:  N N N N  140 140 140 140   14     53

t [4] comp0->SetThreshold(9, 1, 130); // set fpga 9, cable 1 to threshold 130
13 bytes sent:
THR 89 19 82
13 bytes read back:
THR 89 19 82
root [5] comp0->ShowParam();
   Fri Jun 27 14:46:38 2003
Compressors Started.    Clock: External
      Mode       Threshold     Rate   Level
     0 1 2 3   0   1   2   3   (All)  (All)
00:  N N N N  255 255 255 255   23     40
01:  N N N N  255 255 255 255   22     41
02:  N N N N  255 255 255 255   21     42
03:  N N N N  255 255 255 255   20     43
04:  N N N N  255 255 255 255   19     44
05:  N N N N  255 255 255 255   18     45
06:  N N N N  140 140 140 140   17     46
07:  N N N N  140 140 140 140   16     47
08:  N N N N  140 140 140 140   15     48
09:  N N N N  140 130 140 140   14     49
10:  N N N N  140 140 140 140   13     50
11:  N N N N  140 140 140 140   12     51
12:  N N N N  140 140 140 140   13     52
13:  N N N N  140 140 140 140   14     53
root [6] comp0->ShowMask();   // warning: not read from hardware
   Fri Jun 27 14:47:32 2003
Mask Pattern in Hexadecimal (0001 = wire #0 masked, 8000 = wire #15 masked)
     0     1     2    3
00: 0000 0000 0000 0000 
01: 0000 0000 0000 0000 
02: 0000 0000 0000 0000 
03: 0000 0000 0000 0000 
04: 0000 0000 0000 0000 
05: 0000 0000 0000 0000 
06: 0000 0000 0000 0000 
07: 0000 0000 0000 0000 
08: 0000 0000 0000 0000 
09: 0000 0000 0000 0000 
10: 0000 0000 0000 0000 
11: 0000 0000 0000 0000 
12: 0000 0000 0000 0000 
13: 0000 0000 0000 0000 
root [7] comp0->SetAllMasks();   // mask everything
4 bytes sent:
SMK
4 bytes read back:
SMK
89 19 82
(int)0
root [8] comp0->ShowMask(); // now we can be pretty sure this really is the hardware state
   Fri Jun 27 14:49:12 2003
Mask Pattern in Hexadecimal (0001 = wire #0 masked, 8000 = wire #15 masked)
     0     1     2    3
00: FFFF FFFF FFFF FFFF 
01: FFFF FFFF FFFF FFFF 
02: FFFF FFFF FFFF FFFF 
03: FFFF FFFF FFFF FFFF 
04: FFFF FFFF FFFF FFFF 
05: FFFF FFFF FFFF FFFF 
06: FFFF FFFF FFFF FFFF 
07: FFFF FFFF FFFF FFFF 
08: FFFF FFFF FFFF FFFF 
09: FFFF FFFF FFFF FFFF 
10: FFFF FFFF FFFF FFFF 
11: FFFF FFFF FFFF FFFF 
12: FFFF FFFF FFFF FFFF 
13: FFFF FFFF FFFF FFFF 
root [9] comp0->ClearAllMasks()
4 bytes sent:
CMK
4 bytes read back:
CMK
89 19 82
(int)0
root [10] comp0->ShowMask()
   Fri Jun 27 14:50:30 2003
Mask Pattern in Hexadecimal (0001 = wire #0 masked, 8000 = wire #15 masked)
     0     1     2    3
00: 0000 0000 0000 0000 
01: 0000 0000 0000 0000 
02: 0000 0000 0000 0000 
03: 0000 0000 0000 0000 
04: 0000 0000 0000 0000 
05: 0000 0000 0000 0000 
06: 0000 0000 0000 0000 
07: 0000 0000 0000 0000 
08: 0000 0000 0000 0000 
09: 0000 0000 0000 0000 
10: 0000 0000 0000 0000 
11: 0000 0000 0000 0000 
12: 0000 0000 0000 0000 
13: 0000 0000 0000 0000 
root [11] comp0->Disconnect()
(int)0
root [12] .q
[data@pc3608 objects]$ 

TCompressor uses the files compParam0.dat and compParam1.dat, for ePC1 and ePC2
respectively, and similarly compMask0.dat and compMask1.dat.  These files are
read when TCompressor::Connect(<0 or 1>) is called and are written when
TCompressor::Disconnect() is called.  These files are in a human-readable
format.  The functions TCompressor::ShowParam() and TCompressor::ShowMask() can
optionally take a string as an argument, in which case they will write a file with
the name indicated.  The function TCompressor::SetParamFile() can be used to
send all parameters to the compressors according to what is shown by
TCompressor::ShowParam() or optionally according to a file specified by
name in the argument (ex., TCompressor::SetParamFile("compParams27Jun03.dat")).
TCompressor::SetMaskFile() works similarly.

*************************************************************************