...

- For each MCIntegratingHit including particles with Z > 1, store:
- Flag indicating Z > 1 present
- Ein for each particle with Z > 1
- Eout for each particle with Z > 1
- Z for each particle with Z > 1

- If, in a single MCIntegratingHit (i.e. for one "cell" in a single xtal), there are N particles with Z > 1:
- Wiki MarkupE ~effective~ = \[E ~IHit~ \- (? ~i~ (E ~in i~ \- E ~out i~ ))\] +
? ~i~ \[(E ~in i~ \- E ~out i~ ) × Q((E ~in i~ + E ~out i~)/2 , Z ~i~ )\] \[1\E
_{effective}= [E_{IHit}- (?_{i}(E_{in i}- E_{out i}))] +

?_{i}[(E_{in i}- E_{out i}) × Q((E_{in i}+ E_{out i})/2 , Z_{i})] [1] - E
_{effective}is the "apparent" energy deposited in the integrating hit i.e. the energy that actually contributes to the measured signal. Alternatively, it is the energy as represented by the scintillation light produced, that is, corrected for variations with E and Z in scintillation light production per unit energy - E
_{IHit}is the energy deposited in the integrating hit, as generated by GLEAM - Q(E,Z) is the quenching correction as a function of E and Z, assumed here = 1 for Z = 1
- This formulation assumes that all energy from ionization is deposited locally i.e. that the contribution from longer range delta electrons is negligible
- This assumption has to be tested!
- Note that violation of this assumption causes errors in quenching correction, not errors in deposited energy directly

- The first term in \ [1\] is the (approximate) contribution of Z = 1 particles
- Wiki MarkupThe second term in \ [1\] is the the sum of contributions from all Z > 1 particles contributing to this integrating hit (i.e. in this cell), corrected for quenching

- Wiki MarkupE ~effective~ = \[E ~IHit~ \- (? ~i~ (E ~in i~ \- E ~out i~ ))\] +
? ~i~ \[(E ~in i~ \- E ~out i~ ) × Q((E ~in i~ + E ~out i~)/2 , Z ~i~ )\] \[1\E
- Note that, due to delta electrons traveling from cell to cell, it is possible for E ~IHit~
_{IHit}< ? ~i~_{i}(E ~in i~ \- E ~out i~ ) in which case we should assume that all energy in the hit is due to Z > 1 ions and, instead of \[1\] use:_{in i}- E_{out i}) in which case we should assume that all energy in the hit is due to Z > 1 ions and, instead of [1] use:- E
_{effective}= E_{IHit}× ?_{i}[Q((E_{in i}+ E_{out i})/2 , Z_{i}) × (E_{in i}- E_{out i})] / ?_{i}(E_{in i}- E_{out i}) [2] - [2] is just the sum of ion energies modified by quenching as above and weighted by their "deposited"
Wiki Markup `E ~effective~ = E ~IHit~ × ? ~i~ \[Q((E ~in i~ + E ~out i~ )/2 , Z ~i~) × (E ~in i~ \- E ~out i~ )\] / ? ~i~ (E ~in i~ \- E ~out i~) \[2\]`

- Wiki Markup\[2\] is just the sum of ion energies modified by quenching as above and weighted by their "deposited" energy
- Once again, this is only approximate due to the assumption of local energy deposition

- E