- 1Dipartimento di Fisica, Sapienza Università di Roma, Roma, Italy
- 2INFN sezione di Roma, Roma, Italy
- 3Dipartimento di Fisica, Università di Roma Tor Vergata, Roma, Italy
- 4Facultad de Ciencias Astronómicas y Geofísicas (Universidad Nacional de La Plata), La Plata, Argentina
- 5Dipartimento di Fisica, Università di Milano-Bicocca, Milano, Italy
- 6INFN sezione di Milano-Bicocca, Milano, Italy
- 7Laboratoire Astroparticule et Cosmologie (APC), Université Paris-Cité, Paris, France
- 8Department of Experimental Physics, National University of Ireland, Maynooth, Ireland
- 9Université de Paris, Centre National de la Recherche Scientifique (CNRS), Astroparticule et Cosmologie, Paris, France
- 10Instituto de Tecnologías en Detección y Astropartículas (ITeDA), CONICET–CNEA–UNSAM, Buenos Aires, Argentina
- 11Departamento de Física, Facultad de Ciencias Físicas y Matemàticas, Universidad de Chile, Santiago, Chile
- 12Observatoire de Paris, Université PSL, Paris, France
Introduction: QUBIC (the Q
Methods: An algorithm was developed for detecting cosmic ray events in the time-ordered data (TOD) of transition-edge sensor detectors (TES bolometers). Raw signals were pre-processed to obtain de-noised data. Events were searched by applying a threshold to isolate segments showing a rapid increase and subsequent exponential decay. The final goal is to fit each segment to extract the time scale of the candidate and verify the fit quality statistically.
Results: The cosmic ray detection algorithm was applied to datasets acquired in Salta (Argentina) in 2022, during a testing campaign. So far, no candidates have been found after exploring different thresholds for initiating the cosmic ray search, along with various combinations of minimum points required for the sudden increase and exponential decay expected in the signal.
Discussion: We select only high signal-to-noise regions to find the most energetic cosmic ray candidates matching the filters proposed in the method. The null result is not surprising since, for the energy range of cosmic muons of interest here (approximately
1 Introduction
QUBIC (the Q
As QUBIC operates in the millimeter wave region of the electromagnetic spectrum, the instrument needs a clean and dry atmosphere. Consequently, it has been installed at a high-altitude site in Alto Chorrillos, Argentina (4,869 m above sea level). At this altitude, there is a significant impact on the measurements caused by cosmic rays (CRs), mainly produced by high energetic cosmic ray muons interacting with the detectors. We expect that most of the detected CRs originate from interactions of primary CRs at the top of the Earth’s atmosphere. They are secondary particles resulting from air showers triggered by hadronic interactions between primary CRs and atmospheric nuclei. There are two types of traces left in the data by CRs: above and below detector noise. CR events are of particular importance for QUBIC for two complementary reasons. From an observational standpoint, CRs represent a source of fast transients that can significantly contaminate the time-ordered data (TOD). Their sudden increase and exponential decay break the statistical stationarity of the noise, introduce non-Gaussian features, and, if not properly identified and removed, can propagate into the map-making stage, ultimately degrading the sensitivity to CMB polarization. At the same time, CRs provide a valuable diagnostic tool for the instrument: each CR impact deposits an almost instantaneous energy impulse in the TES, exciting the thermal response of the detector. The decay that follows this excitation directly probes the effective time constant of the TES. Since the TES response is described by a single-pole exponential in the time domain (equivalently, by a first-order low-pass filter in the frequency domain), the time constant extracted from CR events offers an independent and natural in-flight measurement of the instrument’s transfer function. Knowing this time constant is crucial for recovering signal linearity: once it is measured, the TOD can, in principle, be deconvolved from the detector transfer function, thus correcting for the low-pass filtering introduced by the TES and enabling a more faithful reconstruction of the sky signal. For these reasons, detecting CR events is essential both to preserve data quality and exploit the diagnostic information they carry about the instrument’s temporal response. In this article, an algorithm is described to detect the leftover traces above noise, i.e., in a high signal-to-noise region.
When an amount of energy
where
where
often an order of magnitude faster than
Knowing
Another essential component of the QUBIC readout system is the superconducting quantum interference device (SQUID). The direction of the SQUID coil winding, which couples the SQUID to the TES, affects the current–voltage (IV) response and TES polarity and must be considered during data analysis to correctly interpret the direction of CR-induced transients.
2 Methods
To investigate the impact of CR candidates on TODs, a detection algorithm was developed. The description of the methodology used to perform this analysis would focus on a single TES of the focal plane; however, through multiprocessing, the algorithm developed in Python can perform the analysis of the entire focal plane.
The dataset analyzed in this work was acquired during the QUBIC technical run of 2022 in Salta (1,150 m a.s.l.). It consists of TODs from the 256 TES detectors of the focal plane, sampled at 157 Hz, and includes azimuthal scanning observations performed under stable cryogenic and readout conditions. Prior to analysis, all datasets underwent the standard QUBIC quality-control procedures, including verification of TES stability through IV-curve checks. Only TES passing these controls were included in the final CR analysis.
2.1 Data pre-processing
Before searching for cosmic rays, the raw TODs are pre-processed to remove low-frequency trends and optimize the sensitivity to CR impulses. We apply this pre-processing procedure exclusively during azimuthal scans (in the case of fixed pointing, a simple median is removed from the signal), which involve repeated forward and backward telescope movements in azimuth at a fixed elevation to map specific regions of the sky. The objective is to obtain clean, synchronized sweeps from the raw azimuth signal and prepare these data for subsequent analysis. The pre-processing consists of the following steps:
1. Sweep segmentation:
Raw azimuth data are segmented into forward and backward azimuth scans by analyzing the angular velocity, computed as the time derivative of azimuth. A median filter is applied to reduce noise and irregularities, and sweeps are identified based on threshold crossings of the angular velocity.
2. Sweep labeling and indexing:
Each identified forward or backward azimuth scan is labeled and assigned a unique index, enabling clear identification of the data points corresponding to specific sweeps and directions.
3. Time synchronization and interpolation:
Segmented azimuth data are mapped onto the electronics’ time base through interpolation, ensuring alignment between the azimuth data and the electronic system’s sampling times.
4. Baseline correction:
For each forward and backward azimuth scan, the median value of the signal is subtracted, removing any offset between individual sweeps.
5. Trend removal:
The corrected signals are grouped into macro-bins. Trends and slow drifts within each macro-bin are estimated and subtracted through a second-order polynomial fitting, resulting in a stabilized and centered dataset.
6. Final smoothing:
Residual irregularities at sweep boundaries are corrected by linearly interpolating between the start and end points of each sweep, removing any invalid data points in the process. These invalid points may be caused by scan instabilities occurring at the edges of the back-and-forth motion. An example demonstrating the correction and cleaning method applied to the TOD is provided in Figure 1.
The direction of SQUID coil winding is also taken into account. In cases where coils are wound in the opposite direction (e.g., counterclockwise), the IV characteristics—and presumably the spikes due to CRs, are inverted. Accordingly, the TES signal is sign-corrected to maintain a consistent analysis framework for transient direction.
2.2 Candidate identification
The signal from a CR candidate can be modeled as a vertical linear growth, followed by a single-pole exponential decreasing trend. Segmentation techniques isolate signals corresponding to potential transient events (CR candidates), ensuring that each analyzed segment accurately represents an individual occurrence. We defined the candidate search region using a high signal-to-noise ratio (SNR) threshold, set to three, four, and five times the signal’s standard deviation plus the average value of the signal, to explore the parameter space of the search algorithm. When a signal exceeds the threshold, it triggers the search for the characteristic CR pattern. The algorithm determines whether the data points immediately following the initial trigger point conform to an exponential decay. This check is applied particularly to the first point above the threshold because the method is designed to detect prominent signal bumps, whose decaying nature is immediately identified after the bump.
The algorithm is sensitive to such trends even if their amplitude falls below the initial detection threshold as long as it remains above the baseline defined by the signal’s average plus its standard deviation.
Concurrently, we explored other parameters, including the minimum number of points required to define the vertical linear growth (1, 2, and 3) and the exponential decreasing trend (2, 3, 4, 5, and 6).
To illustrate the behavior of the detection pipeline and the fitting strategy adopted in this work, Figure 2 presents the examples of candidates that have been identified, removing the restrictive filters explained so far. The signal exhibits a small increase, followed by an exponential decay, and was therefore fitted using the model described in Section 2.3, Equation 5.
Although the fit formally converges, these candidates fail the pipeline because they do not exhibit a pronounced bump in the increasing part of the signal, which is characteristic of a high-energy cosmic ray event, and they may represent signal artifacts. As a result, they do not pass the validation steps required by the algorithm; therefore, the events do not correspond to a cosmic ray-induced transient but are instead compatible with instrumental fluctuations or external interference. Events of this type are not selected by the algorithm, and no CR candidates are found in the dataset analyzed in this work.
2.3 Signal fitting procedures
For each identified candidate, a two-stage fitting procedure is applied. Initially, the increasing edge is characterized using linear regression to estimate the slope. Subsequently, the following exponential decay model is fitted to the decay profile using non-linear least squares optimization:
where
2.4 Statistical validation
The reliability of the fitted models is assessed using chi-square tests, p-value estimations, and residual analyses. These statistical metrics quantify the agreement between the observed data and the model, providing a framework for validating each time-scale estimation.
First, to assess whether a candidate truly follows an exponentially decreasing trend, the natural logarithm of the decreasing points is computed. Then, the difference between consecutive log-transformed values is calculated. If this difference deviates by more than
• It emphasizes small variations, allowing for better control over how individual points of a candidate change.
• It enables the use of Pearson’s test, which is not suitable for testing non-linear relationships between points.
Regarding Pearson’s test, the Pearson correlation coefficient
An additional goodness-of-fit criterion based on the root-mean-square error (RMSE) of the linear regression applied to the log-transformed decay points is evaluated. Let
obtained through ordinary least squares, and the RMSE is computed as shown in Equation 7:
Because the data are expressed in logarithmic units, the RMSE quantifies the typical multiplicative deviation from an ideal exponential decay; for example, an RMSE of 0.02 corresponds to an average amplitude error of approximately
A candidate is rejected if either of the following conditions is satisfied:
• the fitted slope is non-negative,
•
The RMSE test complements Pearson’s correlation: Pearson’s coefficient assesses the linearity of the log-decay, whereas the RMSE quantifies the absolute misfit, discarding candidates that are formally linear yet deviate from a pure exponential by more than the specified tolerance.
To identify candidates that exhibit a significant deviation from the surrounding signal baseline, the average value of each candidate is calculated. If 20 surrounding points (corresponding to approximately 0.12 s at a sampling frequency of 157 Hz) exceed this average, the candidate is rejected. This criterion ensures that only events increasing above the surrounding fluctuations are classified as CR candidates.
Concerning the uncertainties over candidate points, as an initial rough estimation, they are set to the standard deviation of 20 points before and after the candidate (excluding the increasing edge). This can lead to an overestimation of the uncertainties. To obtain a more accurate estimate, an iterative procedure is adopted. In the first step, the standard deviation of the residual for a given candidate is computed. The fitting procedure is then repeated using this new estimate of the standard deviation. The process continues until the relative change (Equation 8):
where
where
2.5 Visualization and mapping
Several visualization tools are used to support data interpretation (i.e., histograms and residual plots). The computational pipeline was implemented entirely in Python, leveraging scientific libraries, including NumPy for numerical computation, SciPy for optimization and statistics, Matplotlib for visualization, and the qubicpack library for initial data handling.
3 Results
3.1 Cosmic ray detection
The algorithm was applied to datasets acquired under different scanning strategies, including azimuthal scans. The datasets were further categorized by measurement site, but for this analysis, we focus on a single dataset acquired during the testing campaign conducted in Salta (Argentina; 1,150 m a.s.l., 2022).
However, regardless of the site or scanning strategy, the goal for each dataset is to extract the time scale of the candidates for individual TES detectors, each accompanied by an estimate of the statistical uncertainty. These values allow for direct comparisons between detectors. It is important to note that, following the analysis of datasets from a given campaign, the algorithm determines whether the time scales of the candidates associated with a specific TES are of the same order of magnitude. If not, these time scales are excluded from the final overall estimation. This criterion is based on the assumption that if CR candidates are related to the intrinsic time constants of the TESs, then the time scales detected for a given TES should be consistent in order of magnitude. Residual analysis was performed on each candidate event to validate the exponential fit. Finally, an overall analysis is performed across all datasets, including residual histograms, amplitude distributions, elevation and candidate frequency plots, and best-fit models.
If the algorithm detects candidates across all analyzed datasets, an overall analysis of the TESs on the focal plane would be performed:
• Estimation of candidate time constant.
• Histogram of the amplitudes fitted with a Landau distribution, which is an asymmetric probability distribution—most commonly used in high-energy physics to describe the energy loss of charged particles as they pass through a thin layer of material.
• Distribution of residuals between the fitted and observed decays, fitted with a combined normal–Cauchy distribution.
• Two plots to show the relationship between the time scales obtained for the candidates of TESs, which, at the end of the overall analysis, are of the same order of magnitude for that TES, along with
The reliability of the testing framework was evaluated by varying all major algorithmic parameters, including the high SNR threshold (3, 4,
3.2 Expected cosmic ray rates
The input CR flux was derived from the integrated muon flux over the solid angle of the upper Earth’s hemisphere measured at Bogotà [2,657 m a.s.l., Borja et al. (2022)],
leading to an estimated flux at the QUBIC site of Equation 11:
The geometric area of a single bolometer membrane is taken to be
corresponding to approximately 3409 events per hour on the 256 TESs. If we perform the same calculation at the QUBIC site (Alto Chorrillos 2,657 m a.s.l), we obtain a factor
We expect CR muons with energies in the range
For each sampled energy, the corresponding cosmic ray amplitude in ADU was computed by converting the deposited energy from eV to Kelvin through Equation 13:
where
Events of this amplitude, even occurring at a rate of approximately 3409 events per hour, nonetheless, remain buried in the instrumental noise, quantified as the standard deviation of the TOD (10509.6 ADU), as evident in the TOD shown in Figure 1.
4 Discussion
In this work, we have proposed a method for identifying above-noise CR transients in QUBIC’s TES TODs by combining threshold-based event segmentation, two-stage fitting, and statistical validation.
The algorithm has been applied to data from the testing phase in Salta (Ar), and at the current stage of the analysis, no CR candidates have been found. The methodology developed here is directly applicable to future QUBIC longer campaigns to estimate, from the largest (and rare) cosmic ray energy depositions, the TES time constants, and to other bolometric experiments operating in high–cosmic-ray environments. At Salta’s altitude, the CR spectrum is dominated by secondary muons, with an energy distribution extending from 1 to 100 GeV. In a
The algorithm can, nonetheless, be integrated into offline or near-real-time pipelines with negligible computational overhead, providing a robust framework for automated transient rejection. Moreover, the ability to extract TES time constants from CR hits offers a valuable in-flight calibration opportunity. The modularity of the approach, combined with its statistically driven validation, makes it suitable for deployment in future instruments aiming to characterize transient energy depositions without compromising science data or map-making performance.
Data availability statement
The data analyzed in this study is subject to the following licenses/restrictions: access to the datasets is restricted by the QUBIC collaboration’s internal policy. Requests for access can be evaluated on a case-by-case basis. Requests to access these datasets should be directed toaGFtaWx0b25AQVBDLklOMlAzLkZS.
Author contributions
SF: Data curation, Methodology, Software, Formal analysis, Visualization, Writing – original draft, Writing – review and editing. EBt: Writing – review and editing. SM: Writing – review and editing. EBr: Writing – review and editing. AC: Writing – review and editing. BC: Writing – review and editing. PD: Writing – review and editing. GD: Writing – review and editing. MG: Writing – review and editing. J-CH: Writing – review and editing. NM: Writing – review and editing. GI: Writing – review and editing. CO’S: Writing – review and editing. AP: Writing – review and editing. MP: Writing – review and editing. FS: Writing – review and editing. CS: Writing – review and editing. ST: Writing – review and editing. MZ: Writing – review and editing.
Funding
The author(s) declared that financial support was received for this work and/or its publication. QUBIC is funded by the following agencies. France: ANR (Agence Nationale de la Recherche) 2012 and 2014, DIM-ACAV (Domaine d’Intérêt Majeur-Astronomie et Conditions d’Apparition de la Vie), CNRS/IN2P3 (Centre national de la recherche scientifique/Institut national de physique nucléaire et de physique des particules), CNRS/INSU (Centre national de la recherche scientifique/Institut national et al. de sciences de l’univers). Italy: CNR/PNRA (Consiglio Nazionale delle Ricerche/Programma Nazionale Ricerche in Antartide) until 2016, INFN (Istituto Nazionale di Fisica Nucleare) since 2017. Argentina: MINCyT (Ministerio de Ciencia, Tecnología e Innovación), CNEA (Comisión Nacional de Energía Atómica), CONICET (Consejo Nacional de Investigaciones Cieníficas y Técnicas).
Acknowledgements
The computational work reported in this article was performed on the supercomputers at CINECA, Italy, under the 2024-2025 INFN-CINECA agreement and on the CC-IN2P3 computing cluster operated by CNRS/IN2P3, France. The authors gratefully acknowledge the computing time and technical support provided by both facilities.
Conflict of interest
The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Generative AI statement
The author(s) declared that generative AI was not used in the creation of this manuscript.
Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
References
Borja, C., Ávila, C., Roque, G., and Sánchez, M. (2022). Atmospheric muon flux measurement near earth’s equatorial line. Instruments 6, 78. doi:10.3390/instruments6040078
Gadey, H., Chatzidakis, S., and Farsoni, A. T. (2020). Monte carlo characterization of the cosmic ray muon flux in shallow subsurface geological repositories intended for disposal of radioactive materials. Appl. Radiat. Isotopes 163, 109209. doi:10.1016/j.apradiso.2020.109209
Hamilton, J.-C., Mousset, L., Battistelli, E. S., de Bernardis, P., Bigot-Sazy, M.-A., Chanial, P., et al. (2022). Qubic I: overview and science program. J. Cosmol. Astropart. Phys. 2022, 1–34. doi:10.1088/1475-7516/2022/04/034
Irwin, K. D., and Hilton, G. C. (2005). Transition-edge sensors. Top. Appl. Phys. Cryog. Part. Detect. 99, 63–150. doi:10.1007/10933596_3
Masi, S., Battistelli, E. S., de Bernardis, P., Lamagna, L., Nati, F., Nati, L., et al. (2010). On the effect of cosmic rays in bolometric cosmic microwave background measurements from the stratosphere. Astronomy & Astrophysics 519, 9. doi:10.1051/0004-6361/201014065
Piat, M., Stankowiak, G., Battistelli, E. S., de Bernardis, P., D’Alessandro, G., Petris, M. D., et al. (2022). Qubic iv: performance of tes bolometers and readout electronics. J. Cosmol. Astropart. Phys. 2022, 037. doi:10.1088/1475-7516/2022/04/037
Keywords: bolometer time constant, CMBR polarization, cosmic rays, data analysis, transition-edge sensors
Citation: Ferazzoli S, Battistelli ES, Masi S, Barbavara E, Coppolecchia A, Costanza B, De Bernardis P, De Gasperis G, Gervasi M, Hamilton J-C, Miron Granese N, Isopi G, O’Sullivan C, Paiella A, Piat M, Sánchez F, Scóccola C, Torchinsky SA and Zannoni M (2026) QUBIC: an algorithm for detecting cosmic rays. Front. Astron. Space Sci. 12:1659952. doi: 10.3389/fspas.2025.1659952
Received: 04 July 2025; Accepted: 02 December 2025;
Published: 08 January 2026.
Edited by:
Massimiliano Galeazzi, University of Miami, United StatesReviewed by:
Wenjie Zhao, Chinese Academy of Sciences (CAS), ChinaDavid Maurin, Délégation Alpes (CNRS), France
Copyright © 2026 Ferazzoli, Battistelli, Masi, Barbavara, Coppolecchia, Costanza, De Bernardis, De Gasperis, Gervasi, Hamilton, Miron Granese, Isopi, O’Sullivan, Paiella, Piat, Sánchez, Scóccola, Torchinsky and Zannoni. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Sofia Ferazzoli, c29maWEuZmVyYXp6b2xpQHJvbWExLmluZm4uaXQ=
Elia Stefano Battistelli1,2