CYGNUS-RD / reconstruction

Camera and scope analysis tools
0 stars 25 forks source link

analysis code to reconstruct and analyze track/clusters from CYGNUS camera

Checkout instructions:

git@github.com:CYGNUS-RD/analysis.git git checkout tune_sel

Convert the H5 files in ROOT files with TH2D

This could be avoided reading directly the H5 files, but for now it is like this... See instructions in:

https://github.com/CYGNUS-RD/hdf2root

The usual name of the runs after the conversion is histogram_Run00494.root or histograms_Run01515.root if it was already a root file.

Updated HOW-TO-RUN

Running the analysis code (in general):

python3.X reconstruction.py configFile.txt --pdir plots --max-entries X -jX -r R -t /inputdir/path/

Running the analysis code on MC data (updated on June 2023):

Firstly, create pedestal map (example with pedestal run 4904 of LNGS):

  1. set justPedestal to True in configFile_LNGS.txt
  2. create pedmap with: python3 reconstruction.py configFile_LNGS.txt -r 4904

Now, you should have the file pedestals/pedmap_run4904_rebin1.root

Then, reconstruct digitized (simulated) images:

  1. set justPedestal to False (and debug_mode to 0) in configFile_MC.txt
  2. if needed, create the file pedestals/runlog_MC.csv with the script scripts/make_runlog_tmp.py. If the pedestal run is 4904, the simulated runs must be named with higher run numbers (4905, 4906 ...)
  3. move the simulated runs in the input directory /path/to/inputdir/ and recostruct them with:

python3 reconstruction.py configFile_MC.txt -r 4905 -t /path/to/inputdir/

Prerequisite to run:

Python libraries:

(Beware that some dependent packages will be installed automatically as requirements for some of these packages like:

...so proceed in order)

Small guide to PMT parameters

Read here

Useful Example

Download the code from github:

git clone git@github.com:CYGNUS-RD/analysis.git or git clone https://github.com/CYGNUS-RD/analysis.git

cd analysis

Get a file for a specific run taken with the DAQ (eg. run 2113):

wget https://swift.cloud.infn.it:8080/v1/AUTH_1e60fe39fba04701aa5ffc0b97871ed8/Cygnus/Data/LAB/histograms_Run02113.root

Change the run number in the config file (Line 34)

https://github.com/CYGNUS-RD/analysis/blob/fng_18/configFile.txt#L34

emacs -nw configFile.txt

Then run the code on all the events

python reconstruction.py configFile.txt

If your computer has X cores

(check on linux with cat /proc/cpuinfo | awk '/^processor/{print $3}’)

You can speed up the processing by parallelizing it:

python reconstruction.py configFile.txt -j X

You can now look at the output ROOT file with a tree containing 1 event/image with:

root -l reco_run02113_3D.root