Skip to content

Commit 63f49c3

Browse files
committed
Add detsim city documentation
1 parent 7412008 commit 63f49c3

File tree

5 files changed

+296
-2
lines changed

5 files changed

+296
-2
lines changed

docs/source/detsim.rst

+296-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,299 @@
11
Detsim
22
==========
33

4-
.. caution::
5-
This page is currently not created, we are working on it. If you would like to contribute on this documentation, reach `me <[email protected]>`_!
4+
**Detsim**, from **Detector Simulation**, is a the city that simulates the *detector response* for *fast-simulated* events.
5+
A *fast-simulated* event consist of a collection of hits of position and energy desposition in the gaseous volume (right figure below). The *detector response* are the signals measured in the light-sensors in the form of time ordered waveforms (left figure below).
6+
7+
We can differenciate two simulation modes implemented in NEXUS: the
8+
full-simulation and the fast-simulation. In what follows, *primary
9+
particles* are defined as the particles of the simulated event. The rest
10+
of the particles produced in the simulation would be considered as
11+
*secondary particles*. For example, :math:`0\nu\beta\beta` primary
12+
particles are :math:`e^+ e^-`. Ionization electrons, scintillation
13+
photons, and EL photons are secondary particles. The simulation modes
14+
are described below.
15+
16+
**Full-Simulation:** In this mode the propagation of all particles
17+
(primary and secondary) is carried out until they reach the sensors.
18+
Particles are considered as individual entities with a unique ID-number,
19+
making it possible to trace their interactions throughout the detector.
20+
Therefore the overall simulation would be composed by the simulation of
21+
each individual particle. This is a CPU-time-consuming task, growing
22+
with the number of particles involved, which scales with the energy of
23+
the simulated event. Since each of the emitted photons is also
24+
simulated, the final result of the simulation will be a number of
25+
photons arriving at the photo-sensors. The output of the simulation is
26+
given as zero-suppressed time histograms with the photo-electrons
27+
generated in each sensor (left figure). This simulation mode is
28+
both CPU-time-consuming and memory demanding, with a time-scale on the
29+
order of 2 min to simulate a 41.5 keV :math:`^{83m}`\ Kr event and > 1
30+
hour for a :math:`Q_{\beta\beta} \sim 2.5` MeV event. The advantage of
31+
this simulation mode is its extreme detail and that its outcome is the
32+
actual signal measured at the light sensors.
33+
34+
**Fast-Simulation:** In this mode the simulation is stopped after the
35+
creation of the ionization electrons and scintillation photons. The
36+
ionization electrons and scintillation photons are produced by the
37+
direct propagation of primary particles, or by secondary particles
38+
emitted by the primaries, like delta electrons or bremsstrahlung that
39+
subsequently interact. Once they are created, the simulation stops, and
40+
neither drift nor light propagation is simulated. The ionization
41+
electrons and scintillation photons created are collected in voxels of a
42+
certain volume (usually around 1x1x1 mm\ :math:`^3` voxels). Each voxel
43+
represents an energy deposition, a so-called *hit*, and is characterized
44+
by a 3D position :math:`\boldsymbol{r} = (x, y, z)`, the energy
45+
:math:`E` required to produce them, and the delay time :math:`t` from
46+
the start of the event (right figure). The
47+
collection of hits for a given even is saved, defining a *track* in the
48+
detector’s active volume. The fast-simulation is very fast compared with
49+
the full-simulation mode, on the :math:`\mu s` scale. However, since the
50+
simulation is stopped we do not know the signal that would be measured
51+
at the sensors.
52+
53+
.. image:: images/detsim/fullsim_output.png
54+
:width: 40%
55+
56+
.. image:: images/detsim/fastsim_output.png
57+
:width: 40%
58+
59+
60+
.. _Detsim input:
61+
62+
Input
63+
-----
64+
65+
Detsim input are NEXUS fast simulation tracks, these files must contain only the following non-empty information.
66+
67+
* ``/MC/hits``
68+
69+
.. _Detsim output:
70+
71+
Output
72+
------
73+
74+
* ``/MC/``: the data in the nexus input file is copied in the output file
75+
* ``/Run/event_map``: mapping between nexus event id and IC event id. This mapping is needed because **detsim** might split nexus events into multiple IC events
76+
* ``/Run/events``: IC event number and simulated timestamps based on **rate** configuration parameter
77+
* ``/Run/runInfo``: run number of each event
78+
* ``/pmtrd``: the PMT waveforms for each PMT
79+
* ``/sipmrd``: the SiPM waveforms for each SiPM
80+
* ``/Filters/active_hits``: nexus events without hits inside the active volume are filtered
81+
82+
.. _Detsim config:
83+
84+
Config
85+
------
86+
87+
.. container::
88+
:name: tab:detsim-parameters
89+
90+
.. table:: List of **detsim** parameters used at each stage of the algorithm.
91+
92+
=================== ==========================================
93+
\ Parameter
94+
=================== ==========================================
95+
Electron simulation inverse ionization yield :math:`w_{io}`
96+
\ fano-factor :math:`F`
97+
\ drift velocity :math:`v_d`
98+
\ lifetime :math:`\tau`
99+
\ diffusion :math:`D_L`, :math:`D_T`
100+
Photon simulation inverse scintillation yield :math:`w_{sc}`
101+
\ EL gain :math:`G_{EL}`
102+
\ conde-policarpo factor :math:`J_{CP}`
103+
Signal simulation EL drift velocity :math:`v^{EL}_d`
104+
\ S1 Light Tables
105+
\ S2 Light Tables
106+
\ point spread function (PSF)
107+
Waveform creation pre-trigger time
108+
\ buffer length
109+
\ PMT waveforms bin width
110+
\ SiPM waveforms bin width
111+
=================== ==========================================
112+
113+
114+
Workflow
115+
--------
116+
117+
The city flow parts are shown in the diagram
118+
119+
.. image:: images/detsim/workflow.png
120+
:width: 80%
121+
122+
123+
**Hits filtering**. Hit position determines in which region of the
124+
detector the energy deposition occurs. Energy depositions, ie ionization
125+
electrons, can only be created in the gaseous part of the detector which
126+
is composed by the *active*, *buffer* and EL regions. The ionization
127+
electrons drift towards the EL only if they are produced in the active
128+
region, therefore only hits at this region are selected in the S2
129+
simulation. On the other hand, scintillation photons can be emitted and
130+
produce signal from anywhere inside the gas, thus the S1 simulation
131+
keeps all the hits in the active and buffer regions. Hits in the
132+
EL-region are removed to avoid duplication of S1 and S2 LTs and
133+
implementation complications. This is a good approximation since the S1
134+
of tracks with hits in the EL-region is overlapped with the subsequent
135+
S2, and the event would be reconstructed anyway as an no-S1 event.
136+
137+
**Electron simulation**. This step starts by computing the ionization
138+
electrons produced in each hit, which is the value of the hit energy
139+
divided by the inverse ionization yield :math:`w_{io}`. Defining
140+
:math:`n=E/w_{io}`, the number of ionization electrons in a hit
141+
:math:`n'_{ie}` is simulated following the distribution
142+
143+
.. math::
144+
145+
n'_{ie} \sim
146+
\begin{cases}
147+
\text{Pois}(n) & \text{if} ~ n F < 1 \\
148+
\text{Gauss}(\mu=n, \sigma=\sqrt{n F}) & \text{if} ~ n F \geq 1
149+
\end{cases},
150+
151+
motivated by the definition of the fano-factor :math:`F`. Next the
152+
electrons are drifted toward the EL region. During the drifting some of
153+
the electrons are absorbed due to impurity attachment, a process
154+
described by an exponential with characteristic lifetime :math:`\tau`.
155+
Or equivalently, the time it takes the drifting electrons to be absorbed
156+
:math:`t_{abs}` is given by
157+
158+
.. math::
159+
160+
t_{abs} \sim \text{Exp}(\lambda = \tau^{-1}).
161+
\label{eq:detsim-absorption-time}
162+
163+
Then the number of electrons that survive :math:`n_{ie}` can be computed
164+
by
165+
166+
.. math::
167+
168+
n_{ie} = \sum_{i=1}^{n'_{ie}}
169+
\begin{cases}
170+
1 & \text{if} ~ t_{abs}^i < t_{drift} \\
171+
0 & \text{if} ~ t_{abs}^i \geq t_{drift}
172+
\end{cases},
173+
174+
where :math:`t_{drift}=z/v_{d}` is the time it takes to the ionization
175+
electrons produced at :math:`z` to reach the gate with drift velocity in
176+
the active volume :math:`v_d`. The last electron physical process to
177+
simulate is the diffusion, characterized by the longitudinal and
178+
transverse diffusion coefficients :math:`D_{L}` and :math:`D_{T}`
179+
respectively. The position of each electron arriving at the gate is
180+
diffused following
181+
182+
.. math::
183+
184+
\begin{aligned}
185+
X_{diff}&\sim\text{Gauss}(x,~D_{T}\sqrt{z}),\\
186+
Y_{diff}&\sim\text{Gauss}(y,~D_{T}\sqrt{z}),\\
187+
Z_{diff}&\sim\text{Gauss}(z,~D_{L}\sqrt{z}).\end{aligned}
188+
189+
where :math:`x, y, z` are the initial position of the electrons, ie the
190+
hit position in which they are created.
191+
192+
**Photon simulation**. The S1 photons are generated from the initial
193+
hits through the inverse scintillation yield :math:`w_{sc}`
194+
195+
.. math:: n_{S1} \sim \text{Pois}(E/w_{sc})
196+
197+
The S2 photons are computed using the number of ionization electrons
198+
arriving at the EL :math:`n_{ie}`,
199+
200+
.. math:: n_{S2} \sim\text{Gauss}\left(n_{ie}G_{EL}, \sqrt{n_{ie}G_{EL}J_{CP}}\right),
201+
202+
where :math:`G_{EL}` is the EL gain (number of photons emitted by a
203+
single electron) and :math:`J_{CP}` is the conde-policarpo factor.
204+
205+
**Signal simulation**. In this stage we compute the photon-electrons
206+
(pes) measured in each sensor and their arrival times. The treatment is
207+
different for S1 and S2 signals and also for PMTs and SiPMs.
208+
209+
*S1*. In the photon simulation block, we computed the number of
210+
scintillation photons produced by each hit. By the definition of the S1
211+
LT, the number of photo-electrons generated by the scintillation photons
212+
at :math:`x, y, z` is given by
213+
214+
.. math::
215+
216+
S_{S1}(\text{PMT}) \sim \text{Pois}(n_{S1} \times \text{LT}_{S1}(x, y, z|\text{PMT})).
217+
\label{eq:poisson-S1}
218+
219+
The next step is to simulate the arrival time of the photons to the
220+
sensors, which is given by
221+
222+
.. math::
223+
224+
t_{arrival} = t + t_{decay} + t_{travel}
225+
\label{eq:s1-tarrival}
226+
227+
where :math:`t` is the hit production time, :math:`t_{decay}` the
228+
scintillation decay time and :math:`t_{travel}` is the time it takes the
229+
photons to go from the hit position to the particular PMT. The travel
230+
time is neglected in detsim since its simulation would require a
231+
complete photon propagation. The photon travel time is in fact
232+
negligible compared to the drift time of the ionization electrons that
233+
produce the S2, thus we can safely omit it (recall that S1 is used to
234+
compute the drift time of the event, namely its longitudinal position).
235+
The decay time is simulated for xenon using its fast and slow
236+
scintillation components given by
237+
238+
.. math:: t_{decay} \sim 0.1 ~ \text{exp}(-t/\tau_{f}) + 0.9 ~ \text{exp}(-t/\tau_{s})
239+
240+
where :math:`\tau_{f} = 4.5~\text{ns}` and
241+
:math:`\tau_{s} = 100~\text{ns}` are the fast and slow scintillation
242+
decay times, respectively. For each measured photo-electron, a
243+
:math:`t_{arrival}` is computed. The total S1 signal would be given by
244+
the time histogram of the arrival times for the generated
245+
photo-electrons. The S1 signal at the SiPMs is not simulated.
246+
247+
*S2*. The computation of the number of photo-electrons in the PMTs is
248+
similar to that of the S1,
249+
250+
.. math:: S_{S2}(\text{PMT}) \sim \text{Pois}(n_{S2} \times \text{LT}_{S2}(x, y|\text{PMT})),
251+
252+
but the arrival times are treated differently. The arrival time will be
253+
given by the sum of the production time, the drift time and the EL
254+
emission time,
255+
256+
.. math:: t_{arrival} = t + t_{drift} + t_{EL}.
257+
258+
The drift time is given by :math:`t_{drift}=z/v_{d}`. The :math:`t_{EL}`
259+
is the emission time at the EL gap. Assuming that photons are emitted
260+
uniformly throughout the EL gap,
261+
262+
.. math:: t_{EL} \sim \text{Uniform} \left( 0, T_{EL} \right) \quad \text{with} \quad T_{EL}=\frac{w_{EL}}{v^{EL}_{d}},
263+
264+
where :math:`w_{EL}` is the width and :math:`v^{EL}_{d}` the drift
265+
velocity in the EL. Notice that we are implicitly neglecting the travel
266+
time from the emission point to the sensor, which is much lower that the
267+
drift and EL times.
268+
269+
The signal in the SiPMs is computed with the PSF function. Recall that
270+
the PSF is :math:`z` dependent, covering the EL width in several
271+
partitions. For an ionization electron arriving at the EL at position
272+
:math:`x, y` and emitting :math:`n_{S2}` total photons, the signal
273+
produced at the SiPM at distance :math:`d` would be
274+
275+
.. math:: S_{S2}(\text{SiPM}, z_p) \sim \text{Pois} \left( n_{S2}/n_z \times \text{PSF} (d|z_{p}) \right),
276+
277+
where :math:`n_z` is the total number of EL partitions. Notice that this
278+
is the signal produced by photons emitted at partition :math:`z_p`,
279+
which are assumed to be uniformly emitted throughout the EL width. The
280+
arrival times would also depend on the partition
281+
282+
.. math:: t_{arrival~p} = t + t_{drift} + t_{drift~p} + t_{EL~p}
283+
284+
where :math:`t_{drift~p} = |z_p|/v^{EL}_d` and
285+
286+
.. math:: t_{EL~p} \sim \text{Uniform} \left( 0, \Delta T_{p} \right) \quad \text{with} \quad \Delta T_{p}=\frac{w_{p}}{v^{EL}_{d}},
287+
288+
where :math:`w_p` is the partition width. Again, in both PMTs and SiPMs
289+
the arrival time is computed for each measured photo-electron.
290+
291+
292+
**Waveforms creation**. By definition, a waveform is a time histogram of
293+
the arrival times. Therefore this step consists of histograming the
294+
photo-electron’s arrival times for each sensor. The PMT and SiPM
295+
waveforms are assumed to have the same *buffer-length* but different
296+
*bin width*. By convention the waveform times go from 0 to
297+
buffer-length, and in order to mimic the DAQ triggering system we add an
298+
extra *pre-trigger buffer time* that fixes the start of the signals
299+
inside the buffer.
179 KB
Loading
126 KB
Loading
124 KB
Loading
171 KB
Loading

0 commit comments

Comments
 (0)