![]() |
ATLAS Offline Software
|
Functions | |
| fetch_calib_data (server, tag, run, lumi, channels) | |
| process_channel_list (channel_list) | |
| output_filename (args) | |
| save_calib_data_to_file (blobs, output_file, requested_channels=None) | |
| setup_argparser () | |
Variables | |
| log = getLogger("CopyBlobFromCrest") | |
| logLevel = logging.DEBUG | |
| log1 = getLogger("TileCalibTools") | |
| str | schema = 'CREST' |
| args = setup_argparser() | |
| payload_data | |
| ofile = output_filename(args) | |
@author Laura.Sargsyan@cern.ch 2025-04-16
CopyBlobFromCrest.py - Tool for retrieving TileCal calibration data from CREST
Description:
------------
This script connects to the CREST service to fetch calibration data (blobs) for TileCal. Users can specify which calibration tag, run number, luminosity
block, and channels to retrieve for fine-grained control of the data. The fetched calibration data is then saved into a JSON file whose name typically
includes metadata such as the tag, run, and luminosity block.
Command-line Parameters:
-----------------------
-s, --server
CREST server URL. Default: http://crest-j23.cern.ch:8080/api-v5.0
-t, --tag
Calibration tag to fetch from CREST (e.g., TileOfl02CalibCes-RUN2-UPD4-29). Default: TileOfl02CalibCes-RUN2-UPD4-29)
-r, --run
The run number. Default: 2147483647 (retrieves the latest IOV).
-l, --lumi
Luminosity block number. Default: 0
-c, --channel
Space or comma-separated list of COOL channel IDs to retrieve (e.g., 0,1,2). Default: [0..275] plus channel 1000.
-o, --output
Output filename (JSON). If omitted, a default is generated, typically
structured as: <tag>.<run>.<lumi>.json. For example: UPD4.2147483647.0.json
Usage Example:
--------------
python CopyBlobFromCrest.py --tag TileOfl02CalibCes-RUN2-UPD4-29 --channel 0,1,2 --output fetched_data.json
What the Script Does:
---------------------
1. Connects to the specified CREST service (-s/--server).
2. Fetches calibration data (blobs) for the given tag, run, lumi block,
and channels.
3. Saves the data into a JSON file with a filename either provided via
--output or auto-generated from the tag, run, and lumi.
The output JSON file stores the calibration data keyed by the channel IDs.
Each channel’s data includes the calibration blob(s) retrieved from CREST.
| CopyBlobFromCrest.fetch_calib_data | ( | server, | |
| tag, | |||
| run, | |||
| lumi, | |||
| channels ) |
Fetch calibration data from TileBlobReaderCrest.
Args:
server (str): CREST server URL.
tag (str): Tag identifying the calibration data.
run (int): Run number to fetch data for.
lumi (int): Lumi block to fetch data for.
channels (list of int): List of COOL channel numbers.
Returns:
list: List of calibration data entries retrieved.
Definition at line 68 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.output_filename | ( | args | ) |
Definition at line 121 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.process_channel_list | ( | channel_list | ) |
Process a list of channel identifiers, handling comma-separated values. Args: channel_list (list): List of channel identifiers, which may contain comma-separated value Returns: list: Processed list of individual channel identifiers
Definition at line 101 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.save_calib_data_to_file | ( | blobs, | |
| output_file, | |||
| requested_channels = None ) |
Save fetched calibration data to a file.
Parameters:
-----------
blobs : dict containing calibration data blobs
output_file : str Path to the output file where data will be saved
requested_channels : list, optional
List of specific channels to include in the output file.
If None, all channels from the blobs will be included.
Definition at line 142 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.setup_argparser | ( | ) |
Set up command-line argument parser.
Returns:
argparse.ArgumentParser: Configured argument parser
Definition at line 177 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.args = setup_argparser() |
Definition at line 230 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.log = getLogger("CopyBlobFromCrest") |
Definition at line 60 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.log1 = getLogger("TileCalibTools") |
Definition at line 64 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.logLevel = logging.DEBUG |
Definition at line 61 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.ofile = output_filename(args) |
Definition at line 244 of file CopyBlobFromCrest.py.
| CopyBlobFromCrest.payload_data |
Definition at line 235 of file CopyBlobFromCrest.py.
| str CopyBlobFromCrest.schema = 'CREST' |
Definition at line 66 of file CopyBlobFromCrest.py.