Skip to content
Merged
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
4 changes: 2 additions & 2 deletions lib/database/adapters/DataPassAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class DataPassAdapter {

const runsCount = databaseObject.get('runsCount');
const simulationPassesCount = databaseObject.get('simulationPassesCount');
const pdpBeamType = databaseObject.get('pdpBeamType');
const pdpBeamTypes = databaseObject.get('pdpBeamTypes')?.split(',') || [];

return {
id,
name,
skimmingStage,
versions: (versions ?? []).map(this.dataPassVersionAdapter.toEntity),
pdpBeamType,
pdpBeamTypes,
runsCount,
simulationPassesCount,
isFrozen,
Expand Down
4 changes: 2 additions & 2 deletions lib/database/adapters/LhcPeriodStatisticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LhcPeriodStatisticsAdapter {

const runsCount = databaseObject.get('runsCount');
const distinctEnergies = databaseObject.get('distinctEnergies')?.split(',').map((energy) => parseFloat(energy)) || [];
const beamTypes = databaseObject.get('beamTypes')?.split(',') || [];
const pdpBeamTypes = databaseObject.get('pdpBeamTypes')?.split(',') || [];
const dataPassesCount = databaseObject.get('dataPassesCount');
const simulationPassesCount = databaseObject.get('simulationPassesCount');

Expand All @@ -43,7 +43,7 @@ class LhcPeriodStatisticsAdapter {
avgCenterOfMassEnergy,
runsCount,
distinctEnergies,
beamTypes,
pdpBeamTypes,
dataPassesCount,
simulationPassesCount,
lhcPeriod: lhcPeriod ? this.lhcPeriodAdapter.toEntity(lhcPeriod) : null,
Expand Down
2 changes: 2 additions & 0 deletions lib/database/adapters/SimulationPassAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class SimulationPassAdapter {

const dataPassesCount = databaseObject.get('dataPassesCount');
const runsCount = databaseObject.get('runsCount');
const pdpBeamTypes = databaseObject.get('pdpBeamTypes')?.split(',') || [];

return {
id,
Expand All @@ -54,6 +55,7 @@ class SimulationPassAdapter {
outputSize,
runsCount,
dataPassesCount,
pdpBeamTypes,
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @property {number} id
* @property {number|null} avgCenterOfMassEnergy
* @property {number[]} distinctEnergies
* @property {string[]} beamTypes
* @property {string[]} pdpBeamTypes
* @property {number} runsCount
* @property {number} dataPassesCount
* @property {number} simulationPassesCount
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/entities/LhcPeriodStatistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @property {number} id
* @property {LhcPeriod} lhcPeriod
* @property {number[]|null} distinctEnergies
* @property {string[]} beamTypes
* @property {string[]} pdpBeamTypes
* @property {number} runsCount
* @property {number} dataPassesCount
* @property {number} simulationPassesCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export const dataPassesActiveColumns = {
associatedRuns: {
name: 'Runs',
visible: true,
format: (_, { id, runsCount, pdpBeamType }) =>
format: (_, { id, runsCount }) =>
runsCount === 0
? 'No runs'
: frontLink(
badge(runsCount),
'runs-per-data-pass',
{ dataPassId: id, pdpBeamType },
{ dataPassId: id },
),
classes: 'w-10',
},
Expand Down
8 changes: 4 additions & 4 deletions lib/public/views/QcFlags/QcFlagsModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export class QcFlagsModel extends Observable {
/**
* Load the creation for data pass page model
*
* @param {Object} params - Parameters for the method
* @param {number} params.dataPassId - The data pass ID
* @param {string} [params.runNumberDetectorsMap] - String representation of run number to detector map
* @param {Object} parameters - Parameters for the method
* @param {number} parameters.dataPassId - The data pass ID
* @param {string} parameters.runNumberDetectorsMap - String representation of run number to detector map
* @returns {void}
*/
loadCreationForDataPass({ dataPassId, runNumberDetectorsMap }) {
Expand Down Expand Up @@ -190,7 +190,7 @@ export class QcFlagsModel extends Observable {
* Load the creation for simulation pass page model
* @param {object} parameters parameters for the model
* @param {number} parameters.simulationPassId - The simulation pass ID
* @param {string} [parameters.runNumberDetectorsMap] - String representation of run number to detector map
* @param {string} parameters.runNumberDetectorsMap - String representation of run number to detector map
* @returns {void}
*/
loadCreationForSimulationPass({ simulationPassId, runNumberDetectorsMap }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* 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.
*/

import { PdpBeamType } from '../../../domain/enums/PdpBeamType.js';
import { inelasticInteractionRateActiveColumnsForPbPb as inelForPbPb } from './inelasticInteractionRateActiveColumnsForPbPb.js';
import { inelasticInteractionRateActiveColumnsForProtonProton as inelForPP } from './inelasticInteractionRateActiveColumnsForProtonProton.js';

/**
* Get appropriate runs' activate columns dependent on their pdp beam types
*
* @param {string[]} pdpBeamTypes lit of pdp beam types
* @return {ActiveColumn} active column
*/
export const getInelasticInteractionRateColumns = (pdpBeamTypes) => ({
...pdpBeamTypes?.includes(PdpBeamType.LEAD_LEAD) ? inelForPbPb : {},
...pdpBeamTypes?.includes(PdpBeamType.PROTON_PROTON) ? inelForPP : {},
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,26 @@ export class FixedPdpBeamTypeRunsOverviewModel extends RunsWithQcModel {
*/
constructor(model) {
super(model);

this._pdpBeamType = null;
this._pdpBeamTypes = [];
}

/**
* Get pdp_beam_type of fetched runs
*
* @return {string} beam type
* @return {string[]} beam type
*/
get pdpBeamTypes() {
return this._pdpBeamType;
return this._pdpBeamTypes;
}

/**
* Set pdp_beam_type of fetched runs
*
* @param {string} pdpBeamType beam type
* @param {string|string[]|null} pdpBeamTypes beam type, nullish values are ignored
*/
set pdpBeamTypes(pdpBeamType) {
this._pdpBeamType = pdpBeamType;
setPdpBeamTypes(pdpBeamTypes) {
if (pdpBeamTypes) {
this._pdpBeamTypes = typeof pdpBeamTypes === 'string' ? pdpBeamTypes.split(',') : pdpBeamTypes;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,16 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo

this._fetchQcSummary();
this._fetchGaqSummary();
await this._fetchDataPass();
this._dataPass$.getCurrent().match({
Success: ({ skimmingStage }) => skimmingStage === SkimmingStage.SKIMMABLE && this._fetchSkimmableRuns(),
Other: () => null,
});
await this._fetchDataPass().then(() =>
this._dataPass$.getCurrent().match({
Success: ({ skimmingStage, pdpBeamTypes }) => {
if (skimmingStage === SkimmingStage.SKIMMABLE) {
this._fetchSkimmableRuns();
}
this.setPdpBeamTypes(pdpBeamTypes);
},
Other: () => null,
}));
super.load();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* or submit itself to any jurisdiction.
*/

import { DropdownComponent, h, iconWarning, sessionService, switchCase } from '/js/src/index.js';
import { DropdownComponent, h, iconWarning, sessionService } from '/js/src/index.js';
import { table } from '../../../components/common/table/table.js';
import { paginationComponent } from '../../../components/Pagination/paginationComponent.js';
import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js';
Expand All @@ -20,8 +20,6 @@ import spinner from '../../../components/common/spinner.js';
import { tooltip } from '../../../components/common/popover/tooltip.js';
import { breadcrumbs } from '../../../components/common/navigation/breadcrumbs.js';
import { createRunDetectorsAsyncQcActiveColumns } from '../ActiveColumns/runDetectorsAsyncQcActiveColumns.js';
import { inelasticInteractionRateActiveColumnsForPbPb } from '../ActiveColumns/inelasticInteractionRateActiveColumnsForPbPb.js';
import { inelasticInteractionRateActiveColumnsForProtonProton } from '../ActiveColumns/inelasticInteractionRateActiveColumnsForProtonProton.js';
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
import { runNumbersFilter } from '../../../components/Filters/RunsFilter/runNumbersFilter.js';
import { qcSummaryLegendTooltip } from '../../../components/qcFlags/qcSummaryLegendTooltip.js';
Expand All @@ -38,6 +36,7 @@ import { mergeRemoteData } from '../../../utilities/mergeRemoteData.js';
import { numericalComparisonFilter } from '../../../components/Filters/common/filters/numericalComparisonFilter.js';
import { iconCaretBottom } from '/js/src/icons.js';
import { BkpRoles } from '../../../domain/enums/BkpRoles.js';
import { getInelasticInteractionRateColumns } from '../ActiveColumns/getInelasticInteractionRateActiveColumns.js';
import { exportTriggerAndModal } from '../../../components/common/dataExport/exportTriggerAndModal.js';
import { mcReproducibleAsNotBadToggle } from '../mcReproducibleAsNotBadToggle.js';

Expand All @@ -63,14 +62,14 @@ const getRowClasses = (run) => isRunNotSubjectToQc(run) ? '.danger' : null;
* @return {Component|null} badge or button
*/
const skimmableControl = (dataPass, onclick, requestResult) => {
const { name, pdpBeamType, skimmingStage } = dataPass;
const { name, pdpBeamTypes, skimmingStage } = dataPass;
const skimmableIndicator = badge('Skimmable', { color: Color.SUCCESS });
if (skimmingStage === SkimmingStage.SKIMMABLE) {
return skimmableIndicator;
}

const validSkimmableProductionNameRegex = /_apass\d+(?!.*(skimming|skimmed|debug|test))/;
if (validSkimmableProductionNameRegex.test(name) && pdpBeamType === PdpBeamType.PROTON_PROTON) {
if (validSkimmableProductionNameRegex.test(name) && pdpBeamTypes.includes(PdpBeamType.PROTON_PROTON)) {
const buttonContent = 'Mark as skimmable';
return requestResult.match({
Success: () => skimmableIndicator,
Expand Down Expand Up @@ -109,7 +108,7 @@ export const RunsPerDataPassOverviewPage = ({
dataPassId,
sortModel,
mcReproducibleAsNotBad,
pdpBeamType,
pdpBeamTypes,
markAsSkimmableRequestResult,
skimmableRuns: remoteSkimmableRuns,
freezeOrUnfreezeActionState,
Expand All @@ -128,17 +127,7 @@ export const RunsPerDataPassOverviewPage = ({
Success: ([dataPass, runs, detectors, qcSummary, gaqSummary]) => {
const activeColumns = {
...runsActiveColumns,
...switchCase(
pdpBeamType,
{
[PdpBeamType.PROTON_PROTON]: inelasticInteractionRateActiveColumnsForProtonProton,
[PdpBeamType.LEAD_LEAD]: inelasticInteractionRateActiveColumnsForPbPb,
},
{
...inelasticInteractionRateActiveColumnsForProtonProton,
...inelasticInteractionRateActiveColumnsForPbPb,
},
),
...getInelasticInteractionRateColumns(pdpBeamTypes),
...dataPass.skimmingStage === SkimmingStage.SKIMMABLE
? {
readyForSkimming: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import { buildUrl, RemoteData } from '/js/src/index.js';
import { TabbedPanelModel } from '../../../components/TabbedPanel/TabbedPanelModel.js';
import { detectorsProvider } from '../../../services/detectors/detectorsProvider.js';
import { RunsWithQcModel } from '../Overview/RunsWithQcModel.js';
import { jsonFetch } from '../../../utilities/fetch/jsonFetch.js';
import { DetectorType } from '../../../domain/enums/DetectorTypes.js';
import { ObservableData } from '../../../utilities/ObservableData.js';
import { FixedPdpBeamTypeRunsOverviewModel } from '../Overview/FixedPdpBeamTypeRunsOverviewModel.js';

export const RUNS_PER_LHC_PERIOD_PANELS_KEYS = {
DETECTOR_QUALITIES: 'detectorQualities',
Expand All @@ -26,7 +26,7 @@ export const RUNS_PER_LHC_PERIOD_PANELS_KEYS = {
/**
* Runs Per LHC Period overview model
*/
export class RunsPerLhcPeriodOverviewModel extends RunsWithQcModel {
export class RunsPerLhcPeriodOverviewModel extends FixedPdpBeamTypeRunsOverviewModel {
/**
* Constructor
*
Expand Down Expand Up @@ -78,7 +78,12 @@ export class RunsPerLhcPeriodOverviewModel extends RunsWithQcModel {
return;
}

await this._fetchLhcPeriod();
await this._fetchLhcPeriod().then(() => {
this._lhcPeriodStatistics$.getCurrent().match({
Success: ({ pdpBeamTypes }) => this.setPdpBeamTypes(pdpBeamTypes),
Other: () => null,
});
});
super.load();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ import { paginationComponent } from '../../../components/Pagination/paginationCo
import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js';
import { runsActiveColumns } from '../ActiveColumns/runsActiveColumns.js';
import { runDetectorsQualitiesActiveColumns } from '../ActiveColumns/runDetectorsQualitiesActiveColumns.js';
import { inelasticInteractionRateActiveColumnsForProtonProton } from '../ActiveColumns/inelasticInteractionRateActiveColumnsForProtonProton.js';
import { inelasticInteractionRateActiveColumnsForPbPb } from '../ActiveColumns/inelasticInteractionRateActiveColumnsForPbPb.js';
import { isRunNotSubjectToQc } from '../../../components/qcFlags/isRunNotSubjectToQc.js';
import { runDetectorsSyncQcActiveColumns } from '../ActiveColumns/runDetectorsSyncQcActiveColumns.js';
import { tabbedPanelComponent } from '../../../components/TabbedPanel/tabbedPanelComponent.js';
import { RUNS_PER_LHC_PERIOD_PANELS_KEYS } from './RunsPerLhcPeriodOverviewModel.js';
import { PdpBeamType } from '../../../domain/enums/PdpBeamType.js';
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
import { runNumbersFilter } from '../../../components/Filters/RunsFilter/runNumbersFilter.js';
import { mergeRemoteData } from '../../../utilities/mergeRemoteData.js';
import errorAlert from '../../../components/common/errorAlert.js';
import spinner from '../../../components/common/spinner.js';
import { getInelasticInteractionRateColumns } from '../ActiveColumns/getInelasticInteractionRateActiveColumns.js';
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
import { runNumbersFilter } from '../../../components/Filters/RunsFilter/runNumbersFilter.js';
import { mcReproducibleAsNotBadToggle } from '../mcReproducibleAsNotBadToggle.js';
import { exportTriggerAndModal } from '../../../components/common/dataExport/exportTriggerAndModal.js';

Expand Down Expand Up @@ -66,6 +64,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
sortModel,
tabbedPanelModel,
mcReproducibleAsNotBad,
pdpBeamTypes,
} = perLhcPeriodOverviewModel;

/**
Expand Down Expand Up @@ -102,12 +101,11 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
NotAsked: () => null,
Failure: (errors) => errorAlert(errors),
Loading: () => spinner(),
Success: ([lhcPeriodStatistics, runs]) => {
Success: ([lhcPeriodStatistics]) => {
const activeColumns = {
...runsActiveColumns,
...runs.some((run) => run.pdpBeamType === PdpBeamType.LEAD_LEAD) ? inelasticInteractionRateActiveColumnsForPbPb : {},
...runs.some((run) => run.pdpBeamType === PdpBeamType.PROTON_PROTON)
? inelasticInteractionRateActiveColumnsForProtonProton : {},
...getInelasticInteractionRateColumns(pdpBeamTypes),

};

return [
Expand Down
14 changes: 6 additions & 8 deletions lib/public/views/Runs/RunsModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export class RunsModel extends Observable {
/**
* Load runs overview data
* @param {object} params the parameters for the model
* @param {string} [params.lhcPeriodId] the id of the LHC period to display
* @param {string} [params.panel] the key of the panel to display
* @param {string} params.lhcPeriodId id of the LHC period to display
* @param {string} params.panel key of the panel to display
* @return {void}
*/
loadPerLhcPeriodOverview({ lhcPeriodId, panel }) {
Expand All @@ -108,14 +108,12 @@ export class RunsModel extends Observable {
/**
* Load runs overview data
* @param {object} params the parameters for the model
* @param {string} [params.dataPassId] the id of the data pass to display
* @param {string} [params.pdpBeamType] the beam type of the data pass to display
* @param {string} params.dataPassId the id of the data pass to display
* @return {void}
*/
loadPerDataPassOverview({ dataPassId, pdpBeamType }) {
loadPerDataPassOverview({ dataPassId }) {
if (!this._perDataPassOverviewModel.pagination.isInfiniteScrollEnabled) {
this._perDataPassOverviewModel.dataPassId = parseInt(dataPassId, 10);
this._perDataPassOverviewModel.pdpBeamType = pdpBeamType;
this._perDataPassOverviewModel.load();
}
}
Expand All @@ -130,8 +128,8 @@ export class RunsModel extends Observable {

/**
* Load runs overview per simulation pass data
* @param {object} root0 - The parameters for the model.
* @param {string} root0.simulationPassId - The ID of the simulation pass to load.
* @param {object} params - The parameters for the model.
* @param {string} params.simulationPassId - The ID of the simulation pass to load.
* @return {void}
*/
loadPerSimulationPassOverview({ simulationPassId }) {
Expand Down
Loading