seen in Table 3.5. It can be noted that the measured values are higher than
the Hamamatsu data. The environmental and triggering conditions for the
Hamamatsu test are unknown. In any case, the obtained values are below the 500
Hz upper limit, fulfilling the initial requirements.

######

Figure 3.16: PMT dark counts vs. HV. PMT | Dark current (Hz) | Dark current Hamamatsu (Hz)
---|---|---
FA0022 | $248.5\pm 5.8$ | 135.00
FA0037 | $283.1\pm 7.2$ | 71.10
FA0051 | $298.8\pm 6.2$ | 43.60
FA0057 | $467.5\pm 9.2$ | 84.70
FA0087 | $479.5\pm 9.6$ | 297.00
Table 3.5: Dark counts at gain $1\cdot 10^{6}$.

####  3.6.5 Relative quantum efficiency

Relative quantum efficiency measurements require high stability in the light
source and in the physical set-up in order to ensure the same incident light
to the photomultiplier. For this reason, a careful and fast PMT change must be
performed taking into account the intrinsic drift of the set-up (see Section
3.5.4) and the harmful effects of an undesired change in the optical fiber,
filter and diffuser positions.

######

The data were collected at very low light ($\mu\simeq 0.05$) to take advantage
of the better behavior of the detection light algorithms seen in Section
3.5.5. The measured $\mu$ is compared with the $\mu$ from the reference PMT
(FA0087). The results of the measurements can be seen in Table 3.6. It can be
noted that the discrepancies between the expected and measured relative
quantum efficiency are above the statistical error possibly due to the
instabilities in light emission and collection. A more stable set-up is in
preparation as noted earlier. Anyway, this set-up is useful as crosscheck in
order to detect units with significant deviations from the Hamamatsu
specification (see Section 3.2.2).

FA0051 $\mu$ | FA0087 $\mu$ | Relative QE
---|---|---
$0.03975\pm 0.00058$ | $0.04593\pm 0.00061$ | $0.865\pm 0.017$
FA0051 QE | FA0087 QE | Relative QE (Hamamatsu)
33.19 | 40.37 | 0.822
|  |
FA0057 $\mu$ | FA0087 $\mu$ | Relative QE
$0.05665\pm 0.00072$ | $0.06432\pm 0.00072$ | $0.818\pm 0.016$
FA0057 QE | FA0087 QE | Relative QE (Hamamatsu)
33.95 | 40.37 | 0.841
|  |
FA0090 $\mu$ | FA0087 $\mu$ | Relative QE
$0.04266\pm 0.00063$ | $0.04493\pm 0.00060$ | $0.949\pm 0.019$
FA0090 QE | FA0087 QE | Relative QE (Hamamatsu)
38.97 | 40.37 | 0.965
Table 3.6: Relative quantum efficiency results.

####  3.6.6 Characterization protocol

The proposed protocol to test all the ANAIS PMTs is based on the set-up and
algorithms previously described in Section 3.5 taking advantage of accumulated
experience in the analysis of the PMT data presented in this section. The
steps of such a protocol will be: & Data taking at different voltages in order
to draw the gain curve. The starting point will be the voltage of gain $\times
10^{6}$ with steps of 25 V. The data will be deconvoluted obtaining the SER
parameters, including gain and peak-to-valley ratio with the procedure
described in Section 3.6.1. Taking dark counts data at least twenty hours
after the PMT installation in order to get a stable dark rate. The starting
point will be the $10{{}^{6}}$ gain. Taking a run at low voltage and change
the PMT for the reference PMT (FA0087) in order to compare the measured light
and calculate the relative quantum efficiency. This PMT was chosen for its
high quantum efficiency.

###  3.7 Operating voltage and trigger level selection

The operating high voltage of every PMT can be selected once it is fully
characterized. Several factors must be taken into account in order to get the
proper selection: signal-to-noise ratio, the PMT linearity range and the
photoelectron signal.

######

Triggering at photoelectron level has a direct impact on the high voltage
settings: the SER distribution has to be above the baseline RMS. The higher
the voltage, the better the signal to noise ratio. Nevertheless, the operating
voltage rise can produce other unwanted effects such as PMT saturation,
reflections and dark counts. The first would have a negative impact in the
linearity and the latter two in the signal-to-noise ratio.

######

The PMT linearity depends on the cathode and anode current linearities with
light intensity and both depends only on the current [182]. For this reason,
the energy range of interest imposes restrictions to the high voltage. The
maximum of the energy range of interest should create a current below the
saturation range. This is a major restriction when characterizing the
detectors because the alpha rate plays a key role in the background
understanding (see Sections 2.3 and 2.4). On the other hand, a significant
increase on the operating voltage can cause signal reflections which could be
mistaken for photoelectrons by the peak identification algorithm and it can
also increase the dark count rate. These two effects limit the range of the
voltage increase.

######

Once selected the operation voltage with the energy region of interest in
mind, the trigger level must be naturally selected to trigger all the SER
distribution. Here, a method for finding the associated trigger level to a
voltage is presented. The method is to locate the SER valley in the pulsed LED
data used in the previous sections.

######

It has to be noted that the valley is better algorithmically found in charge
than in amplitude distribution but the ANAIS trigger is performed in
amplitude. A software comparison between amplitude and area distributions was
performed in order to help to set trigger level. Figure 3.17(a) shows the
ratio between the events above the charge SER valley and the events above the
amplitude trigger level at different trigger levels. The horizontal red line
at a ratio of 1 marks the equal rate of both amplitude and area triggers and
it is useful as reference. Following this reference, the trigger level would
be 3 mV for an operating voltage of 875 V. Figure 3.17(b) shows the SER charge
distribution at the selected voltage (875 V, blue line) and the comparison of
the events above the SER valley (black) and the events above the selected
trigger (red) showing a good agreement and the suitability as trigger
selection method.

(a)

(b)

Figure 3.17: Voltage and trigger level selection. Ratio between amplitude
triggered events and _above the SER valley_ events at different amplitude
trigger level (see text for details) (a). The SER at selected voltage (blue)
and triggered events at selected trigger level (red) compared with valley cut
(black) (b).

###  3.8 Coincidence Trigger

The low energy threshold required for the experiment makes triggering a very
critical step. Dark current, as described and measured in Section 3.5.7, has a
high rate of events produced in the PMTs without the presence of light with a
signal level compatible with light. Triggering at that rate would saturate the
data acquisition with a dead time unacceptable for the experiment (see Section
2.1).

######

The coincidence trigger technique uses two (or more) PMTs in a crystal
detector in order to ensure having signal in all detector PMTs. This technique
drastically reduces the trigger rate allowing to collect more light and
discard other non-bulk scintillation events. Coincidence must be conceived
from the very beginning of the experiment because the crystals must allow to
couple two (or more) PMTs. The ANAIS modules uses two PMTs as seen in Section
2.3 for example.

######

The coincidence trigger is defined by the _coincidence window_. This window is
the time in which two signals are considered coincident. It must be set
carefully because a big window may trigger many random coincidences but a
small one can lose some genuine events, depending on light collection and dark
rate. The random coincidence rate as a function of the two rates ($r_{1}$ and
$r_{2}$) and the coincidence window ($\tau$) is [179]:

$R_{random\\_coinc}=2\tau r_{1}r_{2}$ (3.14)

The dark rate for the R12669SEL2 has its upper limit at 500 Hz, so the upper
limit random rate for a 200 ns coincidence window is 0.1 Hz. The resulting
upper limits of the total random rate in the full experiment, with nine
detectors, is of the order of the hertz, being acceptable for the acquisition
system (see Section 8.2).

##  Chapter 4 Data acquisition electronic front-end

This chapter covers the design, implementation and the tests of the electronic
front-end modules for the ANAIS experiment. The design presented here is the
evolution of the front-end of the previous prototypes [190, 167] adapted to
VME electronics. Some parts have been developed specifically in this work such
as the preamplifier (see Section 4.3.1), the real time/live time system (see
Section 4.4.1) and the NIM delay module (see Section 4.5.2).

###  4.1 Front-end requirements

The electronic front-end must be designed with the scintillation signal
described in the previous chapter in mind. It has to be able to get
information in a wide range of energies in order to understand the experiment
background while optimizing the low energy range. The system must have the
lowest possible hardware threshold level in order to achieve the lowest energy
threshold. Hence, a baseline as clean as possible is needed.

##### Low threshold

An energy threshold below 2 keV must be achieved as described in Section 2.1.
Being able to lower the energy threshold will allow to better explore the
DAMA/LIBRA region and it could enable the observation of expected features for
the WIMP interactions such as the phase inversion.

######

This requirement implies a hardware trigger at the photoelectron level with a
good signal to noise ratio, as it can be seen in Section 3.4.

##### Stability

The requirement of stable operation conditions described in Section 2.1 is
particularly relevant from electronic front-end point of view. The system must
ensure a valid set of stable enough energy estimators during all the data
taking phase. Taking into account the nature of the experiment, the stability
must be ensured during several annual cycles. These estimators must be
accurately calibrated and effects like gain drift or fitful noises must be
avoided as far as possible.

######

The above conditions are translated to the front-end design:

[itemize] & Trigger level must be at the photoelectron level and it must be as
stable as possible. Electronic noise must be minimized and controlled. The
system must allow energy calibrations to control the stability. The whole
system must be robust, stable and scalable.

######

The design of the front-end and the fulfillment of these requirements will be
discussed in the following. The tests for the modules are reported in Section
4.5, the hardware trigger level is discussed in Chapter 8 and the stability of
the data acquisition parameters is covered in Chapter 9.

###  4.2 High Level Description

The electronic front-end needs several stages in order to achieve the above
described requirements as it can be seen in Figure 4.1. The basic stages are:

[itemize] & Analog front-end: It is responsible for processing PMT signals in
order to achieve: Trigger Improve Signal/Noise ratio Digital front-end: It is
responsible for digitizing all the relevant signal parameters: PMT waveforms
Charge generated at the PMTs Pattern of triggering for all detectors
Triggering Time for all the PMT signals Real time of the trigger and
accumulated live time.

Figure 4.1: DAQ System Block Diagram.

###  4.3 Analog front-end

The analog front-end consists of a home-made preamplifier and several standard
NIM [191] modules. The design of this block can be seen in Figure 4.2.

Figure 4.2: Detector Analog front-end.

The first step consists of an AD8009 based preamplifier in order to strengthen
the signal as close to the PMT as possible. This preamplifier has two outputs:
one for digitizing and one for the rest of analog front-end. This last signal
is duplicated using a Fan-In/Fan-Out from which the trigger signal is
obtained.

######

The triggering signal is used as input of a Constant Fraction Discriminator
(CFD). The detector trigger is the logical AND of the two detector CFDs. The
global trigger is the logical OR of the detector triggers. More information
about triggering strategies in ANAIS can be seen in Section 4.3.2.

######

Figure 4.2 also shows the high energy signal. There is an optional resistive
divider of 1 k$\Omega$ inside the preamplifier in order to get an attenuated
signal. This signal do not suffer limitations in dynamic range previous to the
digitization step and it can be used for the study of the high energy ranges.

######

All modules are listed and described in following subsections: preamplifier in
Section 4.3.1, trigger modules in Section 4.3.2 and NIM modules in Section
4.3.3.

######

####  4.3.1 Preamplifier

The particular restrictions of radiopurity and low background seen in Section
2.1 difficult the signal amplification near its production. The preamplifiers
are located outside the shielding for low background reasons, but close to it
to minimize signal loss and noise issues and to improve the signal/noise
ratio.

######

The preamplifier design is based on the AD8009 low distortion amplifier. This
amplifier is an ultrahigh speed current feedback amplifier with a good slew
rate, enabling the resulting preamplifier to have a good bandwidth. It has
been designed having ANAIS requirements in mind, providing two main outputs,
one for triggering and one for digitization. It also provides an attenuated
output in order to explore the high energy range without limitation in dynamic
range. Figure 4.3 shows a simplified version of the schematics without the
power supply filters.

Figure 4.3: Simplified schematics for the AD8009 based preamplifier.

######

The preamplifier was designed taking into account the nominal bandwidth of the
MATACQ digitizer board (300 MHz). In order to achieve such a bandwidth, a
minimal physical layout was designed and SMA connectors were used. The first
prototypes were designed as a proof of concept, testing basic functionality,
linear behavior and noise issues. The next step was to scale up the design in
order to achieve modularity, ease of installation and maintainability of the
whole set of needed amplifiers. The basic part of this new design was a PCB
with two preamplifiers on it (see Figure 4.4(a)). This PCB can be mounted in a
rack located next to the shielding as can be seen in Figure 4.4(b).

(a) PCB for two preamplifiers.

(b) Preamplifiers rack.

Figure 4.4: AD8009 based preamplifier design for rack.

######

The development of this amplifier was extensively tested as it can be seen in
Section 4.5.1 showing a good linear response and an increase of the
signal/noise ratio.

####  4.3.2 Trigger Modules

This section describes the possible strategies to perform the PMT signal
trigger and the needed modules for these strategies. Finally, ANAIS global
trigger strategy is presented and discussed.
[itemize] & Low threshold discriminators. The simplest strategy is to detect
signals with a discriminator; a signal triggers when a voltage threshold is
exceeded. This is the low threshold discriminator (LTD) mechanism. LTD can be
used for triggering low energy events if the signal distribution can be
separated from the noise in amplitude. Constant Fraction Discriminators.
Constant fraction discriminator (CFD) technique is similar to LTD but it gives
a better trigger in temporal terms [192] avoiding jitter in the output
discriminator signal, whereas a LTD triggers when the signal passes the
trigger level. A CFD triggers when the signal passes a constant fraction of
the maximum of the pulse. This feature is obtained by subtracting a delayed
and attenuated copy of the signal to the original one and detecting the zero
crossing for signals greater than the threshold level. This kind of
discriminators have two configurable parameters: threshold and delay.

######

ANAIS has a very low energy threshold as target so the detectors are designed
to couple with two PMTs and trigger in coincidence. This coincidence, logical
AND, can be performed with a coincidence module (see Section 4.3.3).

######

Some tests were performed for choosing discrimination strategy (see Section
4.5.4) and as a result the CFD option was selected. This election has some
advantages: [itemize] & CFD trigger is a better temporal reference. this
particular CFD (see next section) saves a window generator because the maximum
width exceeds 200 ns. LTD has a maximum window of 95 ns.

It has some disadvantages such as requiring some careful delay choosing as it
can be seen in Section 4.5.4.

######

The discriminator digital output width is a critical parameter because, being
wide enough, it can determine the coincidence window as input of the coincide
module. ANAIS-25 and ANAIS-37 set-ups were performed with 200 ns coincidence
window. A discussion for the impact in the reduction of such window can be
found in Sections 8.7 and 8.8. Additionally, ANAIS does not use shaping
because a photoelectron triggering can be achieved (see Section 8.5.1) and the
baseline is clean enough to avoid the need of an additional shaping stage.

####  4.3.3 NIM Modules

All NIM modules used in the ANAIS analog front-end are listed and described in
this section explaining their most important features and their use in ANAIS.

###### Linear Fan-In/Fan-Out:

CAEN N625 (Quad Linear FAN-IN FAN-OUT) has four sections of four inputs and
four outputs. Each section produces in all its output connectors the analog
sum of all section inputs. The sum can be inverted optionally. The module
bandwidth is 100 MHz. It is used in ANAIS to obtain signal copies for all
modules except for the MATACQ VME input to preserve the signal bandwidth.

###### Constant fraction discriminator:

CAEN N843 (16 Channel Constant Fraction Discriminator) accepts 16 negative
inputs and it produces 2 NIM signals and 1 inverted NIM signal for every
channel when it exceeds the threshold level that ranges from 1-255 mV and it
is expressed as a “constant fraction” of the input signal. The constant
fractions of this CFD are fixed at 20%. It is used in ANAIS to detect a
significant signal in one PMT and generate 200 ns gates. It uses two ordinary
outputs, one for coincidence as input of the Coincidence Unit and the other,
conveniently delayed, as input of the TDC VME module in order to save a
precise timestamp of the arrival of every signal.

###### Coincidence unit:

CAEN N455 (Quad Coincidence Logic Unit) has four sections and can perform
selectable AND/OR logical operations. It has three NIM outputs and one
inverted NIM output with selectable width via trimmer. In addition, it has an
overlap output with a width equal to the interval in which the logical
function is true. In ANAIS this module is used in a straightforward way as AND
logical coincidence. It uses two normal outputs, one for the global trigger to
the OR module and another as input of the pattern unit VME module.

###### OR Module:

CAEN N113 (Dual OR 12 IN - 2 OUT). This module has two sections with twelve
inputs and two outputs every section. The output is the logical OR of every
logical NIM input signal. This module has in the ANAIS set-up the role of
joining all detector triggers in a global trigger. The output goes to the VME
I/O Register that prevents a new trigger when boards are busy.

###### Gate generator:

N93B (Dual Timer) has two pulser generators from 50 ns to 10 s. Both input and
output are logic NIM signals. This module is used in ANAIS to generate a
precise 1 $\mu$s window that must be propagated to all digital VME boards (see
Section 4.4 and Figure 4.5) as trigger or acquisition window. The input comes
from the VME I/O Register and the output goes to a logical Fan-In/Fan-Out.

###### Logical Fan-In/Fan-Out:

CAEN N454 (4-8 Logic FAN-IN/FAN-OUT) has four sections with four inputs and
six outputs. The module performs a logical OR. Its outputs are four normal NIM
and two complementary (inverted) NIM signals. ANAIS uses a logical Fan-In/Fan-
Out as trigger propagator making copies of the output of the Gate Generator
described in the previous paragraph and triggering all VME modules.

###### Delay Module:

A home-made high channel density NIM module. It takes NIM signals as input and
produces a delayed gate as output. The delay is adjustable via external
trimmer. The design and testing can be seen in Section 4.5.2.

###  4.4 Digital front-end

The ANAIS digital front-end consists of several VME [193] modules. These
modules convert the relevant signal parameters to digital values. They are
controlled by the trigger of the analog front-end and store digital
information in their buffers. The DAQ program reads these buffers and must
ensure their validity.

######

The design of this section can be seen in Figure 4.5. The global trigger is
the logical OR of the detector trigger but it is filtered by the I/O Register.
This module has the key role of marking the busy state of the system. The
trigger is distributed throughout the system if the I/O register is in idle
state (OFF). This distribution is performed by a gate generator with a trigger
window of 1 $\mu$s. The I/O Register also marks the start of the DAQ Software
acquisition and stores the busy system state (ON). The busy state must be
reset by the DAQ program once the buffers are read, all information is saved
and all boards are ready for a new acquisition. An OR trigger is discarded
when the I/O register is on busy ON state in order to preserve the buffer
integrity. The I/O register ON state is also used to measure the real time and
the live time of the experiment as described in Section 4.4.1. The VME boards
receive both trigger and signals and convert signal and signal parameters into
digital.

Figure 4.5: Digital front-end.

######

The digitized parameters are listed and discussed here:

###### Signal Waveform:

The 230 ns decay constant of NaI(Tl) scintillators (see Section 3.1) and the
expected signal from low energy events (see Section 3.4) determines the
digitization window and minimal bandwidth in order to get all relevant
information. The digitization window has a minimal width of 1 $\mu$s and the
minimal bandwidth must be 200 MHz and a sampling rate of the order of 1 GS/s.

###### Charge:

The energy yield of the interaction is proportional to the charge obtained
from a PMT as described in Section 3.5, so it is a very important parameter to
digitize. It can be obtained by integrating the area in the previous waveform
in the dynamic range of the digitizer or using a Charge-to-Digital converter
(QDC).

###### Trigger time:

The relative trigger time of PMT signals for the same detector can be a useful
information in order to discriminate random coincidence from bulk
scintillation. This information can be digitized directly with a Time-to-
Digital Converter (TDC) with the CFD outputs as inputs or it can be deduced
analyzing the waveform.

###### Coincidence pattern:

It is very important to know which detectors were triggered in an event. This
information can be saved in a structure called coincidence pattern: every bit
of that structure has a related detector. This bit marks if the detector has
triggered in that event. This information could be reconstructed at analysis
time seeing what detector has signal or it can be done with a specific module.

####  4.4.1 Time scalers

The digital front-end must also measure the trigger real time and the
accumulated live time. The real time of every trigger should be stored to
temporal event tagging and to perform temporal studies such as time distance
between consecutive events (see Section 7.3.3). The accumulated live time must
be measured in order to properly calculate the exposure of the measurements
(as seen in Section 2.1). Therefore, the acquisition dead time, the time in
which the system is not able to detect a new event, should be discounted from
the real time to measure the live time.

######

All this information is stored in scalers counting clock ticks coming from the
VME/PCI Bridge clocks. This module is programmed to generate a 50 ns clock
signals, used as real time clock master. This clock is distributed and
logically processed in order to get the correct information. Two different
modules are used: the first test were performed with a 64 bits scaler and a 32
bit latched scaler was acquired later for a more precise temporal tagging. The
design of the scaler system can be seen in Figure 4.6.

######

Figure 4.6: Time scalers in Digital front-end. 64 bit scaler (top) and 32 bit
latched scaler (bottom).

The real time master clock, generated by the VME/PCI Bridge and started at the
beginning of the run, is stored in the 64 bit scaler channel. Dead time is
determined by the time that the I/O Register is in busy state as described at
the beginning of this section. In addition, live time is the time that the I/O
Register is in idle state. Another VME/PCI Bridge controller clock is used to
measure live time. This clock is stopped when the I/O Register enters in busy
state and it is started when the state is reset. This clock is stored in a 64
bit scaler.

######

The 32 bit latched scaler can record start and stop timestamps of DAQ
acquisition performing the latch process in any change of I/O Register state.
The accurate tagging of the trigger event was the reason to acquire and
install this new counter. It uses only the real time clock master and it
requires some postprocessing in order to compute the event dead time: the
difference between start and stop times (see Section 7.1.4). The crosscheck
for both (64-bit and 32-bit latched) measurements of real time and dead/live
time can be seen in Sections 8.1 and 8.2 respectively.

####  4.4.2 VME modules

All VME modules used in the ANAIS digital front-end are listed and described
in this section explaining their more important features and their use in
ANAIS.

###### I/O Register

CAEN V977 (16 Channel Input/Output Register) can work either as general
purpose I/O Register or as Multihit Pattern Unit. Every channel has its own
status storing a _true_ logic value if input was true for some time. This
state is stored until the channel is reset via VME command or a CLEAR signal.
It is used as I/O register in ANAIS storing the trigger DAQ busy state. This
state is reset via VME command by the DAQ program. The busy state is used for
measuring dead time and its positive change triggers all VME boards via gate
generator. In addition, it is configured to generate an interruption when the
0 output changes to a _true_ logical value and it is the board that starts the
DAQ software process. This configuration allows saving dead time as can it be
seen in Section 8.2.

###### MATACQ

CAEN V1729 (4 Channel 12 bit 2 GS/s Switched-Capacitor Digitizer) and CAEN
V1729A (4 Channel 14 bit 2 GS/s Switched-Capacitor Digitizer) have four analog
channels of bandwidth up to 300 MHz with sampling frequency up to 2 GS/s and a
depth of 2520 points. Every sample is coded into 12 bit (14 bit in V1729A) in
650 $\mu$s giving a total dead time near 1ms. The configuration for ANAIS is
2GS/s (1260 $\mu$s digitization window), pretrigger 300 ns and external
trigger.

######

The default dynamic range for this module is (-0.5V,0.5V) but it allows
shifting by modifying some SMD components over the PCB. Given the mostly
negative signal of PMTs as described in Section 3.5 the dynamic range was
modified to be (0.1V, -0.9V) in V1729 model. A complete description and
characterization of this module can be seen in Section 4.5.3.

###### QDC, Charge-to-Digital Converter

CAEN V792 (32 Channel Multievent QDC) integrates negative pulses. It converts
the values into 12 bits and has a buffer of 32 events. This module is used in
ANAIS with an integration window of 1 $\mu$s. The high density of channels
allows the use of this module in several range of energies in order to get a
reliable background information in these ranges.

###### TDC, Time-to-Digital Converter

CAEN V775 (32 Channel Multievent TDC) converts time intervals between ECL
inputs and common gate into digital. Full Scale Range can be selected via VME
from 140 ns to 1.2 $\mu$s. The board can operate in both _common start_ and
_common stop_ modes. The configuration used in ANAIS is _common start_.

###### Pattern Unit

CAEN V259 (16 Bit Strobed Multihit Pattern Unit) module is able to store
internally a 16 bit input pattern. The board has 16 inputs and an input
coincidence circuit, controlled by a gate signal, selects the hits which are
stored in a pattern register. It has also a multiplicity register. This module
is used in ANAIS in a straightforward way without using the multiplicity
register.

###### Scaler

CAEN V560 is a 16 Channel Scaler that allows internal cascading to produce
eight 64 bit counters. In ANAIS it is used as Real Time and Live Time
counters. 64 bits can store 50 ns tick counters in a typical run period (one
or two weeks).

###### Latched Scaler

CAEN V830 is a 32 Channel Latching Scaler with ECL inputs. The latching
feature allows to obtain a precise time measurements: the scaler stores
counters when latch input triggers. It is used in ANAIS to store Real Time and
Dead Time counters. The counters have only 32 bit and this width is not enough
to store run counters of weeks at 50 ns clock tick. For this reason ANAIS uses
both scalers, latched for high precision less significant bits and V560 for 64
bit counter, higher bits.

###### Clock generator and VME-PCI Optical Link Bridge

ANAIS uses VME controller (V2718 VME-PCI Optical Link Bridge) as clock
generator. It uses all two pulse generator hosted in as described in Section
4.4.1. Real Time clock is configured in _manual_ mode starting it at the
beginning of the acquisition. The start and stop signals of Live Time clock
are configured as input driven. This board is also used as VME-PCI bridge
allowing high speed communication between VME and DAQ program.

###  4.5 Front-end characterization

####  4.5.1 Preamplifier

This section covers the tests performed to the AD8009 based preamplifier (see
Section 4.3.1). First, amplitude test to check linearity and dynamic range is
presented. Next, a more detailed area test is shown and finally, the desired
baseline improvement is checked.

##### Basic amplitude tests

Several tests were performed in order to check the behavior of the AD8009
based preamplifier. The first test was done using negative pulses generated
with a TTi-TGA12101 arbitrary pulse generator. The input waveform was designed
to be similar to a typical photoelectron. The amplitude was variable to
explore all requirements: low distortion and linear response at both low and
high energy range.

######

The input amplitude was ranged from a few millivolt to several volts. Figure
4.7 shows the response in both low and high amplitude ranges. It can be
observed a good linearity in amplified and attenuated outputs. The
preamplifier gain can be seen in Figure 4.7(a) from the linear zone to
saturation. The linear zone is fitted in Figure 4.7(b). The attenuated signals
in both low and high input amplitude are shown in Figures 4.7(c) and 4.7(d).
The latter shows the most important range to this signal because it is used to
explore the high energy range when the preamplifier saturates.

(a) Gain.

(b) Gain in linear range (Fit).

(c) Attenuated output in amplified output linear range.

(d) Attenuated output in amplified output saturation range .

Figure 4.7: Amplitude linearity test from the preamplifier.

The dynamic range of the preamplifier is (300mV,-300mV) in input amplitude, so
the output amplitude range is (1.5V,-1.5V) and it is higher than the
(0.1,-0.9V) MATACQ digitizer modified dynamic range (see Section 4.4.2). This
means that the preamplifier dynamic range does not limit the global dynamic
range, determined by the MATACQ range.

##### Area test

The next step was to test the linearity between input and output areas. A new
software was developed to acquire three signals and analyze them using a
Tektronix TDS5034B oscilloscope. This test was performed using a triangular
signal generated by the aforementioned pulse generator. The duration of the
signal was configured to be twice NaI(Tl) scintillation constant, so we
obtained an input signal similar to a scintillation signal in area and timing.
Linearity and dynamic range of the amplifier can be quantified by the
digitized signals analysis.

(a) Input vs. amplified output.

(b) Input vs. attenuated output.

(c) Ratio between amplified and input area in linear range.

(d) Ratio between attenuated and input areas.

Figure 4.8: Area test from the preamplifier.

######

The linearity of the attenuated signal and the amplified signal out of the
saturation zone can be observed in Figure 4.8 (area is represented in
mV$\times$ns units). Figure 4.8(a) shows the scatter plot between input and
amplified output with linear and saturation zones. Figure 4.8(b) is a similar
scatter but with attenuated output in _y_ axis showing the linearity in all
the range as expected. The bottom pictures quantify these linearities: Figure
4.8(c) shows the distribution of the ratio between input and amplified output
in the linear range (input amplitude less than 400 mV) and Figure 4.8(d) ratio
between input and attenuated output. Both show a FWHM smaller than 2% and the
same behavior for two distributions. This width can be attributed to
systematic effects like sampling or area computing: the voltage divider nature
of the attenuated output must give the same area ratio as the divider
resistances ratio (as can be seen in Figure 4.3, resistors nominal values
$49.9\Omega/1k\Omega=0.0499$ theoretical, 0.048 mean in Figure 4.8(d),
compatible taking into account the resistor tolerances and measurement
errors).

Figure 4.9: Effect of the saturation of the input (top), amplified (middle)
and attenuated (down) signals.

######

As we can see in this test, linearity was achieved but an undesired effect was
found. A _glitch_ can be observed in Figure 4.9 in the three digitized
signals: input, amplified and attenuated outputs. This effect can be explained
by a change in the input impedance of the amplifier when it leaves the
saturation zone. An area calculation was done in order to quantify the effect.
The total area and the _glitch_ area were computed taking polygonal areas as
it can be seen in Figures 4.10(a) and 4.10(b) respectively. Next, areas were
computed by TGraph::Integral from the ROOT framework for different input sizes
and all of them gave a _glitch_ area smaller than 1% of total area.

(a) Area Estimation.

(b) Glitch Area Estimation.

Figure 4.10: Polygon Area Estimation.

######

It is worth noting that events at low energy are free from this effect and all
saturated signals are affected. It is also relevant to note that this effect
is always smaller than 1% in area, and consequently in energy, at high energy
ranges.

##### Baseline Test

The most important feature expected from the preamplifier was the improvement
of signal/noise ratio. This baseline test can be seen in Section 4.5.5, in the
context of baseline characterization.

####  4.5.2 Delay module

Every detector needs three delayed NIM signals according to the design seen in
Section 4.3 (see Figure 4.2). Hence, a high density of channels was needed.
Since the commercial modules for this task do not have the required channel
density, a high density NIM delay module was designed.

######

It is based on a Delay & Gate Generator [194] previously implemented making it
less versatile but multiplying $\times 4$ the number of channels. It uses the
74121 monostable multivibrator as TTL triggered gate generator with low
jitter. In addition the module has NIM-to-TTL and TTL-to-NIM level adapters in
order to match with all other NIM modules. The one channel design and the
process of developing and testing from the test board to the whole module can
be seen in Figure 4.11.

Figure 4.11: Delay Module design and development.

######

The basic delay feature was tested with a periodic NIM signal duplicated with
a Logical Fan-In/Fan-Out and used as input of the Delay Module and as trigger
of a CAEN V775 TDC (see Section 4.4.2). The delayed output was used as input
of the TDC obtaining the delay time of a channel. The test of one channel can
be seen in Figure 4.12.

Figure 4.12: Delay module dispersion test.

######

The data of all channels can be seen in Table 4.1 based on 150,000 samples of
every channel. This test shows a very good delay time accuracy in every
channel showing a typical standard deviation of tens of picoseconds and a
worst case jitter of the order of 1 ns. This test also found an unstable
channel with more jitter and it was excluded from the working channels set.

Channel | Mean (ns) | Standard deviation (ns) | Minimum (ns) | Maximum (ns)
---|---|---|---|---
1 | 128.52 | 0.033 | 127.88 | 128.83
2 | 122.33 | 0.033 | 121.99 | 122.65
3 | 122.68 | 0.455 | 121.34 | 123.33
4 | 124.03 | 0.046 | 123.70 | 124.39
5 | 128.67 | 0.041 | 128.29 | 129.05
6 | 128.88 | 0.042 | 128.49 | 129.19
7 | 128.57 | 0.038 | 128.22 | 128.91
8 | 115.10 | 0.055 | 114.59 | 115.78
9 | 125.80 | 0.038 | 125.02 | 126.06
10 | 126.29 | 0.040 | 125.78 | 126.62
11 | 121.81 | 0.042 | 121.33 | 122.17
12 | 124.82 | 0.038 | 124.46 | 125.09
13 | 120.04 | 0.041 | 119.66 | 120.36
14 | 119.01 | 0.042 | 118.34 | 119.32
15 | 121.44 | 0.043 | 120.98 | 121.7
16 | 124.40 | 0.039 | 123.84 | 124.7
Table 4.1: Delay Module channels test.

####  4.5.3 MATACQ Module

The MATACQ boards are based on the MATACQ (MATrix ACQuision) digitization
chip. The digitizer functional block of the chip is a matrix of switched
capacitors associated with Delay Locked Loops [195, 196] configuring a sample
matrix as it can be seen in Figure 4.13. The matrix has 128 columns of 20
switched capacitor arrays giving a pulse depth of 2560 points (2520 valid
points). This matrix is mapped to a circular memory and it must be unfolded in
order to obtain the desired pulse. The pedestal of every sample cell must be
calibrated in order to subtract it from the sampled value. The pedestal
calibration process is covered later.

Figure 4.13: MATACQ chip design showing switched capacitors matrix and
associated Delay Locked Loops.

######

The MATACQ digitizer was extensively tested due its key role in the data
acquisition system and the pervasive use of digitized pulse signal along the
analysis process (see Chapter 7 for more information). Many functional tests
were performed and some peculiar characteristics were found.

##### Pattern in mean signal and pedestal calibration

The more demanding scenario for MATACQ board was the SER characterization (see
Section 3.5) due to the signal size and the adverse signal/noise ratio. In
these conditions, a subtle MATACQ behavior was observed: an unexpected pattern
in mean pulses was discovered. This effect can be seen in Figure 4.14: a
regular pattern in the baseline of the mean pulse. This effect was causing in
the analysis program a bogus pulse onset detection with a low software
threshold giving a strange periodicity.

Figure 4.14: Baseline pattern in mean pulses.

######

The pattern seen in the baseline seems to be related with the MATACQ chip
physical memory matrix seen before. For this reason, improving the pedestal
calibration process has a positive impact in this effect. The plots of Figure
4.14 were computed with fifty acquisitions. The V1729 MATACQ board manual
states that for pedestal calibration it is enough with “few tens of raw
acquisitions of the baselines for all of the cells (disconnected or grounded
inputs). The trigger must then be either automatic, or external” and pedestal
is computed as the mean of taken values. Several tests were performed in order
to take pedestals without signal: switching off the preamplifier or the high
voltage from the PMT but no improvement was observed in the mean pulse. The
next test was to increase the number of acquisitions when the signal is
present as suggested in the aforementioned manual. The baseline of a mean
pulse acquired with a pedestal calibration of fifty acquisitions was compared
with a pedestal of 50,000 acquisitions. The effect was reduced from 0.4 to
0.15 mV peak-to-peak.

######

A comparison of the baseline root mean square was carried out in order to
check the pedestal calibration impact. Several runs were performed with
different number of pedestal acquisitions and the RMS of the pretrigger points
was computed. An improvement of the baseline correlated to the number of
acquisitions was observed as it can be seen in Figure 4.15.

Figure 4.15: Baseline RMS with different pedestal calibrations (right to left:
50, 500, 5,000 and 50,000 acquisitions).

######

It is worth noting the circular nature of the MATACQ memory (as seen in Figure
4.13) and the random position of the trigger in this memory. The effect seems
to be caused by a subtle crosstalk between trigger and digitization systems.
In all previous plots the pedestal calibration was done with auto (software)
trigger because it is the faster way of getting all needed samples. Different
methods from calibrating pedestal were compared. First using the ANAIS trigger
(see Section 4.3.2) as external trigger but in OR mode giving a reduction from
0.15 mV to 0.05 mV observing a little positive bias that can be attributed to
photoelectrons. For this reason, the pedestal computing was modified taking
advantage of the known trigger strategy: only data from the first points of
the pretrigger zone is used to obtain the mean value. A final improvement was
achieved by doing the acquisition with IRQ notification instead of active poll
loop. This behavior seems to be related to the VME polling induced noise
covered in Section 4.5.5. The effect in the final conditions is below 25
$\mu$V peak-to-peak that given the 0.4 mV of initial effect is an improvement
of more than one order of magnitude.

######

The RMS baseline value was also tested in the above conditions but no
improvement could be reported in Figure 4.15. The total mean pulse was
computed with external trigger and computing only pretrigger points with the
IRQ acquisition method and the result is compared in Figure 4.16 with the
previous mean pulse obtained with software trigger: a much thiner baseline and
an almost negligible matrix effect can be observed. A subtle remaining effect
is still observed: a 0.2 mV peak-to peak spike at trigger time. It is
negligible in normal operation conditions due to the presence of signal with
much more amplitude. For a complete description of Single Electron Response
see Section 3.5.

######

\begin{overpic}[width=433.62pt]{Pedestal50Mean.png}
\put(50.0,28.0){\includegraphics[width=173.44534pt]{Pedestal50Meanbaseline.png}}
\end{overpic}

\begin{overpic}[width=433.62pt]{PedestalMeanETPretrigIRQ.png}
\put(15.0,28.0){\includegraphics[width=151.76964pt]{Pedestal50000MeanbaselineETPretrigIRQ.png}}
\end{overpic}

Figure 4.16: Mean pulses with zoomed baseline using software trigger (left)
and external trigger with pretrigger computed pedestals (right). Note the
different vertical scales in zoomed images.

The previous results are fundamental to establish criteria to routinely
calibrate pedestals. The software developed to calibrate it and the protocol
to do it are covered in Section 6.3.2.

####  4.5.4 Trigger modules

Various alternative modules to trigger the acquisition are available and they
were checked in this section. First, the comparison of constant fraction
discriminator with low threshold discriminator was performed (see Section
4.3.2 for an introduction to these discriminators). Next, the stability of the
constant fraction discriminator with temperature variations was tested.

##### Constant Fraction Discriminator (CFD) delay settings

A basic set-up with a CFD discriminator, a MATACQ board and a PMT was mounted
and the MATACQ internal trigger was used to store both PMT signal and
discriminator output. The MATACQ internal trigger threshold was set to trigger
near the baseline noise and to see as much photoelectron distribution as
possible and discriminator behavior with those signals.

######

The CFD test showed that its default 20 ns delay configuration was not
suitable for triggering with photoelectrons as can be seen in Figure 4.17(a)
with 1 mV trigger level. The minimum value of the PMT signal is displayed for
all events (black) and for those that CFD was triggered (gray). This plot
gives a poor trigger efficiency with a marked non-threshold behavior. A very
different trigger efficiency with a delay of 8 ns can be seen in Figure
4.17(b), featuring a threshold at 5 mV. It is worth noting that settings for
CFD threshold is the constant fraction of the real threshold (20% fixed for
this module), so 1 mV corresponds to 5 mV as it can be seen in Figure 4.17(b).

(a) 20 ns.

(b) 8 ns.

Figure 4.17: CFD trigger efficiency with different delays. Pulse minimum
distribution (mV) for all (black) and CFD triggered (gray) pulses.

##### Constant Fraction Discriminator (CFD) vs. Low Threshold Discriminator
(LTD)

The SER characterization set-up (see Section 3.5.2) was also used to test
different triggering strategies at photoelectron level. This set-up allowed to
compare the trigger for the two different modules. The discriminator output
was digitized for both models in order to determine the trigger behavior with
a photoelectron as input signal. An example of this test can be seen in Figure
4.18 showing a very similar behavior once the CFD was configured with the
shorter delay.

Figure 4.18: CFD (left) and LTD (right) trigger efficiency with single
electron response signals. Triggered event area distribution is shown in gray
and the distribution of all events in black.

######

The similar SER triggering seen here, the better behavior of the CFD with DC
level variations (see next section) and the more convenient CFD output window
width were the reasons to choose the CFD modules for the ANAIS experiment.

##### Trigger versus temperature

