From f1988b5579dd00ae27ad5c6f089881d8ee5e6248 Mon Sep 17 00:00:00 2001
From: tomeichlersmith <eichl008@umn.edu>
Date: Thu, 26 Oct 2023 15:27:31 -0500
Subject: [PATCH] longer comment about process ordering

trying to point future developers in the right direction
---
 src/SimCore/GammaPhysics.cxx | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/SimCore/GammaPhysics.cxx b/src/SimCore/GammaPhysics.cxx
index b75bf48..ed65361 100644
--- a/src/SimCore/GammaPhysics.cxx
+++ b/src/SimCore/GammaPhysics.cxx
@@ -31,7 +31,24 @@ void GammaPhysics::ConstructProcess() {
       modelParameters);
   pn->removeExistingModel(processManager);
   pn->ConstructGammaProcess(processManager);
-  // put the PN process first in the ordering in case PN biasing is happening
+  /**
+   * Put the PN process first in the ordering in case PN biasing is happening.
+   *
+   * Process ordering is a complicated concept and unfortunately
+   * its affect on biasing is poorly documented. What has been said is
+   * that some processes _need_ to be called _last_[1]. In addition,
+   * the practical experience of working on defining a custom
+   * process for
+   * [G4DarkBreM](https://github.com/LDMX-Software/G4DarkBreM)
+   * showed that sometimes Geant4 does
+   * not get through the full list of processes but it always starts
+   * at the beginning. For these reasons, we put the PN process first
+   * in the ordering so that we can insure it is always check by Geant4
+   * before continuing.
+   *
+   * [1]
+   * https://indico.cern.ch/event/58317/contributions/2047449/attachments/992300/1411062/PartDef-ProcMan-AS.pdf
+   */
   const auto processes{processManager->GetProcessList()};
   for (int i{0}; i < processes->size(); i++) {
     const auto process{(*processes)[i]};