Bug #407

Setting CODA version for files filtered with EVIO 4

Added by Robert Michaels almost 2 years ago. Updated almost 2 years ago.

Status:NewStart date:08/08/2018
Priority:NormalDue date:09/07/2018
Assignee:Robert Michaels% Done:

100%

Category:-Estimated time:5.00 hours
Target version:1.7Spent time:8.10 hours
Responsible:R. Michaels

Description

The decoding depends on the CODA version, 2 and 3 are quite different. Unfortunately, there is no easy way to tell what CODA version was used, except from the structure of the data, e.g. the Prestart event looks different. The easiest rule is that all CODA 2 files used EVIO <= 3 and all CODA 3 files used EVIO >= 4. If the files were generated by CODA ! And its easy to tell what EVIO version was used. This was done (see issue 274), but there was a Time Bomb. Steve Wood took some CODA 2 data files, filtered them, and wrote them out with EVIO 4, which makes sense since its a modern version of EVIO. Unfortunately, this led to segmentation faults with Podd. I'm working on this now. When the segfault occurs on his files, I warn the user to run->SetCodaVersion(2) in the analyzer script. It's not great, but better than nothing. That public "Set" method seemed straightforward, except that the initial THaRun object is deleted in the analyzer and a new THaRun is made, so the "Set" state is not propagated. (Naively, I thought one CODA file is one run, but I guess not and I'm sure there's a good reason.) I'm working through this now. Basically we need a public "SetCodaVersion" method which over-rides the version discovered from the data file, and the version needs to persist through the complicated life of objects in the analyzer.

History

#1 Updated by Robert Michaels almost 2 years ago

The place to over-ride the CODA version in the analyzer script:

analyzer->SetCodaVersion(2);
instead of using run->SetCodaVersion

Regarding warning the user:

Prior to the seg fault that was mentioned in the bug Description, there is now an error message.
It's a little obscure and you'd rather not have a segfault period, but at least this may give a clue.

****ERROR: Trigger and Physics Block sizes do not match (4 != 39321)
This might indicate a file written with EVIO 4 that was a CODA 2 file
Try analyzer->SetCodaVersion(2) in the analyzer script.

**Break ** segmentation violation

#2 Updated by Robert Michaels almost 2 years ago

  • % Done changed from 30 to 100

I believe this issue has been solved. I tested it on several files, including some of Steve's. I have made a Pull request.

#3 Updated by Robert Michaels almost 2 years ago

The branch is "setcodavers"

Also available in: Atom PDF