The trigger behavior with temperature variations has also been studied. A set-
up consisting of a PMT in dark environment, an ANAIS preamplifier, a CFD and a
MATACQ digitizer was mounted at the laboratory of the University of Zaragoza.
The data acquisition was configured to be triggered by the internal MATACQ
level discriminator. The MATACQ board was configured to acquire the waveform
of the PMT and the output of the CFD. The MATACQ trigger was set to trigger as
low as possible above the baseline in order to study the CFD behavior. The
temperature were controlled using the air conditioning system and it can be
seen in gray in Figure 4.19 showing an increase of more than four degrees
Celsius. A DC drift can be reported correlated with the temperature
variations. Such a DC drift on the digitized signal, of the order of 0.4 mV,
could have impact in trigger and that was the reason to carefully test their
behavior.

Figure 4.19: DC level (black) and temperature (gray) over time switching off
the air conditioning system.

######

The charge distribution at different temperatures was constructed to see the
effect in the CFD trigger and it can be seen in Figure 4.20. The signals
triggering the MATACQ internal trigger can be seen in black and the CFD
triggered signals can be seen in gray. Figure 4.20(a) shows the data at 25º C
and Figure 4.20(b) at 30 ºC. A clear reduction of the low area events can be
noted due to the low threshold nature of the MATACQ discriminator. The CFD
trigger exhibits a more robust behavior with the temperature triggering an
almost full SER in both cases.

(a)

(b)

Figure 4.20: CFD behavior at different temperatures: 25 ºC (a) and 30 ºC (b)
(triggered in gray, all events in black).

######

The very similar behavior of the two kind of modules in terms of SER
efficiency, the very convenient width of the CFD trigger output window and the
good behavior of the CFD even with baseline shift with temperature were the
reasons to choose CAEN N843 as ANAIS discriminator.

####  4.5.5 Baseline characterization and improvements

A low threshold experiment has to be extremely careful about the electric
noises which may affect both trigger and resolution. The present section is a
catalog of detected noises in the ANAIS DAQ system. It covers all detected
noises, describes the origin and the potential harm and explains the measures
taken to prevent the generation and/or mitigate the effect.

##### Preamplifier baseline effect

The home-made preamplifier replaced a CAEN $\times$10 amplifier located in a
NIM crate outside the ANAIS hut. Two preamplifiers were installed outside the
shielding but inside the hut, near the shielding. The cable length was
shortened from 5 m to 1 m. The RMS from the baseline, calculated as described
in Section 7.1.1, was plotted for both CAEN and AD8009 amplifiers as it can be
seen in Figure 4.21. This plot takes into account the different gain from both
amplifiers ($\times$10 vs. $\times$5). The events to plot were pure baseline
ones selecting events triggered by the other crystal in the ANAIS-25 set-up.
The figure shows the RMS of the baseline of two PMTs. It can be seen a mean
reduction of the RMS and it also can be observed a distribution shape change.
A population near but separated from the main baseline peak was almost
suppressed.

Figure 4.21: Baseline RMS with CAEN NIM amplifier (black) and with AD8009
based preamplifier (gray).

An example of the suppressed population can be seen in Figure 4.22. The left
Figure shows a baseline from this population and it is compared with a normal
baseline using the preamplifier (right Figure). The amplitude of this noise
was not so relevant but DC calculation and energy estimators (QDC, area) can
be affected at low energies.

Figure 4.22:  Example of noise suppressed with AD8009 based preamplifier
(left) and comparison with normal baseline with the use of preamplifier
(right) (vertical mV, horizontal ns).

######

##### High voltage power supply noises

First ANAIS runs using Hamamatsu R6956MOD PMTs with recommended voltage
divider (see Section 3.2.3) were unexpectedly noisy. The origin of this noise
was identified at CAEN SY 2527 HV Power Supply level. The noisy nature of the
Power Supply and the lack of any filtering in voltage divider was the cause of
a poor baseline and episodes of triggering noise. A LC filter was installed in
order to cut higher frequencies coming from HV Power Supply. A reduction of
the noise population and a much more stable triggering were achieved.

######

A significant crosstalk among signals was also observed. High energy events
produced oscillations in all other PMT signals as can be seen in Figure
4.23(a). The amplitude of this effect is similar to photoelectrons so it can
even trigger the event detection and give false coincidence events although
its contribution to energy estimators (Area, QDC) was almost negligible. The
source of this effect was identified at the level of A1833BP CAEN HV module
hosted in CAEN SY 2527 HV mainframe by monitoring the signal from HV outputs
through an HV capacitor. The effect was not filtered by the aforementioned LC
filter.

######

A new $\pi$ filter has been designed in order to avoid such a crosstalk (470
pF, 1nF, 1 mH) and replace the LC filter in between HV Power Supply and every
voltage divider. This filter removed the effect of the crosstalk as it can be
seen in Figure 4.23(b).

######

Another crosstalk was identified at HV filter level. The box that housed all
filters was modified to allow easy connection, but the cable from filter the
PCB to the connector and later to the PMT was sensitive to big signals in
other channels as it can be seen in Figure 4.23(c). The effect was totally
removed by using ferrite beads in such cables as it can be seen in Figure
4.23(d).

######

(a) Crosstalk among channels using LC filter.

(b) A similar event using $\pi$ filter.

(c) Crosstalk among channels without ferrite beads.

(d) A similar event with ferrite beads removing crosstalk.

Figure 4.23: High voltage crosstalks.

The last HV Power Supply related issue was to study the two different
available Power Supply modules, A1833BP and A1535. The results can be seen in
Figure 4.24 evidencing the A1535 a noisier nature. The A1833BP module has
enough channels for a nine detector experiment, so this module is preferred.
If the number of detectors increases, a new filter design like a double-$\pi$
filter could be needed.

Figure 4.24: Baseline with A1833BP (black) and A1535 (gray).

##### VME polling

An unexpected effect was also discovered when using poll acquisition strategy
(see Section 8.2.2). A noise associated to VME bus activity was identified in
different RMS baseline distribution for IRQ and Poll strategies as it can be
seen in Figure 4.25. This figure shows the RMS baseline sum distributions
displaying relevant populations of higher RMS sum with poll strategy (Figure
4.25(a)) corresponding to signals like those seen in Figure 4.25(b). This
effect can be attributed to a MATACQ analog front-end poor isolation from the
digital sections. This kind of noise can be particularly harmful because it
can confuse the starting point detection (t0) of the signal described in the
pulse characterization algorithm (see Section 7.1.1) and it can be detrimental
to the rest of the algorithm. This effect can also affect to DC calculation, a
key parameter in all the algorithm as well as t0.

######

The same test was performed with the 14-bit MATACQ. The RMS baseline sum
distribution can be seen in Figure 4.25(c) showing a better behavior in both
amplitude and relative frequency with normal baseline for poll strategy. The
effect of polling is visible anyway and it causes a poorer baseline.

(a) RMS baseline distribution for IRQ (black) and poll (gray).

(b) Noise in baseline due to VME polling.

(c) RMS baseline distribution (14 bit MATACQ).

(d) Noise in baseline due to VME polling (14 bit MATACQ).

Figure 4.25: Poll generated noise.

######

The existence of this effect made impossible the use of polling strategy.
Section 8.2 describes the impact of not using poll in terms of dead time and
how this was dealt in order to absorb this supplementary dead time.

##### Fan-In/Fan-Out

A very wide baseline was observed using Linear Fan-In/Fan-Out module as it can
be seen in Figure 4.26(a). This noisy baseline was caused by the (not used in
ANAIS) internal discriminator of this module. A low default position of the
threshold trimmer can cause constant triggering in the aforementioned
discriminator and an undesired crosstalk to the baseline of all section. The
solution to avoid this effect is to set the discriminator in a higher level.
The baseline is notably thinner as can be seen in Figure 4.26(b), 0.3 mV (RMS)
versus 3 mV (RMS).

(a) Baseline oscillation in Fan-In/Fan-Out module due to it discriminator.

(b) Fan-In/Fan-Out with higher lever discriminator.

Figure 4.26:

##### Preamplifier crosstalk

A crosstalk was detected with very high energetic events between two
preamplifiers in a subsequent design using the same PCB to two different
AD8000. This crosstalk is shown in Figure 4.27(a) showing crosstalk between
first and third signals that shared PCB.

######

An effect like this one can be especially harmful because it can affect to
coincidence studies like ${}^{40}K$ and ${}^{22}Na$ events used to determine
the crystal contamination as seen earlier. The printed circuit was redesigned
to improve the isolation between amplifiers. The result can be seen in Figure
4.27(b) showing no crosstalk with an event of very high energy.

(a)

(b)

Figure 4.27: Preamplifier crosstalk (a) and resolution with improved isolation
(b).

##### Improper EMC preamplifier power supply

A series of noises were reported attributable to a poor EMC in the amplifier
power supply in some test set-ups. The first type of noise consist of spikes
with high frequency components and high amplitude correlated with flashes by
broken fluorescent lamp. This spikes can be seen in Figure 4.28(a). The second
one was detected by analyzing the triggering time pattern from the data, as it
can be seen in Section 7.1.4, and detecting a 100 Hz component. This noise can
be seen in Figure 4.28(b).

(a)

(b)

Figure 4.28: EMC power supply preamplifier noises.

These noises were not very frequent. They could trigger the acquisition and
pass some quality cuts but their area pattern and the amplitude area ratio
make simple to filter during the data analysis. The preamplifier power supply
was redesigned in order to avoid such effects and the crosstalk described in
the previous subsection.

##  Chapter 5 Muon detection system

###  5.1 Muon underground interaction

The underground muon flux has a measured annual modulation [107] and muon-
related events could mimic the dark matter signal [148, 149, 197, 198, 199].
The system proposed, implemented and described in this chapter allows to
correlate muon events with the NaI(Tl) measured signals in order to study and
control these effects.

Figure 5.1: Location of underground laboratories.

######

The residual muon flux at the Canfranc Underground Laboratory is approximately
$5\times 10^{-3}\mu$ s-1m-2 [200] being more than four orders of magnitude
lower than the surface flux, but enough to have some influence in the ANAIS
detectors. The expected effects of muons in the NaI crystals are direct
interaction in the crystal with very energetic depositions [179] and other
effects such as secondary neutrons [201]. Secondary neutrons can be very
harmful for the direct search of dark matter because they can produce similar
signals to the expected WIMP interaction.

######

For this reason, a plastic veto system to tag muon-related events has been
designed and tested in order to monitor possible systematic effects in the
search of annual modulation in the data. The plastic scintillators
characterization, the electronic front-end, the rate and the correlation of
plastic events with NaI(Tl) events in both time and energy are covered in this
chapter.

###  5.2 Muon detector set-up

The muon detection system will consist of sixteen plastic scintillators (also
called veto in this work) covering all the ANAIS set-up except the bottom face
(see Figure 5.2). The role of these scintillators is to detect the residual
muon flux arriving at the laboratory and to use their information to discard
coincident events in the crystals and study the correlation between muon
events and crystal events. For this study, a tagging strategy was carried out
instead of a hardware vetoing strategy.

Figure 5.2: Muon detection system design.

######

The sixteen plastic scintillators have different dimensions and origins as it
can be seen in Table 5.1. Eight units were constructed and used for the IGEX
neutrinoless double-beta decay experiment [202] and eight new Scionix ME2PX
plastic scintillators were purchased to cover the ANAIS experiment.

Plastic numbers | Vendor/Model | Dimensions (mm)
---|---|---
1, 2, 7, 8 | Scionix/R500*50B1000-2ME2PX | $1000\times 500\times 50$
3 - 6 | Scionix/R700*50B750-2ME2PX | $750\times 700\times 50$
9 - 16 | Homemade | $1000\times 500\times 50$
Table 5.1: Plastic scintillators models and dimensions.

###  5.3 Plastic scintillator characterization

Both plastic scintillators models were tested in order to characterize the
muon signal. First, a simulation of the expected muon energy deposition in the
plastics is presented. Next, the plastic scintillation test bench is described
and finally the characterization of the homemade and Scionix plastics are
shown.

####  5.3.1 Plastic scintillator simulation

A simulation using Geant4 toolkit [203] was performed as a guide to understand
the expected signal in the plastic scintillators. Horizontal and vertical
orientations were simulated given their positioning in the final set-up (see
Figure 5.2). The interacting mechanisms considered were multiple scattering,
ionization, bremsstrahlung and pair production. The considered underground
angular distribution was $\propto cos^{3.6}\theta$ corresponding to 800 m of
standard rock [204] and the energy spectrum was taken from Lipari et al.
[205]. The results can be seen in Figure 5.3.

######

Figure 5.3: Simulated plastic spectra: horizontal (gray) and vertical (black)
positions.

Figure shows the spectra of the horizontal (gray) and vertical (black) plastic
orientations. Due to the plastic characteristics, both distributions of energy
deposition show a _muon peak_ near 10 MeV. The spectrum of the vertical one
features a wider peak and a longer tail. The peak corresponds to an energy
deposition of $\sim$2 MeV per cm, in agreement with the expected interaction
of a muon in this kind of plastic [179].

######

This simulation can also be used to estimate the effect of the threshold
location. A threshold level below the peak will tag most of the muons still
rejecting the $\gamma$ background. Nevertheless, the continuum below the muon
peak accounts the 6.6% of the events in the horizontal position and an 8.9% in
the vertical position.

####  5.3.2 Plastic scintillator test bench

A test bench (see Figure 5.4) with two stacked plastics was mounted to
digitize signals with an OR trigger. This test allowed to study the PMT
electric signal of coincident and anti-coincident events.

######

Figure 5.4: Plastic scintillators test bench.

The non-coincident events consist of natural radioactive background and PMT
noise. The coincident events are mainly muons ionizing both detectors giving a
spectrum predicted by the previous simulations. Anyway, the characterization
of these populations was needed because of the geometry of the final set-up
(see Figure 5.2) which does not allow to use coincidence to select muons
because most of the expected trajectories pass through only one detector. This
assumption is reviewed later, in Section 5.5.2. Once characterized the
different signals for different populations, the features needed by the
electronic front-end for the correct muon identification and tagging can be
defined.

