Skip to main content

A package for generating toy tracking data.

Project description

ToyTrack

Documentation Status

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.07 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, hits and tracks as needed
particles = event.particles
hits = event.hits
tracks = event.tracks

# Plot the event
event.display()

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.8.tar.gz (9.3 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.8-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toytrack-0.1.8.tar.gz
  • Upload date:
  • Size: 9.3 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.8.tar.gz
Algorithm Hash digest
SHA256 8e16e688a3ddc2d7c354f3804d9b7d5fea564b4e42487519da3f56556860db23
MD5 ca0741ae745c4ecbf5d8479a3cc3630f
BLAKE2b-256 9a56bc01f98711154fa759f6c3d56346c3af90796b52d087fd5162879856defe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toytrack-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 9.8 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5ececc10c5e6033ca21b4155eaab9836decdbc9deee4618bdf51578a3ba87738
MD5 fe69253d6c687be4a67854f368d4e51b
BLAKE2b-256 a19ac02ee8d9c5615cc186aeca6ee886d19847007f913cf51c95ee963b74db1c

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