ELogs/SoniaEscribano: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 3: Line 3:
== To Do ==
== To Do ==


* Geant4 calibration source
* Compilation for pi4 (tested an working)
g++ -L/opt/local/lib -I/opt/local/include/libftdi1 -lftdi1 -std=c++17 -Wno-psabi -O3 -pthread FTDI.cpp -o FTDI


== QuARC Information Summary ==
* Compiling to pi5: gives an error -> fatal error: ftdi.h: No such file or directory


'''1. Scintillators'''
If we use  g++ -L/usr/lib -I/usr/include/libftdi1 -lftdi1 -pthread -std=c++17 -O3 -Wno-psabi FTDI.cpp -o FTDI


The main properties of our scintillators are:
we also get an error. We modify the code to the following, this gives a warning but creates the executable
* ρ = (1.03±0.01)g cm-3
* decay constant = 2.5 ns
* maximum emission at 425 nm (blue-violet)
* light output = 56% of anthracene
* n = 1.57


In total we have 302 scintillator sheets. Their production mechanisms and average thicknesses are summarised in this file []. The order in which the scintillators are assembled in each stack is available in the GUI, inside every experimental run log.
g++ -L/usr/lib -I/usr/include/libftdi1 -std=c++17 -O3 -Wno-psabi FTDI.cpp -o FTDI -lftdi1 -pthread
* Each sheet thickness is measured in 8 different points of the scintillator: 4 corners, and 4 middle parts of each side.
* The uncertainty is simply calculated as the standard deviation.
* For the scintillator stacks used in Manchester and PARTREC we measured the thickness in 3 points.
* Clear polished scintillators (machine block) offer the best light output.




'''2. Photodiodes'''
* Geant4 calibration source


The first prototype of the QuARC had a CMOS sensor, but it was then upgraded to photodiodes coupled to each sheet individually. There is a direct coupling, so no optical gel is used.
sdf
* Model = hamamatsu S12915-16R
* Effective photosensitive area = 6.0 mm2
* Spectral response wavelength between 340-1100 nm
* Quantum efficiency peaks at 960 nm


pi@raspberrypi:~/Photodiodes $ g++ -L/usr/lib -I/usr/include/libftdi1 -std=c++17 -O3 -Wno-psabi FTDI.cpp -o FTDI -lftdi1
FTDI.cpp: In function ‘int main(int, char**)’:
FTDI.cpp:131:33: warning: ‘int ftdi_usb_purge_buffers(ftdi_context*)’ is deprecated [-Wdeprecated-declarations]
  131 |    ret = ftdi_usb_purge_buffers(ftdi);                            //flush data currently in the buffer
      |          15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)~~^15:31, 24 January 2024 (UTC)
In file included from FTDI.cpp:8:
/usr/include/libftdi1/ftdi.h:567:20: note: declared here
  567 |    int DEPRECATED(ftdi_usb_purge_buffers(struct ftdi_context *ftdi));
      |                    ^15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)~
/usr/include/libftdi1/ftdi.h:247:55: note: in definition of macro ‘DEPRECATED’
  247 | #define DEPRECATED(func) __attribute__ ((deprecated)) func


'''3. Boards: DDC232'''
== GUI ==
'''Version 2.1'''


