Skip to content

Resolve "Use SDC library"

Renat Dusaev requested to merge 111-sdc-integration into master

Closes #111 (closed)

This MR makes SDC to linked as a library instead of header. Besides of reduction of the number of header files included in the p348reco.h, this change mainly opens a way for better testing (UTs with code coverage) and more transparent loading.

From user's point of view the changes are negligible (same ./build.sh).

One thing that, I believe, may be interesting for @acelenta and others who work with calibration data files: new distribution scheme provides a Python script capable of some basic querying on the data loaded. The data printed by this script follows loading process exactly. To demonstrate: after usual ./build.sh is finilized, run make sdc-inspect.exe to get the loader executable and then run:

$ python3 ../sdc/inspect_sdc.py -r ./sdc-inspect.exe -k 5563 -cname=ECAL0 -d conddb/calib/ 

c                                         factor-in-use  peakpos  time timesigma  x  y
srcID                        lineNo name                                              
conddb/calib/2021mu/ecal.txt 22     ECAL0    4.0000e+00  525.538   NaN       NaN  0  0
                             23     ECAL0    4.0000e+00    569.9   NaN       NaN  0  1
                             24     ECAL0    4.0000e+00  570.864   NaN       NaN  0  2
                             25     ECAL0    4.0000e+00  508.983   NaN       NaN  0  3
                             26     ECAL0    4.0000e+00  568.936   NaN       NaN  0  4
                             27     ECAL0    4.0000e+00   628.00   NaN       NaN  0  5
                             28     ECAL0    4.0000e+00  506.245   NaN       NaN  1  0
                             29     ECAL0    4.0000e+00  565.383   NaN       NaN  1  1
... (I omitted some output for brevity)
                             119    ECAL0           NaN      NaN  150.       10.  4  2
                             120    ECAL0           NaN      NaN  150.       10.  4  3
                             121    ECAL0           NaN      NaN  150.       10.  4  4
                             122    ECAL0           NaN      NaN  150.       10.  4  5

(one has to have the Python pandas available, so some LCG should be probably loaded) The printed table provides the calib data loaded for certain run (given with -k). One can query various sub-detectors/cells with -cx=2 -cy=3, see full loaded sample by omitting all the -c args, sort by certain column, etc. If current command line interface is inconvenient, I can write a short wrapper script. To my mind, this addition should simplify management of the newly added calibration data and complex cases (like changing factors).

Merge request reports