Task #550

Rewrite libsbsdig

Added by Eric Fuchey 3 months ago. Updated 18 days ago.

Status:ResolvedStart date:08/28/2020
Priority:ImmediateDue date:
Assignee:Eric Fuchey% Done:

40%

Category:-Spent time:141.00 hours
Target version:-
Responsible:Eric Fuchey

Description

libsbsdig needs to be rewritten for simplicity and speed.
Key features: * Instead of a library to be called by a script, it becomes a standalone program taking a few arguments for input, thus becoming much easier to use. * The program will just use the tree from the G4SBS input file, and expand it to add ADC and TDC values.
The structure of the program is exposed on the attached file. This structure is of course not definitive, but the idea is to deviate from this structure as little as possible.
(Note: the enemy is not the number of classes in itself, but useless intermediate classes layered in between the core classes).

First caveats: * so far, the program is still using the feature of background superimposition to signal from actual background files. * while the class hierarchy should be left lightweight, it is also preferable not to overextend the main itself, so some of the work will have to be made in separate functions, preferably in separate auxilliary files.

libsbsdig_newstructure.pdf - new structure for libsbsdig (70.1 KB) Eric Fuchey, 08/19/2020 12:36 AM


Subtasks

Feature #572: Add randomized background hits as an alternate of superim...In ProgressEric Fuchey

Task #600: sbsdig_lw completionIn Progress

History

#1 Updated by Eric Fuchey 3 months ago

libsbsdig needs to be rewritten for simplicity and speed.
Key features: * Instead of a library to be called by a script, it becomes a standalone program taking a few arguments for input, thus becoming much easier to use. * The program will just use the tree from the G4SBS input file, and expand it to add ADC and TDC values.
The structure of the program is exposed on the attached file. This structure is of course not definitive, but the idea is to deviate from this structure as little as possible.
(Note: the enemy is not the number of classes in itself, but useless intermediate classes layered in between the core classes).

First caveats: * so far, the program is still using the feature of background superimposition to signal from actual background files. We might want to switch to a more time efficient system.

  • while the class hierarchy should be left lightweight, it is also preferable not to overextend the main itself, so some of the work will have to be made in separate functions, preferably in separate auxilliary files.

#2 Updated by Eric Fuchey 3 months ago

  • % Done changed from 10 to 20

Implemented the new output (which is an extension of the input file tree) according to the description in the documentation:
https://redmine.jlab.org/projects/sbs-software/wiki/Documentation_of_libsbsdig#Root-output-documentation
It has to be decided whether we directly modify the input file or if we require the program to make a copy of the file before modifying it.
Doing so would take about an hour.

#3 Updated by Eric Fuchey 3 months ago

  • Status changed from New to In Progress
  • % Done changed from 20 to 70

Edited the core digitization functions for the PMT detectors, and rewrote the PMT detector classes so they are simpler and more generic.
The code for HCal is now simpler.
The function to fill the output vector from the detectors is implemented - but it seems slow (over 2min for ~50k events instead of ~1min before) for some reasons.

#4 Updated by Eric Fuchey 3 months ago

Added all structures and implemented data flow for the GEM digitization. In debugging...

#5 Updated by Eric Fuchey 3 months ago

  • Status changed from In Progress to Resolved

The many bugs affecting the GEM digitization in lisbsdig have now been fixed. The GEM output is sensible and written correctly in the branches.
The speed took another hit as a result (down to slightly under 200Hz) but I suspect it can be improved (but I suspect is is not as urgent compared to sampling the background and rewrite the SBSSimDecoder.

Also available in: Atom PDF