21.5 Detector Spectra
Table of Contents
Energy spectra
Energy spectra are distributions of how many events are observed as a function of measured energy. In ROOT, they are usually represented as one dimensional histograms, for example TH1F or TH1D, where the horizontal axis is energy and the vertical axis is the number of counts in each bin.
In a detector analysis, the content of each bin represents the number of events whose measured energy falls into the corresponding energy interval. For example, a gamma ray detector might show distinct peaks at known gamma energies, on top of a continuous background. The choice of bin width is important. If the bins are too wide, peaks can be smeared and details lost. If they are too narrow, statistical fluctuations dominate, and many bins may have low or zero counts.
In a typical ROOT workflow, you fill an energy spectrum by looping over events and calling something like histE->Fill(energy); where energy is a calibrated variable, for example from a TTree branch. Calibration is essential. Raw detector signals are usually in ADC counts or voltage. Through a separate calibration procedure, often using known reference lines, you determine a transformation such as
$$
E = a \, x + b
$$
where $x$ is the raw channel number and $E$ is the physical energy in keV or MeV.
Always convert raw detector channels to calibrated energy before interpreting peaks, comparing to reference values, or extracting physical parameters.
ROOT provides convenient methods for inspecting energy spectra. You can obtain the total number of entries, the mean and the RMS with methods like GetEntries(), GetMean(), and GetRMS(). These give a quick sense of the central value and spread of the measured energy distribution. When you draw the histogram, you can add axis titles such as "Energy [keV]" and "Counts" to make the spectrum physically meaningful.
Frequently, you are interested in energy resolution. In ROOT, you typically fit a peak with a Gaussian function and extract the fit parameters. If the Gaussian has sigma $\sigma$ and mean $\mu$, the full width at half maximum (FWHM) is
$$
\text{FWHM} = 2\sqrt{2\ln 2}\,\sigma \approx 2.355\,\sigma.
$$
Energy resolution is often quoted as the ratio $\text{FWHM} / \mu$. This gives a dimensionless measure of how well the detector can distinguish nearby energies.
By fitting different peaks across the spectrum, you can study how the detector resolution depends on energy. In ROOT, this is often automated using macros that select regions of interest in the histogram, perform fits, and store the resulting parameters in new histograms or graphs.
Energy spectra are also used to separate signal and background. In ROOT, you may define cuts around a peak to select events in a certain energy window, or use sideband regions to estimate background under the peak. These selections can be applied via TTree::Draw() expressions or more advanced tools like RDataFrame. The binned representation in ROOT makes it simple to integrate counts over certain energy ranges, which is essential for yield extraction and comparison with theoretical predictions.
Time spectra
Time spectra describe how event counts depend on time. The time variable can mean different things depending on the experiment. It can be absolute time, time since the start of data taking, time of flight between two detectors, or time difference between correlated signals. In ROOT, you again use a one dimensional histogram to represent the distribution of a time variable.
A simple example is a decay curve. If you have a radioactive sample and record the detection time of each decay, the histogram of detection times often follows an exponential law
$$
N(t) = N_0 \, e^{-t/\tau} + B
$$
where $\tau$ is the lifetime and $B$ is a constant background. In ROOT, you can fit this distribution with an exponential plus constant model and extract the decay constant $\lambda = 1/\tau$.
When fitting time spectra for decay constants or lifetimes, verify that the time window and binning are appropriate so that the exponential behavior is clearly visible and not dominated by pileup, dead time, or trigger effects.
Time of flight (TOF) measurements are another common application. Here, you measure the time difference between a start detector and a stop detector. The time spectrum can show peaks corresponding to different particle species or different flight paths. In ROOT, this is naturally analyzed as a histogram of $\Delta t$, where the peak positions give average times and the widths are related to timing resolution.
ROOT provides tools to calculate simple statistics of time spectra in the same way as for energy spectra. The GetMean() and GetRMS() methods applied to a time histogram can give average arrival times and time spreads. You can also compare time spectra for different detector channels by overlaying histograms on the same canvas, which helps identify timing offsets or calibration issues.
In more complex analyses, time information is combined with other observables. For example, you might create a two dimensional histogram of energy versus time to study how energy spectra evolve over time or how the timing of particular energy ranges behaves. ROOT’s 2D histograms and profiles are used for this purpose, but the basic building block remains the one dimensional time spectrum.
In many detectors, timing information is affected by electronic effects such as trigger jitter, dead time, or time walk. ROOT can help you visualize these effects. For example, you can plot the time difference between two channels to see if they are properly synchronized. You can also perform calibration by correcting raw times using calibration constants and then refilling the histogram or transforming an existing TTree into calibrated variables that you then histogram.
Time spectra are also essential in coincidence experiments. You often define a time window, for example around zero in a time difference spectrum, to select coincident events. In ROOT, this selection can be implemented via cuts, and the resulting time dependent behavior of selected and rejected events can be studied by drawing their respective histograms.
Position distributions
Position distributions show how event counts vary as a function of position in or on a detector. Depending on the detector, position can be one dimensional, for example along a strip, or two dimensional, for example in an imaging detector or tracker. ROOT supports both one dimensional histograms and two dimensional histograms to represent position information.
A one dimensional position spectrum might use a histogram with the horizontal axis representing a strip number or a spatial coordinate such as $x$ in millimeters. The content of each bin shows how often hits occurred at that position. This kind of spectrum can reveal detector non uniformities, dead channels, or regions of lower efficiency. In ROOT, you can quickly look for missing or unusually high bins to identify problems or interesting physics effects like beam focusing.
For two dimensional position information, you typically use TH2F or TH2D histograms. One axis might represent $x$ and the other $y$. Each bin in the 2D histogram contains the number of events whose reconstructed positions fall within the corresponding area. When you draw such histograms with color options, you get a density map of hits across the detector. This is very useful for visualizing beam spots, detector acceptance, or hot and cold regions.
In ROOT, you can draw 2D position distributions with drawing options like "COL" or "COLZ" to see a color map of occupancy. By adjusting axis ranges and bin sizes, you can control the spatial resolution and the statistical significance per bin.
Choose binning in position distributions so that each bin has enough statistics to be meaningful, but not so large that important spatial structures are smeared out.
To study projected distributions along one coordinate, you can use projections of a 2D histogram. For example, ProjectionX() gives you a histogram of $x$ integrated over all $y$. This is helpful when you want to reduce a 2D position map to a simpler 1D profile for detailed fitting or comparison with models.
Position distributions are often used to determine detector resolution. You might reconstruct positions from multiple measurements and then consider the difference between reconstructed and true or reference positions. The distribution of these residuals can be plotted in ROOT as a histogram, and a Gaussian fit provides a quantitative measure of spatial resolution.
Position spectra can also be studied as a function of other variables using profiles. For instance, you might want to know the average energy deposition as a function of position. A TProfile histogram in ROOT can store, for each position bin, the mean value of energy. This helps identify gradients or systematic effects across the detector.
Finally, position distributions are key to defining fiducial volumes. In ROOT analyses, you often apply cuts on reconstructed coordinates to restrict the analysis to a central region where the detector response is well understood. Visualizing the position distributions before and after such cuts in ROOT allows you to confirm that your fiducial region is correctly defined and that edge effects or inactive areas are properly excluded.
Views: 10
KAHIBARO