####  5.3.3 Homemade plastic scintillators

The homemade plastic scintillators have been working in ANAIS since ANAIS-0
prototype [160]. Two of these plastic scintillators were stacked and tested
underground as described earlier in order to characterize their behavior.

######

Figure 5.5(a) shows the scatter of signal area (proportional to the event
charge collected) versus the signal amplitude, with coincident events in green
and non-coincident population (in black). It can be noted the faster nature of
this later population (note its lower area/height ratio) compared with the
coincident muon population. Figure 5.5(b) shows the charge spectrum of almost
one month of underground data in black, the coincident event in green and the
fast population in red. Setting a hardware trigger in charge (area) discards
most of the fast population and the other non-coincident background events.
This trigger can be achieved by using an integrating shaping amplifier. The
trigger level must be set below the muon peak to maximize the tagged muons but
above the end of the natural radioactive background. This trigger strategy
greatly reduces the triggering of the fast population. For example, setting
the trigger at 700 $mV\cdot ns$ gives 60 events above the area threshold in
almost one month, $2.5\times 10^{-5}Hz$, two orders of magnitude below the
muon counts. Examples of muon and fast events with similar collected charge
are shown in Figures 5.5(c) and 5.5(d) respectively (note the different
vertical range).

(a)

(b)

(c)

(d)

Figure 5.5: Scatter plot (pulse area vs. pulse height) (a) with coincident
events in green and spectrum (b) with fast events in red and coincidences in
green. Underground data. Example of slow (c) and fast (d) events with similar
collected charge.

####  5.3.4 Scionix plastic scintillators

The underground data of the Scionix plastic scintillators also revealed a
population faster than muon events but with a rate substantially higher than
expected, five order of magnitude compared with the homemade plastic
scintillators. This fast population, which is also present at surface, is
clearly dominating the underground rate as can be observed in Figure 5.6.
Figure 5.6(a) shows the area/height scatter at surface in a short run of five
minutes featuring muons and fast population. Figure 5.6(b) shows an
underground run of same duration, showing a very high rate of the fast
population and a complete suppression of the muon rate. Figures 5.6(c) and
5.6(d) show events corresponding to a muon and a fast event with similar
collected charge (note the different vertical range).

######

These figures illustrate the impossibility of the previous triggering
strategy: the fast population would trigger much more frequently than real
muons with a rate $\sim$ 1 Hz per plastic scintillator. The use of such a
trigger would imply the tagging of all NaI events as muon-related events
reducing the effective exposure time (live time) beyond acceptable levels (see
ANAIS experimental requirements in Section 2.1). Therefore, a new trigger
strategy was designed to tag muons based on pulse shape analysis, as it can be
seen in Section 5.4.

(a)

(b)

(c)

(d)

Figure 5.6: Scatter plot (pulse area vs. pulse height taken) at surface (a)
and underground (b) with fast events dominating underground rate. Example of
slow (c) and fast (d) events with similar collected charge.

###  5.4 Electronic front-end design and DAQ

The muon detection front-end was designed to characterize and offline discard
the fast population due to its high rate in the Scionix plastics. This
discrimination is based on the shape of the fast population. The design of the
front-end electronics can be seen in Figure 5.7 showing the detailed scheme of
one plastic channel. The key concept is to have two different parameters for
each event: one proportional to the whole area and the other accounting for
the last part of the pulse. This allows to reject the fast population based on
the ratio of these two parameters.

######

The original plastic signal is linearly amplified and duplicated. One signal
goes through a 16 channel shaper, timing filter amplifier with constant
fraction discriminator (Mesytec MSCF-16) providing an output with the
amplitude proportional to the collected charge and a logical trigger signal
for every channel. The module also provides an OR trigger that is used as
global trigger. The output of this module is delayed and used as input to a
Peak Sensing ADC (CAEN V785) that digitizes the maximum amplitude during the
trigger window.

######

The other linearly amplified signal is delayed and used as input of a QDC (see
Section 4.4.2 for a description of this module and other VME modules). The QDC
digitizes the charge collected during the trigger window. This trigger window
is generated by the global trigger with a convenient delay, collecting only
the tail of the signal in such a way that the fast events collect much less
charge than the slow events. The delay in QDC trigger is 320 ns from the
global trigger given the shape of both populations (see Figures 5.6(c) and
5.6(d)) and the delay of the non-shaped signal (see Figure 5.7).

Figure 5.7: Muon tagging electronic set-up.

######

Storing peak sensing data is not only necessary for fast population
discrimination but it is also valuable to monitor effects such as gain or
threshold instabilities that could affect the data analysis. The
discrimination using both QDC and Peak Sensing values can be seen in the next
subsection.

######

In addition to the analog to digital conversion, some other information is
recorded in order to properly analyze and correlate the plastic data with the
NaI scintillators data. Every event has also information of its multiplicity
pattern and the real time clock of the event. The multiplicity pattern is
obtained from the digital outputs of the MSCF-16 and stored by a CAEN 16 Bit
Strobed Multihit Pattern Unit V259. The real time clock is shared with the
clock of the NaI DAQ (see Section 4.4.1), counted and stored by a CAEN 32
Channel Latching Scaler V830. The time distance between events is calculated
in the time correlation analysis (see Section 7.1.4). A test of such a
correlation and its use to study the muon-related events can be seen in
Section 5.5.3.

######

The DAQ software is exactly the same developed for the NaI acquisition (see
Chapter 6) with an appropriate configuration showing its versatility and
general purpose nature. It is launched remotely by the NaI DAQ scripts (see
Section 6.3.2) in order to guarantee the same count in both latched scalers.
The time correlation between both DAQs is studied in Section 5.5.3.

####  5.4.1 Pulse shape analysis characterization

The muon response of the plastic scintillators and the discrimination
capabilities of the aforementioned front-end were studied by testing two of
them at surface, at the LSC external building. Again, a simple set-up with two
stacked plastic scintillators (as in Figure 5.4) and the front-end was
mounted. The muons were identified by selecting events with signal in both
detectors. This population can be seen in green in Figure 5.8 showing the
ratio between ADC and QDC values versus the ADC.

######

Figure 5.8: Coincident events at surface.

The non-coincident events (in black in this picture) are the fast population
(at the bottom of the figure) and non-coincident muons (intermediate
population). This effect is due to a peculiarity of the Mesytec MSCF-16
trigger: it triggers 10 ns later in case of coincident event resulting in a
lower QDC value and the consequent higher ADC/QDC ratio. This effect was
confirmed by taking data with different overlapping horizontal plastic surface
and checking the growing of the intermediate population and the decrease of
the top population and by digitizing the digital trigger signal and
calculating the distance in both cases. The impact of this effect in a non-
overlapping set-up like the final ANAIS muon detector system is low due to the
low probability of a random coincidence of two fast events. In any case, once
located the muon population, the rest of the test is done in non-overlapping
(non-stacked) position. The scatter plot in such a non-stacked position can be
observed in Figure 5.9(a) showing a possible discrimination strategy.

######

(a)

(b)

Figure 5.9: Muons (blue) and fast events (red) discrimination at surface (a)
and underground (b).

The same configuration of two stacked plastic scintillators was mounted
underground. The results can be seen in Figure 5.9(b) showing a very
suppressed muon population (blue) as opposed to the dominant fast population
(red). These plots show the possibility of a discrimination strategy using
these values.

######

Table 5.2 shows the similar rate of the fast population in surface and
underground conditions, pointing to an internal contamination in the
scintillator, the photomultiplier or the optical coupling as origin of such a
population. The small differences in the population rate can be attributed to
the slight differences in PMT operating voltage due the use of an analog power
supply.

Plastic number | Surface (Hz) | Underground (Hz)
---|---|---
#3 | 1.40$\pm$0.05 | 1.31 $\pm$ 0.01
#4 | 1.55$\pm$0.05 | 1.26 $\pm$ 0.01
Table 5.2: Fast population rate.

######

Two different criteria can be applied for muon selection depending on their
use for muon tagging or for muon flux determination. The muon selection for
flux estimation strategy should minimize the false positive acceptance. This
can be achieved using a conservative cut and estimating their efficiency. In
addition to this cut, the efficiency of the plastic scintillator along their
surface must be studied and quantified. This measurement will be performed in
the near future and for this reason the total muon flux is not estimated in
this work. Anyway, the results without applying any efficiency correction are
similar to previous measurements [200] as we will see in Table 5.3.

######

The muon tagging event selection must ensure the identification of all
possible events with an accurate timing information. This tagging is used to
identify and remove NaI events from the dark matter analysis. Having this fact
in mind, some false positive events can be accepted in order to minimize the
rejection of real muons. This scheme was used to select muons in the rest of
this chapter.

###  5.5 ANAIS-37 plastic scintillators set-up

A preliminary set-up was mounted with eleven plastic scintillators covering
the shielding of ANAIS37 set-up (see Section 2.4). Eight Scionix scintillators
were placed at the lateral faces, two of them in each face and three homemade
scintillators were placed at the top of the shielding as it can be seen in
Figures 5.10. The face grouping and the veto numbering can be seen in Figure
5.11.

Figure 5.10: ANAIS-37 plastic scintillators set-up. Figure 5.11: ANAIS-37
plastic scintillators numbering and face grouping (top view).

######

A preliminary result of a month of data taking can be seen in Figure 5.12. The
discrimination and muon selection can be seen in Figure 5.12(a) and the
resulting muon spectra is shown in Figure 5.12(b). It can be observed the
expected muon peak in every detector.

(a)

(b)

Figure 5.12: Muon discrimination (a) and spectra (b).

######

Table 5.3 shows the preliminary results of the detection rate in every
detector. It can be noted that the top detectors have more flux than vertical
ones, in agreement with the expected angular distribution [204]. Additionally,
the south and north faces have more counts than east and west, suggesting a
non-homogeneous flux with a preferred direction south-north, compatible with
the Tobazo mountain profile. This preferred direction could be deduced with
the multiplicity information (see Section 5.5.2). The total muon flux could be
deduced using the previous rates, estimating the muons below the threshold and
correcting with the efficiency of the plastic scintillators. This efficiency
has not been yet determined as mentioned earlier and for this reason the data
are given in measured muon per square meter and second.

Face | Plastic |  | Measured rate
---
($\mu\times m^{-2}\times s^{-1}$)$\times 10^{-3}$
| Measured rate
---
($\mu\times m^{-2}\times s^{-1}$)$\times 10^{-3}$
South | #1 | $5.27\pm 0.10$ | $5.43\pm 0.07$
#2 | $5.53\pm 0.10$
West | #3 | $4.88\pm 0.10$ | $4.75\pm 0.07$
#4 | $4.61\pm 0.10$
East | #5 | $4.53\pm 0.10$ | $4.54\pm 0.07$
#6 | $4.54\pm 0.10$
North | #7 | $5.05\pm 0.10$ | $4.91\pm 0.07$
#8 | $4.77\pm 0.10$
Top | #9 | $7.23\pm 0.12$ | $7.36\pm 0.07$
#10 | $7.54\pm 0.12$
#11 | $7.32\pm 0.12$
Table 5.3: Muon detection rate.

####  5.5.1 Temporal behavior

The seasonal modulation of the muon flux at underground is a well measured
effect [107, 206, 207, 208, 209] due to the seasonal variation of the
temperature of the upper atmosphere. This temperature variation affects to the
atmospheric density, which modifies the fraction of mesons decaying to muons
energetic enough to reach underground detectors [210].

######

The temporal behavior of the muon detection rate can be seen in Figure 5.13.
It shows the counts per surface and time along several runs suggesting a
modulation with a maximum in summer, at the end of June, compatible with those
observed at the LNGS [107, 206, 207]. However, a complete seasonal cycle is
needed to confirm and fit such a modulation.

Figure 5.13: Muon detection rate over time.

####  5.5.2 Multiplicity and face coincidences

The study of the coincident events among plastic scintillators can give more
information about the muon flux. Figure 5.14 shows the total multiplicity of
the events in a run, featuring a quick decrease of events with multiplicity
but it is worth to note that there are events hitting almost all plastic
scintillators which can be attributed to muon showers [211]. In any case, most
of the muons leave signal in one plastic only, making impossible the use of
the coincidence as the only criterion to identify muons and reject the fast
population, in agreement with the earlier assumption.

######

Figure 5.14: Plastic trigger multiplicity.

Additionally to the trigger multiplicity, the coincidence among different
faces gives hints about the muon flux coming to the ANAIS experiment. A count
of events hitting two faces was carried out and it can be seen in Table 5.4.
The table is grouped in faces with equal geometry in order to compare the
rates properly. The most prominent feature is the asymmetry North-South in
coincidence with top face. It shows the muon flux being non-homogeneous in
azimuthal angle, with a preferred direction South-North, in agreement with the
Tobazo mountain profile and with the individual plastic rate seen at the
beginning of this section. The North-South and East-West coincidences cannot
be directly compared because of the rectangular geometry of the shielding.

Faces | Coincident rate (mHz)
---|---
Top-North | $3.26\pm 0.07$
Top-South | $1.05\pm 0.04$
Top-East | $0.87\pm 0.04$
Top-West | $0.95\pm 0.04$
North-South | $0.37\pm 0.02$
East-West | $0.14\pm 0.01$
North-East | $0.48\pm 0.03$
North-West | $0.34\pm 0.02$
South-East | $0.45\pm 0.03$
South-West | $0.47\pm 0.03$
Table 5.4: Faces coincident rate.

