From 25e708fbd3ede6e747f5ac7de4caf456f60448f4 Mon Sep 17 00:00:00 2001 From: Ehevi Date: Wed, 26 Jul 2023 14:34:35 +0200 Subject: [PATCH] Energy mapping --- app/config/rct-data/index.js | 4 ++-- .../beamTypeMapping.js} | 4 ++-- app/config/rct-data/mapping/energyMapping.js | 22 +++++++++++++++++++ .../ServicesDataCommons.js | 2 +- 4 files changed, 27 insertions(+), 5 deletions(-) rename app/config/rct-data/{beamTypesMappings.js => mapping/beamTypeMapping.js} (91%) create mode 100644 app/config/rct-data/mapping/energyMapping.js diff --git a/app/config/rct-data/index.js b/app/config/rct-data/index.js index bd9e248f6..130bf7091 100644 --- a/app/config/rct-data/index.js +++ b/app/config/rct-data/index.js @@ -19,7 +19,7 @@ const { filterTypes, filterInputTypes } = require('./filterTypes.js'); const detectors = require('./detectors.js').sort(); const roles = require('./roles.js'); const physicalParticlesData = require('./physicalParticlesData.js'); -const beamTypesMappings = require('./beamTypesMappings.js'); +const beamTypeMapping = require('./mapping/beamTypeMapping.js'); const healthcheckQueries = require('./healthcheckQueries.js'); const quality = require('./quality'); @@ -34,6 +34,6 @@ module.exports = { roles, quality, physicalParticlesData, - beamTypesMappings, + beamTypeMapping, ...healthcheckQueries, }; diff --git a/app/config/rct-data/beamTypesMappings.js b/app/config/rct-data/mapping/beamTypeMapping.js similarity index 91% rename from app/config/rct-data/beamTypesMappings.js rename to app/config/rct-data/mapping/beamTypeMapping.js index f183d4e42..96c5928cc 100644 --- a/app/config/rct-data/beamTypesMappings.js +++ b/app/config/rct-data/mapping/beamTypeMapping.js @@ -12,7 +12,7 @@ * or submit itself to any jurisdiction. */ -const beamTypesMappings = { +const beamTypeMapping = { pp: 'p-p', nn: 'n-n', XeXe: 'Xe-Xe', @@ -22,4 +22,4 @@ const beamTypesMappings = { pA: 'p-A', }; -module.exports = beamTypesMappings; +module.exports = beamTypeMapping; diff --git a/app/config/rct-data/mapping/energyMapping.js b/app/config/rct-data/mapping/energyMapping.js new file mode 100644 index 000000000..6fb5db98a --- /dev/null +++ b/app/config/rct-data/mapping/energyMapping.js @@ -0,0 +1,22 @@ +/** + * @license + * Copyright 2019-2020 CERN and copyright holders of ALICE O2. + * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. + * All rights not expressly granted are reserved. + * + * This software is distributed under the terms of the GNU General Public + * License v3 (GPL Version 3), copied verbatim in the file "COPYING". + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +const energyMapping = { + ['6800']: 6800, + ['7000']: 7000, + ['5360/2']: 5360/2, + ['450']: 450, +}; + +module.exports = energyMapping; diff --git a/app/lib/alimonitor-services/ServicesDataCommons.js b/app/lib/alimonitor-services/ServicesDataCommons.js index 24b273fee..b6426626a 100644 --- a/app/lib/alimonitor-services/ServicesDataCommons.js +++ b/app/lib/alimonitor-services/ServicesDataCommons.js @@ -25,7 +25,7 @@ const { rctData } = require('../config/configProvider.js'); function mapBeamTypeToCommonFormat(dataObject) { dataObject.beam_type = Utils.switchCase( dataObject.beam_type, - rctData.beamTypesMappings, + rctData.beamTypeMapping, { default: dataObject.beam_type }, ); return dataObject;