e-, e+ primaries do not output EVTH when failing cuts in ELECTR-subroutine, bernlohr, eventio
version: 7.56 options: See config.h
Short
Find attached a steering_card.txt which will lead to a broken output-file run.eventio, although CORSIKA exits correctly. The issue seems to originate in the ELECTR() subroutine.
Details
For electrons or positrons with energies below 1 GeV, for certain combinations of primary-direction, observation-level, and magnetic field, the output-file of Cherenkov-bunches in eventio-format is missing the container of the beginning of the event (eventio-id: 1201, I think). I took a look, and I suspect this is not an issue in the bernloehr-packacge, but in CORSIKA. For the Cherenkov-bunch-output created in bernloehr/iact.c the callback-functions: [TELRNH(), TELEVT(), TELOUT(), TELEND(), TELRNE()] must be called in a particular order. The callback TELEVT() signals the beginning of an event. For particle-ids > 3, this is called early in the shower-loop in AAMAIN(). But for e.g. electron and positron this is called deep in CORSIKA/MAIN()/AAMAIN()/BOX3()/EM()/EGS4()/SHOWER()/ELECTR()/TELEVT(). In the ELECTR()-subroutine, particles are discarded when not fulfilling certain criteria as e.g. when they are not moving down, but up. All these cuts are implemented using GOTO to the labels [500, 390, 420, 421]. Now some of these cuts implement special treatment when the particle is the primary, i.e. FNPRIM == FALSE, in which case they GOTO label 498 where the propagation is ended and the TELEVT() callback is made. But not all of the cuts do treat the primary special. I identify, that CORSIKA's ELECTR()-subroutine is discarding some primary electrons and positrons without ever doing the TELEVT() callback, and thereby breaking the correct order of callbacks. I think the physics is all done correct, only the output-file is missing something. From my understanding, all the cuts implemented in ELECTR() going to the labels [500, 390, 420, 421], should treat the primary particle special, and first GOTO label 498 in order to ensure that TELEVT() is called. This modification lead to the expected behaviour of CORSIKA in my test-cases. I reported this on 2020-01-22 10:57 via email.
Cheers from Heidelberg, Sebastian A. Mueller