Giter Site home page Giter Site logo

larnd-sim's Introduction

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()

If you already have cupy installed, you can force skip the automatic cupy installation by setting the SKIP_CUPY_INSTALL environment variable prior to running pip.

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.

larnd-sim's People

Contributors

alexwilkinsonnn avatar awh1t3 avatar cuddandr avatar danielmdouglas avatar dependabot[bot] avatar dmargala avatar drinkingkazu avatar eliastaira avatar f-shaker avatar krwood avatar liviocali avatar maxpkatz avatar mjkramer avatar peter-madigan avatar sam-fogarty avatar soleti avatar zoyavallari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.