Git Product home page Git Product logo

alconley / cebra_efficiency Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 2.97 MB

GUI for calculating the efficiency of CeBrA (Cerium Bromide Array) with different calibration sources. Runs on web and locally!

Home Page: https://alconley.github.io/cebra_efficiency/

License: MIT License

JavaScript 0.72% Shell 0.52% HTML 5.20% Rust 93.56%
cebra detector efficiency egui gamma-ray nuclear-physics rust wasm cebr3

cebra_efficiency's Introduction

CeBrA Efficiency

Easily calculate the full-energy peak (FEP) efficiency of the CeBr3 Array (CeBrA) with this app.

Running Locally

Make sure you are using the latest version of stable Rust by running rustup update. Rust is very easy to install on any computer. First, you'll need to install the Rust toolchain (compiler, cargo, etc.). Go to the Rust website and follow the instructions there.

cargo run --release

On Linux, you need to first run:

sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libgtk-3-dev

On Fedora Rawhide, you need to run:

dnf install clang clang-devel clang-tools-extra libxkbcommon-devel pkg-config openssl-devel libxcb-devel gtk3-devel atk fontconfig-devel

Example

A previous measurment (from the REU in 2023 with 5 CeBr3 detectors) button is located on the top panel when running locally. This button loads the file at etc/REU_2023.yaml.

Web Application

The application can be run online here. Files can be saved (downloaded) and re-loaded back in... straight from the web! For an example, download the file in the etc direction (REU_2023.yaml).

Other

The UI is pretty self explanatory, so I am not going to write a lot about it.

To change the marker shape, color, and line traits, right click on the plot!

Fitting

I am using the crate Varpro to do single and double exponential fitting. Make sure to give the initial values of the non-linear parameters in the bottom panel.

I calculate the uncertainity bands the same way pythons lmfit package does.

Efficiency Calculation of CeBrA

Before you can calculate the full-energy peak (FEP) efficiency of CeBrA, you need to have a calibrated $\gamma$ source. At FSU, we have a couple of calibrated sources ($^{60}\mathrm{Co}$, $^{152}\mathrm{Eu}$, and $^{133}\mathrm{Ba}$) as of 2024. Each source has a known activity $A_{0}[\mathrm{kBq}=1000*\frac{\mathrm{disintegration}}{\mathrm{seconds}}]$ at some date ($T_{0}$) with a specific half-life ($T_{1/2}=\frac{\mathrm{ln(2)}}{\lambda}\mathrm{[years]*\frac{365.25[days]}{[years]}}$). The app then calculates the activity of the source ($A$) on the day of the measurement ($T$) based on the radioactive decay law.

Activity of Source (Radioactive Decay Law) $$A(T) = A_{0} \mathrm{[kBq]} * \mathrm{Exp}[-\frac{\lambda [\mathrm{days}] }{T-T_{0}[\mathrm{days}]}] $$

Now that we have the activity of the source on the day of the measurement, we need to find the $\gamma$ lines in the source. For a $^{60}\mathrm{Co}$ source, these would be the 1173.2 keV and 1332.5 keV $\gamma$ rays emitted after the decay of $^{60}\mathrm{Co}$ to $^{60}\mathrm{Ni}$. Each $\gamma$ has a certain intensity ($I_{\gamma}$), which can be found on NNDC or elsewhere on the internet. The intensity values for the $\gamma$ rays emitted from a $^{60}\mathrm{Co}$ source are $I_{1173.2}$=99.85(3) and $I_{1332.5}$=99.9826(6) (60Co decay info). Our job is to figure out the efficiency, aka how many $\gamma$ rays did we detect ($N_{\gamma}^{detected}$) divided by how many $\gamma$ rays were emitted ($N_{\gamma}^{total}$). To calculate the number of $\gamma$ rays emitted, we need to know the intensity of the line ($I_{\gamma}$), the measurement run time ($T_{measurement}[\mathrm{hours}]$), and the source activity on the day of the measurement ($A(T_{measurement})\mathrm{[kBq]}$).

Number of $\gamma$'s Emitted (with unit conversion) $$N_{\gamma}^{total} = I_{\gamma} * T_{measurement}[\mathrm{hours}] * \frac{3600 \mathrm{[seconds]}}{1 \mathrm{[hours]}} * A(T_{measurement}) \mathrm{[kBq] \frac{1000[Bq]}{[kBq]} \frac{Counts/[seconds]}{[Bq]} }$$

The number of counts detected will then correspond to a Gaussian peak fitted onto the peak of interest ($N_{\gamma}^{detected}$). Make sure that you take into account background subtraction.

Efficiency $$E_{\gamma} [\%]= \frac{N_{\gamma}^{detected}}{N_{\gamma}^{total}}*100\%$$

cebra_efficiency's People

Contributors

alconley avatar

Stargazers

 avatar  avatar

Watchers

Lucian avatar  avatar

Forkers

shabbirhasan1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.