We have two different types of boards (revB and revC) that differ in the number of PD and the space between them. They are directly coupled to the PD, and need a power cable and a PMOD connection that goes to the FPGA.
This version displays the data from a file selected via a dropdown menu (using php), the Kelleter and Bortfeld curves, and the energy and range of the beam as a legend.
* revB: 16 photodiodes, spaced 2.86 mm. Uses 12V power cable.
[https://www.hep.ucl.ac.uk/pbt/PDdisplay/escribano/v2.1/ https://www.hep.ucl.ac.uk/pbt/PDdisplay/escribano/v2.1/]
* revC: 32 photodiodes, spaced 3.0 mm. Uses 7V power cable -> revD is a modification of revC, with a change in the heat management.


* Create a file with Manchester data
* Fix cache busting in Google Chrome
* Overlap between users in different browsers
* Determine number of points per PD for files
* Responsivity in different devices is not considered


'''4. FPGA'''


The FPGA is used to read the boards and transfer the data to the PC. The FPGA automatically loads the last code designed, but if not we can load it with Vivado: the code used is FTDI.h, which uses libFTDI libraries so they need to be installed in the laptop. We have 2 different boards:
'''Version 2.06'''
* Nexys board:
* usb104: powered via USB and connected to the board with a PMOD cable.


If we want to run the DAQ, first we have to compile the code as follows:
Version 2.06 has a unique start/stop button and displays live data when running a shell script via terminal.
  MacBook: g++ -L/opt/local/lib -I/opt/local/include/libftdi1 -lftdi1 -std=c++17 -O3 FTDI.cpp -o FTDI
* Zooming issue: PDdata and fitted data do not scale at the same rate, when zooming there is a shifting between the two -> Use linear scales for both ✓
Nuc PC: g++ -L/usr/lib64 -I/usr/include/libftdi1 -lftdi1 -std=c++17 -O3 FTDI.cpp -o FTD​I
* When clicking stop freeze the graph but do not make it dissapear
* Modify code to give - instead of 0 when fit not performed ✓
* Plot data with 20 points ✓


We can then run the code with the adequate parameters:
./FTDI nexys/usb104 num_DDCports FSR t_INT(us) nmeasurements outputfile board (testmode)


We can also visualise "live" (reads from average.csv) using the livePlot code.
'''Version 2.05'''
g++ -o livePlot livePlot.cpp `root-config --cflags --glibs` -O3


./livePlot num_DDCboards FSR yScale revB/C reversetrue/false (clean folder background.txt backST.txt frontST.txt ...)
Version 2.05 has two separate start and stop button


* Upload files to new directory ✓
* Modify position of error bars ✓
* x-axis zooming problem: only some numbers work ✓
* Fix misalignment between PDdata and FITdata ✓
* Test access from NUC PC ✓


'''5. Data acquisition'''


Running FTDI code the average time per read should be ~170us, giving a data transfer speed of ~0.47MB/s.
== Knowledge Transfer ==
* We acquire data using FTDI.cpp code, changing the output file to Run001.txt, Run002.txt and so on.
- Future work in QuARC: [https://www.hep.ucl.ac.uk/pbt/wiki/Proton_Calorimetry/Future_Work https://www.hep.ucl.ac.uk/pbt/wiki/Proton_Calorimetry/Future_Work]
* If we want to acquire data and show it live we need to use progh.sh
  ./prog.sh nexys/usb104 4 350 0 170 100000 50 true capture.txt revB/C true/false (fit/test/clean) (folder background.txt backST.txt frontST.txt ...)


- Summary : [https://www.hep.ucl.ac.uk/pbt/wiki/Proton_Calorimetry/Equipment/QuARC_General_Information https://www.hep.ucl.ac.uk/pbt/wiki/Proton_Calorimetry/Equipment/QuARC_General_Information]


'''6. Data analysis'''
== Replay + Fit ==
Two different codes are used for the data analysis: replay.py and fit.cpp, their functionalities are described below.


replay.py code calibrates and subtracts the background of each measurement, generating an output text file with header information, all the individual calibrated measurements and the average of them all. An example file with data from Clatterbridge Hospital of what the generated file looks like can be found here [https://www.hep.ucl.ac.uk/pbt/wikiData/data/GUI-Clatterbridge/Run001_calibrated.txt], every individual run fit takes ~3.3s on a MacBook to be completed. All of them can be processed together by running the shell script ./replayshell.sh. To run this code we need the following arguments:
python3 replay.py t_INT framerate skipahead reverse folder run background backST frontST


'''Questions'''
fit.cpp averages the data at a user specified frequency (or generic 25 Hz) and then performs Bortfeld and Kelleter fits to the data. After the fitting, the beam energy and range are extracted for each of those averaged measurements. All of them can be processed together by running the shell script ./fitshell.sh An example of what the output of fit.cpp looks like can be found here [https://www.hep.ucl.ac.uk/pbt/wikiData/data/GUI-Clatterbridge/Run001_fitted_25Hz.txt]. This code needs to be compiled, and then run with the appropriate arguments.
* Boards: What needs to be done to them? Vivado codes into FPGA but boards? Daisy chaining? What was done in terms of usbC connection?
g++ -o fit fit.cpp `root-config --cflags --glibs` -O3
* FPGA: no longer using nexys? What issues did we have with both of them?
./fit reverse energy facility folder run (frequency)
* Experiment: just use FTDI code changing the run number? where are these runs saved? Possible errors during data acquisition? test mode?
* Data analysis: parameters for fit based on what?


== GUI ==
To show these data in the GUI a shell script that iterates through the lines of the fitted output file is necessary.
* Modify code to give - instead of 0 when fit not performed ✓
* Plot data with 20 points ✓
* Upload files to new directory
* Modify position of error bars ✓
* x-axis zooming problem: only some numbers work ✓
* Fix misalignment between PDdata and FITdata ✓
* Test access from NUC PC ✓


== Replay + Fit ==
Previously both of the codes were developed in cpp. The replay.cpp replays the DDC232 acquisition by either stepping through each measurement or averaging measurements at specified frame rate, while fit.cpp performs the fit on calibrated and background subtracted data.
* Check parameter limits with Saad
* Fit data with 20 points instead of 10 to avoid harsh lines ✓
* Print date and time of original file, not produced ones ✓
* Test code on NUC PC ✓
* Add fitted rate to header ✓


== Done ==
== Done ==
Line 103: Line 95:


== Quick-start ==
== Quick-start ==
 
* Send a copy of pasport/ID so they can set up a contract (Bonita Carboo). Then a videocall needs to be arranged to check passport.
* Get user name + email
* Proof of right to work (share code via gov.uk)
* Sign online contract. Your employee number is here.
* Once you have an employee number you can check your user ID and email account [https://myaccount.ucl.ac.uk/new-staff]
* Welcome email with infromation for new staff member, probation and guidance [https://www.ucl.ac.uk/human-resources/ucl-induction-and-probation-policy#Policy]
* Check and complete the induction checklist (received on the welcome email)
* Get ID card: book appointment online ✓
* Get ID card: book appointment online ✓
* Mandatory safety training courses: Safety Induction + Fire Safety ✓
* Mandatory safety training courses: Safety Induction + Fire Safety ✓
Line 122: Line 118:
|26th-27th October 2023|| Ion Imaging Workshop London
|26th-27th October 2023|| Ion Imaging Workshop London
|-
|-
|11th-13th October 2023|| ACCMED online course
|11th-13th October 2023|| ACCMED course Pavia
|-
|-
|25th-28th July 2023|| FPGA Course RAL
|25th-28th July 2023|| FPGA Course RAL

Latest revision as of 15:31, 24 January 2024

Electronic Log for Sonia Escribano

To Do

  • Compilation for pi4 (tested an working)

g++ -L/opt/local/lib -I/opt/local/include/libftdi1 -lftdi1 -std=c++17 -Wno-psabi -O3 -pthread FTDI.cpp -o FTDI

  • Compiling to pi5: gives an error -> fatal error: ftdi.h: No such file or directory

If we use g++ -L/usr/lib -I/usr/include/libftdi1 -lftdi1 -pthread -std=c++17 -O3 -Wno-psabi FTDI.cpp -o FTDI

we also get an error. We modify the code to the following, this gives a warning but creates the executable

g++ -L/usr/lib -I/usr/include/libftdi1 -std=c++17 -O3 -Wno-psabi FTDI.cpp -o FTDI -lftdi1 -pthread


  • Geant4 calibration source

sdf

pi@raspberrypi:~/Photodiodes $ g++ -L/usr/lib -I/usr/include/libftdi1 -std=c++17 -O3 -Wno-psabi FTDI.cpp -o FTDI -lftdi1 FTDI.cpp: In function ‘int main(int, char**)’: FTDI.cpp:131:33: warning: ‘int ftdi_usb_purge_buffers(ftdi_context*)’ is deprecated [-Wdeprecated-declarations]

 131 |     ret = ftdi_usb_purge_buffers(ftdi);                             //flush data currently in the buffer
     |           15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)~~^15:31, 24 January 2024 (UTC)

In file included from FTDI.cpp:8: /usr/include/libftdi1/ftdi.h:567:20: note: declared here

 567 |     int DEPRECATED(ftdi_usb_purge_buffers(struct ftdi_context *ftdi));
     |                    ^15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)15:31, 24 January 2024 (UTC)~

/usr/include/libftdi1/ftdi.h:247:55: note: in definition of macro ‘DEPRECATED’

 247 | #define DEPRECATED(func) __attribute__ ((deprecated)) func

GUI

Version 2.1

This version displays the data from a file selected via a dropdown menu (using php), the Kelleter and Bortfeld curves, and the energy and range of the beam as a legend. https://www.hep.ucl.ac.uk/pbt/PDdisplay/escribano/v2.1/

  • Create a file with Manchester data
  • Fix cache busting in Google Chrome
  • Overlap between users in different browsers
  • Determine number of points per PD for files
  • Responsivity in different devices is not considered


Version 2.06

Version 2.06 has a unique start/stop button and displays live data when running a shell script via terminal.

  • Zooming issue: PDdata and fitted data do not scale at the same rate, when zooming there is a shifting between the two -> Use linear scales for both ✓
  • When clicking stop freeze the graph but do not make it dissapear ✓
  • Modify code to give - instead of 0 when fit not performed ✓
  • Plot data with 20 points ✓


Version 2.05

Version 2.05 has two separate start and stop button

  • Upload files to new directory ✓
  • Modify position of error bars ✓
  • x-axis zooming problem: only some numbers work ✓
  • Fix misalignment between PDdata and FITdata ✓
  • Test access from NUC PC ✓


Knowledge Transfer

- Future work in QuARC: https://www.hep.ucl.ac.uk/pbt/wiki/Proton_Calorimetry/Future_Work

- Summary : https://www.hep.ucl.ac.uk/pbt/wiki/Proton_Calorimetry/Equipment/QuARC_General_Information

Replay + Fit

Two different codes are used for the data analysis: replay.py and fit.cpp, their functionalities are described below.

replay.py code calibrates and subtracts the background of each measurement, generating an output text file with header information, all the individual calibrated measurements and the average of them all. An example file with data from Clatterbridge Hospital of what the generated file looks like can be found here [1], every individual run fit takes ~3.3s on a MacBook to be completed. All of them can be processed together by running the shell script ./replayshell.sh. To run this code we need the following arguments:

python3 replay.py t_INT framerate skipahead reverse folder run background backST frontST

fit.cpp averages the data at a user specified frequency (or generic 25 Hz) and then performs Bortfeld and Kelleter fits to the data. After the fitting, the beam energy and range are extracted for each of those averaged measurements. All of them can be processed together by running the shell script ./fitshell.sh An example of what the output of fit.cpp looks like can be found here [2]. This code needs to be compiled, and then run with the appropriate arguments.

g++ -o fit fit.cpp `root-config --cflags --glibs` -O3
./fit reverse energy facility folder run (frequency)

To show these data in the GUI a shell script that iterates through the lines of the fitted output file is necessary.

Previously both of the codes were developed in cpp. The replay.cpp replays the DDC232 acquisition by either stepping through each measurement or averaging measurements at specified frame rate, while fit.cpp performs the fit on calibrated and background subtracted data.

Done

  • PARTREC pictures uploaded to: /unix/pbt/data/partrec/20221125/Pictures
  • Cut Mylar foil sheets for Manchester experiment
  • Talk to Derek about Mylar foil.
  • Probation meeting with Simon (fill form)
  • Set up new MacBook Pro: might need dual booting (talk to Tony Hoare about Windows).
  • Set up Geant4 simulations of detector → copied and running
  • Port Saad's FPGA data replay code to Python → copied
  • Duplicate functionality of Fern's GUI in D3.

Quick-start

  • Send a copy of pasport/ID so they can set up a contract (Bonita Carboo). Then a videocall needs to be arranged to check passport.
  • Proof of right to work (share code via gov.uk)
  • Sign online contract. Your employee number is here.
  • Once you have an employee number you can check your user ID and email account [3]
  • Welcome email with infromation for new staff member, probation and guidance [4]
  • Check and complete the induction checklist (received on the welcome email)
  • Get ID card: book appointment online ✓
  • Mandatory safety training courses: Safety Induction + Fire Safety ✓
  • Book departamental safety induction with Lee Bebbington ✓
  • Mandatory training courses: GDPR, information security, freedom of information, DSE, diversity, unconscious bias, ✓
  • Create a wiki account ✓
  • Register for an account on the HEP Linux cluster (email support@hep.ucl.ac.uk) ✓
  • Install Geant4 (instructions: [5]) ✓
  • Set up bank details online on myHR ✓

Important Dates

Date Event
26th-27th October 2023 Ion Imaging Workshop London
11th-13th October 2023 ACCMED course Pavia
25th-28th July 2023 FPGA Course RAL
3rd-7th July 2023 HIT Online course
10th-16th June 2023 PTCOG Conference Madrid
18th May 2023 Clatterbridge beam test
5th Apr 2023 PGI Seminar @Queen Mary
8th Feb 2023 QuARC Seminar @Bristol
20th Jan 2023 PhD Graduation York
30th Nov - 2nd Dec 2022 FRPT Conference Barcelona
24-25th Nov 2022 Groningen beam test
25-26th Oct 2022 Manchester beam test
21st Oct 2022 HEP Seminar
20th Oct 2022 Prague
23rd Sep 2022 VIVA York