Skip to main content

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

Example Event

Performance

ToyTrack is designed to be fast. The following benchmarks were performed on a 64-core AMD EPYC 7763 (Milan) CPU.

Scaling Study

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toytrack-0.1.4.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toytrack-0.1.4-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file toytrack-0.1.4.tar.gz.

File metadata

  • Download URL: toytrack-0.1.4.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for toytrack-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a108e659e4e45c76fd2ce1b016672e001c231b5694f8e0612d3d1ac97e859bf9
MD5 a9531a48de1558ac6e4951ea4a2c8445
BLAKE2b-256 c82222cdd4f71e5d05827a665ebf3c8c9dd01247613c3d58b291f9dfd5f80cc0

See more details on using hashes here.

File details

Details for the file toytrack-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: toytrack-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for toytrack-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a0aee5dc554b262763941178395d1c164527bc492e77a634aee055e797a5fb07
MD5 ea24704a893c97dcb0e6ee53d9f0bdd6
BLAKE2b-256 729cf25eb571c1e2c035d6a9f1dee1ee10b83ed9a27be6d3bc8bf205fd4c31ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page