From c9b6e55b64a12c695f9c178ef0efb23490ea230e Mon Sep 17 00:00:00 2001 From: George Raduta Date: Wed, 16 Sep 2026 13:37:00 +0200 Subject: [PATCH 1/2] Add explicit rct async provide of detectors --- .../services/detectors/detectorsProvider.js | 33 +++++++++++++++---- .../views/Runs/Overview/RunsWithQcModel.js | 3 +- .../RunsPerDataPassOverviewModel.js | 4 +-- .../RunsPerLhcPeriodOverviewModel.js | 2 +- .../RunsPerSimulationPassOverviewModel.js | 2 +- 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/lib/public/services/detectors/detectorsProvider.js b/lib/public/services/detectors/detectorsProvider.js index 2370f19942..dad04ebda3 100644 --- a/lib/public/services/detectors/detectorsProvider.js +++ b/lib/public/services/detectors/detectorsProvider.js @@ -16,11 +16,7 @@ import { getRemoteData } from '../../utilities/fetch/getRemoteData.js'; import { ObservableData } from '../../utilities/ObservableData.js'; import { DetectorType, DATA_TAKING_DETECTOR_TYPES, QC_DETECTORS } from '../../domain/enums/DetectorTypes.js'; import { DetectorOrders } from '../../domain/enums/DetectorOrders.js'; - -import { NonPhysicalDetector } from '../../domain/enums/detectorsNames.mjs'; - import { RemoteDataProvider } from '../RemoteDataProvider.js'; -const DETECTORS_EXCLUDED_FROM_QC = [NonPhysicalDetector.GLO]; /** * Return the physical detectors from a list of detectors @@ -37,7 +33,15 @@ const getPhysicalDetectorsFromAllDetectors = (allDetectors) => allDetectors.filt * @return {Detector[]} QC detectors */ const getQcDetectorsFromAllDetectors = (allDetectors) => allDetectors - .filter(({ type, name }) => QC_DETECTORS.includes(type) && !DETECTORS_EXCLUDED_FROM_QC.includes(name)); + .filter(({ type }) => QC_DETECTORS.includes(type)); + +/** + * Return the RCT async detectors from a list of detectors + * + * @param {Detector[]} allDetectors the list of all detectors + * @return {Detector[]} RCT async detectors + */ +const getRctAsyncDetectorsFromAllDetectors = (allDetectors) => allDetectors.filter(({ type, name }) => type !== DetectorType.AOT_GLO && name != 'CTP'); /** * Service class to fetch detectors from the backend @@ -71,6 +75,13 @@ export class DetectorsProvider extends RemoteDataProvider { Success: getQcDetectorsFromAllDetectors, })) .build(); + + this._rctAsync$ = ObservableData.builder() + .source(this._items$) + .apply((remoteDetectors) => remoteDetectors.apply({ + Success: getRctAsyncDetectorsFromAllDetectors, + })) + .build(); } /** @@ -143,7 +154,17 @@ export class DetectorsProvider extends RemoteDataProvider { } return this._dataTaking$; } - + /** + * Return RCT async detectors list observable data + * + * @return {ObservableData>} the observable RCT async detectors list + */ + get rctAsync$() { + if (this._isStale()) { + this._load(); + } + return this._rctAsync$; + } /** * Return physical and QC (meaning physical ones plus e.g. 'GLO') detectors list observable data * diff --git a/lib/public/views/Runs/Overview/RunsWithQcModel.js b/lib/public/views/Runs/Overview/RunsWithQcModel.js index 5b77d1325e..0912bf25c1 100644 --- a/lib/public/views/Runs/Overview/RunsWithQcModel.js +++ b/lib/public/views/Runs/Overview/RunsWithQcModel.js @@ -292,11 +292,10 @@ export class RunsWithQcModel extends RunsOverviewModel { .map(({ id }) => id).join(','), mcReproducibleAsNotBad: this._mcReproducibleAsNotBad.isToggled, })); - const { data: qcSummary2 } = await getRemoteData(buildUrl('/api/qcFlags/summary', { ...this.qcSummaryScope, detectorIds: detectors - .filter(({ type }) => [DetectorType.AOT_GLO, DetectorType.AOT_EVENT, DetectorType.MUON_GLO].includes(type)) + .filter(({ type }) => [DetectorType.QC_ONLY, DetectorType.AOT_GLO, DetectorType.AOT_EVENT, DetectorType.MUON_GLO].includes(type)) .map(({ id }) => id).join(','), filter: { createdBy: { diff --git a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js index f532b13bd2..df11edfa0c 100644 --- a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js +++ b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js @@ -45,12 +45,12 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo this._filteringModel.put('gaq', new GaqFilterModel(this._mcReproducibleAsNotBad)); this._setDetectorsObservable( - [rctDetectorsProvider.qc$, this._dataPass$], + [rctDetectorsProvider.rctAsync$, this._dataPass$], ([detectors, dataPass]) => { const filteredDetectors = filterOutLegacyDetectorsForNewerPeriods(detectors, dataPass.name); return ALL_CPASS_PRODUCTIONS_REGEX.test(dataPass.name) - ? filteredDetectors.filter(({ name, type }) => type !== DetectorType.AOT_GLO || DETECTOR_NAMES_NOT_IN_CPASSES.includes(name)) + ? filteredDetectors.filter(({ name }) => !DETECTOR_NAMES_NOT_IN_CPASSES.includes(name)) : filteredDetectors; }, ); diff --git a/lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js b/lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js index 23413b2071..17be53353d 100644 --- a/lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js +++ b/lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js @@ -39,7 +39,7 @@ export class RunsPerLhcPeriodOverviewModel extends FixedPdpBeamTypeRunsOverviewM ([detectors, lhcPeriodStatistics]) => { const filteredDetectors = filterOutLegacyDetectorsForNewerPeriods(detectors, lhcPeriodStatistics.lhcPeriod.name); - return filteredDetectors.filter(({ type }) => [DetectorType.PHYSICAL, DetectorType.MUON_GLO].includes(type)); + return filteredDetectors.filter(({ type }) => [DetectorType.PHYSICAL, DetectorType.QC_ONLY].includes(type)); }, ); this._lhcPeriodStatistics$.bubbleTo(this); diff --git a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js index 663b5139c9..fd1ef1d7b0 100644 --- a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js +++ b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js @@ -33,7 +33,7 @@ export class RunsPerSimulationPassOverviewModel extends FixedPdpBeamTypeRunsOver this._simulationPass$.bubbleTo(this); this._detectors$ = this._setDetectorsObservable( - [rctDetectorsProvider.qc$, this._simulationPass$], + [rctDetectorsProvider.rctAsync$, this._simulationPass$], ([detectors, simulationPass]) => filterOutLegacyDetectorsForNewerPeriods(detectors, simulationPass.name), ); } From 85e4649116beb8f941606f1b269b44872b269b33 Mon Sep 17 00:00:00 2001 From: George Raduta Date: Wed, 16 Sep 2026 13:57:42 +0200 Subject: [PATCH 2/2] Fix lint issues --- lib/public/services/detectors/detectorsProvider.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/public/services/detectors/detectorsProvider.js b/lib/public/services/detectors/detectorsProvider.js index dad04ebda3..704728af91 100644 --- a/lib/public/services/detectors/detectorsProvider.js +++ b/lib/public/services/detectors/detectorsProvider.js @@ -34,14 +34,16 @@ const getPhysicalDetectorsFromAllDetectors = (allDetectors) => allDetectors.filt */ const getQcDetectorsFromAllDetectors = (allDetectors) => allDetectors .filter(({ type }) => QC_DETECTORS.includes(type)); - + /** * Return the RCT async detectors from a list of detectors * * @param {Detector[]} allDetectors the list of all detectors * @return {Detector[]} RCT async detectors */ -const getRctAsyncDetectorsFromAllDetectors = (allDetectors) => allDetectors.filter(({ type, name }) => type !== DetectorType.AOT_GLO && name != 'CTP'); +const getRctAsyncDetectorsFromAllDetectors = (allDetectors) => allDetectors.filter( + ({ type, name }) => type !== DetectorType.AOT_GLO && name != 'CTP' +); /** * Service class to fetch detectors from the backend @@ -75,7 +77,7 @@ export class DetectorsProvider extends RemoteDataProvider { Success: getQcDetectorsFromAllDetectors, })) .build(); - + this._rctAsync$ = ObservableData.builder() .source(this._items$) .apply((remoteDetectors) => remoteDetectors.apply({ @@ -154,6 +156,7 @@ export class DetectorsProvider extends RemoteDataProvider { } return this._dataTaking$; } + /** * Return RCT async detectors list observable data * @@ -165,6 +168,7 @@ export class DetectorsProvider extends RemoteDataProvider { } return this._rctAsync$; } + /** * Return physical and QC (meaning physical ones plus e.g. 'GLO') detectors list observable data *