####  5.5.3 Muon related NaI(Tl) events

The synchronization between the NaI DAQ (see Chapter 4) and the plastic DAQ
(see Section 5.4) was checked by finding events with a real time difference
less than 10 $\mu s$. This test should reveal the muon interaction in the
plastic scintillators previous to a second interaction in the NaI crystals.
This effect can be seen in Figure 5.15. It shows all events in the considered
time window (in blue) and the muon events (in red). It can be observed a high
accumulation of events in two tick bins (almost simultaneous events) and a
tail of delayed events in the crystal. The time correlation described here is
used to examine the effects of the muon interactions in the NaI(Tl) data as it
can be seen hereafter.

Figure 5.15: Time difference between NaI and plastic events.

######

The muon-related events in the NaI crystal are direct interactions with very
energetic depositions and secondary neutrons among others. Such secondary
neutrons can be very harmful because it can be confused with expected WIMP
interaction as seen at the beginning of this chapter.

######

The muon interaction tagged in both plastic scintillators and NaI crystals
were studied. Approximately a 7% of the plastic events have a subsequent
crystal event within 1 $\mu$s interval, half of them being very high energy
events with simultaneous events in both data acquisition systems corresponding
to direct muon interaction in the crystal. Table 5.5 shows the coincident
events in 100 ns time window with higher energy than main alpha contribution
(energy greater than 5.3 MeV due to 210Po). This condition was established in
order to discard low energy coincidences.

Detector | Coincident rate (events/day)
---|---
D0 | $26.7\pm 0.7$
D1 | $26.3\pm 0.7$
D2 | $26.2\pm 0.7$
Table 5.5: Plastic and NaI coincident events at high energy.

######

A crosscheck for these numbers can be done by calculating the rate expected by
the measured vertical flux, the main component of the total flux, in the NaI
surface. The measured muon rate in the top face is $7\times
10^{-3}~{}\mu/(m^{2}\cdot s)$ and the detector section is 0.036 $m^{2}$ giving
a contribution due to the vertical flux of the order of 22.9 $\mu/day$. The
difference can be attributed to the non-vertical component of the total flux,
which is relevant as seen with the coincident rate in the previous sections.

######

Figure 5.16: NaI event rate correlated with plastic events (red triangles).

These events produce a crystal activation or afterglow as seen in Figure 5.16.
This figure shows a very infrequent succession of two muon events in less than
two seconds. The NaI events are grouped in bins of 10 ms with three detector
events (D0 red, D1 green, D2 black). The two events hit in the same detector
(D2) with a high energy deposition and an afterglow of the order of tenths of
seconds. The plastic tagged events can be seen as red triangles in the
picture, at the beginning of the high rate interval.

######

All these facts can be seen in Figure 5.17. It shows the tagged muons with
triangles over the events binned in one second bins. The red triangles are
muons tagged with less than one $\mu$s interval with one NaI event. The black
triangles are the remaining plastic events. The black line marks all NaI
events and the red line discards all events in a 1 second window after tagged
muon.

######

Figure 5.17:  Event rate of all (black) and excluding plastic related events.

##### High rate episodes and very high energy events

The existence of a very clear correlation between high rate episodes and
plastic events was the reason to study all the high rate episodes. Most of the
high rate episodes have a related plastic scintillator event ($\sim$ 86%) but
some are not tagged as it can be seen in Figure 5.17. These episodes were
identified and studied in order to establish their origin. Once identified, a
search for high energy events up to one second before was performed. These
events can be seen in red in Figure 5.18. This figure plots their area versus
the height in the high energy range digitization. This scatter is used to
discriminate $\alpha$ particles (the population in the middle) from
$\gamma/\mu$ particles. The plot also shows the PMT saturation effect with
very high energetic events. This effect can give less collected charge (or
area) for a muon event than for an $\alpha$ interaction. The pulse shape
analysis allowed to identify these high energy events as muons.

Figure 5.18:  Area (charge) versus height for a background run (black) and
highest energy events in one second window from a high rate episode without
plastic scintillators tag (red).

######

A filtering strategy cutting events near a muon tagged in plastic vetoes and
very high energy events in the NaI crystals were used with one second time
windows as it can be seen in Figure 5.19 removing the high rate intervals (or
afterglows) illustrating the effect of the slow NaI(Tl) constants already
studied by the ANAIS team [180]. The figure shows the rate of detector D2 and
the identification of very high energy events (blue triangles) and plastic
events (red triangles). It is worth to note that all high rate episodes can be
explained with very high energy interactions, being discarded some other
possible origins such as electric noise or other instabilities.

Figure 5.19: Event rate of all events (black) and rate excluding events after
high energy or muon events (green)(blue: high energy events, red: plastic
tagged event).

##### Muons without subsequent high rate episode

In addition to very high energy events, low energy event population is
expected as a result of muon interactions such as secondary neutrons described
earlier.

######

Once the high rate episodes were identified, the information can also be used
to select NaI(Tl) events related to plastic scintillator events that does not
produce afterglow. The spectra of the events with one millisecond time windows
between plastic and crystal time event can be observed in Figure 5.20(a) in
red compared with the normal raw background in black.

######

(a)

(b)

Figure 5.20: Muon related low energy events: energy distribution in red with
all background events in black (a) and a typical muon-related event (b).

The more notable feature is a very low energy event population, lower than 20
keV. An event of such a population can be seen in Figure 5.20(b), showing a
scintillation signal that would pass all quality cuts. All these events should
be rejected for a dark matter analysis because of their possible cosmic
radiation related origin. In addition to their rejection, the tagging and
offline removing strategy allows to study the behavior of the muon-related
events.

######

A preliminary study was done in order to quantify the influence of such a
population. The events in the 1-6 keV energy window coincident with a tagged
muon within a 1 ms window are $0.55\pm 0.05$ counts/(kg day). This population
decreases to $0.07\pm 0.02$ counts/(kg day) with quality cuts (only one
detector triggering, number of peaks, NaI(Tl) scintillation shape and symmetry
between PMT signals, see Section 7.4 for a description of ANAIS low energy
event section). The random coincident population of events passing all quality
cuts in 1 ms windows with a tagged muon is of the order of $8\times 10^{-4}$
counts/(kg day). This value is an upper bound calculated by using the
frequency of all tagged muons ($\sim 2.5\times 10^{-2}Hz$). For this reason, a
clear correlation between these low energy events and muon can be established,
suggesting a contribution of muon induced neutrons detected via nuclear recoil
in the crystal.

######

The background events in that region passing the same cuts are $\sim 18$
count/(kg day) being the muon-related events a factor 0.004, so the influence
in the total rate at low energy is negligible. Anyway, the low energy cuts are
being improved and this factor should be recalculated with a better noise
rejection. In any case, the study of these events will give a very valuable
information of nuclear recoil events such as shape and possible modulation. It
is worth to mention again that the most considered scenario for WIMP
interaction is a nuclear recoil, and having a population of this kind of
interaction allows to characterize the response of the detectors. For this
purpose, a statistically significant amount of events is needed.

##  Chapter 6 Data acquisition software

The requirements, implementation and tests of the acquisition software for the
ANAIS experiment are covered in this chapter. First of all the requirements of
the software are listed and discussed. Next, all the software used in the
acquisition system is described including relevant design and implementation
details.

######

The acquisition software has been developed expressly for this work except the
classes that defines the interaction with the VME boards which have been
completed with new modules (14-bit MATACQ, V830) and updated for new
functionality and performance reasons.

###  6.1 DAQ software requirements

The most important software requirements are given by the characteristics of
the experiment (see Section 2.1) and it imposes some specific restrictions.
The software requirements for the ANAIS experiment include the data
acquisition and storing, a detector calibration mode, the dead time
minimization, scalability in the number of signals, stability, flexibility,
monitoring and robust storage. There are some other requirements given by the
ease of use or for help the diagnose and debugging auch as easy configuration,
debuggable output format and task automation in data synchronization and
analysis. All these features are described and discussed in this section.

##### Data acquisition and storing

The most important requirement is to acquire and store data. In addition, this
software must detect the trigger and unlock the hardware in order to be
available for a new trigger once the data have been acquired as described in
Section 4.4. This is needed because of the lack of more than one buffer in the
digitizer. The software must also ensure that all data are correct, checking
the data availability and performing the correct negotiation with every
module. An error in this critical step can give subtle effects such as
incorrect data or uncorrelated data in an event.

##### Detector calibration mode

The software must allow a fast calibration of the detectors. In this mode the
system must provide the energy spectra from the detectors. The easiest way to
achieve this feature is to use only the QDC (see Section 4.4.2). In this way
the acquisition system is fast and the generated data are minimized. As a
plus, the system could be configured to do the spectra and to digitize the
signals in order to test Pulse Shape Analysis algorithms with calibration
source.

##### Dead time minimization

The software can introduce dead time because of the lack of double buffers
seen earlier. This time has to be minimized in order to maximize the live time
of the system, a requirement of the global system (see Section 2.1).

##### Scalability

The whole system must be scalable because of the expected growing of the
number of crystals in the future. The software must consider this growing as a
key design guideline: performance (live time, DAQ frequency, output data flow)
of the whole system must be appropriate.

##### Stability

The access to the experiment is difficult because of the underground
placement. The DAQ design must be done assuming that the resultant system is
going to be unattended. This assumption adds a relevant requirement to the
software: it must be very reliable and stable. This is a very critical feature
taking into account the need of maximization of the live time of the complete
system (see Section 2.1).

##### Flexibility

The DAQ system of the ANAIS experiment must allow adding and removing
information from the written data. It is a very common need to add some
counters of signals in the data on a temporary basis for debugging hardware or
for physical reasons such as exploring energy regions outside the usual one.
So the ideal system must allow to add data and must allow mixing data with and
without this temporal data. Additionally, the possibility of conditionally
download data from the boards and/or store events based on the first acquired
values would be useful in order to limit useless transmission dead time and
disk space and allow less stringent hardware trigger.

##### Monitoring

The DAQ itself must be monitored to find and notify any hardware or software
incidence. The monitoring system must ensure that all the detectors provide
signals and the acquisition rate is normal. The monitoring system must notify
those incidences via Internet as soon as possible. It is also desirable that
the DAQ system sends reports for an early incident detection.

##### Robust storage

The storage system must be robust and redundant in order to avoid data loss
and allow fast transfer to the University of Zaragoza servers for the analysis
and backup processes.

##### Debuggable output format

The debugging process of the DAQ system is easier if the output format is easy
to view, query and analyze.

##### Task automation

There are tasks that are needed in a periodic and repetitive way: data
synchronization with the University of Zaragoza servers and execution of data
analysis software. These processes can be automated and the results can
generate reports which can detect any anomaly or malfunction.

###  6.2 DAQ software design

The design of the DAQ software is described in the present section. First, all
the software components are presented. Next the design of the DAQ software is
discussed.

####  6.2.1 Software Components

In this section the components of the whole DAQ software system are covered.
In Figure 6.1 these components and its interactions are graphically described.

Figure 6.1: DAQ Software components and their interactions.

##### DAQ program

This program acquires and stores the data from the VME bus. The most important
activities are:

  * •

Read and interpret the configuration file. This file describes the boards used
by the DAQ system and other relevant parameters. In this step all parameters
are saved in the data file so the data acquired are saved together with the
actual hardware configuration.

  * •

Check for a new event. The system is able to do it with polling or waiting for
an IRQ. In Section 8.2, both options are reviewed, discussed and compared.

  * •

Read timestamps from real time, live time and dead time counters (see Section
4.4.1) as well as the system time timestamp in order to properly tag the
events and allow time with other DAQ system (such as NaI and Plastic
scintillators correlation seen in Section 5.5.3).

  * •

Check for the validity and availability of the data in every electronic board.

  * •

Check, if configured, the logical conditions to store the values.

  * •

If the associated condition to a value is true, read its value.

  * •

Prepare boards for a new acquisition.

  * •

Allow the arrival of new triggers by resetting the I/O Register (see Section
4.4).

  * •

Store data.

  * •

Generate statistics about rate with Real Time counters .

This activities and their sequence are summarized in Figure 6.2.

Figure 6.2: DAQ Program flow chart.

######

The code was written in C++ in order to find the right level of abstraction
without suffering a big performance penalty. The design of this piece of
software is described in next section. It was written for being executed in a
Linux PC.

##### Kernel module and vendor library

The vendor of the VME/PCI Bridge (see Section 4.4.2) provides two different
components to manage the VME bus from a PC. The first component is a kernel
module with source code. This is needed by the nature of the drivers in Linux.
It has some advantages because it can be easily debugged and instrumented as
can be seen in Section 8.2.2. The second one is a closed library that
implements the communication functionality. This library is called by the DAQ
program and the library _talks_ directly with the driver via ioctl calls.

##### Network Time Protocol (NTP)

Personal computers have unreliable clocks. The system has NTP installed in
order to mitigate this known irregularities: jitter and frequency wander. A
comparison between hardware real time clock (see Section 4.4.1) and PC clock
with NTP can be seen in Section 8.1.

##### ext4 and software RAID5

The chosen filesystem is ext4 [212] because it is the default in modern Linux
distributions, it is well tested and it provides _journaling_. This feature
prevents data loss by ensuring consistence of filesystem metadata: the
resulting filesystem is harder to corrupt. Additionally the storage system has
a software RAID5 system in order to fulfill the redundancy requirement. RAID5
only allows one broken hard disk, if there is another broken disk the RAID
cannot be reconstructed and the data are lost. To prevent this eventuality the
system is configured to monitor the disks and RAID health. If there is any
incidence the monitor system (checkarray from mdadm package [213]) sends an
email in order to solve the incidence as soon as possible.

