# Presentation: 078073

## Spectroscopic analysis in hard x-rays and 

-    gamma rays
-                  David Smith, UCSC
-                  SPD summer school, June 2006

## We collect and count individual photons

**Zone 1:**
**thermal**

**Zone 2:**
**nonthermal**
**e- brem.**

**Zone 3:**
**nuclear**
**lines**
**(ions)**

**Z**

**Zone 4:**
**nontherm.**
**e- brem.**
**again**

**Z5:**
**pi-**
**on**
**de-**
**cay**

## Reminder of why we want to do solar spectroscopy:

-       Temperature and density plasma diagonstics in thermal x-rays
-       Inversion of hard x-ray spectrum to accelerated electron spectrum
-       Gamma-ray line ratios for accelerated ion spectrum & composition
-       Nuclear de-excitation line shapes for ion angular distributions &
-             composition
-       Positron-annihilation line shape for flaring atmosphere temperature
-             and density
-       Pion decay spectral signature for highest energy ion flux
-                            [See slides of talk by R. Murphy]

## Zone:  Detectors:                  MeV:  Physics/energy losses:

- Thicker Si, gas prop. ctrs       0.01                   k-shell escape
- CdTe, CZT                             0.03
- Germanium detectors            0.1
-                                                0.3            Compton scattering
- Scintillators: NaI                       1                     Compton escape
-                     CsI                       3              Pair production
-                     BGO                    10                    511 photon escape
-                                                 30                    electron escape
- Pair tracking                           100
-    (Gas or silicon again,          300
-     scintillation fibers)

