Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Detector simulation #691

Closed
andLaing opened this issue Feb 17, 2020 · 5 comments
Closed

Detector simulation #691

andLaing opened this issue Feb 17, 2020 · 5 comments
Assignees

Comments

@andLaing
Copy link
Collaborator

andLaing commented Feb 17, 2020

The functionality to sort nexus full simulation into buffers or fully simulate the detector response in python (generally referred to as detsim) needs to be integrated into IC.

We propose the following grouping of pull requests to gradually integrate the functionality:

  1. Additional source components to read relevant MC info into dataflow
  2. New writer to save all the relevant information and add the possibility to split long events into multiple 'triggers'
  3. Functions to generate scintillation light and its detection by the sensors
  4. Functions to simulate electron drift (diffusion/attachment etc)
  5. Functions to simulate EL light and its detection by the sensors
  6. Functions to produce buffers and position s1 and s2
  7. Utility functions for light level scaling etc
  8. Dataflow (city) reading mc hits, simulating detector response, and saving relevant information
  9. Dataflow (city) reading full simulation sensor response and production buffers and other relevant info.

All PRs will reference this issue for book keeping.

@gondiaz
Copy link
Collaborator

gondiaz commented Feb 26, 2020

  1. Functions to manipulate the psf functions.

carmenromo pushed a commit that referenced this issue Jun 5, 2020
#722

[author: andLaing]

Adds a new io option to `rwf_io` which uses the basic `rwf_writer` and
other table writers to write all event info in one step. In this way
long MC events can be split into multiple trigger-like events in the
output file and the event numbers can be logged and mapped
accordingly.

Some issues remain for the logging portion that are under debate.

Addresses point 2 of issue #691

[reviewer: jmalbos]

This PR adds a new writer (and the corresponding test) to `rwf_io` than
can handle the splitting of long (MC) events into several subevents. A
new table (`MCEventMap`) is used to associate the new subevents to the
original event.

Nevertheless, this new writer has limited use until a decision is
taken regarding #715.
@gonzaponte
Copy link
Collaborator

In order to coordinate the PRs, please agree on a common folder for the code that doesn't belong in the cities folder and move your code there (just before the PR is merged, don't do it in between other commits).

@andLaing
Copy link
Collaborator Author

andLaing commented Sep 8, 2020

In PR #737 I put the new functions in a folder detector_simulation. If everyone's happy with that we could use it. If other PRs are accepted before it it'll make things a bit more awkward but it shouldn't be a big problem.

If that name's a bit verbose we could change it in all.

@gonzaponte
Copy link
Collaborator

Both detector_simulation and detsim look good to me. I think the detsim name is pretty well known among the software people and it is shorter, which may be nicer to see, but I don't have a strong opinion. Whatever you decide. But I would like all PRs to share this folder before merging them.

carmenromo added a commit that referenced this issue Sep 16, 2020
#737

[author: andLaing]

Adds functions and utilities used to sort MC sensor data (full optical
simulation) into buffers for IC processing.

Addresses point 6 of issue #691

Functions can be seen in context in
https://github.com/andLaing/detsim/tree/IC-integration-tests where the
`position_signal.py` script will form the basis for a future IC city.

[reviewer: gonzaponte]

A complete set of functions and components to split events into
buffers and create waveforms in each of them. It reuses existing code
as much as needed and tests every function implemented. All functions
have some documentation. Very nice job.
carmenromo pushed a commit that referenced this issue Sep 21, 2020
#721

[author: andLaing]

Adds a source to compoments which reads the nexus sensor response
output and returns a dictionary.

Addresses point 1 of issue #691 for the case of nexus full optical
simulation.

Valid for NEW, NEXT100 and DEMO++.

[reviewer: jmalbos]

This pull request adds a new data source that reads the nexus sensor
response output and yields a dictionary as expected by `dataflow`. The
code is straightforward, given that it relies on existing functions to
do most of the legwork.

Three new tests are added to IC in this PR: the first two check the
behavior of the new function when the input datafile does not conform
to the standard; the third test makes sure that the returned
information is correct.

Once a small typo is fixed in the docstring of the function, I'll
approve the PR.
carmenromo pushed a commit that referenced this issue Nov 27, 2020
#758

[author: andLaing]

Moves some of the pipe from buffy to a compound component in components so it
can be used by the parametrized detsim city (under development).

Also adds a couple of protections to the buffer functions so that they are safe
for both cities.

[reviewer: mmkekic]

This PR adapts bufferization functions and extract the pipe that creates buffers
from the buffy flow allowing it to be reused in the detsim city as
well (#691,#700). Tests are added to show that the functions work both with
pandas and numpy inputs. Thanks for the effort!
carmenromo pushed a commit that referenced this issue Feb 22, 2021
#695

[author: gondiaz]

Following issue #691:
4. upload functions to simulate electron drift (diffusion/attachment etc) in
`invisible_cities/cities/detsim_simulate_electrons.py`

This module contains three functions, that generate, drift and diffuse the
secondary electrons produced by the energy hits.

[reviewer: gonzaponte]

This PR implements all the functions needed to transform energy deposits from
nexus into ionization electrons at the EL gap. The code is well written,
documented, and tested.
Good job.
@mmkekic
Copy link
Collaborator

mmkekic commented Feb 23, 2021

Closed by approving final parts: #742 and #769

@mmkekic mmkekic closed this as completed Feb 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants