Metadata-Version: 2.1
Name: HighResAnalysis
Version: 0.0.3
Summary: Analysis of High Resolution Data from CERN and DESY beam tests
Home-page: https://github.com/dmitryhits/HighResAnalysis
Author: Dmitry Hits
Author-email: dmitry.hits@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python alignment telescope testbeam
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

HighResAnalysis
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

The current repository is in development and is not guaranteed to work
The working version can be found
https://github.com/diamondIPP/HighResAnalysis

## Requirements

- python\>=3.6
- (py)ROOT\>=6.22
- [proteus](https://github.com/diamondIPP/proteus)
- [judith](https://github.com/diamondIPP/judith) (only for CERN data)
- [eudaq2](https://github.com/diamondIPP/eudaq-2) (only for DESY data)

## Installation

- download the code
  `shell   git clone --recurse-submodules https://github.com/diamondIPP/HighResAnalysis.git   cd HighResAnalysis`

- Install python3, pip, virtualenv (requires sudo)
  `shell   make prepare-dev`

- virtual environment and python packages (included in previous step)
  `shell     make venv`

- required python packages are listed in
  [requirements](requirements.txt)

- activate virtual environment and install aliases
  `shell    source .bash_aliases`

## Example analysis of the DESY data

the data need to be frist pre-converted:

`>analyse --run=4`

you will need to import a couple of libraries. Most of the tools are in
`src.dut_analysis`. It will load the data and set all the cuts. The
`draw` module from plotting library has some useful functions and
presets that allow plotting histograms and graphs

``` python
from HighResAnalysis.src.dut_analysis import *
from HighResAnalysis.plotting.draw import *
```

    Welcome to JupyROOT 6.28/00

Initialize the DUTAnalysis with run number, DUT number, and a string
indicating the year and the month of the beam test

``` python
run4 = DUTAnalysis(4, 0, '201912')
```

    --- Palette ------ 55

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    STARTING DUT ANALYSIS of D02, run 4 (Dec 2019), 2.50M ev |
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ************** Initing Converter *****************
    *************** Initing PROTEUS ******************

A small function that allows inline plotting of ROOT histograms

``` python
def dc(): get_last_canvas().Draw()
```

Let’s plot a signal distribution

``` python
run4.draw_charge_distribution()
dc()
```

    INFO:     10:34:18 --> Creating directory: /Users/hits/Documents/GitHub/HighResAnalysis/HighResAnalysis/results/201912
    INFO:     10:34:18 --> saving plot: SignalDist
    WARNING:  10:34:19 --> Diamond server is not mounted in /Users/hits/mounts/high-rate

![](index_files/figure-commonmark/cell-5-output-2.png)
