ADD: TRA data loader and tra file fixes - #210
Conversation
fhagemann
left a comment
There was a problem hiding this comment.
I updated megalib locally and ran the unit tests on my computer, and all tests passed.
I also manually confirmed that all bad flags that can be written by MReadOutAssembly::StreamBDFlags are covered in the new MModuleLoaderMeasurementsTRA::AnalyzeEvent here.
| Event->SetTime(PhysicalEvent->GetTime()); | ||
| Event->SetTimeUTC(PhysicalEvent->GetTime()); |
There was a problem hiding this comment.
Time and TimeUTC is the same? Do we need both or could this be cleaned up?
There was a problem hiding this comment.
MEGAlib just has time - I want to keep MEGAlib that way, because there is no fixed meaning what time is - it all depends on the context.
| Hit->SetPositionResolution(PhysicalHit.GetPositionUncertainty()); | ||
| Hit->SetEnergy(PhysicalHit.GetEnergy()); | ||
| Hit->SetEnergyResolution(PhysicalHit.GetEnergyUncertainty()); |
There was a problem hiding this comment.
Category code clean-up: in the future, we might want to use either Resolution or Uncertainty consistently and avoid mixing both terms to denote the same thing.
There was a problem hiding this comment.
It should be uncertainty and not resolution, correct.
If they are the same thing depends on context: Imaging a multimeter with display 00.00 V: it has a resolution of 0.01 V but might have a measurement uncertainty of +-2%
| } | ||
|
|
||
| // Hits: Compton events carry their hit sequence, photo events a single position and energy | ||
| if (PhysicalEvent->GetNHits() > 0) { |
There was a problem hiding this comment.
Here you're trying to find Compton events, so shouldn't GetNHits > 1 to filter out Photo events, or, better yet, why not if (PhysicalEvent->GetType() == MPhysicalEvent::c_Compton)?
There was a problem hiding this comment.
I made the code nicer.
|
I also added a new unit test data set which is from DC4 for test conversion. |
|
And i did a test conversion to L2 - looks OK |
*** NEEDS MEGALIB UPDATE ***
New tra file loader for DC5 data conversion.
Some newly discovered issues in MEGAlib lead to new tra files for the unit tests (BD flags and hits where not handled correctly under all circumstances).