**Zone:  Detectors:                  MeV:  Physics/****energy losses:**

**1**
**2**
**3**
**4**
**5**

**Detectors and interaction physics vs. energy:**

## Photoelectric 

**absorption:**
**Dominates below about:**
**50 keV in Si**
**150 keV in Ge**
**500 keV in Pb, BGO**
**Material becomes more**
**transparent just below "edge";**
**possibility for k-shell photon**
**escape. **

**K**

**L**

**M**

## Compton scattering:

- Compton-dominated regime has minimum cross-section; escape is
-    common.  RHESSI detectors are only about 15% photopeak
-    efficient at 2.2 MeV (solar neutron capture line)
- Free-electron approximation good but not perfect (opacity related to
-    electron density only)
- Energy lost to Compton electron is a function only of scatter angle
-    and starting energy (conservation of energy, momentum):
- Cross-section is more complicated; there are forward and reverse peaks at
-    semirelativistic to relativistic energies
- Scatter prefers to preserve direction of electric field vector when
-    scattering near 90 degrees -- therefore azimuthal angle distribution
-    is a good polarization diagnostic until 90-degree scatter becomes rare
-    at high energies.

## Compton scattering can take place

**    ** at the Sun
-      off the spacecraft into the detector
-      off the Earth's atmosphere into the detector
-           (if the Earth is nearby)
-      out of the detector
**For example**
-      Forward (small-angle) Compton scattering of the
-         2.2 MeV neutron capture line from deep in the** **
**        **solar atmosphere produces a "step" continuum
-         just below the line (T. Vestrand et al. 1990, ICRC).
-      But so does forward scattering in any passive
-         material in front of your detector

## Pair Production:

- Occurs because the field of the nucleus looks like another
- photon to a passing energetic photon
- Like photoelectric effect, cross sections increase dramatically
- with Z (strength of nuclear field)
- Minimum photon energy is 2*electron rest mass = 1022 keV
- But cross section does not become significant until > 2 MeV
- Remaining energy goes into kinetic energy of e+ and e-
- e+ and e- tend to be forward-beamed, particularly at the
- highest energies
- Positrons must slow down before annihilating (just like in the Sun)

## Electron propagation in detector:

**      **Photoelectron, Compton electron or pair ionize detector material
-         and lose their energy
-         Range is deterministic, not probabilistic as with photons (many
-         interactions).  Example:  ~1mm at 1 MeV in Ge
-         **The resulting ionization causes the signal in detectors:**
-                    Diode detectors (Si, Ge, CdTe):  electron/hole clouds
-                    are swept to opposite electrodes by applied high voltage
-                    and the resulting current is amplified
-                    Scintillators (plastic, NaI, CsI, BGO, etc.):  electrons wander
-                    the crystal until they relax to the ground state (usually
-                    via a dopant site) emitting optical/UV light in the transparent
-                    crystal.  Light is converted to a current by a phototube,
-                    channel plate, semiconductor, etc. and amplified

## Best reference for detector interaction

**physics, detector types and capabilities:**
**                   ****Radiation Detection and Measurement**
**                        ****by Glenn F. Knoll**

## Advantages of detectors from 100 keV to 10 MeV:

**                                  ****Scintillators**
**NaI: **Inexpensive, medium stopping power, moderate
-         energy resolution (about 7% FWHM at 1 MeV),
-         hygroscopic.
**CsI: **Slightly more expensive, slightly higher stopping power,
-         slightly worse resolution, neutron identification,
-         somewhat hygroscopic.
**BGO (**bismuth germanate):  More expensive, best stopping
-         power per unit mass, worse resolution
-         (about 20% FWHM at 1 MeV).  Chosen for shielding
-         or very-high-energy detection.  Easily machined,
-         non-hygroscopic

## Advantages of detectors from 100 keV to 10 MeV: Ge:

- Most expensive, requires cryogenic operation, superb
- energy resolution (about 0.3% FWHM at 1 MeV),
- worse stopping power above 500 keV
- Detector must operate < 100K so that electron/hole pairs aren't
- thermally excited.
- Purest material existing; low
- impurities allow lower
- "depletion" field.  Electrical
- contacts can be traditional
- diode (n-type, p-type implant)
- or simply conductive.
- Thermal/vacuum enclosure
- (cryostat) requires space,
- cost, design effort:

**Image: LLNL**

## Radiation damage in GeDs:

- Nuclear interactions of protons/neutrons/nuclei with
-    germanium atoms create lattice defects
- Lattice defects trap holes drifting through crystal, so charge is
-    not completely collected; result is a "tail" on the line:
- Annealing at ~100C
- results in removal of
- this effect; no one
- knows why.
- Culprit particles are
- cosmic rays (gradual),
- radiation-belt protons,
- SEP protons (most sudden, can be most intense)

## Other semiconductor detectors (room temperature):

- Cadmium telluride/ Cadmium zinc telluride (CZT):
-       Small crystals only (about 1cm3)
-       Higher "Z" than Ge, better stopping power
-       Worse resolution than Ge, better than scintillators
-       Very good for hard-x-ray-only work
- Silicon:
-       large wafers available, but thin (<= 1mm)
-       Medium resolution like CZT
-       Best for low energies (< 30 keV) or as a pair
-           tracker at high energies (> 30 MeV)
- All semiconductor detectors can be read out in
- strips or pixels for spatial resolution, division of
- count rates.  More demanding on electronics.

## Tasks of detector electronics:

- Peak identification (triggering)
- Amplification and shaping of pulse
- Energy measurement (analog-to-digital conversion)
- (Anti-) coincidence tagging and handling
- Time tagging
- Data storage
**Usual components, in order:**
- Preamplifier
- Shaping amplifier
- Peak detect
- A2D
- Computer

## Removing the effects of the instrument

- ("data reduction"):

- Channel-to-energy conversion (gain)
- Deadtime correction
- Pulse pileup (highest rates)
- Background subtraction
- Imperfect energy resolution
-     detector physics & electronics
- Incomplete energy collection
-     ("response matrix")

## Channel-to-energy conversion:

- Detector physics: either completely linear (semiconductor diode)
-     or modestly nonlinear in a predictable way (scintillator light)
- Electronics:
-     Temperature drifts
-     "integral nonlinearity"  -- nonlinearity across the scale
-     "differential nonlinearity" -- varying widths of nearby channels
- This is usually the most straightforward part of data reduction but
-     you have to ask:
-         Are there spectral lines you can use to calibrate?
-         Will you accumulate enough counts in the time that gain
-                might drift?
-         Do you need to include a calibration source onboard?
-         What precision do you need to do your science?

## Deadtime (livetime) correction:

- All detectors take a finite time to process an event; significant
-    issue for flares, where fluxes can be extremely high
-          **Intrinsic:**
**               **Semiconductor detectors: electron/hole drift times on
-                   order of 10 to 1000 ns.
-                Scintillators:
-                   Decay time of scintillation response -- NaI, 250ns,
-                      others more or less
-          **Electronic:**
-                 Best spectral resolution requires shaping of pulse
-                    to a width of a few microseconds
- Maximum throughputs vary from a few thousand to a few
-      hundred thousand c/s per detector; one solution is to
-      use many small detectors.
- Correcting from detected to corrected count rate fairly easy

## Pileup: 

**Pileup:**
- Two pulses close enough together get treated as one by
- electronics** OR** one pulse has its energy changed slightly
- by riding on the tail of another.  Unavoidable at some level.
- "Fast" electronics
- channel, without
- high energy
- resolution, can
- help reject a large
- fraction of pileup.
- The rest of the
- effect must be
- modeled.

## Sources of background

- Simulation of RHESSI background components by T. Wunderer

## Sources of background:

**Cosmic diffuse photons: **dominates unshielded or
-     wide-aperture instruments below ~ 100 keV
**Earth-atmospheric photons: **dominates an unshielded,
-     low-Earth orbit instrument above ~ 100 keV.  Strong
-     positron-annihilation line at 511 keV.  Due to interactions
-     of cosmic rays, therefore lowest near magnetic
-     equator
**Prompt cosmic-ray interactions in detectors:**  tend to
-     leave > 10 MeV in large detectors, little confusion with
-     solar photons
-                                                   continued.......

## Sources of background, continued:

**Prompt cosmic-ray interactions in the spacecraft: **
-     Similar spectrum to Earth-atmosphere component
**Direct interaction and bremsstrahlung from particles:**
**     **Huge, temporary backgrounds possible from SEPs
-      (outside magnetosphere) or radiation belts (inside).
-      Only an equatorial LEO is completely safe.
**Radioactivity: **delayed result of nuclear interactions of
-     cosmic rays; primary component is in the detector
-     itself, but lines can also be seen from surrounding
-     materials
**Natural radioactivity: **40K, U, Th isotopes occuring
-     naturally in the spacecraft.  Generally minor.
-     "Cleaner" materials (generally old) can be used.

## Coping with background:

- Scale of the problem:
-      a B-class microflare will dominate any background < 10 keV
-      an M-class flare will dominate any background < 30 keV
-      a large X-class line flare will dominate or at least compete
-           with background at all energies

## Coping with background: Reducing it

-        Passive shielding: blocks photons but can glow with
-              cosmic-ray secondaries just like the atmosphere
-        Generally useful only below 100 keV, to block cosmic photons
-        "Graded-Z" shielding: k-shell fluorescence from heavy shielding
-             element is blocked by a slightly lighter element, and so on....
-             RHESSI uses Ta/Sn/Fe/Al

## Coping with background: Reducing it

-        Active plastic scintillator shielding: tags incoming cosmic
-              rays; electronic veto during time of their prompt influence.
-              No effect on incoming gammas or delayed radioactivity.
-        Heavy active shielding (CsI, BGO, etc.): tags incoming
-              cosmic rays **and **blocks photons, but can create
-              intense local neutron environment, enhancing
-              detector radioactivity.
-        Best geometry is a "well" -- fewest leaks possible:

- INTEGRAL/SPI

- Your shield probably weighs
- several times what your prime
- detectors do -- Can you use it
- for science?  Is it your best
- investment of money and weight?

## Coping with background: Reducing it

-        Choice of orbit: low-Earth equatorial is best, followed by
-              orbit outside the magnetosphere.  Exposure to the
-              Earth's radiation belts is worst.  The belts touch the
-              atmosphere at the South Atlantic Anomaly.
-        SEPs give you a huge background when not protected by
-              the magnetosphere.  Can be a big problem for studying
-              large flares since they tend to come in bunches
-        Keep field of view and detector volume as small as possible
-              consistent with your science
-        Focus!  This allows you to connect a small detector with
-              a large collecting area.  Excellent for faint astrophysical
-              sources or nanoflares; could be deadly for large
-              flares due to deadtime & pileup

## Coping with background: Subtracting it

-        Good background subtraction is necessary but not sufficient:
-            if background is >> signal, Poisson fluctuations in
-            background can dominate errors even if the background
-            is 100% understood
-        When Poisson errors are small (many counts), background
-            systematic errors become important unless background
-            is negligible
-   In practice, time variability
-   makes pure modeling difficult;
-   subtract background taken
-   at an "analogous" time
-    RHESSI lightcurves, 2 hours,
-    showing bkg variation & flare

## Efficiency and off-diagonal response

- In the hard x-ray range, often only a correction of efficiency
- (effective area) versus energy is necessary:
- (counts/s/keV seen at E) / (effective area at E in cm2) =
-                                          photons/cm2/s/keV incident
- At high energies, many counts are often shifted to low energies
- instead of just lost, and this simple division becomes a matrix
- inversion instead.
- At very low energies, window absorption can be important.  This
- is normally just an efficiency correction.
- Subtlety:  Fluorescence escape from the crystal
- (say 13 keV --> 4 keV) can dominate true 4 keV stuff if the latter
- is strongly absorbed.

## Off-diagonal response:

**Off-diagonal response:**
- Recorded energy differs from photon energy.  Common reasons:
- Compton scatter before entering detector
- Compton scatter out of detector
- Fluorescence outside
- Fluorescence escape
- 511 keV escape
- Annihilation outside
- Energy resolution
- imperfect (always);
- only time count energy
- > photon energy

## High energy resolution 

- High energy resolution
- serves to make lines more
- identifiable; also reduces
- background for line
- identification.
- Naturally broad lines are
- more difficult to see even
- with a high resolution
- instrument.
- Off-diagonal (Compton)
- response is reduced both by
- more efficient detectors
- (higher Z, larger) and by
- active shielding, which
- suppresses outward
- Comptons as well as
- inward background (e.g.
- SMM/GRS vs RHESSI).

## Response matrix at low energies, annotated by H. Hudson

## Response matrix at high energies, annotated by H. Hudson

## Order of operations is important !

**Gain correction**
**Livetime & Pileup**

**Background**
**Subtraction**

**Response matrix **
**Deconvolution**

- These first: background spectra
- may not have same gain, livetime

- This next: background doesn't
- have same response characteristics

- This is last and hardest; analogous
-  to the inverse problem in imaging

## Given gain/livetime/pileup/background corrected

-     spectrum (count spectrum),  two routes to an
-     "instrument-free" photon spectrum:

**Count spectrum**

**Response matrix**

**Photon spectrum**

**THE DIRECT ROUTE:**

**DIRECT INVERSION**

**EMISSION **
**MODELS:**
**Electron spectra**
**Ion spectra**
**Angular distrib.**
**etc.**

**"DATA REDUCTION"**

**"DATA**
**  ****ANALYSIS"**

## THE DIRECT ROUTE is unfortunately very difficult;

**Response matrix**

**Model count**
** ****spectrum**

**THE DIRECT ROUTE **is unfortunately very difficult;
- can only be done for simple spectra with excellent
- counting statistics (see work by Johns-Krull, Piana,
- Kontar, Brown).  More usually, use **FORWARD FITTING:**

**CONVOLUTION**

**EMISSION **
**MODELS:**
**Electron spectra**
**Ion spectra**
**Angular distrib.**
**etc.**

**MINIMIZE CHI-SQUARE**

**DATA REDUCTION AND**
**ANALYSIS ARE COMBINED**

## Error propagation:

- For gamma-ray energies, Poisson statistics are the
- dominant error.  Limitations on using sqrt(N) for error:
-         You must do this in units of **raw counts only**,
-         not counts/s, not background subtracted counts
-         It's inaccurate for N<10 or so.  sqrt(N+1) is slightly
-         better but still no good for N<3.  Binning counts
-         to broader energy channels to get N ~ 10 is
-         favored by duffers but deplored by Bayesians.
- Remember to include error on background too.
- For x-rays, calibration uncertainties probably dominate.
- Errors propagated as usual.  Very nice compact book:
- A Practical Guide to Data Analysis for Physical Science Students, L. Lyons

## Example: RHESSI SPEX program (by R. Schwartz)

- Image by B. Dennis
- from "RHESSI
- Spectroscopy
- First Steps"

## Wheels not to reinvent:

-        Instrument response, solar and atmospheric
-          photon propagation:  GEANT3, GEANT4
-              http://wwwinfo.cern.ch/asd/geant/
-        Space radiation environment and doses: SPENVIS
-                  http://www.spenvis.oma.be/
-        Instrument background prediction: MGGPOD
-          (includes GEANT)
-        Cross-section lookup: NIST XCOM
-                  http://www.physics.nist.gov/PhysRefData/Xcom/Text/XCOM.html
-        Radioactivities, fluoresence, isotopes, etc.:
-                  http://ie.lbl.gov/toi/

- http://sigma-2.cesr.fr/spi/MGGPOD/