Skip to content
forked from DUNE/larnd-sim

Simulation framework for a pixelated Liquid Argon TPC

License

Notifications You must be signed in to change notification settings

soleti/larnd-sim

 
 

Repository files navigation

larnd-sim

CI status Documentation DOI

larnd-sim

This software aims to simulate the light readout and the pixelated charge readout of a Liquid Argon Time Projection Chamber. It consists of a set of highly-parallelized algorithms implemented on the CUDA architecture using Numba.

Software documentation is available here.

Overview

The software takes as input a dataset containing segments of deposited energy in the detector, generated with a Geant4 wrapper called edep-sim. The output of edep-sim is in the ROOT format and must be converted into HDF5 to be used by larnd-sim. To this purpose we provide the cli/dumpTree.py script.

larnd-sim simulates both the scintillation light acquired by the light sensors and the charge induced on the pixels.

Installation

The package can be installed in this way:

git clone https://github.com/DUNE/larnd-sim.git
cd larnd-sim
pip install .

which should take care of installing the required dependencies. cupy installation might take a long time. You can considerably speed up the process by pre-installing cupy precompiled binaries, available here. The version will depend on the version of CUDA installed on your system.

larnd-sim requires a CUDA-compatible GPU to function properly. To check if the GPU is setup properly and can talk to larnd-sim you can run:

>>> from numba.cuda import is_available
>>> is_available()

How to run a simulation

Input dataset

The input array can be created by converting edep-sim ROOT output files using the cli/dumpTree.py script (which is independent from the rest of the software and requires ROOT and Geant4 to be installed).

This script produces a bi-dimensional structured array saved in the HDF5 format, which is used as input for the simulation of the pixel response.

Command line interface

We provide a command-line interface available at cli/simulate_pixels.py, which can run as:

simulate_pixels.py \
--input_filename=examples/lbnfSpillLAr.edep.h5 \
--detector_properties=larndsim/detector_properties/ndlar-module.yaml \
--pixel_layout=larndsim/pixel_layouts/multi_tile_layout-3.0.40.yaml \
--output_filename=lbnfSpillLAr.larndsim.h5 \
--response_file=larndsim/bin/response_38.npy

The response_38.npy is a file containing an array of induced currents for several $(x,y)$ positions on a pixel with a 38 mm pitch. It is calculated externally to larnd-sim. Another version, with 44 mm pitch, is also available in the larndsim/bin directory.

The charged readout output is stored in the datasets described in the LArPix HDF5 documentation, plus a dataset tracks containing the true energy depositions in the detector, and a dataset mc_packets_assn, which has a list of indeces corresponding to the true energy deposition associated to each packet.

The light output is stored in the light_dat, light_trig, and light_wvfm datasets, containing the number of photons, the optical sensors triggers and the optical sensors waveforms, respectively.

About

Simulation framework for a pixelated Liquid Argon TPC

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%