Skip to content

ArrayBenchSingle

cquarant edited this page Oct 31, 2022 · 41 revisions

Table of Contents

Turn on cooling system

Read temperature sensors:

Check if there is a process already running, if not follow this instructions
OPEN NEW TERMINAL

conda activate tofpet_new
cd  /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/arduino/temperature
python3 read_temp.py -o temperature_tmp.txt -p /dev/tempmon_0 -r 9600

Note: keep this terminal always open.
Temperatures are saved in the temporary file "temperature_tmp.txt" and then automatically attached after each run at the end of the file "temperature_all.txt". The temporary file is then automatically cleared after each run.

Cooling control:

  • Make sure the cooling system is connected to the power (check black cable with "cooling" label)
  • Double click on the "LT_Interface" icon on the laptop desktop --> a GUI opens.
  • Click on File -> Open -> Select /home/cmsdaq/.wine/drive_c/users/cmsdaq/PR59TempController/StandardPIDConfig_withHeating.sc (The file should be visible in the window by default) -> Click Open
  • Click on Regulator -> Connect
  • Click on START on the "Regulator control" (default temperature should be set to 24 degrees Celsius, Sp1 value in the "Regulator information" box): the Peltier cell inside the box and the fans will start working.
  • Check on "Runtime" to see the variation in time of the temperature inside the box (see either T1 line on the graph or Tr1 value in the "Regulator Information" box)

Turn on xy tables

Check if there is a process already running, if not follow this instructions

Make sure the xy table system is connected to the power (check black cable with "guida mobile" label)

Start MOTOR_0 (connected to reference bar, TOP)
OPEN NEW TERMINAL

conda activate tofpet_new
cd  /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/arduino/tablexy
python3 grblServer.py --usb /dev/motor_0 -l /tmp/test.log --port=8820

Note: keep this terminal always open.

Start MOTOR_1 (connected to test array, BOTTOM)
OPEN NEW TERMINAL

conda activate tofpet_new
cd  /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/arduino/tablexy
python3 grblServer.py --usb /dev/motor_1 -l /tmp/test.log --port=8821

Note: keep this terminal always open.

To test the motors via a script:

OPEN NEW TERMINAL Edit the script (testXYMover.py) to test either motor_0 or motor_1.

conda activate tofpet_new
cd  /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/arduino/tablexy
python3 testXYMover.py

IMPORTANT:

  • IN CASE THE XY STOPS AND MAKES A STRANGE NOISE, IMMEDIATELY UNPLUG THE POWER (CABLE WITH "GUIDA MOBILE" LABEL). STOP THE GRBLSERVERS, PLUG THE POWER CABLE BACK AND RESTART FROM THE BEGINNING.

  • IN CASE, THE XY TABLE DOES NOT WORK DURING A RUN (NO RESPONSE, BUT WITHOUT MAKING NOISE) SIMPLY STOP AND RESTART THE SERVER AND TRY AGAIN.

Turn on TOFPET

  • Switch on the TOFPET power: press the green "POWER" button in the white power unit; the voltage is set by default to 12V.
  • Wait about 30 seconds for the system to warm up, until the current measured by the power unit is about 1.4A.
  • Connect TOFPET to pc: OPEN NEW TERMINAL
conda activate tofpet_new
cd /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3
./connect_TOFPET.sh

Note: keep this terminal always open.

  • Wait 60 min. for thermal stability inside the box (within about 1/10 of degree). NOTE: Wait 1 hour only the first time you turn on the system from scratch.

