Muon Calibrator refactoring
Summary
I plan to refactor the whole muon throughput routine to be more efficient and to satisfy our current goals.
Main changes:
-
First of all, I propose slightly refactoring again the
throughput_calibrator
. Let's make all calibration work including handling exceptions and DB/ecsv population in theMuonCalibrator
. Sothroughput_calibrator
should (see also figure below):- Initialise
MuonCalibrator
with the correct config and input file - Call the method
calibrate
- Receive the information about exceptions handled by
Calibrator
and return to theWorkload
correct exit status.
- Initialise
-
Refactor
calibpipe.throughput.throughput_containers
because they contain redundant containers, i.e.- In fact, we need only one container, that will contain only fields that will be uploaded to DB, and regarding current naming, this is
TelescopeOpticalThoughtputContainer
. This container contains information about obs_id and tel_id so I would delete the other two containers related toobs_id
andtel_id
, and subsequently rename this container to justOpticalThroughputContainer
.
- In fact, we need only one container, that will contain only fields that will be uploaded to DB, and regarding current naming, this is
-
Now let's deal with a
MuonCalibrator
. I think it is working not efficiently and with a redundant number of methods. For example:- It performs calculations for every telescope in every event, then stores not full information in some intermediate table, then checks for what telescope we can calculate efficiency (
good_muon_data
), then for each telescope calculates mean values and stores them in another container, and then uploads child container to DB. - My idea is
- to perform calculations only for the telescopes that have
good_muon_data
(in that way drastically reduce the number of calculations for multi-telescope event files) - make the intermediate table that stores results to look the same as in DB (in that way it will be easier to upload the data to DB - we will only need to perform
mean
/std
/etc. operations to all rows in the table for each telescope) - overally reduce the number of methods and make the code much clearer
- to perform calculations only for the telescopes that have
- It performs calculations for every telescope in every event, then stores not full information in some intermediate table, then checks for what telescope we can calculate efficiency (
What is the expected correct behavior?
Relevant logs and/or screenshots
Schematic view of how the calibration pipeline should look from my view: