Author: Satoshi Takashima
If you want a formatted (or easier-to-read) version of this file, scroll to the bottom of GramsSim/README.md
for instructions. If you're reading this on github, then it's already formatted.
Table of contents generated with markdown-toc
This program is a simulation of the electronics response to the detector readout, including noise and shaping. It sums the energy deposited into each readout pixel as a function of time, and generates waveform simulations for each pixel.
Note that gramselecsim
uses a random-number generator for its noise and pre-amp operations. When running this program as part of grid or batch job, you probably want to set up a process-based value for option rngseed
as mentioned in GramsSim/README.md. For example, assuming that the individual process ID is stored in variable ${Process}
:
./gramselecsim --rngseed=${Process}
See GramsSim/util/README.md
for a description of how to control the
operation of gramsdetsim
through the options.xml
file and the
command line.
-
timebin_width
: The minimal time interval over which the readout can can respond to a charge. -
time_window
: The total time interval over which charge would be sampled once the electronics are triggered.
There are three segments of the electronics response modeled by gramselecsim
.
The number of electrons arriving at given pixel is adjusted by:
where
- Νi is the number of electrons in an electron cluster;
- Νi' is the noise-adjusted number of electrons;
- N(0,1) is a normal distribution with a mean of 0 and width of 1;
- c0, c1, and c2 are the parameters
noise_param0
,noise_param1
, andnoise_param2
respectively.
Each group of electrons is treated as a delta function which must be shaped by a response function. The parameters that affect this process are:
preamp_prior_time
: The rise time of the response function.preamp_post_time
: The decay time of the response function.peak_delay
: The delay between the arrival of the electron cluster and the peak of the response function.preamp_gain
: The amplitude of the response function.
The parameter preamp_func
selects which response function to use:
0 -> A gaussian distribution normalized to unity:
1 -> A gaussian distribution:
2 -> The log of a normalized gaussian distribution:
3 -> The log of a gaussian:
4 -> A double exponential function:
where σ, τ1, and τ2 are the parameters preamp_sigma
, preamp_tau1
, and preamp_tau2
respectively.
The last step is to take the summed response functions for the accumulated electrons and apply the effects of analog-to-digital (ADC) conversion.
The parameters that affect this procedure are:
-
sample_freq
: The analog values are scaled from time bins whose width was determined bytimebin_width
to the ADC bins whose width is determined bysample_freq
. -
input_max
andinput_min
: The signal is then clipped at the high and low ends by these two parameters. The parameterinput_min
also effectively serves as the ADC pedestal. -
bit_resolution
: The last step is to convert the floating-point value from the previous steps into a number of ADC counts, as determined by thebit_resolution
parameter.
As you look through the description below, consult the GramsDataObj/include directory for the header files. These are the files that define the methods for accessing the values stored in this object. Documentation may be inaccurate; the code is actual definition. If it helps, a std::map is a container whose elements are stored in (key,value) pairs. If you're familiar with Python, they're similar to dicts.
![]() |
---|
Sketch of the grams::ReadoutWaveforms data object. |
The grams::ReadoutWaveforms
data object represents an approximation to the electronic signals expected to come from the detector. ReadoutWaveforms
is a map containing grams::ReadoutWaveform
objects for an event. Each ReadoutWaveform has two vectors (similar to a Numpy array), one for the signal that's input to the analog-to-digital conversion (ADC) and one for the digitized version of the analog signal.
The analog and digital versions of the waveforms are created by summing the charges (electron clusters) accumulated at each readout channel. Units of the analog waveform are millivolts; units of the digital waveform are ADC counts. Note that the length of these two vectors are not the same; the length of the "digital" vector is scaled from the "analog" vector using the sample_freq
parameter described above.
It's reasonable to ask why the functions of GramsDetSim, GramsReadoutSim, and GramsElecSim are in three separate programs.
Functionally, each of these programs relates to a different aspect of an experiment's simulation:
-
GramsDetSim relates to the physics of charge transport in the detector.
-
GramsReadoutSim relates to the geometry of the readout anode.
-
GramsElecSim relates to the design of the data-acquisition electronics.
Experience has taught us that for the purpose of planning, testing, studies, and maintenance, it's best to have these functions in separate programs, rather than one large program.