Data acquisition

  • Turn off TOFPET:

    • stop the program "./connect_TOFPET.sh" (CTRL-C in the terminal)
    • turn-on the power (press green button)
  • Remove the Na22 radioactive source in its support from the box

  • Unplug / plug the crystal support in the TOFPET board:

    • Note: The reference crystal bar should be already mounted on the other TOFPET board and should not be touched.
  • Put back the Na22 source back in its support inside the box

  • REMEMBER TO CLOSE THE BOX BEFORE STARTING ANY RUN !!!!

  • Turn on TOFPET (as in point 2):

    • turn-on the power
    • wait 30 seconds to warm up, until the measured current is about 1.4A
    • start the program "./connect_TOFPET.sh"
  • Wait 15 min. for system stability

  • If not present, open the GUI: OPEN NEW TERMINAL (can use the same for following runs)

cd /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3
./startBenchGui.sh
  • Once opened the GUI:
    • Select the BAR code for the array
    • For normal measurement make sure the Longitudinal scan box is not checked
    • Use the delay option in order to wait 15 min. before start

NOTES:

  • typically you should only change the bar code. The run number will be automatically updated for every acquisition and used as label in the output file names.
  • the standard run sequence is:
    • PEDESTAL run (few seconds)
    • PHYSICS RUN (300 s)
    • PEDESTAL run (few seconds) The run numbers will be sequential.

Update airtable

When the maximum records value 1200 is reached do the following steps:

  • In airtable.com duplicate the last working DB, change the name accordingly and then remove all the RUNS records
  • Then go to https://airtable.com/api to check the REST api endpoints for your new DB. Click on the newly created DB and then:
    • appID: "The ID of this base is appXXXXXX"
    • Authentication Token: click top right "Show API key", then scrolling to authentication you will find the key "keyXXXXXXXXX"

The new authentication key should be changed in ~/AutoProcess/setup.sh. Instead the appID should be changed into ~/AutoProcess/runDB.py. Then restart the autoprocess service

Data Alignment

Edit config_main_array_1.txt and run_DAQ_multiarrays_align.py as needed

Run daq:

python run_DAQ_multiarrays_align.py -c list_config_main_array.txt -o /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/data/align/LYSOARRAYALIGN_20xx_xx_xx -n 405

(substitute XXX with today's date)

Find the range of run numbers in the output folder specified above (es. 1-34) Create root files:

python process_runs.py -r 1-34 -d /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/data/align/LYSOARRAYALIGN_XXXX_XX_XX/

Analyze data:

python3 analysis/analyze_alignArray_with_barRef.py -i /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/data/align/LYSOARRAYALIGN_XXXX_XX_XX/ -o /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/data/align/LYSOARRAYALIGN_XXXX_XX_XX/

Check plots: display /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/data/align/LYSOARRAYALIGN_XXXX_XX_XX/*.png

Finally edit run_DAQ_multiarrays.py with the positions of the arrays:

#xyz position of the center of the arrays (for example, position of bar 8 [counting from 0])                                                                          
dict_array_x_y_z = {
    0: np.array([18, 22, 0]),
    #1: np.array([25.0, 25.0, 0.0])                                                                                                                                    
    #2: np.array([216.1, 138.3, 23.]),                                                                                                                                 
    #3: np.array([215.1, 42.5, 23.])                                                                                                                                   
}

Process data

THE PROCESS IS AUTOMATICALLY DONE, to check the status go on airtable - Single Array Bench processing
OPEN NEW TERMINAL (can use the same for following runs)

  • Process data:
python process_runs.py -r 1-34 -d /media/cmsdaq/ext/data/LYSOARRAYS_NEW/

NOTES:

  • indicate the range of all runs (pedestals and physics)

Data Analysis

THE ANALYSIS IS AUTOMATICALLY DONE, to check the status go on airtable - Single Array Bench processing

  • Run analysis code:
cd /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3
python analysis/launch_analyze_run_array.py --firstRun 1 -i /media/cmsdaq/ext/data/LYSOARRAYS_NEW/ -o /media/cmsdaq/ext/data/LYSOARRAYS_NEW/RESULTS/ --arrayCode 0"

NOTES:

  • indicate the PHYSICS run number (it is one minus the last run processed which should be a pedestal run) and the bar code.

  • the program will also analyze the corresponding PEDESTAL runs associated to the PHYSICS run.

  • Output:

    • stored in /media/cmsdaq/ext/data/LYSOARRAYS_NEW/RESULTS/
    • histo_RunXXXXXX_BARYYYYYY.root : histograms and canvases
    • tree_RunXXXXXX_BARYYYYYY.root : measurements of light output and CTR stored in a root tree
    • tree_RunXXXXXX_BARYYYYYY.root : measurements of light output and CTR stored in a root tree.
    • the measurements with uncertainties are also printed out on airttable
  • Check fits on local pc (deprecated)

 display /media/cmsdaq/ext/data/LYSOARRAYS_NEW/RESULTS/*XXX*.png 

(substitute XXX with run number)

  • Check fits on airtable:
    • OPEN A NEW BROWSER
    • go to airtable
    • open the Single Array bench page
    • check for the result column and click on the link
    • NOTE: substitute localhost with the PC ip

After the processing is completed, always check the run and tag it as Validated or Failed

Special runs

Calibration runs (TO BE CHECKED)

Calibration runs have to be made when changing reference arrays

BEFORE DATA-TAKING:

  • Edit file /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2/analysis/analyze_run_array_with_barRef.py
  • Edit line L413 setting "default=0" for option applyCalib
    parser.add_option("-c", "--applyCalib", dest="applyCalib", default=1,
                    help="apply calibrations")
    

DATA-TAKING:

  • Start with the ref. arrays in their default configuration and take 4 runs, shifting the arrays by one slot each time.

Example: if the default configuraiton is:

  • IARR0=405, IARR1=406, IARR2=407, IARR3=408

then, the configuration for the second run will be:

  • IARR0=408, IARR1=405, IARR2=406, IARR3=407

And so on.

  • Repeat the process with the arrays in the reversed position. The standard position has the bar code of the array facing the rear of the fridge, in the reversed position the bar code faces the fridge door and it is still visible (side up).

AFTER DATA-TAKING:

  • Edit /home/cmsd aq/Workspace/TOFPET/Timing-TOFPET2/analysis/makeCalib.py
  • Insert runs specifying run number, ref. and Reverse True/False position
  • launch calibration:
    cd /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2/
    source analysis/runCalib.sh
    

Overvoltage scan

To run an overvoltage scan edit file:

emacs -nw /home/cmsdaq/Workspace/TOFPET/Timing-TOFPET2-py3/run_DAQ_multiarrays.py

comment/uncomment one of the following lines:

#ov_values = [8,7,6,5,4,3] #V                                                                                                                         
ov_values = [8] #V    

Update the elog

  • Post a message on the arraybench ( elog , before Oct 2022 the page was used by the old TOFPET test bench for single bar measurement) ):
    • run number (physics run), run type, bar code, configuration string
    • Light output measurements (at 511 keV peak): barCoinc peak 1
    • CTR (time resolution using pixel as reference): gaussian mean and sigma
    • Time resolution (time resolution using time difference between two channels): gaussian mean and sigma
    • Example of elog entry:
ARRAY000405 RUNS: 202 - 
LY_mean=     50.45
LY_RMS=      1.21
sigmaT_sigma_mean=     137.3 ps
sigmaT_sigma_RMS=       5.8 ps
CTR_sigma_mean=     179.0 ps
CTR_sigma_RMS=       8.0 ps
XT_mean=      0.02
XT_RMS=      0.01
http://10.0.0.33/ARRAYS/index.php?match=Run000202

This is taken from MATTERMOST CERN MATTER MOST - SIPM BENCH channel

End of the day

  • Turn off TOFPET:

    • stop the program "./connect_TOFPET.sh" (CTRL-C in the terminal)
    • turn-on the power (press green button)
  • Put the Na22 radioactive source inside the safe

  • Close the box

  • Leave the linux terminals used open for the next data taking

  • Check if all the good run are tagged as validated on airtable

Clone this wiki locally