Newer
Older
# Hep Analysis Tools (HAT)
Tools for Hep Analysis including data processing, analysis and visualization.
This repository contains some of my analysis tools (mainly) for charged particle collision experiments.
I'll keep updating it with my work progresses (if I remember it).
$ 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
Following is all the functions that this repository provided.
I'll organise it into a document if there are enough of them.
### 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
```
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"
>>> hat.merge_csv_files(folder_path, columns_to_extract, output_file)