Closed saikatxdas closed 2 years ago
Could you please add a minimal example that is able to reproduce that behavior. With the provided information we cannot provide any help.
Thank you for your reply. Yes, I have attached a working script emsim.txt
Here, the SN0 values generated seem erroneous. Because particles with the same SN0 must have the same E0. Here, they differ.
I finally found some time to look into this.
Have you checked what happens if you use a TextOutput for your electrons, too?
# Observer for EM particles
out2 = TextOutput('em_part.txt', Output.Event1D)
out2.enable(Output.SerialNumberColumn)
obs2 = Observer()
obs2.add(ObserverDetectAll())
obs2.add(ObserverNucleusVeto())
obs2.onDetection(out2)
In this case, I get around 8500 unique parent serial numbers (SN0 or SN1) for all observed electrons, which seems reasonable to me.
Do not forget to close both outputs after the simulation, when using jupyter notebooks or similar tools for your simulation.
@saikat8018 could you try to explicitly set the constructor arguments of the ParticleCollector
ParticleCollector(int(1e6), False, False)
and keep the rest of your script the same? For me it is working in this case.
Which brings me to the question: Why does it make a difference if I set the default arguments explicitly? Does someone have an idea?
Here is also a smaller script that is able to reproduce this issue.
@TobiasWinchen and @adundovi is this related to #244?
@saikatxdas can you confirm that my work-around by explicitely setting the arguments, does what you want?
@lukasmerten Sorry for not following it up earlier. Yes, I have checked it now on CRPropa 3.1.7 and it works. Thank you for your help. This indeed works
Hi,
I have a usage question. I am trying to track which EM secondaries are produced from which primary UHECR using
ParticleCollector()
but I end up gettingSN0
column to be 448 for all the rows. I am using something like this.ObserverDetectAll()
should detect the particles as soon as they are produced. But how come all of them have the sameSN0
in out2?