km3dq_common.common_library¶
Functions¶
|
For a given dataset / detector, returns the path for various files: |
|
Retrieve run properties from the database with the km3db package |
|
For a given dataset/detector, returns the run numbers, their lengths, |
|
Extract the all runs acquired in the last nweeks of running |
|
Get the full detector name with the prefix (D0, D_...) |
|
Return the detector id |
|
Returns the site (ORCA or ARCA) |
|
Retrieve the range of DU active |
|
Retrieve the number of variables in the QAQC file |
|
Create a ttree from qaqc sftp file and defect variables stored on git |
|
Computes the veto/Q-score for a detector/tag using a QAQC source. |
|
Write the run range and run list on disk |
|
sftp QAQC file reading |
|
Decode the source of degradation stored in the TTree |
Module Contents¶
- km3dq_common.common_library.get_file_paths(dataset, qaqc_proc_version, runnumber=0, jra_proc='')[source]¶
For a given dataset / detector, returns the path for various files: JMonitor, JDataQuality, JRunAnalyzer The run number and jra_proc are relevant only for the JRunAnalyzer files jra_proc: - priv: analysis level = 1, patches to TH2D coding to recompute the mean/RMS of PMT rates
- km3dq_common.common_library.get_run_properties_from_db(det, filt='PHYS')[source]¶
Retrieve run properties from the database with the km3db package
- km3dq_common.common_library.get_run_properties_from_qaqc(dataset, dq_tag, origin='qaqc_sftp', startrun=0, endrun=1000000000.0)[source]¶
For a given dataset/detector, returns the run numbers, their lengths, time counter… A dataset may be restricted to a user-defined run range When using the create_ttree_from_qaqc function, a check on the QAQC file is performed Source: QAQC file or JDataQualityFile
- km3dq_common.common_library.get_last_n_weeks_runs_qaqc(dataset, nweeks=2)[source]¶
Extract the all runs acquired in the last nweeks of running
- km3dq_common.common_library.get_full_detector_name(options, key='detector')[source]¶
Get the full detector name with the prefix (D0, D_…) when there is no ambiguity
The input is the options dict. NB: options[‘detector’] can be either a single list either a list of detector/strings.
- km3dq_common.common_library.get_nb_qaqc_variables(qaqc_vers)[source]¶
Retrieve the number of variables in the QAQC file NB: in a near future, the det argument should be replaced by a Jpp version === Arguments === - det : detector name - [string] - Ex: “D0ARCA021”, “D0ORCA018”…
=== Output === - Number of QAQC variables
- km3dq_common.common_library.create_ttree_from_qaqc(det, var_to_fill, source, tag, append_veto_qsco=False)[source]¶
Create a ttree from qaqc sftp file and defect variables stored on git It includes some advanced check about the QAQC file integrity. === Arguments === - det : detector name - [string] - Ex: “D0ARCA021”, “D0ORCA018”… - var_to_fill : QAQC variables or defect to fill - [array of string] -
Ex: [‘run’, ‘timestampdiff’, ‘def_operation’, ‘def_oos’]
source : QAQC source, a priori “qaqc_sftp” - [string]
- tagdata-quality tag (not its name) as created by
configure_dataquality_tag
append_veto_qsco: append the veto and Qscore - [boolean]
=== Output === - TTree - Error log
- km3dq_common.common_library.compute_veto_qscore(var_prop, var_val)[source]¶
Computes the veto/Q-score for a detector/tag using a QAQC source.
- km3dq_common.common_library.log_run_range(det, run_0, run_1, log_file)[source]¶
Write the run range and run list on disk