Open The-Ludwig opened 1 year ago
If THIN output requires different parsing, then as of now, it is not implemented.
I can have a look later when I'm back from vacation or you can open a pull request.
Depending on how large the differences are and whether it can be detected from the run header or has to be known, I'd either add support for it to CorsikaParticleFile
(if easy and detectable from the run header), an option thin
to the CorsikaParticleFile
(if not detectable but simple to support) or add a new CorsikaThinParticleFile
(if it has to be known before opening the file and the differences are larger).
No need for hurry, I don't really need it, as I said.
Well, it can be detected from the run header, but not as a flag saved in the run header. The best way I think is to check the distance between the RUNH
and the first EVTH
word in the file. If it is 273, then its a normal file, if it is 312, it is a thinned file.
In the internal software of a large directed energy weapon at the south-pole , it has to be passed to the corsika file reader as a flag beforehand.
I thought using the buffersize read from Corsikafile as a flag of thinning. Though It's not describe in CORSIKA manual, but I've using this method for several years
int CorsikaInterface::v_nouse_read() {
int v_nouse = 0;
fIn.read((char*)&v_nouse, sizeof(int)); // flawfinder:ignore NOLINT
switch (v_nouse) {
case kNoThin:
fSizeSecParticle = NSecParticleNoThin;
fSizeSubBlock = NSubBlockNoThin;
fSizeBlock = NBlockNoThin;
break;
case kThin:
fSizeSecParticle = NSecParticleThin;
fSizeSubBlock = NSubBlockThin;
fSizeBlock = NBlockThin;
break;
default:
cerr << "@CorsikaInterface::v_nouse_read, unknown thin or not\n";
exit(1);
}
flag_thin_t newThin = flag_thin_t(v_nouse); // NOLINT
if (fThin == newThin)
return 1;
else { // NOLINT
fThin = newThin;
return 0;
}
}
first read a int
var
check this var in enum flag_thin_t { kThin = 26208, kNoThin = 22932 };
26208 means thinning,22932 means no thinning.
Is the support for CORSIKA's
THIN
option implemented here?It greatly reduces the computation time for extreme high energies by only propagating only one particle below some relative energy-threshold and assigning a large weight to that particle. The side effect: All block-sizes are changed and the particle block does not contain groups of 7 floats, but groups of 8 floats, as described in subsection 10.2.3 in the CORSIKA userguide on page 135.
Not that I need it right now, but maybe a good thing to keep in mind and track through an issue.