### Applying Quenching Corrections in CalDigi

- 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:
- 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
- The 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

- Note that, due to delta electrons traveling from cell to cell, it is possible for E
_{IHit} < ? _{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:
- 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" energy
- Once again, this is only approximate due to the assumption of local energy deposition

{"serverDuration": 50, "requestCorrelationId": "6ae64a8daa53d1d5"}