Hi @Andrew
thanks for the code to debug this, with a tiny extension we were able to track down what this is:
diff --git a/debugger.cpp b/debugger.cpp
index e106226..7ac398f 100644
--- a/debugger.cpp
+++ b/debugger.cpp
@@ -52,13 +56,13 @@ int debugger()
int count = 0;
for (auto &mcparticle : MCParticles)
{
- if (mcparticle->getParticleID() == 2112) {count++;}
+ if (mcparticle->getParticleID() == 2212) {count++;}
}
if (count >= 2)
{
std::cout << "*****************************************" << std::endl;
- std::cout << "Protons Found: " << count << std::endl;
+ std::cout << "Protons Found: " << count << " evt " << evt+1 << std::endl;
for (auto& mcparticle : MCParticles)
{
This gives us the event ID of a given event where the issue appears, e.g.:
*****************************************
Protons Found: 2 evt 9028
Particle ID: 2212
Local Start Position: (4.88646,4.12467,-0.1425) mm
Local End Position: (4.88647,4.12467,0.1425) mm
Self: 0x55f343bcdd30
Parent: 0
Particle ID: 2212
Local Start Position: (5.87754,4.04292,0.1425) mm
Local End Position: (6.05043,4.03337,-0.1425) mm
Self: 0x55f343ef8840
Parent: 0x55f343bcdd30
Now, knowing the initial random seed as well as the event ID, we can single out that one event and just run exactly that:
allpix -c Main.conf -o random_seed=8156334119563125231 -o skip_events=9027 -o number_of_events=1
Here, we configure the fixed starting seed, skip all events until the one in question, and then just run one. Now adding VisualizationGeant4
as a module, we can have a look at the event:
Or, in side view, with primary proton incident from the left:
So the situation is as follows:
- Initial proton incident from the left, crosses sensor and interacts with silicon
- After crossing, it undergoes a nuclear interaction with the PCB material behind the sensor, with lots of secondaries backscattering
- Some of these secondaries hit the sensor again, crossing from topside-to-backside (initial positive
z
axis, exiting at negative z
, creating the other particles (protons) which are linked to the initial one.
While the physics here is sane, the linking between the particles (i.e. the cseondary being linked to the initial proton) is somewhat unexpected because we should treat every particle that has been created outside the sensor as a primary - which we clearly fail to do here.
We’ll have a look at how to solve this properly… Thanks a lot!
Cheers,
Simon