##### Data synchronization

The synchronization system was designed to be invoked on demand or in an
automatic way. It uses rsync [214] via SSH [215].

####  6.2.2 DAQ Program Design

The DAQ program design follows the scalability and performance guidelines seen
in the previous section.

##### Classes design

The design of the program is guided by the need of easily configure a system
that has to grow in the number of crystals. The easiest way to achieve that is
to encapsulate functionality in concepts such as Data Source, Data, Board or
Event. This concepts are implemented as C++ classes and Figure 6.3 shows its
relationships.

Figure 6.3: DAQ program classes design.

######

DAQEvent is the nuclear base of the DAQ system. It acquires the data coming
for a source (DAQSource), waits for a trigger coming for a board (DAQBoard)
and prepares boards (DAQBoard again) for a new acquisition. DAQBoard can
implement several features depending on the features of the real board: it can
wait for a trigger, it can be prepared (if needed) for a new acquisition and
it acquires the data that can be accessed with a DAQSource instance.

##### Configuration

It is easy to instantiate a new board or complete a new event with new data
once defined and implemented the concepts above described. But instantiating
manually all classes require program modification and it can be error prone
and a tedious task. For that reason a configuration system was designed in
order to make an easy and legible configuration file. It is based in YAML
[216] (YAML Ain’t Another Markup Language) in order to be easy for humans and
programs.

######

The data acquired and stored when an event has triggered can be configured in
a straightforward way. An example of event with data, trigger and post acquire
actions can be seen in Listing 1. In this example the trigger is generated by
an IRQ generated in the VME bus vme1, the data to store come from some
channels of a QDC, TDC and MATACQ boards and for some counters. Additionally
the actions to perform before a new acquisition are configured in the
post_acquire clause.

Listing 1: Event configuration example.

⬇

- event: Event

trigger: vme1

write_mode: asynch

source: [RealTime, clock, LiveTime, DeadTime]

source: [qdc1_0, qdc1_1, qdc1_2, qdc1_3, qdc1_4, qdc1_5]

source: [matacq1_0, matacq1_1]

source: [tdc1_0, tdc1_1]

source: [pattern_unit]

post_acquire: [qdc1, matacq1, tdc1, scalerl, io_reg_0]

This configurability makes trivial to add and remove data from an event and
insert debugging information on it. Additionally, this system is versatile
enough to allow to configure two distinct acquisition set-ups such as ANAIS
main set-up (see Chapter 4) and the plastic scintillators muon detector (see
Chapter 5).

##### Output Format

The ROOT [217] format was chosen as output format because of the ease of
querying data and the compression feature. ROOT is a data analysis library
developed at CERN in the context of particle physics. It allows to plot and
analyze data in a very fast way. The DAQ program, in the DAQEvent class,
generate dynamically a data structure (TDataStruct) that allows the ROOT
library to store the data in its format. So the output data is determined by
the configuration and there is no need of additional recompilation or
reconfiguration. The compression feature allows to decrease the output data
size but it needs more CPU time. This increase in CPU consumption can be
excluded from the dead time using asynchronous data storing described in this
section.

######

The actual output format and the naming conventions used for the ANAIS
experiment are described in Section 6.3.1.

##### Conditional data acquisition

This feature was designed taking advantage of ROOT features and with data and
dead time minimization in mind. Every data (every DAQSource) can be configured
to evaluate a condition. If this condition is true the data is acquired and
stored, if it is false a default value is stored without trying to acquire the
real data. This has two advantages: it saves acquisition time and it can save
disk space.

######

This feature can be used to discard data with a condition based on other data.
For example the DAQ system can acquire and store only digitization from the
signals that has triggered. In Listing 2 it can be seen how to configure a
source (MATACQ in this case) in order to avoid acquisition if the crystal has
not triggered. The condition is that the data of the pattern unit (see Section
4.4.2) has the first bit on, so the first crystal has triggered.

Listing 2: Conditional data acquisition.

⬇

- source: matacq_0

board: matacq

condition: "(pattern_unit&1)!=0"

channel: 0

######

The key point of the design of this feature is the use of TFormula (or the
more versatile RooFormulaVar). This ROOT class implements formula evaluation
at runtime in a very efficient way. So this feature can be used for many
purposes. For example it can be used to digitize only a narrow range of energy
values. This can be useful to accumulate digitized signals from interesting
but scarce ranges in a calibration without the need of huge amount of disk
space. With this technique the statistical significance of pulse shape
analysis can be increased for some energy ranges. In Listing 3 it can be seen
an example of such a configuration, in this case the condition is low energy
events that triggers.

Listing 3: Conditional data acquisition with energy condition.

⬇

- source: matacq_0

board: matacq

condition: "qdc1_0<400 && ((pattern_unit&1)!=0)"

channel: 0

##### Conditional event storing

This feature is implemented in a very similar way than the previous one. It
allows to skip valueless data. Every DAQEvent can be configured to evaluate a
condition based on the related source values. The event is saved if the
condition is true and it is discarded otherwise.

######

The Listing 4 shows a rather unconventional but simple example. This
configuration stores events the fist second of every hour very useful to
characterize stability parameters in the long run, such as the temperature
measurements seen in Section 4.5.4.

Listing 4: Conditional event storing.

⬇

- event: Event1

trigger: vme1

condition: "fmod(clock,3600)<1"

source: [clock, matacq1_0]

post_acquire: [matacq1]

##### Asynchronous data storing

The process of data storing in hard disk may incur in high non-deterministic
latencies. An asynchronous data storing process can avoid such latencies and
allow new triggering as soon as possible. The design of this mechanism consist
of a circular data buffer and a storage thread. The acquisition saves data in
the buffer and the storage thread writes the new data. This feature was
implemented as optional and it allows to compare different storing strategies
(see Section 8.2). The asynchronous storage sequence diagram can be seen in
Figure 6.4. The normal process is shown in the left side and the buffer empty
and buffer full conditions are shown in the right side. The critical section
is needed in every thread in order to avoid race conditions accessing to the
Event Buffer can also be seen in the figure.

Figure 6.4: Asynchronous data storing diagram. Left: normal insertion and
extraction. Right: empty buffer and full buffer conditions.

##### DAQ Monitoring

A subsystem of DAQ monitoring is needed to be able to know the acquisition
rate in real time. This subsystem is designed to write statistics in shared
memory and read this statistics via filesystem. The use of shared memory is
fast and it does not incur in performance penalty. In addition this statistics
are stored in write time so it does not add dead time directly in asynchronous
data storing configuration.

######

An external cron task monitors the execution of the DAQ process and their
statistics via filesystem. It sends an email in case of DAQ process failure
and in case of abnormal acquisition rate. Additionally it sends a daily easily
customizable email report with rate statistics and energy, asymmetry and rate
plots. The cron process is spawned at minimum priority in order to minimize
the interference with the acquisition thread. A typical report content for a
system of two detectors can be seen in Figure 6.5. The email body with global
acquisition rate information can be observed in Figure 6.5(a). The report
script generates a plot for every configured detector with QDC spectra in all
the configured energy ranges (see Figure 6.5(b)). Additionally, scatter plots
with QDC signals are sent in order to detect abnormal asymmetries caused by
signal malfunction. Finally a plot with the rate of all detectors and total
rate is sent (Figure 6.5(c)). This plot is generated by a script that
calculates the frequency with a minute temporal binning. The script is
configurable and it allows to compute rates in other timebases than minutes
and it is ready to compute the rate of new detectors added to the system.

(a)

(b)

(c)

Figure 6.5: DAQ report email. Body (a) and attatched reports: spectra and
asymmetry plots from a detector (b) and rate report (c).

###  6.3 DAQ software implementation

The program implementation may seem straightforward once the main loop is
designed (see Figure 6.2). But the specific requirements about stability
impose a very careful implementation of every hardware negotiation. For
example, all operations on every board must have a proper timeout mechanism in
order to avoid unwanted DAQ stops. This mechanism must be implemented
alongside a proper error checking and a logging system in order to be able to
detect possible infrequent errors that can cause malfunction or even stall the
whole system.

####  6.3.1 Output file structure and naming conventions

Due to the flexible DAQ system the output file format is determined by the
event configuration. This is a very convenient feature because it allows
testing configurations without development. But this flexibility can result in
a disorganized output without some discipline. In this section the naming
convention used to configure DAQ is covered.

######

The aim of the naming convention is to establish useful criteria to the rest
of the software chain in order to produce output easy to analyze for users and
programs. The guidelines used for the naming convention are: & naming detector
or signal parameters in a compact way making easy and predictable the
parameter names avoiding capital letters and subscript operators to aid typing

######

For these reasons the criterion of adding numbers with crystal and signal
information at the end of the parameter was used:
name_parameter+ncrystal+nsignal (e.g. tdc21 is detector 2 signal 1 TDC value).
Similarly, ROOT aliases were configured to get compact information about
detectors: for example replacing the final signal digit with an s to express
sum (e.g adc0s meaning adc00+adc01). All signal parameters for the default
configuration are listed in Table 6.1 showing name compositions. These naming
criteria are also used in signal parameter extraction as it can be seen in
Section 7.3.2.

Origin |  Name |  Description |  Examples
---|---|---|---
Digitizer |  p |  The signal digitized pulse |  p31: Pulse, detector 3, signal 1
Digitizer |  np |  The digitized pulse size |  np20: Pulse size, detector 2, signal 0
QDC |  adc |  Charge-to-digital data at low energy |  adc1s: alias for adc10+adc11, the QDC sum for detector 1
QDC |  adche, adcvhe |  Charge-to-digital data at high and very high energy |  adche0s: QDC sum for detector 0 at high energy
TDC |  tdc |  Time-to-digital data for the PMT trigger |  tdc30-tdc31: time span between two signal triggers for detector 3
Table 6.1: Naming convention for signals parameters.

######

The global parameters for the default configuration are listed in Table 6.2.

Origin | Name |  Description
---|---|---
Scaler | RT |  Real time clock (50 ns clock tick)
Scaler | LT |  Live time clock (50 ns clock tick)
PC clock |  clock (alias, utc) |  PC time in seconds (UNIX time, seconds elapsed since 1970)
PC clock | clock_ns |  PC time in nanoseconds (nanoseconds elapsed since 01/01/2013)
Table 6.2: Naming for global parameters.

####  6.3.2 Run routine and run script

The needed stability in the data taking forces to routinely calibrate the
whole system. This calibration routine also marks the length of a data taking
run and it is used to do some others routine tasks such as data
synchronization (see Section 6.2.1) and data processing (see Chapter 7). This
section describes the steps needed by the aforementioned routine:

[enumerate] & Stop data taking. It stops both NaI crystal DAQ and plastic
scintillators DAQ. Synchronize data. Energy calibration with X-ray and
$\gamma$ sources. Pedestal calibration of the MATACQ digitizer boards. Execute
data taking again. It remotely (asynchronously via ssh) run the plastic
scintillators DAQ and then starts the NaI DAQ preserving this execution order
in order to correctly maintain the synchronization of both DAQs (see Section
5.4 for details).

######

The user is prompted by the system in order to follow the above steps. Step 3
is performed by the CAL script and steps 4 to 2 are guided by the DAQ script.

##### Detectors energy calibration: CAL and CALPULS scripts

The energy calibration is performed with X-ray and $\gamma$ sources introduced
inside the shielding for this purpose. Once the sources are correctly located
the calibration script can be invoked. There are two different scripts: CAL
and CALPULS. The difference is that CALPULS uses a configuration that includes
pulse digitization and it is very similar to background configuration whereas
the CAL configuration excludes all pulse digitization. For this reason CALPULS
has more dead time and it is used to calibrate pulse analysis algorithms
described in Chapter 7. CAL is used to routinely calibrate the system.

######

Both scripts take the same optional algorithms: \--source and \--comment. The
source parameter specifies the $\gamma$ source(s) used and the comment
parameter saves any remarkable fact related to the particular calibration
process such as source position or non-standard hardware configuration. Both
parameters are saved in run log file as described later.

#####  DAQ script: MATACQ pedestal calibration, background acquisition and
data synchronization

This script launches the background data acquisition and all related tasks:
pedestal calibration, background acquisition and data synchronization.

######

First of all it starts the MATACQ pedestal calibration using the same
configurations as the DAQ program and calibrating only the MATACQ boards
configured in it. Following the characterization described in Section 4.5.3
the pedestal calibration process is done with the normal acquisition
conditions: signal plugged in the board, the preamplifiers switched on and the
PMT high voltage in the normal working values. This calibration uses only the
pretrigger points as described in the aforementioned section. The pedestal
calibration is stored in plain-text file with the MATACQ configuration name as
filename. The DAQ later reads this pedestal calibrations in order to subtract
them and obtain the actual signal.

######

Next, the DAQ script spawns the DAQ program and waits until it finishes. It
removes the shared memory file (described in Section 6.2.2) when the user
stops the execution. It is used to detect abnormal process termination if this
file exists and the process is not running triggering a warning email
notification.

######

The last step is to launch the data synchronization process described in
Section 6.2.1 that triggers automatic data analysis (see Section 7.3.3).

####  6.3.3 Run log

The DAQ program can take several parameters in order to store information
about the data taking run as described in the previous section. This
information can be the calibration source used or any other relevant comment.
This information is stored with other run statistics in the run log file. This
file is plain text file with tab separated values. The output fields are
described in Table 6.3.

