Skip to content
Snippets Groups Projects
README.md 1.42 KiB
Newer Older
Yizhou Zhang's avatar
Yizhou Zhang committed
# Hep Analysis Tools (HAT)
Tools for Hep Analysis including data processing, analysis and visualization.
Yizhou Zhang's avatar
Yizhou Zhang committed

Yizhou Zhang's avatar
Yizhou Zhang committed
This repository contains some of my analysis tools (mainly) for charged particle collision experiments.
Yizhou Zhang's avatar
Yizhou Zhang committed

Yizhou Zhang's avatar
Yizhou Zhang committed
This is a personal study note in fact.
Yizhou Zhang's avatar
Yizhou Zhang committed

Yizhou Zhang's avatar
Yizhou Zhang committed
I'll keep updating it with my work progresses (if I remember it).
Yizhou Zhang's avatar
Yizhou Zhang committed

Yizhou Zhang's avatar
Yizhou Zhang committed
## Install
Yizhou Zhang's avatar
Yizhou Zhang committed
```
Yizhou Zhang's avatar
Yizhou Zhang committed
$ git clone https://code.ihep.ac.cn/zhangyz/hep-analysis-tools.git
$ cd hep-analysis-tools
$ pip install -r requirements.txt
$ python setup.py install (add --user if needed)
$ python
>>> import hat
>>> print(hat.__version__)
0.0.1
Yizhou Zhang's avatar
Yizhou Zhang committed
```

Yizhou Zhang's avatar
Yizhou Zhang committed
## Functions
Yizhou Zhang's avatar
Yizhou Zhang committed

Yizhou Zhang's avatar
Yizhou Zhang committed
Following is all the functions that this repository provided.
I'll organise it into a document if there are enough of them.
Yizhou Zhang's avatar
Yizhou Zhang committed

Yizhou Zhang's avatar
Yizhou Zhang committed
### Track Parameter Estimation

#### Karimaki's fit

Estimate the track parameters on the xy plane from at least three space points.
It assumes the trajectory projection on the xy plane is a circle, i.e. the magnetic field is along global z-axis.

```
>>> x = [2, 4, 6, 8, 10, 12]
>>> y = [6, 9, 10, 11, 12, 12]
>>> phi, r, pt, d0 = hat.karimaki.fit_track(x, y, MagneticField=3) #Tesla
```

Yizhou Zhang's avatar
Yizhou Zhang committed
### CSV Handling

Yizhou Zhang's avatar
Yizhou Zhang committed
#### Merge CSV files

Yizhou Zhang's avatar
Yizhou Zhang committed
Merge specified columns from all CSV files in a given folder into a single large CSV file.

```
>>> folder_path = "path/to/your/csv/folder"
>>> columns_to_extract = ["column1", "column2", "column3"]
>>> output_file = "merged_output.csv"
Yizhou Zhang's avatar
Yizhou Zhang committed
>>> hat.merge_csv_files(folder_path, columns_to_extract, output_file)
Yizhou Zhang's avatar
Yizhou Zhang committed
```