A package for generating toy tracking data.
Project description
ToyTrack
ToyTrack is a Python library for generating toy tracking events for particle physics.
The goal: To produce a "good-enough" event simulation, in as few lines as possible (currently 3 lines), as quickly as possible (currently 0.15 seconds for a 10,000-particle event).
Installation
Use the package manager pip to install ToyTrack.
pip install toytrack
Usage
from toytrack import ParticleGun, Detector, EventGenerator
# Initialize a particle gun which samples uniformly from pt between 10 and 20 GeV,
# initial direction phi between -pi and pi, and creation vertex vx and vy between -0.1 and 0.1 cm
particle_gun = ParticleGun(dimension=2, pt=(2, 20), pphi=(-np.pi, np.pi), vx=(-0.1, 0.1), vy=(-0.1, 0.1))
# Initialize a detector
detector = Detector(dimension=2).add_from_template('barrel', min_radius=0.5, max_radius=3, number_of_layers=10)
# Initialize an event generator, which generates an event with a number of particles given by a normal
# distribution, with mean 10 and standard deviation 5
event = EventGenerator(particle_gun, detector, num_particles=(20, 5, 'normal')).generate_event()
# Access the particles and hits as needed
particles = event.particles
hits = event.hits
# Plot the event
event.display()
Performance
ToyTrack is designed to be fast. The following benchmarks were performed on a 64-core AMD EPYC 7763 (Milan) CPU.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toytrack-0.1.5.tar.gz.
File metadata
- Download URL: toytrack-0.1.5.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4c542e66bb5a361fafcce28f513c2ea7529e469e3a34cb49a9c598e3addee50
|
|
| MD5 |
9df14a4d25615327481170c0df939d39
|
|
| BLAKE2b-256 |
28f58141b35f533b552dc0c9a89857e3925b18ef939ca197c114bb22f97c0d3c
|
File details
Details for the file toytrack-0.1.5-py3-none-any.whl.
File metadata
- Download URL: toytrack-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6d777010bfd89316011a064a767e55462c57ce0730980c67b2761a13cf2ae5c
|
|
| MD5 |
ae02e75ba695269bbea75959977f21c4
|
|
| BLAKE2b-256 |
f76268d2734b17a25d46bb68db78d8f50eaefd56ba3f40c1ef30da6118a2e293
|