Field name |  Description
---|---
Filename |  The run base filename. It includes the nun number and the set-up name.
Number of files |  Number of files written in the run
Source |  This field stores the source used in calibration process or Background otherwise
Start |  Run start time and date in the format Year-month-day hour:minute:second in local time
Stop |  Run stop time and date in the same format
Events |  The number of events stored in the run
Real Time |  The real time measured with scaler
Live Time |  The live time measured with scaler
Rate |  The number of events divided by the Live Time
Comment |  The comment provided at execution time. It is useful to document some special event related to the run
Table 6.3: Log file fields.

##  Chapter 7 Data analysis software

The ANAIS data analysis software extracts parameters from the primary acquired
data seen in Section 6.3.1. The current algorithms and its implementation are
the result of the evolution of the analysis from previous prototypes [190,
167, 160]. The original parts developed in this work are the adaptation of the
algorithms to the new DAQ data types and structures, the reimplementation of
the peak detection and the peak based algorithms (Sections 7.1.2 and 7.1.3
respectively), the improvement of the baseline characterization algorithms
(see Section 7.2) and the configuration and automation systems (see Section
7.3).

######

The analysis software reads the file generated by the DAQ software extracting
the information from the analysis of the waveform and the combination of
different acquired parameters. It uses the DAQ configuration parameters as
input of the analysis algorithms and it writes information in ROOT format in
order to aid data analysis and scripting.

######

The output of these algorithms can be classified into three groups: signal,
detector and event parameters. The signal parameters are extracted from the
digitized waveform of the individual PMT (such as the area or the pulse
onset), the detector parameters are extracted from the two module signals and
the event parameter are not specifically related to one signal or detector
(such as the trigger time or the event dead time).

######

The presented algorithms are still improving in order to get better knowledge
of the low energy region. In particular, the construction of new energy
estimators at very low energy is ongoing and the filtering protocols (see
Section 7.4) are expected to be improved with the blank module information
(see Section 2.4).

###  7.1 Algorithms

The algorithms developed for the event, detector and signal analysis are
described in this section. First, the basic pulse parameter extraction
explaining details about their design and implementation are explained. Next a
description of peak detection and peak related parameters is given. Finally
the temporal event parameters are calculated. Further details about the
implementation and parametrization of this analysis can be found in Section
7.3.1.

####  7.1.1 Basic signal characterization

The signal for every PMT is digitized to extract important parameters for
energy estimation or noise rejection. The first process in pulse analysis
consists of finding the minimum, maximum or area and other basic parameters of
the pulse. This section covers the introduction to the pulse parameter
calculation explaining algorithms and dependencies among parameters. Figure
7.1 illustrates the most important parameters covered in this section.

Figure 7.1: Basic pulse parameter extraction.

######

All the parameters described below are calculated in physical units to be able
to mix data from varied hardware or distinct hardware configurations such as
12-bit/14-bit MATACQs and 1 or 2 GS/s sampling rates. The analysis software
reads the hardware configuration and converts arbitrary units to physical
ones. The basic units are _mV_ for voltage and _ns_ for time.

######

The signal is a fixed length array of voltage values, sometimes called pulse
in this work. This length is 2520 points as seen in Section 4.4.2, named
pulse_depth in the following. The parameters extracted from the signal are
reviewed below:

###### Baseline level (dc):

This parameter measures the baseline level before the pulse. It takes
advantage of digitization pretrigger: the value is computed taking the first
half of the pretrigger points. These pretrigger points are referred in this
work as inipulse. This variable needs a correct inipulse value in order to get
a valid result. dc is a very critical parameter because many others depend on
it. Therefore, several algorithms were compared. The selected one takes
information from skewness to refine dc, rms and skw itself as described in
Section 7.2.

###### Baseline mode (mode):

This parameter is the statistical mode of the first half of pretrigger points.

###### Baseline weighted mode (wmode):

This parameter is the weighted mean of the five more frequent values of the
first half of pretrigger points. It is calculated to get a center of baseline
distribution points better than the mode in multimodal distributions. A
detailed use of this parameter is described in Section 7.2.

###### Baseline standard deviation (rms):

This parameter is calculated as the standard deviation of the same points used
to calculate dc. The distribution of this parameter is a good estimator of the
baseline quality as it can be seen in Section 4.5.5.

###### Baseline Skewness (skw):

It is the skewness of the same points used to calculate dc as it can be seen
in Section 7.2.

###### Maximum (max):

It is the maximum value of all points of the digitized signal.

###### Height (high) and its time (tmax):

The parameter high is the minimum point from the digitized signal. The
parameter tmax is the time when this minimum is reached, giving a relation
between them:

$pulse_{tmax}=high$ (7.1)

high is calculated without any other dependence. The amplitude of a pulse can
be evaluated as dc-high (with the alias amp), introducing dc dependence in
that way. It is worth to note that high is calculated without any filtering
and therefore amplitude may be biased by high frequency components. Anyway,
amplitude is only used in PSA algorithms to discriminate the incident particle
(with very good results as it can be seen in Section 5.5.3) and it is not used
as energy estimator.

###### Pulse onset (t0):

The t0 parameter is the time where the signal overtakes a threshold marking
the start of a triggered signal. The simplest and default way to calculate it
is using an external parameter as software threshold: threshold_sw. The value
t0 is extracted from the condition:

$pulse_{t0}<dc-threshold\\_sw$ (7.2)

If the threshold is not reached, t0 value is set to pulse_depth marking a lack
of _software trigger_. This calculation uses dc parameter as seen above. It is
critical to this and subsequent steps to set carefully the threshold value to
the actual hardware trigger in order to obtain accurate t0 values.

######

A varied set of algorithms has been implemented to calculate t0 due to the
different trigger strategies used in this work. A complete list of such
algorithms can be seen in Section 7.3.1.

###### Pulse area (area):

Pulse area is one of the most important parameters extracted in the analysis
software because of its expected linear behavior with the energy yield. It is
calculated as shown in the following equation:

$area=dc\cdot(pulse\\_depth-t0)-\sum_{i=t0}^{pulse\\_depth}pulse_{i}$ (7.3)

This calculation subtracts the baseline using dc and it begins to sum values
in t0 so its value rely on both parameters.

###### Low energy area (abe):

This parameter is an attempt to avoid baseline noise in area computation for
very low energy events. It is computed similarly to area but it only sums the
values that pass the threshold (an rms_threshold described in Section 7.3.1).

###### First momentum (fm), second momentum (sm) and third momentum (tm):

These three parameters are the first, second and third momenta calculated from
tmax to the end of the pulse, defined as follows:

$fm=\sum_{i=tmax}^{pulse\\_depth}(dc-pulse_{i})\cdot(i-tmax)$
$sm=\sum_{i=tmax}^{pulse\\_depth}(dc-pulse_{i})\cdot(i-tmax)^{2}$ (7.4)
$tm=\sum_{i=tmax}^{pulse\\_depth}(dc-pulse_{i})\cdot(i-tmax)^{3}$

These parameters have useful temporal information that can be used for pulse
shape analysis.

######  p1 and p2:

The p parameters are area ratios in different time-bases. Their definition is:

$p1=\frac{area(t0+100ns,t0+600ns)}{area(t0,t0+600ns)}$
$p2=\frac{area(t0,t0+50ns)}{area(t0,t0+100ns)}$ (7.5)

######

The integration time intervals are selected having the NaI scintillation
constant in mind.

####  7.1.2 Peak detection

This algorithm identifies negative peaks in the pulse. This is very useful
given the ability of resolving single photoelectrons in low energy events
[190] (see Section 3.4 for a description of low energy signals). The peak
information is used to discriminate noises from real NaI scintillation [160].
Additionally, the number of peaks are also strongly correlated with the energy
at low energies and its temporal distribution can be very useful to
discriminate bulk scintillation from other sources of light or noise.

######

For this work, two algorithms were compared: an algorithm based on TSpectum
ROOT class and its Search method, usually used to find peaks in $\gamma$-ray
spectra and a simple algorithm based on finding minima in the pulse.

##### Spectrum based algorithm

The method TSpectrum::Search uses a well know algorithm to identify peaks in a
spectrum [218], but it is used in an unconventional way. The pulse is inverted
in order to allow the mentioned algorithm to find maximum. Next, sigma of the
expected peaks and peak minimal threshold is supplied to the algorithm via
nrms value (see Section 7.3.1). The algorithm calculates smoothed waveform
from source waveform based on Markov chain method [219]. Finally, a list with
peaks with position and height is produced as a result of the algorithm. This
algorithm is very costly from a computational point of view.

##### Minimum algorithm

The aim of this algorithm is to find photoelectrons by locating minima. The
first step of this algorithm is to filter the higher frequencies of the signal
with a low pass filter and eliminate fluctuations. The cut frequency is set to
100 MHz. The second step is to calculate the derivative pulse and find the
minima with the derivative sign change. The implementations of this algorithm
also changes the postprocessing of the detected peaks. This algorithm requires
a height to the peak below a software threshold (see Section 7.3.1 for
details).

######

The last algorithm is the currently used for its fast implementation and its
very similar performance. Figure 7.2 shows the peak detection of a very low
energy event.

Figure 7.2: Peak detection and peak based parameters (see Section 7.1.3).

####  7.1.3 Peak based parameters

The last step in pulse characterization is to extract parameters taking
advantage of peak extraction information. This information can be useful to
characterize parameters in very low energy events and it is also used to
record information about the last peak. This last peak information was
extracted to get additional information about SER without the bias of trigger
cut. This bias was detected trying to get SER information with one peak pulses
seeing a photoelectron distribution abruptly cut in trigger level [160].

######

The peak based parameters are:

###### Number of detected peaks (n):

This parameter is the number of peaks detected by the previous algorithm.

###### Area around peaks (areap):

The algorithm that calculates areap uses peaks in order to sum area values
only near them in a fixed time window in order to reduce the effect of the
baseline in the integrated charge (area). This area can be seen in gray in
Figure 7.2.

###### Last peak area (arealp):

This parameter sum area from the last peak in a fixed time window. This
parameter is very useful to characterize the single electron response with the
signal of real events as it can be seen in Section 8.6. This will account the
gray zone under the last peak seen in Figure 7.2. The integration interval is
marked with a brace.

###### Last peak height (hlp):

The $y$ (voltage) value of last peak. It does not take into account the dc
value. It is useful to characterize the single electron response amplitude
distribution.

###### Last peak position (poslp):

The $x$ (temporal) position of last peak. Used to be able to select non-
triggered signals in the SER, avoiding the trigger bias.

####  7.1.4 Time parameters

This group of algorithms constructs some derived temporal parameters relative
to an event from raw temporal data. The more important temporal parameters are
distance to previous event (drt), event dead time (ddt0) and temporal distance
to the last plastic tagged event (veto) (vts).

######

The temporal distance to previous event can be used to detect temporal
triggering patterns attributed to noise as described in Section 7.3.3. The
event dead time gives information about the dead time distribution among
events (see Section 8.2). The distance to veto signal is used to subtract
these muon related events which was already explained in Section 5.5.3.

######

The distance to a plastic tagged event must be done by correlating the two
acquisition data. This is why the veto data are loaded together with the NaI
data in order to identify the nearest precedent veto event and calculate the
time distance to it, vts in seconds and vt in (50 ns) ticks. Another useful
variable is the distance to a very energetic event in the same crystal. This
variable can be used to remove the afterglow events due to a very energetic
event. The variable is named heticks in seconds (and hetick in ticks) for
every crystal (hetick2 for the detector 2). The use of the distance to a muon
tagged event and to a very energetic event can be seen in Section 5.5.3.

###  7.2 Baseline algorithms

Baseline parameter extraction is a key phase in the pulse characterization.
These parameters (dc, rms, skw, etc.) are used to characterize the pretrigger
zone and they are used (especially dc) in all steps of pulse related
algorithms. A wrong calculation is propagated to all other parameters. Hence,
a careful study of the parameter extraction algorithms was performed and some
improvements were implemented and tested.

######

A naive implementation of dc and rms calculations revealed some populations of
bogus dc with negative area mostly consisting in pulses with photoelectrons in
the points used to calculate baseline parameters as it can be seen in Figure
7.3.

######

Figure 7.3: Pulse with bogus calculated dc (horizontal red line in top pulse)
(Horizontal scale in ns, vertical in mV).

Skewness (skw) was used for the study of such a population. It quantifies the
asymmetry of a distribution and it can be used to identify the presence of
peaks in baseline points. In Figure 7.4(a) it can be seen a typical baseline
skewness distribution: right population corresponds to events with
photoelectrons in the baseline. An algorithm to refine baseline parameters can
be carried out given such a distribution. In addition, the algorithm uses the
baseline root mean square value in order to identify photoelectrons in
baseline more robustly. This is possible given the scatter distribution of
these two parameters as it can be seen in Figure 7.4(b).

(a) Baseline skewness. The right population corresponds to photoelectrons in
baseline.

(b) Skewness vs. standard deviation. Photoelectrons are in the top right
population.

Figure 7.4: Baseline skewness and RMS distribution.

######

The refined algorithm consists of recalculating dc, rms and skw in the case of
big skewness and root mean square. First, all the three parameters are
calculated (being dc_points the first half of pretrigger inipulse). mode and
wmode parameters are also calculated being the most frequent value and the
weighted average for the five most frequent values in dc_points. Next, skw and
rms are checked with thresholds configured given by its distribution (see
Section 7.3.1). The refinement cuts off the extreme points using wmode and
trigger_level as reference and establishing windows of 5 ns when the
asymmetric zone is detected. Once the points are removed, the calculations are
recomputed with the remaining population.

######

The results of a better dc identification can be observed in Figure 7.5(a) and
it can be compared with the previous one as seen in Figure 7.3. Additionally,
the area spectrum was compared with and without refinement showing difference
at random coincidence population only as it can be seen in Figure 7.5(b). This
spectrum shows an energy interval from 50 keV to noise peak and it remains