GammaSphere, Scalers


A new utility to read GS scalers has been developed at ANL. This utility allow users to

The scaler readout is accomplished by running a program in the master VXI crate. The program will read a setup file which resides in the

    user/scaler

directory under the gs account. At the moment, only LeCroy 4434 scalers are supported. Here is an example of a simple scaler file called "s1":

1,9,1 ""
1,9,2 ""
1,9,3 ""
1,9,4 ""
1,9,5 ""
1,9,6 ""
1,10,1 ""
1,10,2 ""
1,10,3 ""
1,10,4 ""
1,10,5 ""
1,10,6 ""
1,11,1 "clock"
1,11,2 "clock-gated"
1,11,3 ""
1,11,4 ""
1,11,5 ""
1,11,6 ""
1,11,2 / 1,11,1 "live-time"

A scaler channel to be read out is identified by it's CNA (Crate, Slot and Address) position in the CAMAC crates. Then follows on the same line (in quotes) the label to assign to the channel. You may leave this label empty if you want to; but it must be there. In this example, a clock signal is input 1 of the scaler located in slot 11 in crate 1. The second input of this scaler also has the clock signal; but now vetoed by the busy signal.

The last line shows how the utility can also find the ratio of two scaler channel rates. In this case, the "livetime" is found from the above two mentioned channels rates.

Only the two input line types discussed above are valid inputs to the scaler program.

To run the utility you must be in the tip window (console) of the resource manager of the master VXI crate.

Once you have the tip window for the master resource manager up you simply type, e.g.,

      scaler "s1"

in the window (remember the quotes around the scaler input file) to run the utility. The output would look something like this:

-------------------------------------------
@event-time: 6036.342768 seconds or hh:mm:ss: 001:40:36
usec clock stamp --> 00002:26574:60771

 0>{1, 9, 1} ........................:        0,      0.0 Hz
 1>{1, 9, 2} ........................:        0,      0.0 Hz
 2>{1, 9, 3} ........................:        0,      0.0 Hz
 3>{1, 9, 4} ........................:        0,      0.0 Hz
 4>{1, 9, 5} ........................:        0,      0.0 Hz
 5>{1, 9, 6} ........................:        0,      0.0 Hz
 6>{1,10, 1} ........................:        0,      0.0 Hz
 7>{1,10, 2} ........................:        0,      0.0 Hz
 8>{1,10, 3} ........................:        0,      0.0 Hz
 9>{1,10, 4} ........................:        0,      0.0 Hz
10>{1,10, 5} ........................:        0,      0.0 Hz
11>{1,10, 6} ........................:        0,      0.0 Hz
12>{1,11, 1} clock...................:  9171643,   1729.4 Hz
13>{1,11, 2} clock-gated.............:        0,      0.0 Hz
14>{1,11, 3} ........................:        0,      0.0 Hz
15>{1,11, 4} ........................:        0,      0.0 Hz
16>{1,11, 5} ........................:        0,      0.0 Hz
17>{1,11, 6} ........................:        0,      0.0 Hz
18>{1,11, 2}/{1,11, 1}livetime.......:  ...rates missing

The event time, as calculated in the MTM trigger window, is given and translated into the time since the master crate was rebooted in hours, minutes and seconds. The actual values of the H, M and L bits of the 48Bit u sec clock is then given before the values and rates of the scaler channels are reported. (In this particular case the "clock-gated" signal was missing so no ratio was reported in the last line.)

The output also is written to the file "scaler.out" in the "user/scaler" directory. Hence, it's easy to print this file to the printer in the data room.


To make the scalers read out periodically you can make VxWorks run the scaler program periodically as, e.g.

  period 300,scaler,"s1"

Here we ask the VxWorks operating system to run the scaler process (with input file "s1") every 300 seconds or 5 minutes. To stop this periodic task, type "i" in the master console window and look for lines containing "periodRun":

.
.
tPortmapd  _portmapd      7d7288 100 PEND           83c8   7d7154      16     0
t1         _periodRun     5fa688 100 DELAY         2948c   5fa624       0  4368
t2         _periodRun     58efc8 100 DELAY         2948c   58ef64   c0002  3267
CA client  _camsgtask     5b724c 180 PEND           83c8   5b7154       0     0
.
.

in them. There are normally two of them. The last one would be the scaler process. To kill this task, type

      td t2

"td" is Task Delete.


Future:
I hope to write the scaler values to a buffer which can be accessed by the taper processors in the VME crates in the data room. The idea is that if the taper sees a buffer file it will read it in and put it to tape (and the delete the file so it will not find the same buffer file again). That way, ~every time the scaler program is run, a scaler buffer is put to tape without affecting the data rate much. How often a scaler buffer is written to tape is controlled by how often the scaler utility is run as described above.


FAQ

Q: can I clear the scalers?

A: You can clear the scalers by typing:

     scaler "s1","clear"

if you want to control the absolute scaler count by setting them to zero at a given time.

Q: why can't I find the scaler program?

A: Sometimes we do not load the scaler program automatically when the master crate is rebooted. If the scaler program is not there, simply type

     ld < scaler.o

to load it. You only need to do this once and only if the scaler utility wasn't loaded automatically.

Q: can I have several scaler setup files?

A: Yes. However, the output file is always called "scaler.out" no-matter what input file you specify.

Q: Is this utility guaranteed to not crash the DAQ system?

A: No; but it's been doing well so far...


[email protected]