km3dq_common.common_library

Functions

get_file_paths(dataset, qaqc_proc_version[, ...])

For a given dataset / detector, returns the path for various files:

get_run_properties_from_db(det[, filt])

Retrieve run properties from the database with the km3db package

get_run_properties_from_qaqc(dataset, dq_tag[, ...])

For a given dataset/detector, returns the run numbers, their lengths,

get_last_n_weeks_runs_qaqc(dataset[, nweeks])

Extract the all runs acquired in the last nweeks of running

get_full_detector_name(options[, key])

Get the full detector name with the prefix (D0, D_...)

get_det_id(dataset)

Return the detector id

get_site(det)

Returns the site (ORCA or ARCA)

get_active_dus_range(det)

Retrieve the range of DU active

get_nb_qaqc_variables(qaqc_vers)

Retrieve the number of variables in the QAQC file

create_ttree_from_qaqc(det, var_to_fill, source, tag)

Create a ttree from qaqc sftp file and defect variables stored on git

compute_veto_qscore(var_prop, var_val)

Computes the veto/Q-score for a detector/tag using a QAQC source.

log_run_range(det, run_0, run_1, log_file)

Write the run range and run list on disk

read_qaqc_file(det[, source, qaqc_proc_version])

sftp QAQC file reading

decode_source_byte(value, v_prop)

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_det_id(dataset)[source]

Return the detector id

km3dq_common.common_library.get_site(det)[source]

Returns the site (ORCA or ARCA)

km3dq_common.common_library.get_active_dus_range(det)[source]

Retrieve the range of DU active

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

km3dq_common.common_library.read_qaqc_file(det, source='qaqc_sftp', qaqc_proc_version='')[source]

sftp QAQC file reading

km3dq_common.common_library.decode_source_byte(value, v_prop)[source]

Decode the source of degradation stored in the TTree NB: the source is either a QAQC variable either a defect type ((“daq”, “operation”…)