- edited description
Read routine for BANK32A
Hi everyone,
I am currently working with the new BANK32A format. Unfortunately the rootana Framwork is not able to read this banks. I guess this can be fixed by adding this lines into the midasio.cxx (around line 800) file from the midasio repository. I also create a pull request #1.
} else if (e->bank_header_flags & (1<<5)) {
b->type = GetU32(&e->data[pos+4+0]);
b->data_size = GetU32(&e->data[pos+4+4]);
data_offset = pos+4+4+4+4;
I am wondering if this is enough to fix this issue. For me I could read the bank header information and the analyzer found the bank name etc.
My analyzer is the one Frederik is using after the discussion in the forum: https://midas.triumf.ca/elog/Rootana/35
Cheers,
Marius
Comments (9)
-
reporter -
reporter - edited description
-
reporter - edited description
-
I have not used the BANK32A format, so I can’t test this directly. But this doesn’t look correct to me. The documentation
https://midas.triumf.ca/MidasWiki/index.php/Event_Structure
seems to imply that both bit 4 and bit 5 of the flag field will be set for the BANK32A format. Indeed, that seems to be what is set when doing bk_init32a:
void bk_init32a(void *event) { ((BANK_HEADER *) event)->data_size = 0; ((BANK_HEADER *) event)->flags = BANK_FORMAT_VERSION | BANK_FORMAT_32BIT | BANK_FORMAT_64BIT_ALIGNED; }
So it seems that your modified code is still just picking up the BANK32 format, rather than the BANK32A.
Does your fix work? I would have thought that it would find the first BANK32A bank in an event but not find subsequent banks.
-
reporter Sorry, you are correct the check is wrong. I cant use bk_init32a in my setup since all the MIDAS banks are generated on an FPGA already and then just copied into the MIDAS buffer. And I was misunderstanding the documentation. I thought for the flags I need to set 5th bit to 1, 4th bit to 0 and bit 0th to 1. Than I have 0x21 here and the check is true. But actually the bank type is wrong and the check will not work when using bk_init32a. The flag should be actually 0x31 so the fix should be something like:
if (e->bank_header_flags >> 4 == 0x3) { b->type = GetU32(&e->data[pos+4+0]); b->data_size = GetU32(&e->data[pos+4+4]); data_offset = pos+4+4+4+4; } else if (e->bank_header_flags & (1<<4)) { b->type = GetU32(&e->data[pos+4+0]); b->data_size = GetU32(&e->data[pos+4+4]); data_offset = pos+4+4+4; } else { b->type = GetU16(&e->data[pos+4+0]); b->data_size = GetU16(&e->data[pos+4+2]); data_offset = pos+4+2+2; }
-
I confirm, ROOTANA was never updated to use the bank 32a format. Just by coincidence, I was going to work on this today, as I am changing the TMFE frontend to always generate data in the bank 32a format.
So it is great that you looked at the code and worked out a fix. I will add it to rootana as soon as possible.
K.O.
-
getting there slowly. added bank 32a format generator to the event fuzzer in fetest. K.O.
-
hmm…. took longer than expected, but done. and I implemented a slightly different test, more consistent with the test in midas.cxx: first we check bit 1<<5 for bk32a format, then we check bit 1<<4 for bk32 format then we assume bk16 format. not the best, but this is what all the bk_foo() functions do in midas.cxx. Also added same fix in ROOTANA TMidasEvent.cxx. K.O.
-
- changed status to resolved
- Log in to comment