Modifying FMS voltages and gains (update)

This follows on from my previous blog post.

I take the 2009 gain and voltage information, which comprises:

  • Detector ID (1-4)
  • Channel, row and column numbers
  • A 2009 voltage setting
  • The measured gain at this voltage
  • Parameters for an exponential fit to the measured gain vs. ADC curve

Not all cells have a voltage or gain value recorded, and some lack a gain curve. Therefore before calculating the modified gains, I do the following:

  • If the cell has no voltage recorded, set a default value of 0xA0.
  • If the cell has no gain recorded, set a default value equal to the mean gain of all cells with a gain.
  • If the cell lacks a usable gain vs. ADC curve, use an 'average' gain vs. ADC curve from the mean parameters of the fits for the other cells.

This allows all cells to be included in the procedure, even though we are using default/guessed values for cells where we have no information. The desired new gain for each cell, and the corresponding voltage to obtain that gain, are then calculated using the procedure explained in my previous post (except that the 'problematic cells' mentioned in my previous post are not excluded: they included using the default values discussed above). In some cases the voltage calculated to give the new gain is outside the available range, in which case it is capped and the min/maximum. A new gain/voltage information file is generated in the same format as the input file, replacing the 2009 gain and voltage with the new calculated/extrapolated gain and voltage. This allows the procedure to be iterated. For the small cells, figure 1 shows the gain vs. eta profiles in the input (2009) values, while figure 2 shows the results of two iterations of the procedure.

Figure 1: Input gain vs. eta profile.

 

Figure 2: Gain vs. eta after two iterations.

Finally a text file is generated that can be used to set the new voltage for each cell. The format for small cells is as follows:

!SETdevice <devnum>

!setctrl <chipnum> <channum>

!sleep 100

!rdac <address> <voltage>

!sleep 100

where the voltage is a hexadecimal number. An example of the file generated is uploaded as "setSmallCellVoltages.txt".

The format for large cells is different, namely:

(<slot>, <channel>) <voltage>

where here the voltage is a decimal number.