Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions lib/public/services/detectors/detectorsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
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
Expand All @@ -37,7 +33,17 @@
* @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(

Check failure on line 44 in lib/public/services/detectors/detectorsProvider.js

View workflow job for this annotation

GitHub Actions / linter

Unexpected newline after '('
({ type, name }) => type !== DetectorType.AOT_GLO && name != 'CTP'

Check failure on line 45 in lib/public/services/detectors/detectorsProvider.js

View workflow job for this annotation

GitHub Actions / linter

Missing trailing comma
);

Check failure on line 46 in lib/public/services/detectors/detectorsProvider.js

View workflow job for this annotation

GitHub Actions / linter

Unexpected newline before ')'

/**
* Service class to fetch detectors from the backend
Expand Down Expand Up @@ -71,6 +77,13 @@
Success: getQcDetectorsFromAllDetectors,
}))
.build();

this._rctAsync$ = ObservableData.builder()
.source(this._items$)
.apply((remoteDetectors) => remoteDetectors.apply({
Success: getRctAsyncDetectorsFromAllDetectors,
}))
.build();
}

/**
Expand Down Expand Up @@ -144,6 +157,18 @@
return this._dataTaking$;
}

/**
* Return RCT async detectors list observable data
*
* @return {ObservableData<RemoteData<Detector[], ApiError>>} 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
*
Expand Down
3 changes: 1 addition & 2 deletions lib/public/views/Runs/Overview/RunsWithQcModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,10 @@
.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))

Check failure on line 298 in lib/public/views/Runs/Overview/RunsWithQcModel.js

View workflow job for this annotation

GitHub Actions / linter

This line has a length of 161. Maximum allowed is 145
.map(({ id }) => id).join(','),
filter: {
createdBy: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import { SkimmingStage } from '../../../domain/enums/SkimmingStage.js';
import { jsonFetch } from '../../../utilities/fetch/jsonFetch.js';
import { RemoteDataSource } from '../../../utilities/fetch/RemoteDataSource.js';
import { DetectorType } from '../../../domain/enums/DetectorTypes.js';

Check failure on line 24 in lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js

View workflow job for this annotation

GitHub Actions / linter

'DetectorType' is defined but never used
import { GaqFilterModel } from '../../../components/Filters/RunsFilter/GaqFilterModel.js';
import { filterOutLegacyDetectorsForNewerPeriods } from '../../../utilities/filterOutLegacyDetectorsForNewerPeriods.js';

Expand All @@ -45,12 +45,12 @@
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;
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}
Expand Down
Loading