Scripts and tools for the Crystal Ball High Voltage
The procedure for how to perform a calibration of the CBHV values using an AmBe source is documented on the a2wiki: https://a2wiki.kph.uni-mainz.de/experiment/detectors/cb/source_calibration
Most of the code needed for this procedure is provided by ant (https://github.com/A2-Collaboration/ant). Stored in this repository are all the produced lists of CBHV values, dated by year and month, as well as a macro which can be used in the end of the procedure.
Everytime a PMT get's exchanged or even a splitter card is broken and exchanged, a calibration of the correction values has to be done. There are some crucial steps:
- Stop the CBHV EPICS IOC on slowcontrol
- Set correction loop and correction values to 0 using the script
cbhv_control.pywith the option-ror--reset - Measure the new correction values using the same script
cbhv_control.pywith the option-cor--calibrate; the measurement will take around 6-8h to finish - analyse data with
rootandcbhv_calibrate_boxes.C - optional: convert all ps to pdf and add them together with
convert_add_ps2pdf.sh - finally set the correction values with
cbhv_control.py, providing the input file eg..\cbhv_control.py -i HV_gains_offsets.txtThis will also activate the correction loop again
- You can specify only certain boxes by using
-bor--boxesand providing a list of boxes, e.g.-b 1 2 4 12 - For the calibration you might want to change the stepping or the voltage range,
-s 20 --range 1300 1500 - For a full list of options run
cbhv_control.pywith-hor--help
By default, running the ROOT macro creates a PDF with the histograms for the different channels. For every card a PDF is created. If you want to merge them to one file, you may want to use pdftk:
pdftk HV_gains_offsets*.pdf cat output HV_gains_all_cards.pdf