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.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.6.tar.gz (7.9 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.6-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toytrack-0.1.6.tar.gz
  • Upload date:
  • Size: 7.9 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.6.tar.gz
Algorithm Hash digest
SHA256 d973c4deb2dc5559c36ba8ae5d2c0d735b0b4b5bd46502be04081a57dc80aafd
MD5 3a20b083da50eb50d1cc93ec8276e9e4
BLAKE2b-256 c55c71cd72e9d9e195447371245d27e9d3ee74ba770e5a39cd93975846261ce0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toytrack-0.1.6-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

Hashes for toytrack-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1e6fd9be9ebb9fcb247e71ec0afcfaf8071f3ad49af0907177ee906d4069bff3
MD5 8d3349a1ec4ee9497d702e8bcd6bbc89
BLAKE2b-256 337671f656c47e821a926d079250e5ad844d86396a2ccdbc56a76988ec15c74d

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