π INTRODUCTION
Contents
π INTRODUCTION#
This is a python library to process and analyze raw data from the lab. The design objectives were:
To have a classless structure. We store in dictionaries all the run/ch information + the waveforms.
Avoid as much overcalculation as possible, in particular:
Calculate pedestal/charge/time values all at once and store them separately from the raw data.
Prevent excessive memory usage when dealing with multiple runs.
Avoid complicated hierarchies and commented/uncommented lines with the same code.
To have all the functions compatible between them and moreover, that the obtained output is suitable to be used with all the functions.
π§ OBJECTIVES
Study the detector
GAIN β Calibration β {CUTS + GAUSSIAN FITS}
Data analysis (RAW processing)
Characterization β Effective fits, cross-talk, noise, etc.
Physics studies
Signal deconvolution
Physics fits
MC simulations
Electronics studies
Getting Started - SETUP βοΈ#
Note
We recommend to install VSCode as editor. Some useful extensions are: Remote-SSH, Jupyter, vscode-numpy-viewer, Python Environment Manager
Check that you have python installed with a version
>=3.7by runningpython --version. If you are working locally and you do not have it runsudo apt-get updateandsudo apt-get install python3-pipto start.
1. Configure your SSH connection#
To run the SCINT library you will need to work from any PCAE at CIEMAT or establish an SSH connection from your laptop.
Terminal pro-users:
ssh AFS_USER@YOUR_PCAE.ciemat.esorssh AFS_USER@gaeuidc1.ciemat.esVSCode users:
Click on the Remote-SSH icon
Add new SSH remote connection
Type
ssh AFS_USER@gaeuidc1.ciemat.esIntroduce your AFS password
Work as usual in the new window that appears
You can change your SSH configuration at
.ssh/config
2. Download the library by cloning it from GitHub#
git clone https://github.com/CIEMAT-Neutrino/SCINT.git
cd SCINT
# code . #[OPTIONAL]: Opens a new window with all the folders inside SCINT for easy coding
Please, create a branch for including changes in the library and if everything works as it should you could merge with the main one.
Or run git checkout -b <your_branch_name> in a terminal.
βΉοΈ The folder structure you will see is the following βΉοΈ
.
ββ config
βΒ Β βββ FitConfig.yml
βΒ Β βββ options.yml
βΒ Β βββ input
βΒ Β βΒ Β βββ MegaCellLArDic23.txt
βΒ Β βΒ Β βββ MegaCellLArMar24Extr.txt
βΒ Β βΒ Β βββ MegaCellLArMar24.txt
βΒ Β βΒ Β βββ TUTORIAL.txt
βββ docs
β
βββ lib
βΒ Β βββ __init__.py
βΒ Β βββ ana_functions.py
βΒ Β βββ cal_functions.py
βΒ Β βββ cut_functions.py
βΒ Β βββ dec_functions.py
βΒ Β βββ fig_config.py
βΒ Β βββ fit_functions.py
βΒ Β βββ group_functions.py
βΒ Β βββ head_functions.py
βΒ Β βββ io_functions.py
βΒ Β βββ minuit_functions.py
βΒ Β βββ ply_functions.py
βΒ Β βββ sim_functions.py
βΒ Β βββ sty_functions.py
βΒ Β βββ unit_functions.py
βΒ Β βββ vis_functions.py
βΒ Β βββ wvf_functions.py
βββ src
βΒ Β βββ macros
βΒ Β βΒ Β βββ info
βΒ Β βΒ Β βββ simulation
βΒ Β βΒ Β βββ 00ProcessScintAndDeco.py
βΒ Β βΒ Β βββ 01MCScintAndDeco.py
βΒ Β βΒ Β βββ 02VisMCScintAndDeco.py
βΒ Β βΒ Β βββ 00Raw2Np.py
βΒ Β βΒ Β βββ 01PreProcess.py
βΒ Β βΒ Β βββ 02AnaProcess.py
βΒ Β βΒ Β βββ 03Integration.py
βΒ Β βΒ Β βββ 04Calibration.py
βΒ Β βΒ Β βββ 05Charge.py
βΒ Β βΒ Β βββ 06Deconvolution.py
βΒ Β βΒ Β βββ 0VVisPersistance.py
βΒ Β βΒ Β βββ 0WVisWvf.py
βΒ Β βΒ Β βββ 0XVisEvents.py
βΒ Β βΒ Β βββ 0YVisHist1D.py
βΒ Β βΒ Β βββ 0ZVisHist2D.py
βΒ Β βΒ Β βββ 10Ana2Root.py
βΒ Β βΒ Β βββ 11Average.py
βΒ Β βΒ Β βββ 11AverageSPE.py
βΒ Β βΒ Β βββ 12GenerateSER.py
βΒ Β βΒ Β βββ 13Noise.py
βΒ Β βββ scripts
βΒ Β βΒ Β βββ Dockerfile
βΒ Β βΒ Β βββ make_python_env.sh
βΒ Β βΒ Β βββ requirementsTeX.txt
βΒ Β βΒ Β βββ Utils.md
βΒ Β βββ requirements.txt
βΒ Β βββ utils.py
βββ LICENSE
βββ README.md
βββ setup.sh
βββ ToDo.md
π config\input β input txt files are stored here, and they are used as input in all the macros (check TUTORIAL.txt as template)
π \lib β all the functions of the library itself are stored here
π \srcs β macros and scripts subfolders
\macrosβ macros to run the analysis. 0i are used for visualizing and 0# are used for processing data (they are sorted to make easy to remember the work-flow)\scriptsβ the scripts are used to configure the needed packages for the library (make_python_env.sh), create a Docker image and other utilities
π‘ Recommendation: It is recommended not to change the content of the scripts so that anyone can run the library from scratch with the initial configuration, except to include improvements, of course π.
3. Install packages needed for the library to run#
Execute
source setup.shscript that will create a virtual environment to runSCINTwith all the required packages. It will also generate a symbolic link to a folder were data to follow the tutorial is included.
[Pro-users] You can create the virtual environment by your own:
Install VSCode and some extensions: Remote-SSH, Jupyter, vscode-numpy-viewer, Python Environment Manager
CREATE VIRTUAL ENVIROMENT: VSCode venv extension.


You need to source a
pythonversion installed in your computer [+ Enter interpreter path]. Ingaeuidc1.ciemat.esyou can source to/cvmfs/sft.cern.ch/lcg/releases/Python/3.7.3-f4f57/x86_64-centos7-gcc7-opt/bin/python3(as long as it is>=3.7) (Figure 2). Then it will recommend you the/srcs/requirements.txtpackages, and it will automatically install them (Figure 3) :)
It will create the environment, and you will be able to see it in the right panel of VSCode (Figure 4). Jupyter notebooks will detect this .venvand you can also open terminals and activate it withsource SCINT/.venv/bin/activate.From the terminal
mkdir .venv cd .venv /cvmfs/sft.cern.ch/lcg/releases/Python/3.7.3-f4f57/x86_64-centos7-gcc7-opt/bin/python3 -m venv . source bin/activate
Additionally, if you have sudo permissions you can try an installation requirementsTeX.txt with sudo apt install <requirementsTeX.txt to be able to use LaTeX in the notebooks.